|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.opencms.setup.CmsSetupBean
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);
| Field Summary | |
static String |
GENERIC_PROVIDER
DB provider constant. |
static String |
HTML_MESSAGE_FILE
Name of the property file containing HTML fragments for setup wizard and error dialog. |
static String |
MYSQL_PROVIDER
DB provider constant. |
static String |
ORACLE_PROVIDER
DB provider constant. |
static String |
POSTGRESQL_PROVIDER
DB provider constant. |
static String[] |
REQUIRED_DB_SETUP_FILES
Required files per database server setup. |
| Constructor Summary | |
CmsSetupBean()
Default constructor. |
|
| Method Summary | |
void |
backupConfiguration(String filename,
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(String source,
String target)
Copies a given file. |
Map |
getAvailableModules()
Returns a map with all available modules. |
String |
getConfigRfsPath()
Returns the "config" path in the OpenCms web application. |
String |
getDatabase()
Returns the key of the selected database server (e.g. |
String |
getDatabaseConfigPage(String key)
Returns the URI of a database config page (in step 3) for a specified database key. |
String |
getDatabaseName(String databaseKey)
Returns the clear text name for a database server setup specified by a database key (e.g. |
Map |
getDatabaseProperties()
Returns a map with the database properties of *all* available database configurations keyed by their database keys (e.g. |
List |
getDatabases()
Returns a list with they keys (e.g. |
String |
getDb()
Returns the database name. |
String |
getDbConStrParams()
Returns the JDBC connect URL parameters. |
String |
getDbCreateConStr()
Returns the database create statement. |
String |
getDbCreatePwd()
Returns the password used for database creation. |
String |
getDbCreateUser()
Returns the database user that is used to connect to the database. |
String |
getDbDriver()
Returns the database driver belonging to the database from the default configuration. |
String |
getDbProperty(String key)
Returns the value for a given key from the database properties. |
String |
getDbTestQuery()
Returns the validation query belonging to the database from the default configuration . |
String |
getDbWorkConStr()
Returns a connection string. |
String |
getDbWorkPwd()
Returns the password of the database from the properties . |
String |
getDbWorkUser()
Returns the user of the database from the properties. |
String |
getDefaultContentEncoding()
Returns the default content encoding. |
String |
getDefaultWebApplication()
Returns the name of the default web application, configured in web.xml. |
String |
getDisplayForModule(Map module)
Returns the display string for a given module. |
Vector |
getErrors()
Returns the error messages. |
String |
getEthernetAddress()
Returns the mac ethernet address. |
protected String |
getExtProperty(String key)
Returns the value for a given key from the extended properties. |
String |
getHtmlHelpIcon(String id,
String pathPrefix)
Returns a help image icon tag to display a help text in the setup wizard. |
String |
getHtmlPart(String part)
Returns the specified HTML part of the HTML property file to create the output. |
String |
getHtmlPart(String part,
String replaceString)
Returns the specified HTML part of the HTML property file to create the output. |
Map |
getModuleDependencies()
Returns a map with lists of dependent module package names keyed by module package names. |
String |
getPool()
Gets the default pool. |
ExtendedProperties |
getProperties()
Returns the extended properties. |
Map |
getReplacer()
Returns the replacer. |
String |
getServerName()
Return the OpenCms server name. |
String |
getServletMapping()
Returns the OpenCms servlet mapping, configured in web.xml. |
String |
getSetupLogName()
Returns the name of the setup log file. |
List |
getSortedDatabases()
Returns a sorted list with they keys (e.g. |
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. |
String |
getWorkplaceSite()
Return the OpenCms workplace site. |
protected void |
importModuleFromDefault(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(PageContext pageContext)
Creates a new instance of the setup Bean from a JSP page. |
void |
init(String webAppRfsPath,
String servletMapping,
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. |
String |
isChecked(String value1,
String value2)
Over simplistic helper to compare two strings to check radio buttons. |
boolean |
isInitialized()
Returns true if this setup bean is correctly initialized. |
ExtendedProperties |
loadProperties(String file)
Loads the default OpenCms properties. |
void |
lockWizard()
Locks (i.e. |
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(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(ExtendedProperties properties,
String file,
boolean backup)
Saves properties to specified file. |
void |
setDatabase(String databaseKey)
Sets the database drivers to the given value. |
void |
setDb(String db)
Sets the database name. |
void |
setDbConStrParams(String value)
Sets the JDBC connect URL parameters. |
void |
setDbCreateConStr(String dbCreateConStr)
Sets the database create statement. |
void |
setDbCreatePwd(String dbCreatePwd)
Sets the password used for the initial OpenCms database creation. |
void |
setDbCreateUser(String dbCreateUser)
Set the database user that is used to connect to the database. |
void |
setDbDriver(String driver)
Sets the database driver belonging to the database. |
boolean |
setDbParamaters(HttpServletRequest request,
String provider)
Sets the needed database parameters. |
void |
setDbProperty(String key,
String value)
This method sets the value for a given key in the database properties. |
void |
setDbWorkConStr(String dbWorkConStr)
Sets the connection string to the database to the given value. |
void |
setDbWorkPwd(String dbWorkPwd)
Sets the password of the database to the given value. |
void |
setDbWorkUser(String dbWorkUser)
Sets the user of the database to the given value. |
void |
setEthernetAddress(String ethernetAddress)
Set the mac ethernet address, required for UUID generation. |
protected void |
setExtProperty(String key,
String value)
This method sets the value for a given key in the extended properties. |
void |
setInstallModules(String value)
Sets the list with the package names of the modules to be installed. |
void |
setReplacer(Map map)
Sets the replacer. |
void |
setServerName(String name)
Sets the OpenCms server name. |
void |
setWorkplaceSite(String newSite)
Sets the OpenCms workplace site. |
void |
shellExit()
May be called after shell exit, can e.g. |
void |
shellStart()
May be called before shell startup, can e.g. |
List |
sortModules(Map modules)
Sorts the modules for display. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String GENERIC_PROVIDER
public static final String MYSQL_PROVIDER
public static final String ORACLE_PROVIDER
public static final String POSTGRESQL_PROVIDER
public static final String HTML_MESSAGE_FILE
public static final String[] REQUIRED_DB_SETUP_FILES
| Constructor Detail |
public CmsSetupBean()
| Method Detail |
public void backupConfiguration(String filename,
String originalFilename)
filename - something like e.g. "opencms-xml.ori"originalFilename - the configurations real file name, e.g. "opencms.xml"public void checkEthernetAddress()
*
public void copyFile(String source,
String target)
source - the source filetarget - the destination filepublic Map getAvailableModules()
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!
public String getDisplayForModule(Map module)
module - a module in the form of the result of getAvailableModules()
public List sortModules(Map modules)
modules - the list of modules (the result of getAvailableModules())
public String getConfigRfsPath()
public String getDatabase()
public String getDatabaseConfigPage(String key)
key - the database key (e.g. "mysql", "generic" or "oracle")
public String getDatabaseName(String databaseKey)
databaseKey - a database key (e.g. "mysql", "generic" or "oracle")
public Map getDatabaseProperties()
public List getDatabases()
public String getDb()
public String getDbConStrParams()
public String getDbCreateConStr()
public String getDbCreatePwd()
public String getDbCreateUser()
public String getDbDriver()
public String getDbProperty(String key)
key - the property key
public String getDbTestQuery()
public String getDbWorkConStr()
public String getDbWorkPwd()
public String getDbWorkUser()
public String getDefaultContentEncoding()
public String getDefaultWebApplication()
web.xml.
By default this is "ROOT".
web.xmlpublic Vector getErrors()
public String getEthernetAddress()
public String getHtmlHelpIcon(String id,
String pathPrefix)
id - the id of the desired help divpathPrefix - the path prefix to the image
public String getHtmlPart(String part)
part - the name of the desired part
public String getHtmlPart(String part,
String replaceString)
part - the name of the desired partreplaceString - String which is inserted in the found HTML part at the location of "$replace$"
public Map getModuleDependencies()
public String getPool()
public ExtendedProperties getProperties()
public Map getReplacer()
public String getServerName()
public String getServletMapping()
web.xml.
By default this is "/opencms/*".
web.xmlpublic String getSetupLogName()
public List getSortedDatabases()
public String getWebAppRfsPath()
public boolean getWizardEnabled()
public CmsSetupWorkplaceImportThread getWorkplaceImportThread()
public String getWorkplaceSite()
public void importModulesFromSetupBean()
throws Exception
setInstallModules(String).This method is invoked as a shell command.
Exception - if something goes wrongpublic void init(PageContext pageContext)
pageContext - the JSP's page context
public void init(String webAppRfsPath,
String servletMapping,
String defaultWebApplication)
webAppRfsPath - path to the OpenCms web applicationservletMapping - the OpenCms servlet mappingdefaultWebApplication - the name of the default web applicationpublic void initHtmlParts()
public void initShellCmsObject(CmsObject cms,
CmsShell shell)
I_CmsShellCommands
initShellCmsObject in interface I_CmsShellCommandscms - the shell CmsObjectshell - the CmsShellI_CmsShellCommands.initShellCmsObject(org.opencms.file.CmsObject, org.opencms.main.CmsShell)
public String isChecked(String value1,
String value2)
value1 - the first valuevalue2 - the secound value
public boolean isInitialized()
public ExtendedProperties loadProperties(String file)
throws IOException
file - the file tp read the properties from
IOException - in case of IO errorspublic void lockWizard()
public void prepareStep10()
public boolean prepareStep8()
public void prepareStep8b()
public void prepareStep8bOutput(JspWriter out)
throws IOException
out - the JSP print stream
IOException - in case errors occur while writing to "out"
public void saveProperties(ExtendedProperties properties,
String file,
boolean backup)
properties - the properties to be savedfile - the file to save the properties tobackup - if true, create a backupfilepublic void setDatabase(String databaseKey)
databaseKey - the key of the selected database server (e.g. "mysql", "generic" or "oracle")public void setDb(String db)
db - the database name to setpublic void setDbConStrParams(String value)
value - the JDBC connect URL parameterspublic void setDbCreateConStr(String dbCreateConStr)
dbCreateConStr - the database create statementpublic void setDbCreatePwd(String dbCreatePwd)
This password will not be stored permanently, but used only in the setup wizard.
dbCreatePwd - the password used for the initial OpenCms database creationpublic void setDbCreateUser(String dbCreateUser)
dbCreateUser - the user to setpublic void setDbDriver(String driver)
driver - name of the opencms driver
public boolean setDbParamaters(HttpServletRequest request,
String provider)
request - the http requestprovider - the db provider
public void setDbProperty(String key,
String value)
key - The key of the propertyvalue - The value of the propertypublic void setDbWorkConStr(String dbWorkConStr)
dbWorkConStr - the connection string used by the OpenCms corepublic void setDbWorkPwd(String dbWorkPwd)
dbWorkPwd - the password for the OpenCms database userpublic void setDbWorkUser(String dbWorkUser)
dbWorkUser - the database user used by the opencms corepublic void setEthernetAddress(String ethernetAddress)
ethernetAddress - the mac addess to setpublic void setInstallModules(String value)
value - a string with the package names of the modules to be installed delimited by the pipe symbol "|"public void setReplacer(Map map)
map - the replacer to setpublic void setServerName(String name)
name - the OpenCms server namepublic void setWorkplaceSite(String newSite)
newSite - the OpenCms workplace sitepublic void shellExit()
I_CmsShellCommandsPlease 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.
shellExit in interface I_CmsShellCommandsI_CmsShellCommands.shellExit()public void shellStart()
I_CmsShellCommandsPlease 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.
shellStart in interface I_CmsShellCommandsI_CmsShellCommands.shellStart()protected String getExtProperty(String key)
key - the property key
protected void importModuleFromDefault(String importFile)
throws Exception
importFile - the name of the import module located in the default module directory
Exception - if something goes wrongCmsImportExportManager.importData(CmsObject, String, String, org.opencms.report.I_CmsReport)protected void readDatabaseConfig()
protected void setExtProperty(String key,
String value)
key - The key of the propertyvalue - The value of the property
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||