Class CmsAutoSetupProperties
- java.lang.Object
-
- org.opencms.setup.CmsAutoSetupProperties
-
public final class CmsAutoSetupProperties extends java.lang.Object
Reads and manages the configuration file for the OpenCms auto-setup.Note that each property set in the file is overwritten if the identical property is set as Java system property (what is used, e.g., by the setup wizard). Moreover, the property
setup.install.components
can be set via an accordingly named environment variable.- Since:
- 6.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.commons.logging.Log
LOG
The log object for this class.static java.lang.String
PROP_DB_CONNECTION_STRING_PARAMS
The DB connection string parameters property name.static java.lang.String
PROP_DB_CONNECTION_URL
The property keydb.connection.url
for providing the JDBC connection string, e.g.,jdbc:mysql://localhost:3306/
for the default MySQL installation.static java.lang.String
PROP_DB_CREATE_DB
The property keydb.create.db
for specifying if the database should be created during the setup.static java.lang.String
PROP_DB_CREATE_PWD
The property keydb.create.pwd
for specifying the password for the database user that is used during the setup connection.static java.lang.String
PROP_DB_CREATE_TABLES
The property keydb.create.tables
for specifying if the database tables in the OpenCms database should be created.static java.lang.String
PROP_DB_CREATE_USER
The property keydb.create.user
for specifying the name of the database user that is used during the setup connection.static java.lang.String
PROP_DB_DEFAULT_TABLESPACE
The property keydb.default.tablespace
necessary dependent on the chosen DBMS.static java.lang.String
PROP_DB_DROP_DB
The property keydb.dropDb
for specifying if an existing database should be dropped when the setup is configured to create a database with the same name.static java.lang.String
PROP_DB_INDEX_TABLESPACE
The property keydb.index.tablespace
necessary dependent on the chosen DBMS.static java.lang.String
PROP_DB_JDBC_DRIVER
The property keydb.jdbc.driver
for specifying the fully qualified name of the Java class implementing the JDBC driver to use for the connection.static java.lang.String
PROP_DB_NAME
The property keydb.name
for specifying the name of the database used by OpenCms, e.g.static java.lang.String
PROP_DB_PRODUCT
The property keydb.product
for specifying the used DBMS.static java.lang.String
PROP_DB_PROVIDER
The property keydb.provider
for specifying the database provider.static java.lang.String
PROP_DB_TEMPLATE_DB
The property keydb.template.db
necessary dependent of the chosen DBMS.static java.lang.String
PROP_DB_TEMPORARY_TABLESPACE
The property keydb.temporary.tablespace
necessary dependent of the chosen DBMS..static java.lang.String
PROP_DB_WORKER_PWD
The property keydb.worker.pwd
for providing the password of the database user that is used when running OpenCms after the setup.static java.lang.String
PROP_DB_WORKER_USER
The property keydb.worker.user
for providing the name of the database user that is used for the connection when running OpenCms after the setup.static java.lang.String
PROP_SERVER_ETHERNET_ADDRESS
The property keyserver.ethernet.address
.static java.lang.String
PROP_SERVER_NAME
The property keyserver.name
for specifying the server's name.static java.lang.String
PROP_SERVER_SERVLET_MAPPING
The property keyserver.servlet.mapping
for specifying the name of the OpenCms servlet (by default opencms).static java.lang.String
PROP_SERVER_URL
The property keyserver.url
for specifying the server's URL.static java.lang.String
PROP_SETUP_DEFAULT_WEBAPP
The property keysetup.default.webapp
.static java.lang.String
PROP_SETUP_INSTALL_COMPONENTS
The property keysetup.install.components
to choose the components that should be installed during the setup.static java.lang.String
PROP_SETUP_SHOW_PROGRESS
The property keysetup.show.progress
to specify if dots '.' should be printed to the real STDOUT while a setup is in progress.static java.lang.String
PROP_SETUP_WEBAPP_PATH
The property keysetup.webapp.path
to specify the path of the OpenCms webapp to install, e.g.,/var/lib/tomcat7/webapps/opencms
.
-
Constructor Summary
Constructors Constructor Description CmsAutoSetupProperties(java.lang.String propertiesFile)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getConnectionUrl()
Returns the connectionUrl.java.lang.String
getConStrParams()
Returns the DB connection string parameters.java.lang.String
getCreatePwd()
Returns the createPwd.java.lang.String
getCreateUser()
Returns the createUser.java.lang.String
getDbName()
java.lang.String
getDbProduct()
java.lang.String
getDbProvider()
Returns the dbProvider.java.lang.String
getDefaultTablespace()
Returns the defaultTablespace.java.lang.String
getEthernetAddress()
Returns the ethernetAddress.java.lang.String
getIndexTablespace()
Returns the indexTablespace.java.util.List<java.lang.String>
getInstallComponents()
Returns the installComponents.java.lang.String
getJdbcDriver()
Returns the jdbcDriver.java.lang.String
getServeltMapping()
Returns the serveltMapping.java.lang.String
getServerName()
Returns the serverName.java.lang.String
getServerUrl()
Returns the serverUrl.org.opencms.configuration.CmsParameterConfiguration
getSetupConfiguration()
Returns the setup configuration object.java.lang.String
getSetupDefaultWebappName()
Returns the setupWebappName.java.lang.String
getSetupWebappPath()
Returns the setupWebappPath.java.lang.String
getTemplateDb()
Returns the templateDb.java.lang.String
getTemporaryTablespace()
Returns the temporaryTablespace.java.lang.String
getWebappPath()
Returns the webappPath.java.lang.String
getWorkerPwd()
Returns the workerPwd.java.lang.String
getWorkerUser()
Returns the workerUser.boolean
isCreateDb()
Returns the createDb.boolean
isCreateTables()
Returns the createTables.boolean
isDropDb()
Returns the dropDb.boolean
isShowProgress()
Indicates if dots '.' should be printed to the real STDOUT while a setup is in progress.java.util.Map<java.lang.String,java.lang.String[]>
toParameterMap()
Converts and returns this object as map.
-
-
-
Field Detail
-
LOG
public static final org.apache.commons.logging.Log LOG
The log object for this class.
-
PROP_DB_CONNECTION_STRING_PARAMS
public static final java.lang.String PROP_DB_CONNECTION_STRING_PARAMS
The DB connection string parameters property name.- See Also:
- Constant Field Values
-
PROP_DB_CONNECTION_URL
public static final java.lang.String PROP_DB_CONNECTION_URL
The property keydb.connection.url
for providing the JDBC connection string, e.g.,jdbc:mysql://localhost:3306/
for the default MySQL installation.- See Also:
- Constant Field Values
-
PROP_DB_CREATE_DB
public static final java.lang.String PROP_DB_CREATE_DB
The property keydb.create.db
for specifying if the database should be created during the setup.Set to
true
to create the database automatically, orfalse
if it should not.NOTE: Automatic database creation is not supported for all DBMSs.
- See Also:
- Constant Field Values
-
PROP_DB_CREATE_PWD
public static final java.lang.String PROP_DB_CREATE_PWD
The property keydb.create.pwd
for specifying the password for the database user that is used during the setup connection.- See Also:
- Constant Field Values
-
PROP_DB_CREATE_TABLES
public static final java.lang.String PROP_DB_CREATE_TABLES
The property keydb.create.tables
for specifying if the database tables in the OpenCms database should be created.Set to
true
to create the database automatically, orfalse
if it should not.- See Also:
- Constant Field Values
-
PROP_DB_CREATE_USER
public static final java.lang.String PROP_DB_CREATE_USER
The property keydb.create.user
for specifying the name of the database user that is used during the setup connection. NOTE: The user must have administration permissions. The user data is deleted, when the setup is finished.- See Also:
- Constant Field Values
-
PROP_DB_DEFAULT_TABLESPACE
public static final java.lang.String PROP_DB_DEFAULT_TABLESPACE
The property keydb.default.tablespace
necessary dependent on the chosen DBMS.- See Also:
- Constant Field Values
-
PROP_DB_DROP_DB
public static final java.lang.String PROP_DB_DROP_DB
The property keydb.dropDb
for specifying if an existing database should be dropped when the setup is configured to create a database with the same name. Set totrue
if existing databases should be dropped when necessary, or tofalse
if not.- See Also:
- Constant Field Values
-
PROP_DB_INDEX_TABLESPACE
public static final java.lang.String PROP_DB_INDEX_TABLESPACE
The property keydb.index.tablespace
necessary dependent on the chosen DBMS.- See Also:
- Constant Field Values
-
PROP_DB_JDBC_DRIVER
public static final java.lang.String PROP_DB_JDBC_DRIVER
The property keydb.jdbc.driver
for specifying the fully qualified name of the Java class implementing the JDBC driver to use for the connection.Hint: The names can be found in the
database.properties
file in the webapp' folderssetup/database/
./ - See Also:
- Constant Field Values
-
PROP_DB_NAME
public static final java.lang.String PROP_DB_NAME
The property keydb.name
for specifying the name of the database used by OpenCms, e.g. choose "opencms".- See Also:
- Constant Field Values
-
PROP_DB_PRODUCT
public static final java.lang.String PROP_DB_PRODUCT
The property keydb.product
for specifying the used DBMS. Values should match the folders under the OpenCms webapp's foldersetup/database/
.- See Also:
- Constant Field Values
-
PROP_DB_PROVIDER
public static final java.lang.String PROP_DB_PROVIDER
The property keydb.provider
for specifying the database provider.Hint: The available providers are defined as constants in
CmsSetupBean
.- See Also:
- Constant Field Values
-
PROP_DB_TEMPLATE_DB
public static final java.lang.String PROP_DB_TEMPLATE_DB
The property keydb.template.db
necessary dependent of the chosen DBMS.- See Also:
- Constant Field Values
-
PROP_DB_TEMPORARY_TABLESPACE
public static final java.lang.String PROP_DB_TEMPORARY_TABLESPACE
The property keydb.temporary.tablespace
necessary dependent of the chosen DBMS..- See Also:
- Constant Field Values
-
PROP_DB_WORKER_PWD
public static final java.lang.String PROP_DB_WORKER_PWD
The property keydb.worker.pwd
for providing the password of the database user that is used when running OpenCms after the setup. CAUTION: For security reasons, the user should not have administration permissions. The user data is stored in theopencms.properties
file after the setup.- See Also:
- Constant Field Values
-
PROP_DB_WORKER_USER
public static final java.lang.String PROP_DB_WORKER_USER
The property keydb.worker.user
for providing the name of the database user that is used for the connection when running OpenCms after the setup. CAUTION: For security reasons, the user should not have administration permissions. The user data is stored in theopencms.properties
file after the setup. .- See Also:
- Constant Field Values
-
PROP_SERVER_ETHERNET_ADDRESS
public static final java.lang.String PROP_SERVER_ETHERNET_ADDRESS
The property keyserver.ethernet.address
. Specify a valid MAC-Address. It is used internally by OpenCms. (If not given, the address is generated automatically.)- See Also:
- Constant Field Values
-
PROP_SERVER_NAME
public static final java.lang.String PROP_SERVER_NAME
The property keyserver.name
for specifying the server's name. Special server names are of particular interest in a cluster installation.- See Also:
- Constant Field Values
-
PROP_SERVER_SERVLET_MAPPING
public static final java.lang.String PROP_SERVER_SERVLET_MAPPING
The property keyserver.servlet.mapping
for specifying the name of the OpenCms servlet (by default opencms).- See Also:
- Constant Field Values
-
PROP_SERVER_URL
public static final java.lang.String PROP_SERVER_URL
The property keyserver.url
for specifying the server's URL. It is used, e.g., for the site configuration.- See Also:
- Constant Field Values
-
PROP_SETUP_DEFAULT_WEBAPP
public static final java.lang.String PROP_SETUP_DEFAULT_WEBAPP
The property keysetup.default.webapp
. Provide the default webapp in your servlet container (Default: ROOT).- See Also:
- Constant Field Values
-
PROP_SETUP_INSTALL_COMPONENTS
public static final java.lang.String PROP_SETUP_INSTALL_COMPONENTS
The property keysetup.install.components
to choose the components that should be installed during the setup.The available components are configured in
setup/components.properties
in the webapp's folder.NOTE: You can specify the components to install also as Java system property (highest priority) or via an environment variable (second choice). The value specified in the configuration file is only the third choice.
- See Also:
- Constant Field Values
-
PROP_SETUP_SHOW_PROGRESS
public static final java.lang.String PROP_SETUP_SHOW_PROGRESS
The property keysetup.show.progress
to specify if dots '.' should be printed to the real STDOUT while a setup is in progress.- See Also:
- Constant Field Values
-
PROP_SETUP_WEBAPP_PATH
public static final java.lang.String PROP_SETUP_WEBAPP_PATH
The property keysetup.webapp.path
to specify the path of the OpenCms webapp to install, e.g.,/var/lib/tomcat7/webapps/opencms
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsAutoSetupProperties
public CmsAutoSetupProperties(java.lang.String propertiesFile) throws java.io.IOException, java.lang.SecurityException
Public constructor.- Parameters:
propertiesFile
- the path to the setup properties file- Throws:
java.io.IOException
- if the property file could not be readjava.lang.SecurityException
- if the environment variables could not be read
-
-
Method Detail
-
getConnectionUrl
public java.lang.String getConnectionUrl()
Returns the connectionUrl.- Returns:
- the connectionUrl
-
getConStrParams
public java.lang.String getConStrParams()
Returns the DB connection string parameters.- Returns:
- the DB connection string parameters
-
getCreatePwd
public java.lang.String getCreatePwd()
Returns the createPwd.- Returns:
- the createPwd
-
getCreateUser
public java.lang.String getCreateUser()
Returns the createUser.- Returns:
- the createUser
-
getDbName
public java.lang.String getDbName()
- Returns:
- the name of the db name used
-
getDbProduct
public java.lang.String getDbProduct()
- Returns:
- the name of the db product used
-
getDbProvider
public java.lang.String getDbProvider()
Returns the dbProvider.- Returns:
- the dbProvider
-
getDefaultTablespace
public java.lang.String getDefaultTablespace()
Returns the defaultTablespace.- Returns:
- the defaultTablespace
-
getEthernetAddress
public java.lang.String getEthernetAddress()
Returns the ethernetAddress.- Returns:
- the ethernetAddress
-
getIndexTablespace
public java.lang.String getIndexTablespace()
Returns the indexTablespace.- Returns:
- the indexTablespace
-
getInstallComponents
public java.util.List<java.lang.String> getInstallComponents()
Returns the installComponents.- Returns:
- the installComponents
-
getJdbcDriver
public java.lang.String getJdbcDriver()
Returns the jdbcDriver.- Returns:
- the jdbcDriver
-
getServeltMapping
public java.lang.String getServeltMapping()
Returns the serveltMapping.- Returns:
- the serveltMapping
-
getServerName
public java.lang.String getServerName()
Returns the serverName.- Returns:
- the serverName
-
getServerUrl
public java.lang.String getServerUrl()
Returns the serverUrl.- Returns:
- the serverUrl
-
getSetupConfiguration
public org.opencms.configuration.CmsParameterConfiguration getSetupConfiguration()
Returns the setup configuration object.- Returns:
- the setup configuration object
-
getSetupDefaultWebappName
public java.lang.String getSetupDefaultWebappName()
Returns the setupWebappName.- Returns:
- the setupWebappName
-
getSetupWebappPath
public java.lang.String getSetupWebappPath()
Returns the setupWebappPath.- Returns:
- the setupWebappPath
-
getTemplateDb
public java.lang.String getTemplateDb()
Returns the templateDb.- Returns:
- the templateDb
-
getTemporaryTablespace
public java.lang.String getTemporaryTablespace()
Returns the temporaryTablespace.- Returns:
- the temporaryTablespace
-
getWebappPath
public java.lang.String getWebappPath()
Returns the webappPath.- Returns:
- the webappPath
-
getWorkerPwd
public java.lang.String getWorkerPwd()
Returns the workerPwd.- Returns:
- the workerPwd
-
getWorkerUser
public java.lang.String getWorkerUser()
Returns the workerUser.- Returns:
- the workerUser
-
isCreateDb
public boolean isCreateDb()
Returns the createDb.- Returns:
- the createDb
-
isCreateTables
public boolean isCreateTables()
Returns the createTables.- Returns:
- the createTables
-
isDropDb
public boolean isDropDb()
Returns the dropDb.- Returns:
- the dropDb
-
isShowProgress
public boolean isShowProgress()
Indicates if dots '.' should be printed to the real STDOUT while a setup is in progress.- Returns:
- true if dots '.' should be printed to the real STDOUT while a setup is in progress
-
toParameterMap
public java.util.Map<java.lang.String,java.lang.String[]> toParameterMap()
Converts and returns this object as map.- Returns:
- this object as map
-
-