org.opencms.setup
Class CmsSetupBean

java.lang.Object
  extended byorg.opencms.setup.CmsSetupBean
All Implemented Interfaces:
java.lang.Cloneable, I_CmsShellCommands
Direct Known Subclasses:
CmsUpdateBean

public class CmsSetupBean
extends java.lang.Object
implements java.lang.Cloneable, I_CmsShellCommands

A java bean as a controller for the OpenCms setup wizard.

It is not allowed to customize this bean with methods for a specific database server setup!

Database server specific settings should be set/read using get/setDbProperty, as for example like:

 setDbProperty("oracle.defaultTablespace", value);
 

Since:
6.0.0
Version:
$Revision: 1.48 $
Author:
Thomas Weckert, Carsten Weinholz, Alexander Kandzior, Michael Moossen

Field Summary
static java.lang.String FOLDER_BACKUP
          Folder constant name.
static java.lang.String FOLDER_DATABASE
          Folder constant name.
static java.lang.String FOLDER_LIB
          Folder constant name.
static java.lang.String FOLDER_SETUP
          Folder constant name.
static java.lang.String FOLDER_WEBINF
          Folder constant name.
static java.lang.String GENERIC_PROVIDER
          DB provider constant.
static java.lang.String HTML_MESSAGE_FILE
          Name of the property file containing HTML fragments for setup wizard and error dialog.
protected  java.util.Map m_availableModules
          A map with all available modules.
protected  CmsObject m_cms
          A CmsObject to execute shell commands.
protected  java.util.List m_installModules
          A list with the package names of the modules to be installed .
protected  java.lang.String m_logFile
          Location for log file.
protected  java.lang.String m_logsFolder
          Location for logs relative to the webapp folder.
protected  java.util.Map m_moduleDependencies
          A map with lists of dependent module package names keyed by module package names.
protected  java.util.Map m_moduleFilenames
          A map with all available modules filenames.
protected  java.lang.String m_modulesFolder
          Location for module archives relative to the webapp folder.
protected  int m_newLoggingOffset
          The new logging offset in the workplace import thread.
protected  int m_oldLoggingOffset
          The lod logging offset in the workplace import thread.
protected  java.lang.String m_webAppRfsPath
          The absolute path to the home directory of the OpenCms webapp.
static java.lang.String MAXDB_PROVIDER
          DB provider constant for maxdb.
static java.lang.String MYSQL_PROVIDER
          DB provider constant for mysql.
static java.lang.String ORACLE_PROVIDER
          DB provider constant for oracle.
static java.lang.String POSTGRESQL_PROVIDER
          DB provider constant for postgresql.
static java.lang.String[] REQUIRED_DB_SETUP_FILES
          Required files per database server setup.
 
Constructor Summary
CmsSetupBean()
          Default constructor.
 
