Class CmsSetupBean
- All Implemented Interfaces:
org.opencms.main.I_CmsShellCommands
- Direct Known Subclasses:
CmsUpdateBean
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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Prefix for 'marker' properties in opencms.properties where additional properties should be inserted.static final String
DB provider constant for as400.static final String
The name of the components properties file.static final String
DB provider constant for db2.protected static final int
The default component position, is missing.static final String
Folder constant name.static final String
Folder constant name.static final String
Folder constant name.static final String
Folder constant name.static final String
DB provider constant.static final String
DB provider constant for hsqldb.static final String
Name of the property file containing HTML fragments for setup wizard and error dialog.A map with all available modules.protected org.opencms.file.CmsObject
A CmsObject to execute shell commands.protected org.opencms.workplace.tools.CmsIdentifiableObjectContainer<CmsSetupComponent>
Contains all defined components.A list with the package names of the modules to be installed .protected String
Location for log file.A map with lists of dependent module package names keyed by module package names.A map with all available modules filenames.protected String
Location for module archives relative to the webapp folder.protected int
The new logging offset in the workplace import thread.protected int
The lod logging offset in the workplace import thread.protected String
The absolute path to the home directory of the OpenCms webapp.static final String
DB provider constant for maxdb.static final String
DB provider constant for mssql.static final String
DB provider constant for mysql.static final String
DB provider constant for oracle.static final String
DB provider constant for postgresql.protected static final String
Properties file key constant post fix.protected static final String
Properties file key constant prefix.protected static final String
Properties file key constant.protected static final String
Properties file key constant post fix.protected static final String
Properties file key constant post fix.protected static final String
Properties file key constant post fix.protected static final String
Properties file key constant post fix.protected static final String
Properties file key constant post fix. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addComponentsFromPath
(String fileName) Reads all components from the given location, a folder or a zip file.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).Returns a map of dependencies.void
Checks the ethernet address value and generates a dummy address, if necessary.void
Clears the cache.void
Copies a given file.displayError
(String pathPrefix) Returns html code to display an error.displayErrors
(String pathPrefix) Returns html code to display the errors occurred.Returns a map with all available modules.protected String
getComponentModules
(List<String> componentIds) Returns a pipe separated list of module names for the given list of components.org.opencms.workplace.tools.CmsIdentifiableObjectContainer<CmsSetupComponent>
Returns the components.protected org.opencms.configuration.CmsParameterConfiguration
getComponentsProperties
(String location) Reads all properties from the components.properties file at the given location, a folder or a zip file.Returns the "config" path in the OpenCms web application.Returns the key of the selected database server (e.g.getDatabaseLibs
(String databaseKey) Returns a list of needed jar filenames for a database server setup specified by a database key (e.g.getDatabaseName
(String databaseKey) Returns the clear text name for a database server setup specified by a database key (e.g.Returns a map with the database properties of *all* available database configurations keyed by their database keys (e.g.Returns a list with they keys (e.g.getDb()
Returns the database name.Returns the JDBC connect URL parameters.Returns the database create statement.Returns the password used for database creation.Returns the database user that is used to connect to the database.Returns the database driver belonging to the database from the default configuration.getDbProperty
(String key) Returns the value for a given key from the database properties.Returns the validation query belonging to the database from the default configuration .Returns a connection string.Returns the password of the database from the properties .Returns the user of the database from the properties.Returns the default content encoding.Returns the name of the default web application, configured inweb.xml
.getDisplayForModule
(org.opencms.module.CmsModule module) Returns the display string for a given module.Returns the error messages.Returns the mac ethernet address.protected String
getExtProperty
(String key) Returns the value for a given key from the extended properties.Returns the fullDatabaseKey.Generates the HTML code for the drop down for db selection.getHtmlHelpIcon
(String id, String pathPrefix) Returns a help image icon tag to display a help text in the setup wizard.getHtmlPart
(String part) Returns the specified HTML part of the HTML property file to create the output.getHtmlPart
(String part, String replaceString) Returns the specified HTML part of the HTML property file to create the output.Returns the path to the /WEB-INF/lib folder.Returns the name of the log file.Returns a map with lists of dependent module package names keyed by module package names.Returns the absolute path to the module root folder.Returns A list with the package names of the modules to be installed.getPool()
Gets the default pool.org.opencms.configuration.CmsParameterConfiguration
Returns the parameter configuration.Returns the replacer.Return the OpenCms server name.javax.servlet.ServletConfig
Returns the initial servlet configuration.Returns the OpenCms servlet mapping, configured inweb.xml
.Returns a sorted list with they keys (e.g.Returns the absolute path to the OpenCms home directory.boolean
Checks if the setup wizard is enabled.Returns the workplace import thread.Return the OpenCms workplace site.Returns the xml Helper object.boolean
Returns true if there is an index.html file in the default site after the module import.protected String
htmlComponent
(CmsSetupComponent component) Returns html for the given component to fill the selection list.Returns the html code for component selection.protected String
htmlModule
(org.opencms.module.CmsModule module, int pos) Returns html for the given module to fill the selection list.Returns html code for the module descriptions in help ballons.Returns html for displaying a module selection box.protected void
importModuleFromDefault
(String importFile) Imports a module (zipfile) from the default module directory, creating a temporary project for this.void
Installed all modules that have been set usingsetInstallModules(String)
.void
Creates a new instance of the setup Bean.void
init
(javax.servlet.jsp.PageContext pageContext) Creates a new instance of the setup Bean from a JSP page.void
init
(javax.servlet.ServletContext servCtx, javax.servlet.ServletConfig servConfig) void
This method reads the properties from the htmlmsg.property file and sets the HTML part properties with the matching values.protected void
initializeComponents
(Collection<String> modules) Initializes and validates the read components.void
initShellCmsObject
(org.opencms.file.CmsObject cms, org.opencms.main.CmsShell shell) boolean
Returns the autoMode.Over simplistic helper to compare two strings to check radio buttons.protected boolean
Returnstrue
if the import thread is currently running.boolean
Returns true if this setup bean is correctly initialized.Returns js code with array definition for the available component dependencies.Returns js code with array definition for the component modules.Returns js code with array definition for the available components names.Returns js code with array definition for the available module dependencies.Returns js code with array definition for the available module names.void
Locks (i.e.void
Prepares step 10 of the setup wizard.boolean
Prepares step 8 of the setup wizard.void
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
Stores the properties of all available database configurations in a map keyed by their database key names (e.g.void
saveProperties
(org.opencms.configuration.CmsParameterConfiguration properties, String file, boolean backup) Saves properties to specified file.void
saveProperties
(org.opencms.configuration.CmsParameterConfiguration properties, String file, boolean backup, Set<String> forceWrite) Saves properties to specified file.void
setAutoMode
(boolean autoMode) Sets the autoMode.void
setDatabase
(String databaseKey) Sets the database drivers to the given value.void
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
(Map<String, String[]> request, String provider, String contextPath, javax.servlet.http.HttpSession session) Sets the needed database parameters.boolean
setDbParamaters
(javax.servlet.http.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
setFullDatabaseKey
(String fullDatabaseKey) Sets the fullDatabaseKey.void
setInstallModules
(String value) Sets the list with the package names of the modules to be installed.void
setReplacer
(Map<String, String> map) Sets the replacer.void
setServerName
(String name) Sets the OpenCms server name.void
setStartView
(String userName, String view) Sets the start view for the given user.void
setWorkplaceSite
(String newSite) Sets the OpenCms workplace site.void
void
sortModules
(Collection<org.opencms.module.CmsModule> modules) Sorts the modules for display.void
Writes configuration changes back to the XML configuration.boolean
Checks the jdbc driver.
-
Field Details
-
ADDITIONAL_PREFIX
Prefix for 'marker' properties in opencms.properties where additional properties should be inserted.- See Also:
-
AS400_PROVIDER
DB provider constant for as400.- See Also:
-
COMPONENTS_PROPERTIES
The name of the components properties file.- See Also:
-
DB2_PROVIDER
DB provider constant for db2.- See Also:
-
FOLDER_BACKUP
Folder constant name. -
FOLDER_DATABASE
Folder constant name. -
FOLDER_LIB
Folder constant name. -
FOLDER_SETUP
Folder constant name. -
GENERIC_PROVIDER
DB provider constant.- See Also:
-
HSQLDB_PROVIDER
DB provider constant for hsqldb.- See Also:
-
HTML_MESSAGE_FILE
Name of the property file containing HTML fragments for setup wizard and error dialog.- See Also:
-
MAXDB_PROVIDER
DB provider constant for maxdb.- See Also:
-
MSSQL_PROVIDER
DB provider constant for mssql.- See Also:
-
MYSQL_PROVIDER
DB provider constant for mysql.- See Also:
-
ORACLE_PROVIDER
DB provider constant for oracle.- See Also:
-
POSTGRESQL_PROVIDER
DB provider constant for postgresql.- See Also:
-
DEFAULT_POSITION
The default component position, is missing.- See Also:
-
PROPKEY_CHECKED
Properties file key constant post fix.- See Also:
-
PROPKEY_COMPONENT
Properties file key constant prefix.- See Also:
-
PROPKEY_COMPONENTS
Properties file key constant.- See Also:
-
PROPKEY_DEPENDENCIES
Properties file key constant post fix.- See Also:
-
PROPKEY_DESCRIPTION
Properties file key constant post fix.- See Also:
-
PROPKEY_MODULES
Properties file key constant post fix.- See Also:
-
PROPKEY_NAME
Properties file key constant post fix.- See Also:
-
PROPKEY_POSITION
Properties file key constant post fix.- See Also:
-
m_availableModules
A map with all available modules. -
m_cms
A CmsObject to execute shell commands. -
m_components
protected org.opencms.workplace.tools.CmsIdentifiableObjectContainer<CmsSetupComponent> m_componentsContains all defined components. -
m_installModules
A list with the package names of the modules to be installed . -
m_logFile
Location for log file. -
m_moduleDependencies
A map with lists of dependent module package names keyed by module package names. -
m_moduleFilenames
A map with all available modules filenames. -
m_modulesFolder
Location for module archives relative to the webapp folder. -
m_newLoggingOffset
The new logging offset in the workplace import thread. -
m_oldLoggingOffset
The lod logging offset in the workplace import thread. -
m_webAppRfsPath
The absolute path to the home directory of the OpenCms webapp.
-
-
Constructor Details
-
CmsSetupBean
public CmsSetupBean()Default constructor.
-
-
Method Details
-
backupConfiguration
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"
-
buildDepsForAllComponents
Returns a map of dependencies.The component dependencies are get from the setup and module components.properties files found.
- Returns:
- a Map of component ids as keys and a list of dependency names as values
-
checkEthernetAddress
Checks the ethernet address value and generates a dummy address, if necessary.*
-
clearCache
Clears the cache. -
copyFile
Copies a given file.- Parameters:
source
- the source filetarget
- the destination file
-
displayError
Returns html code to display an error.- Parameters:
pathPrefix
- to adjust the path- Returns:
- html code
-
displayErrors
Returns html code to display the errors occurred.- Parameters:
pathPrefix
- to adjust the path- Returns:
- html code
-
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
-
getComponents
public org.opencms.workplace.tools.CmsIdentifiableObjectContainer<CmsSetupComponent> getComponents()Returns the components.- Returns:
- the components
-
getConfigRfsPath
Returns the "config" path in the OpenCms web application.- Returns:
- the config path
-
getContextPath
-
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")
-
getDatabaseLibs
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
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
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
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
Returns the database name.- Returns:
- the database name
-
getDbConStrParams
Returns the JDBC connect URL parameters.- Returns:
- the JDBC connect URL parameters
-
getDbCreateConStr
Returns the database create statement.- Returns:
- the database create statement
-
getDbCreatePwd
Returns the password used for database creation.- Returns:
- the password used for database creation
-
getDbCreateUser
Returns the database user that is used to connect to the database.- Returns:
- the database user
-
getDbDriver
Returns the database driver belonging to the database from the default configuration.- Returns:
- name of the database driver
-
getDbProperty
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
Returns the validation query belonging to the database from the default configuration .- Returns:
- query used to validate connections
-
getDbWorkConStr
Returns a connection string.- Returns:
- the connection string used by the OpenCms core
-
getDbWorkPwd
Returns the password of the database from the properties .- Returns:
- the password for the OpenCms database user
-
getDbWorkUser
Returns the user of the database from the properties.- Returns:
- the database user used by the opencms core
-
getDefaultContentEncoding
Returns the default content encoding.- Returns:
- String
-
getDefaultWebApplication
Returns the name of the default web application, configured inweb.xml
.By default this is
"ROOT"
.- Returns:
- the name of the default web application, configured in
web.xml
-
getDisplayForModule
Returns the display string for a given module.- Parameters:
module
- a module- Returns:
- the display string for the given module
-
getErrors
Returns the error messages.- Returns:
- a vector of error messages
-
getEthernetAddress
Returns the mac ethernet address.- Returns:
- the mac ethernet addess
-
getFullDatabaseKey
Returns the fullDatabaseKey.- Returns:
- the fullDatabaseKey
-
getHtmlForDbSelection
Generates the HTML code for the drop down for db selection.- Returns:
- the generated HTML
-
getHtmlHelpIcon
Returns a help image icon tag to display a help text in the setup wizard.- Parameters:
id
- the id of the desired help divpathPrefix
- 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
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
Returns the specified HTML part of the HTML property file to create the output.- Parameters:
part
- the name of the desired partreplaceString
- 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
Returns the path to the /WEB-INF/lib folder.- Returns:
- the path to the /WEB-INF/lib folder
-
getLogName
Returns the name of the log file.- Returns:
- the name of the log file
-
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
Returns the absolute path to the module root folder.- Returns:
- the absolute path to the module root folder
-
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
Gets the default pool.- Returns:
- name of the default pool
-
getProperties
Returns the parameter configuration.- Returns:
- the parameter configuration
-
getReplacer
Returns the replacer.- Returns:
- the replacer
-
getServerName
Return the OpenCms server name.- Returns:
- the OpenCms server name
-
getServletConfig
Returns the initial servlet configuration.- Returns:
- the initial servlet configuration
-
getServletMapping
Returns the OpenCms servlet mapping, configured inweb.xml
.By default this is
"/opencms/*"
.- Returns:
- the OpenCms servlet mapping, configured in
web.xml
-
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
Returns the absolute path to the OpenCms home directory.- Returns:
- the path to the OpenCms home directory
-
getWizardEnabled
Checks if the setup wizard is enabled.- Returns:
- true if the setup wizard is enables, false otherwise
-
getWorkplaceImportThread
Returns the workplace import thread.- Returns:
- the workplace import thread
-
getWorkplaceSite
Return the OpenCms workplace site.- Returns:
- the OpenCms workplace site
-
getXmlHelper
Returns the xml Helper object.- Returns:
- the xml Helper object
-
hasIndexHtml
Returns true if there is an index.html file in the default site after the module import.- Returns:
- true if there is an index.html file
-
htmlComponents
Returns the html code for component selection.- Returns:
- html code
-
htmlModuleHelpDescriptions
Returns html code for the module descriptions in help ballons.- Returns:
- html code
-
htmlModules
Returns html for displaying a module selection box.- Returns:
- html code
-
importModulesFromSetupBean
Installed all modules that have been set usingsetInstallModules(String)
.This method is invoked as a shell command.
- Throws:
Exception
- if something goes wrong
-
init
Creates a new instance of the setup Bean from a JSP page.- Parameters:
pageContext
- the JSP's page context
-
init
-
init
Creates a new instance of the setup Bean.- Parameters:
webAppRfsPath
- path to the OpenCms web applicationservletMapping
- the OpenCms servlet mappingdefaultWebApplication
- the name of the default web application
-
initHtmlParts
This method reads the properties from the htmlmsg.property file and sets the HTML part properties with the matching values. -
initShellCmsObject
- Specified by:
initShellCmsObject
in interfaceorg.opencms.main.I_CmsShellCommands
- See Also:
-
I_CmsShellCommands.initShellCmsObject(org.opencms.file.CmsObject, org.opencms.main.CmsShell)
-
isAutoMode
Returns the autoMode.- Returns:
- the autoMode
-
isChecked
Over simplistic helper to compare two strings to check radio buttons.- Parameters:
value1
- the first valuevalue2
- the second value- Returns:
- "checked" if both values are equal, the empty String "" otherwise
-
isInitialized
Returns true if this setup bean is correctly initialized.- Returns:
- true if this setup bean is correctly initialized
-
jsComponentDependencies
Returns js code with array definition for the available component dependencies.- Returns:
- js code
-
jsComponentModules
Returns js code with array definition for the component modules.- Returns:
- js code
-
jsComponentNames
Returns js code with array definition for the available components names.- Returns:
- js code
-
jsModuleDependencies
Returns js code with array definition for the available module dependencies.- Returns:
- js code
-
jsModuleNames
Returns js code with array definition for the available module names.- Returns:
- js code
-
lockWizard
Locks (i.e. disables) the setup wizard. -
prepareStep10
Prepares step 10 of the setup wizard. -
prepareStep8
Prepares step 8 of the setup wizard.- Returns:
- true if the workplace should be imported
-
prepareStep8b
Prepares step 8b of the setup wizard. -
prepareStep8bOutput
Generates the output for step 8b of the setup wizard.- Parameters:
out
- the JSP print stream- Throws:
IOException
- in case errors occur while writing to "out"
-
saveProperties
public void saveProperties(org.opencms.configuration.CmsParameterConfiguration properties, String file, boolean backup) Saves properties to specified file.- Parameters:
properties
- the properties to be savedfile
- the file to save the properties tobackup
- if true, create a backupfile
-
saveProperties
public void saveProperties(org.opencms.configuration.CmsParameterConfiguration properties, String file, boolean backup, Set<String> forceWrite) Saves properties to specified file.- Parameters:
properties
- the properties to be savedfile
- the file to save the properties tobackup
- if true, create a backupfileforceWrite
- the keys for the properties which should always be written, even if they don't exist in the configuration file
-
setAutoMode
Sets the autoMode.- Parameters:
autoMode
- the autoMode to set
-
setDatabase
Sets the database drivers to the given value.- Parameters:
databaseKey
- the key of the selected database server (e.g. "mysql", "generic" or "oracle")
-
setDb
Sets the database name.- Parameters:
db
- the database name to set
-
setDbConStrParams
Sets the JDBC connect URL parameters.- Parameters:
value
- the JDBC connect URL parameters
-
setDbCreateConStr
Sets the database create statement.- Parameters:
dbCreateConStr
- the database create statement
-
setDbCreatePwd
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
Set the database user that is used to connect to the database.- Parameters:
dbCreateUser
- the user to set
-
setDbDriver
Sets the database driver belonging to the database.- Parameters:
driver
- name of the opencms driver
-
setDbParamaters
Sets the needed database parameters.- Parameters:
request
- the http requestprovider
- the db provider- Returns:
- true if already submitted
-
setDbParamaters
public boolean setDbParamaters(Map<String, String[]> request, String provider, String contextPath, javax.servlet.http.HttpSession session) Sets the needed database parameters.- Parameters:
request
- the http requestprovider
- the db providercontextPath
- the context path to usesession
- the session to use ornull
if running outside a servlet container- Returns:
- true if already submitted
-
setDbProperty
This method sets the value for a given key in the database properties.- Parameters:
key
- The key of the propertyvalue
- The value of the property
-
setDbWorkConStr
Sets the connection string to the database to the given value.- Parameters:
dbWorkConStr
- the connection string used by the OpenCms core
-
setDbWorkPwd
Sets the password of the database to the given value.- Parameters:
dbWorkPwd
- the password for the OpenCms database user
-
setDbWorkUser
Sets the user of the database to the given value.- Parameters:
dbWorkUser
- the database user used by the opencms core
-
setEthernetAddress
Set the mac ethernet address, required for UUID generation.- Parameters:
ethernetAddress
- the mac addess to set
-
setFullDatabaseKey
Sets the fullDatabaseKey.- Parameters:
fullDatabaseKey
- the fullDatabaseKey to set
-
setInstallModules
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
Sets the replacer.- Parameters:
map
- the replacer to set
-
setServerName
Sets the OpenCms server name.- Parameters:
name
- the OpenCms server name
-
setStartView
Sets the start view for the given user.- Parameters:
userName
- the name of the userview
- the start view path- Throws:
org.opencms.main.CmsException
- if something goes wrong
-
setWorkplaceSite
Sets the OpenCms workplace site.- Parameters:
newSite
- the OpenCms workplace site
-
shellExit
- Specified by:
shellExit
in interfaceorg.opencms.main.I_CmsShellCommands
- See Also:
-
I_CmsShellCommands.shellExit()
-
shellStart
- Specified by:
shellStart
in interfaceorg.opencms.main.I_CmsShellCommands
- See Also:
-
I_CmsShellCommands.shellStart()
-
sortModules
Sorts the modules for display.- Parameters:
modules
- the list ofCmsModule
objects- Returns:
- a sorted list of module names
-
updateConfiguration
Writes configuration changes back to the XML configuration. -
validateJdbc
Checks the jdbc driver.- Returns:
true
if at least one of the recommended drivers is found
-
addComponentsFromPath
protected void addComponentsFromPath(String fileName) throws org.opencms.configuration.CmsConfigurationException Reads all components from the given location, a folder or a zip file.- Parameters:
fileName
- the location to read the components from- Throws:
org.opencms.configuration.CmsConfigurationException
- if something goes wrong
-
getComponentModules
Returns a pipe separated list of module names for the given list of components.- Parameters:
componentIds
- the list of component IDs to get the modules for- Returns:
- a pipe separated list of module names for the given list of components
-
getComponentsProperties
protected org.opencms.configuration.CmsParameterConfiguration getComponentsProperties(String location) throws FileNotFoundException, org.opencms.configuration.CmsConfigurationException Reads all properties from the components.properties file at the given location, a folder or a zip file.- Parameters:
location
- the location to read the properties from- Returns:
- the read properties
- Throws:
FileNotFoundException
- if the properties file could not be foundorg.opencms.configuration.CmsConfigurationException
- if the something else goes wrong
-
getExtProperty
Returns the value for a given key from the extended properties.- Parameters:
key
- the property key- Returns:
- the string value for a given key
-
htmlComponent
Returns html for the given component to fill the selection list.- Parameters:
component
- the component to generate the code for- Returns:
- html code
-
htmlModule
Returns html for the given module to fill the selection list.- Parameters:
module
- the module to generate the code forpos
- the position in the list- Returns:
- html code
-
importModuleFromDefault
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:
Exception
- if something goes wrong- See Also:
-
CmsImportExportManager.importData(CmsObject, org.opencms.report.I_CmsReport, CmsImportParameters)
-
initializeComponents
Initializes and validates the read components.- Parameters:
modules
- a modifiable list of the modules to be imported
-
isImportRunning
Returnstrue
if the import thread is currently running.- Returns:
true
if the import thread is currently running
-
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
This method sets the value for a given key in the extended properties.- Parameters:
key
- The key of the propertyvalue
- The value of the property
-