Method Summary
 void backupConfiguration(java.lang.String filename, java.lang.String originalFilename)
          Restores the opencms.xml either to or from a backup file, depending whether the setup wizard is executed the first time (the backup does not exist) or not (the backup exists).
 void checkEthernetAddress()
          Checks the ethernet address value and generates a dummy address, if necessary.
 void copyFile(java.lang.String source, java.lang.String target)
          Copies a given file.
 java.lang.String displayError(java.lang.String pathPrefix)
          Returns html code to display an error.
 java.util.Map getAvailableModules()
          Returns a map with all available modules.
 java.lang.String getConfigRfsPath()
          Returns the "config" path in the OpenCms web application.
 java.lang.String getDatabase()
          Returns the key of the selected database server (e.g.
 java.lang.String getDatabaseConfigPage(java.lang.String key)
          Returns the URI of a database config page (in step 3) for a specified database key.
 java.util.List getDatabaseLibs(java.lang.String databaseKey)
          Returns a list of needed jar filenames for a database server setup specified by a database key (e.g.
 java.lang.String getDatabaseName(java.lang.String databaseKey)
          Returns the clear text name for a database server setup specified by a database key (e.g.
 java.util.Map getDatabaseProperties()
          Returns a map with the database properties of *all* available database configurations keyed by their database keys (e.g.
 java.util.List getDatabases()
          Returns a list with they keys (e.g.
 java.lang.String getDb()
          Returns the database name.
 java.lang.String getDbConStrParams()
          Returns the JDBC connect URL parameters.
 java.lang.String getDbCreateConStr()
          Returns the database create statement.
 java.lang.String getDbCreatePwd()
          Returns the password used for database creation.
 java.lang.String getDbCreateUser()
          Returns the database user that is used to connect to the database.
 java.lang.String getDbDriver()
          Returns the database driver belonging to the database from the default configuration.
 java.lang.String getDbProperty(java.lang.String key)
          Returns the value for a given key from the database properties.
 java.lang.String getDbTestQuery()
          Returns the validation query belonging to the database from the default configuration .
 java.lang.String getDbWorkConStr()
          Returns a connection string.
 java.lang.String getDbWorkPwd()
          Returns the password of the database from the properties .
 java.lang.String getDbWorkUser()
          Returns the user of the database from the properties.
 java.lang.String getDefaultContentEncoding()
          Returns the default content encoding.
 java.lang.String getDefaultWebApplication()
          Returns the name of the default web application, configured in web.xml.
 java.lang.String getDisplayForModule(CmsModule module)
          Returns the display string for a given module.
 java.util.List getErrors()
          Returns the error messages.
 java.lang.String getEthernetAddress()
          Returns the mac ethernet address.
protected  java.lang.String getExtProperty(java.lang.String key)
          Returns the value for a given key from the extended properties.
 java.lang.String getHtmlHelpIcon(java.lang.String id, java.lang.String pathPrefix)
          Returns a help image icon tag to display a help text in the setup wizard.
 java.lang.String getHtmlPart(java.lang.String part)
          Returns the specified HTML part of the HTML property file to create the output.
 java.lang.String getHtmlPart(java.lang.String part, java.lang.String replaceString)
          Returns the specified HTML part of the HTML property file to create the output.
 java.lang.String getLibFolder()
          Returns the path to the /WEB-INF/lib folder.
 java.lang.String getLogName()
          Returns the name of the log file.
 java.util.Map getModuleDependencies()
          Returns a map with lists of dependent module package names keyed by module package names.
 java.lang.String getModuleFolder()
          Returns the absolute path to the module root folder.
 java.util.List getModulesToInstall()
          Returns A list with the package names of the modules to be installed.
 java.lang.String getPool()
          Gets the default pool.
 org.apache.commons.collections.ExtendedProperties getProperties()
          Returns the extended properties.
 java.util.Map getReplacer()
          Returns the replacer.
 java.lang.String getServerName()
          Return the OpenCms server name.
 javax.servlet.ServletConfig getServletConfig()
          Returns the initial servlet configuration.
 java.lang.String getServletMapping()
          Returns the OpenCms servlet mapping, configured in web.xml.
 java.util.List getSortedDatabases()
          Returns a sorted list with they keys (e.g.
 java.lang.String getWebAppRfsPath()
          Returns the absolute path to the OpenCms home directory.
 boolean getWizardEnabled()
          Checks if the setup wizard is enabled.
 CmsSetupWorkplaceImportThread getWorkplaceImportThread()
          Returns the workplace import thread.
 java.lang.String getWorkplaceSite()
          Return the OpenCms workplace site.
 CmsSetupXmlHelper getXmlHelper()
          Returns the xml Helper object.
protected  java.lang.String htmlModule(CmsModule module, int pos)
          Returns html for the given module to fill the selection list.
 java.lang.String htmlModuleHelpDescriptions()
          Returns html code for the module descriptions in help ballons.
 java.lang.String htmlModules()
          Returns html for displaying a module selection box.
protected  void importModuleFromDefault(java.lang.String importFile)
          Imports a module (zipfile) from the default module directory, creating a temporary project for this.
 void importModulesFromSetupBean()
          Installed all modules that have been set using setInstallModules(String).
 void init(javax.servlet.jsp.PageContext pageContext)
          Creates a new instance of the setup Bean from a JSP page.
 void init(java.lang.String webAppRfsPath, java.lang.String servletMapping, java.lang.String defaultWebApplication)
          Creates a new instance of the setup Bean.
 void initHtmlParts()
          This method reads the properties from the htmlmsg.property file and sets the HTML part properties with the matching values.
 void initShellCmsObject(CmsObject cms, CmsShell shell)
          Provides access to the shell CmsObject and the shell itself.
 java.lang.String isChecked(java.lang.String value1, java.lang.String value2)
          Over simplistic helper to compare two strings to check radio buttons.
 boolean isInitialized()
          Returns true if this setup bean is correctly initialized.
 java.lang.String jsModuleDependencies()
          Returns js code with array definition for the available module dependencies.
 java.lang.String jsModuleNames()
          Returns js code with array definition for the available module names.
 org.apache.commons.collections.ExtendedProperties loadProperties(java.lang.String file)
          Loads the default OpenCms properties.
 void lockWizard()
          Locks (i.e. disables) the setup wizard.
 void prepareStep10()
          Prepares step 10 of the setup wizard.
 boolean prepareStep8()
          Prepares step 8 of the setup wizard.
 void prepareStep8b()
          Prepares step 8b of the setup wizard.
 void prepareStep8bOutput(javax.servlet.jsp.JspWriter out)
          Generates the output for step 8b of the setup wizard.
protected  void readDatabaseConfig()
          Stores the properties of all available database configurations in a map keyed by their database key names (e.g.
 void saveProperties(org.apache.commons.collections.ExtendedProperties properties, java.lang.String file, boolean backup)
          Saves properties to specified file.
 void setDatabase(java.lang.String databaseKey)
          Sets the database drivers to the given value.
 void setDb(java.lang.String db)
          Sets the database name.
 void setDbConStrParams(java.lang.String value)
          Sets the JDBC connect URL parameters.
 void setDbCreateConStr(java.lang.String dbCreateConStr)
          Sets the database create statement.
 void setDbCreatePwd(java.lang.String dbCreatePwd)
          Sets the password used for the initial OpenCms database creation.
 void setDbCreateUser(java.lang.String dbCreateUser)
          Set the database user that is used to connect to the database.
 void setDbDriver(java.lang.String driver)
          Sets the database driver belonging to the database.
 boolean setDbParamaters(javax.servlet.http.HttpServletRequest request, java.lang.String provider)
          Sets the needed database parameters.
 void setDbProperty(java.lang.String key, java.lang.String value)
          This method sets the value for a given key in the database properties.
 void setDbWorkConStr(java.lang.String dbWorkConStr)
          Sets the connection string to the database to the given value.
 void setDbWorkPwd(java.lang.String dbWorkPwd)
          Sets the password of the database to the given value.
 void setDbWorkUser(java.lang.String dbWorkUser)
          Sets the user of the database to the given value.
 void setEthernetAddress(java.lang.String ethernetAddress)
          Set the mac ethernet address, required for UUID generation.
protected  void setExtProperty(java.lang.String key, java.lang.String value)
          This method sets the value for a given key in the extended properties.
 void setInstallModules(java.lang.String value)
          Sets the list with the package names of the modules to be installed.
 void setReplacer(java.util.Map map)
          Sets the replacer.
 void setServerName(java.lang.String name)
          Sets the OpenCms server name.
 void setWorkplaceSite(java.lang.String newSite)
          Sets the OpenCms workplace site.
 void shellExit()
          May be called after shell exit, can e.g. be used to ouput a goodbye message.
 void shellStart()
          May be called before shell startup, can e.g. be used to ouput a welcome message.
 java.util.List sortModules(java.util.Collection modules)
          Sorts the modules for display.
 boolean validateJdbc()
          Checks the jdbc driver.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FOLDER_BACKUP

public static final java.lang.String FOLDER_BACKUP
Folder constant name.


FOLDER_DATABASE

public static final java.lang.String FOLDER_DATABASE
Folder constant name.


FOLDER_LIB

public static final java.lang.String FOLDER_LIB
Folder constant name.


FOLDER_SETUP

public static final java.lang.String FOLDER_SETUP
Folder constant name.


FOLDER_WEBINF

public static final java.lang.String FOLDER_WEBINF
Folder constant name.


GENERIC_PROVIDER

public static final java.lang.String GENERIC_PROVIDER
DB provider constant.

See Also:
Constant Field Values

HTML_MESSAGE_FILE

public static final java.lang.String HTML_MESSAGE_FILE
Name of the property file containing HTML fragments for setup wizard and error dialog.

See Also:
Constant Field Values

MAXDB_PROVIDER

public static final java.lang.String MAXDB_PROVIDER
DB provider constant for maxdb.

See Also:
Constant Field Values

MYSQL_PROVIDER

public static final java.lang.String MYSQL_PROVIDER
DB provider constant for mysql.

See Also:
Constant Field Values

ORACLE_PROVIDER

public static final java.lang.String ORACLE_PROVIDER
DB provider constant for oracle.

See Also:
Constant Field Values

POSTGRESQL_PROVIDER

public static final java.lang.String POSTGRESQL_PROVIDER
DB provider constant for postgresql.

See Also:
Constant Field Values

REQUIRED_DB_SETUP_FILES

public static final java.lang.String[] REQUIRED_DB_SETUP_FILES
Required files per database server setup.


m_availableModules

protected java.util.Map m_availableModules
A map with all available modules.


m_cms

protected CmsObject m_cms
A CmsObject to execute shell commands.


m_installModules

protected java.util.List m_installModules
A list with the package names of the modules to be installed .


m_logFile

protected java.lang.String m_logFile
Location for log file.


m_logsFolder

protected java.lang.String m_logsFolder
Location for logs relative to the webapp folder.


m_moduleDependencies

protected java.util.Map m_moduleDependencies
A map with lists of dependent module package names keyed by module package names.


m_moduleFilenames

protected java.util.Map m_moduleFilenames
A map with all available modules filenames.


m_modulesFolder

protected java.lang.String m_modulesFolder
Location for module archives relative to the webapp folder.


m_newLoggingOffset

protected int m_newLoggingOffset
The new logging offset in the workplace import thread.


m_oldLoggingOffset

protected int m_oldLoggingOffset
The lod logging offset in the workplace import thread.


m_webAppRfsPath

protected java.lang.String m_webAppRfsPath
The absolute path to the home directory of the OpenCms webapp.

Constructor Detail

CmsSetupBean

public CmsSetupBean()
Default constructor.

Method Detail

backupConfiguration

public void backupConfiguration(java.lang.String filename,
                                java.lang.String originalFilename)
Restores the opencms.xml either to or from a backup file, depending whether the setup wizard is executed the first time (the backup does not exist) or not (the backup exists).

Parameters:
filename - something like e.g. "opencms.xml"
originalFilename - the configurations real file name, e.g. "opencms.xml.ori"

checkEthernetAddress

public void checkEthernetAddress()
Checks the ethernet address value and generates a dummy address, if necessary.

*


copyFile

public void copyFile(java.lang.String source,
                     java.lang.String target)
Copies a given file.

Parameters:
source - the source file
target - the destination file

displayError

public java.lang.String displayError(java.lang.String pathPrefix)
Returns html code to display an error.

Parameters:
pathPrefix - to adjust the path
Returns:
html code

getAvailableModules

public java.util.Map getAvailableModules()
Returns a map with all available modules.

The map contains maps keyed by module package names. Each of these maps contains various information about the module such as the module name, version, description, and a list of it's dependencies. You should refer to the source code of this method to understand the data structure of the map returned by this method!

Returns:
a map with all available modules

getConfigRfsPath

public java.lang.String getConfigRfsPath()
Returns the "config" path in the OpenCms web application.

Returns:
the config path

getDatabase

public java.lang.String getDatabase()
Returns the key of the selected database server (e.g. "mysql", "generic" or "oracle").

Returns:
the key of the selected database server (e.g. "mysql", "generic" or "oracle")

getDatabaseConfigPage

public java.lang.String getDatabaseConfigPage(java.lang.String key)
Returns the URI of a database config page (in step 3) for a specified database key.

Parameters:
key - the database key (e.g. "mysql", "generic" or "oracle")
Returns:
the URI of a database config page

getDatabaseLibs

public java.util.List getDatabaseLibs(java.lang.String databaseKey)
Returns a list of needed jar filenames for a database server setup specified by a database key (e.g. "mysql", "generic" or "oracle").

Parameters:
databaseKey - a database key (e.g. "mysql", "generic" or "oracle")
Returns:
a list of needed jar filenames

getDatabaseName

public java.lang.String getDatabaseName(java.lang.String databaseKey)
Returns the clear text name for a database server setup specified by a database key (e.g. "mysql", "generic" or "oracle").

Parameters:
databaseKey - a database key (e.g. "mysql", "generic" or "oracle")
Returns:
the clear text name for a database server setup

getDatabaseProperties

public java.util.Map getDatabaseProperties()
Returns a map with the database properties of *all* available database configurations keyed by their database keys (e.g. "mysql", "generic" or "oracle").

Returns:
a map with the database properties of *all* available database configurations

getDatabases

public java.util.List getDatabases()
Returns a list with they keys (e.g. "mysql", "generic" or "oracle") of all available database server setups found in "/setup/database/".

Returns:
a list with they keys (e.g. "mysql", "generic" or "oracle") of all available database server setups

getDb

public java.lang.String getDb()
Returns the database name.

Returns:
the database name

getDbConStrParams

public java.lang.String getDbConStrParams()
Returns the JDBC connect URL parameters.

Returns:
the JDBC connect URL parameters

getDbCreateConStr

public java.lang.String getDbCreateConStr()
Returns the database create statement.

Returns:
the database create statement

getDbCreatePwd

public java.lang.String getDbCreatePwd()
Returns the password used for database creation.

Returns:
the password used for database creation

getDbCreateUser

public java.lang.String getDbCreateUser()
Returns the database user that is used to connect to the database.

Returns:
the database user

getDbDriver

public java.lang.String getDbDriver()
Returns the database driver belonging to the database from the default configuration.

Returns:
name of the database driver

getDbProperty

public java.lang.String getDbProperty(java.lang.String key)
Returns the value for a given key from the database properties.

Parameters:
key - the property key
Returns:
the string value for a given key

getDbTestQuery

public java.lang.String getDbTestQuery()
Returns the validation query belonging to the database from the default configuration .

Returns:
query used to validate connections

getDbWorkConStr

public java.lang.String getDbWorkConStr()
Returns a connection string.

Returns:
the connection string used by the OpenCms core

getDbWorkPwd

public java.lang.String getDbWorkPwd()
Returns the password of the database from the properties .

Returns:
the password for the OpenCms database user

getDbWorkUser

public java.lang.String getDbWorkUser()
Returns the user of the database from the properties.

Returns:
the database user used by the opencms core

getDefaultContentEncoding

public java.lang.String getDefaultContentEncoding()
Returns the default content encoding.

Returns:
String

getDefaultWebApplication

public java.lang.String getDefaultWebApplication()
Returns the name of the default web application, configured in web.xml.

By default this is "ROOT".

Returns:
the name of the default web application, configured in web.xml

getDisplayForModule

public java.lang.String getDisplayForModule(CmsModule module)
Returns the display string for a given module.

Parameters:
module - a module
Returns:
the display string for the given module

getErrors

public java.util.List getErrors()
Returns the error messages.

Returns:
a vector of error messages

getEthernetAddress

public java.lang.String getEthernetAddress()
Returns the mac ethernet address.

Returns:
the mac ethernet addess

getHtmlHelpIcon

public java.lang.String getHtmlHelpIcon(java.lang.String id,
                                        java.lang.String pathPrefix)
Returns a help image icon tag to display a help text in the setup wizard.

Parameters:
id - the id of the desired help div
pathPrefix - the path prefix to the image
Returns:
the HTML part for the help icon or an empty String, if the part was not found

getHtmlPart

public java.lang.String getHtmlPart(java.lang.String part)
Returns the specified HTML part of the HTML property file to create the output.

Parameters:
part - the name of the desired part
Returns:
the HTML part or an empty String, if the part was not found

getHtmlPart

public java.lang.String getHtmlPart(java.lang.String part,
                                    java.lang.String replaceString)
Returns the specified HTML part of the HTML property file to create the output.

Parameters:
part - the name of the desired part
replaceString - String which is inserted in the found HTML part at the location of "$replace$"
Returns:
the HTML part or an empty String, if the part was not found

getLibFolder

public java.lang.String getLibFolder()
Returns the path to the /WEB-INF/lib folder.

Returns:
the path to the /WEB-INF/lib folder

getLogName

public java.lang.String getLogName()
Returns the name of the log file.

Returns:
the name of the log file

getModuleDependencies

public java.util.Map getModuleDependencies()
Returns a map with lists of dependent module package names keyed by module package names.

Returns:
a map with lists of dependent module package names keyed by module package names

getModuleFolder

public java.lang.String getModuleFolder()
Returns the absolute path to the module root folder.

Returns:
the absolute path to the module root folder

getModulesToInstall

public java.util.List getModulesToInstall()
Returns A list with the package names of the modules to be installed.

Returns:
A list with the package names of the modules to be installed

getPool

public java.lang.String getPool()
Gets the default pool.

Returns:
name of the default pool

getProperties

public org.apache.commons.collections.ExtendedProperties getProperties()
Returns the extended properties.

Returns:
the extended properties

getReplacer

public java.util.Map getReplacer()
Returns the replacer.

Returns:
the replacer

getServerName

public java.lang.String getServerName()
Return the OpenCms server name.

Returns:
the OpenCms server name

getServletConfig

public javax.servlet.ServletConfig getServletConfig()
Returns the initial servlet configuration.

Returns:
the initial servlet configuration

getServletMapping

public java.lang.String getServletMapping()
Returns the OpenCms servlet mapping, configured in web.xml.

By default this is "/opencms/*".

Returns:
the OpenCms servlet mapping, configured in web.xml

getSortedDatabases

public java.util.List getSortedDatabases()
Returns a sorted list with they keys (e.g. "mysql", "generic" or "oracle") of all available database server setups found in "/setup/database/" sorted by their ranking property.

Returns:
a sorted list with they keys (e.g. "mysql", "generic" or "oracle") of all available database server setups

getWebAppRfsPath

public java.lang.String getWebAppRfsPath()
Returns the absolute path to the OpenCms home directory.

Returns:
the path to the OpenCms home directory

getWizardEnabled

public boolean getWizardEnabled()
Checks if the setup wizard is enabled.

Returns:
true if the setup wizard is enables, false otherwise

getWorkplaceImportThread

public CmsSetupWorkplaceImportThread getWorkplaceImportThread()
Returns the workplace import thread.

Returns:
the workplace import thread

getWorkplaceSite

public java.lang.String getWorkplaceSite()
Return the OpenCms workplace site.

Returns:
the OpenCms workplace site

getXmlHelper

public CmsSetupXmlHelper getXmlHelper()
Returns the xml Helper object.

Returns:
the xml Helper object

htmlModuleHelpDescriptions

public java.lang.String htmlModuleHelpDescriptions()
Returns html code for the module descriptions in help ballons.

Returns:
html code

htmlModules

public java.lang.String htmlModules()
Returns html for displaying a module selection box.

Returns:
html code

importModulesFromSetupBean

public void importModulesFromSetupBean()
                                throws java.lang.Exception
Installed all modules that have been set using setInstallModules(String).

This method is invoked as a shell command.

Throws:
java.lang.Exception - if something goes wrong

init

public void init(javax.servlet.jsp.PageContext pageContext)
Creates a new instance of the setup Bean from a JSP page.

Parameters:
pageContext - the JSP's page context

init

public void init(java.lang.String webAppRfsPath,
                 java.lang.String servletMapping,
                 java.lang.String defaultWebApplication)
Creates a new instance of the setup Bean.

Parameters:
webAppRfsPath - path to the OpenCms web application
servletMapping - the OpenCms servlet mapping
defaultWebApplication - the name of the default web application

initHtmlParts

public void initHtmlParts()
This method reads the properties from the htmlmsg.property file and sets the HTML part properties with the matching values.


initShellCmsObject

public void initShellCmsObject(CmsObject cms,
                               CmsShell shell)
Description copied from interface: I_CmsShellCommands
Provides access to the shell CmsObject and the shell itself.

Specified by:
initShellCmsObject in interface I_CmsShellCommands
Parameters:
cms - the shell CmsObject
shell - the CmsShell
See Also:
I_CmsShellCommands.initShellCmsObject(org.opencms.file.CmsObject, org.opencms.main.CmsShell)

isChecked

public java.lang.String isChecked(java.lang.String value1,
                                  java.lang.String value2)
Over simplistic helper to compare two strings to check radio buttons.

Parameters:
value1 - the first value
value2 - the second value
Returns:
"checked" if both values are equal, the empty String "" otherwise

isInitialized

public boolean isInitialized()
Returns true if this setup bean is correctly initialized.

Returns:
true if this setup bean is correctly initialized

jsModuleDependencies

public java.lang.String jsModuleDependencies()
Returns js code with array definition for the available module dependencies.

Returns:
js code

jsModuleNames

public java.lang.String jsModuleNames()
Returns js code with array definition for the available module names.

Returns:
js code

loadProperties

public org.apache.commons.collections.ExtendedProperties loadProperties(java.lang.String file)
                                                                 throws java.io.IOException
Loads the default OpenCms properties.

Parameters:
file - the file tp read the properties from
Returns:
the initialized OpenCms properties
Throws:
java.io.IOException - in case of IO errors

lockWizard

public void lockWizard()
Locks (i.e. disables) the setup wizard.


prepareStep10

public void prepareStep10()
Prepares step 10 of the setup wizard.


prepareStep8

public boolean prepareStep8()
                     throws CmsXmlException
Prepares step 8 of the setup wizard.

Returns:
true if the workplace should be imported
Throws:
CmsXmlException - if something goes wrong

prepareStep8b

public void prepareStep8b()
Prepares step 8b of the setup wizard.


prepareStep8bOutput

public void prepareStep8bOutput(javax.servlet.jsp.JspWriter out)
                         throws java.io.IOException
Generates the output for step 8b of the setup wizard.

Parameters:
out - the JSP print stream
Throws:
java.io.IOException - in case errors occur while writing to "out"

saveProperties

public void saveProperties(org.apache.commons.collections.ExtendedProperties properties,
                           java.lang.String file,
                           boolean backup)
Saves properties to specified file.

Parameters:
properties - the properties to be saved
file - the file to save the properties to
backup - if true, create a backupfile

setDatabase

public void setDatabase(java.lang.String databaseKey)
Sets the database drivers to the given value.

Parameters:
databaseKey - the key of the selected database server (e.g. "mysql", "generic" or "oracle")

setDb

public void setDb(java.lang.String db)
Sets the database name.

Parameters:
db - the database name to set

setDbConStrParams

public void setDbConStrParams(java.lang.String value)
Sets the JDBC connect URL parameters.

Parameters:
value - the JDBC connect URL parameters

setDbCreateConStr

public void setDbCreateConStr(java.lang.String dbCreateConStr)
Sets the database create statement.

Parameters:
dbCreateConStr - the database create statement

setDbCreatePwd

public void setDbCreatePwd(java.lang.String dbCreatePwd)
Sets the password used for the initial OpenCms database creation.

This password will not be stored permanently, but used only in the setup wizard.

Parameters:
dbCreatePwd - the password used for the initial OpenCms database creation

setDbCreateUser

public void setDbCreateUser(java.lang.String dbCreateUser)
Set the database user that is used to connect to the database.

Parameters:
dbCreateUser - the user to set

setDbDriver

public void setDbDriver(java.lang.String driver)
Sets the database driver belonging to the database.

Parameters:
driver - name of the opencms driver

setDbParamaters

public boolean setDbParamaters(javax.servlet.http.HttpServletRequest request,
                               java.lang.String provider)
Sets the needed database parameters.

Parameters:
request - the http request
provider - the db provider
Returns:
true if already submitted

setDbProperty

public void setDbProperty(java.lang.String key,
                          java.lang.String value)
This method sets the value for a given key in the database properties.

Parameters:
key - The key of the property
value - The value of the property

setDbWorkConStr

public void setDbWorkConStr(java.lang.String dbWorkConStr)
Sets the connection string to the database to the given value.

Parameters:
dbWorkConStr - the connection string used by the OpenCms core

setDbWorkPwd

public void setDbWorkPwd(java.lang.String dbWorkPwd)
Sets the password of the database to the given value.

Parameters:
dbWorkPwd - the password for the OpenCms database user

setDbWorkUser

public void setDbWorkUser(java.lang.String dbWorkUser)
Sets the user of the database to the given value.

Parameters:
dbWorkUser - the database user used by the opencms core

setEthernetAddress

public void setEthernetAddress(java.lang.String ethernetAddress)
Set the mac ethernet address, required for UUID generation.

Parameters:
ethernetAddress - the mac addess to set

setInstallModules

public void setInstallModules(java.lang.String value)
Sets the list with the package names of the modules to be installed.

Parameters:
value - a string with the package names of the modules to be installed delimited by the pipe symbol "|"

setReplacer

public void setReplacer(java.util.Map map)
Sets the replacer.

Parameters:
map - the replacer to set

setServerName

public void setServerName(java.lang.String name)
Sets the OpenCms server name.

Parameters:
name - the OpenCms server name

setWorkplaceSite

public void setWorkplaceSite(java.lang.String newSite)
Sets the OpenCms workplace site.

Parameters:
newSite - the OpenCms workplace site

shellExit

public void shellExit()
Description copied from interface: I_CmsShellCommands
May be called after shell exit, can e.g. be used to ouput a goodbye message.

Please note: This method is not guaranteed to be called. For a shell that has more then one shell command object initialized, only the exit method of one of thouse will be called.

Specified by:
shellExit in interface I_CmsShellCommands
See Also:
I_CmsShellCommands.shellExit()

shellStart

public void shellStart()
Description copied from interface: I_CmsShellCommands
May be called before shell startup, can e.g. be used to ouput a welcome message.

Please note: This method is not guaranteed to be called. For a shell that has more then one shell command object initialized, only the start method of one of thouse will be called.

Specified by:
shellStart in interface I_CmsShellCommands
See Also:
I_CmsShellCommands.shellStart()

sortModules

public java.util.List sortModules(java.util.Collection modules)
Sorts the modules for display.

Parameters:
modules - the list of CmsModule objects
Returns:
a sorted list of module names

validateJdbc

public boolean validateJdbc()
Checks the jdbc driver.

Returns:
true if at least one of the recommended drivers is found

getExtProperty

protected java.lang.String getExtProperty(java.lang.String key)
Returns the value for a given key from the extended properties.

Parameters:
key - the property key
Returns:
the string value for a given key

htmlModule

protected java.lang.String htmlModule(CmsModule module,
                                      int pos)
Returns html for the given module to fill the selection list.

Parameters:
module - the module to generate the code for
pos - the position in the list
Returns:
html code

importModuleFromDefault

protected void importModuleFromDefault(java.lang.String importFile)
                                throws java.lang.Exception
Imports a module (zipfile) from the default module directory, creating a temporary project for this.

Parameters:
importFile - the name of the import module located in the default module directory
Throws:
java.lang.Exception - if something goes wrong
See Also:
CmsImportExportManager.importData(CmsObject, String, String, org.opencms.report.I_CmsReport)

readDatabaseConfig

protected void readDatabaseConfig()
Stores the properties of all available database configurations in a map keyed by their database key names (e.g. "mysql", "generic" or "oracle").


setExtProperty

protected void setExtProperty(java.lang.String key,
                              java.lang.String value)
This method sets the value for a given key in the extended properties.

Parameters:
key - The key of the property
value - The value of the property