public class CmsConfigurationManager extends java.lang.Object implements I_CmsXmlConfiguration
Reads the individual configuration class nodes first and creaes new instances of the "base" configuration classes.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_DTD_LOCATION
The location of the OpenCms configuration DTD if the default prefix is the system ID.
|
static java.lang.String |
DEFAULT_DTD_PREFIX
The default prefix for the OpenCms configuration DTD.
|
static java.lang.String |
DEFAULT_XML_FILE_NAME
The name of the default XML file for this configuration.
|
static java.lang.String |
DEFAULT_XSLT_FILENAME
Location of the optional XSLT file used to transform the configuration.
|
static java.lang.String |
DTD_FILE_NAME
The name of the DTD file for this configuration.
|
protected static java.lang.String |
N_CONFIG
The config node.
|
protected static java.lang.String |
N_CONFIGURATION
The configurations node.
|
static java.lang.String |
N_ROOT
The "opencms" root node of the XML configuration.
|
static java.lang.String |
POSTFIX_ORI
Postfix for original configuration files.
|
A_ALIAS, A_CLASS, A_COUNT, A_DEFAULT, A_DESTINATION, A_ENABLED, A_FROM, A_HANDLER, A_ICON, A_ID, A_KEY, A_MODE, A_NAME, A_ORDER, A_PASSWORD, A_PORT, A_PROTOCOL, A_SUFFIX, A_TO, A_TYPE, A_URI, A_USER, A_VALUE, N_EXPORTPOINT, N_EXPORTPOINTS, N_NAME, N_PARAM, N_PROPERTY, N_RESOURCE, N_SITE, N_VALUEADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD| Constructor and Description |
|---|
CmsConfigurationManager(java.lang.String baseFolder)
Creates a new OpenCms configuration manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConfiguration(I_CmsXmlConfiguration configuration)
Adds a configuration object to the configuration manager.
|
void |
addConfigurationParameter(java.lang.String paramName,
java.lang.String paramValue)
Adds a configuration parameter to this parameter configurable class instance.
|
void |
addXmlDigesterRules(org.apache.commons.digester3.Digester digester)
Digests an XML node and creates an instance of this configurable class.
|
org.dom4j.Element |
generateXml(org.dom4j.Element parent)
Generates the XML element for this configurable class.
|
org.dom4j.Document |
generateXml(I_CmsXmlConfiguration configuration)
Creates the XML document build from the provided configuration.
|
java.io.File |
getBackupFolder()
Returns the backup folder.
|
CmsParameterConfiguration |
getConfiguration()
Returns the properties read from
opencms.properties. |
I_CmsXmlConfiguration |
getConfiguration(java.lang.Class<?> clazz)
Returns a specific configuration from the list of initialized configurations.
|
java.util.List<I_CmsXmlConfiguration> |
getConfigurations()
Returns the list of all initialized configurations.
|
java.lang.String |
getDtdFilename()
Returns the name of the DTD file for this XML configuration,
e.g.
|
java.lang.String |
getDtdSystemLocation()
Returns the internal system location of the DTD file for this XML configuration,
e.g.
|
java.lang.String |
getDtdUrlPrefix()
Returns the external system id prefix of the DTD file for this XML configuration,
e.g.
|
java.lang.String |
getXmlFileName()
Returns the name of the XML input file for this configuration,
e.g.
|
void |
initConfiguration()
Initializes a configuration after all parameters have been added.
|
void |
loadXmlConfiguration()
Loads the OpenCms configuration from the given XML file.
|
void |
setAdminCms(CmsObject cms)
Sets the admin CmsObject.
|
void |
setConfiguration(CmsParameterConfiguration propertyConfiguration)
Sets the configuration read from the
opencms.properties. |
void |
writeConfiguration(java.lang.Class<?> clazz)
Writes the XML configuration for the provided configuration instance.
|
public static final java.lang.String DEFAULT_DTD_LOCATION
public static final java.lang.String DEFAULT_XSLT_FILENAME
public static final java.lang.String DEFAULT_DTD_PREFIX
public static final java.lang.String DEFAULT_XML_FILE_NAME
public static final java.lang.String DTD_FILE_NAME
public static final java.lang.String N_ROOT
public static final java.lang.String POSTFIX_ORI
protected static final java.lang.String N_CONFIG
protected static final java.lang.String N_CONFIGURATION
public CmsConfigurationManager(java.lang.String baseFolder)
baseFolder - base folder where XML configurations to load are locatedpublic void addConfiguration(I_CmsXmlConfiguration configuration)
configuration - the configuration to addpublic void addConfigurationParameter(java.lang.String paramName, java.lang.String paramValue)
I_CmsConfigurationParameterHandleraddConfigurationParameter in interface I_CmsConfigurationParameterHandlerparamName - the name of the parameterparamValue - the value for the parameterI_CmsConfigurationParameterHandler.addConfigurationParameter(java.lang.String, java.lang.String)public void addXmlDigesterRules(org.apache.commons.digester3.Digester digester)
I_CmsXmlConfigurationaddXmlDigesterRules in interface I_CmsXmlConfigurationdigester - the digester to useI_CmsXmlConfiguration.addXmlDigesterRules(org.apache.commons.digester3.Digester)public org.dom4j.Element generateXml(org.dom4j.Element parent)
I_CmsXmlConfigurationgenerateXml in interface I_CmsXmlConfigurationparent - the parent element in the XML treeI_CmsXmlConfiguration.generateXml(org.dom4j.Element)public org.dom4j.Document generateXml(I_CmsXmlConfiguration configuration)
configuration - the configuration to build the XML forpublic java.io.File getBackupFolder()
public CmsParameterConfiguration getConfiguration()
opencms.properties.getConfiguration in interface I_CmsConfigurationParameterHandlernull if the class does not need any parameterssetConfiguration(CmsParameterConfiguration),
I_CmsConfigurationParameterHandler.getConfiguration()public I_CmsXmlConfiguration getConfiguration(java.lang.Class<?> clazz)
clazz - the configuration class that should be returnednull if this is not foundpublic java.util.List<I_CmsXmlConfiguration> getConfigurations()
public java.lang.String getDtdFilename()
I_CmsXmlConfigurationopencms-configuration.dtd.getDtdFilename in interface I_CmsXmlConfigurationI_CmsXmlConfiguration.getDtdFilename()public java.lang.String getDtdSystemLocation()
I_CmsXmlConfigurationorg/opencms/configuration/.
If this is not null, then the DTD is not read through the
web URL, but an internal name resolution is added that resolves the
system id of the DTD to
.I_CmsXmlConfiguration.getDtdSystemLocation() + I_CmsXmlConfiguration.getDtdUrlPrefix()
getDtdSystemLocation in interface I_CmsXmlConfigurationI_CmsXmlConfiguration.getDtdSystemLocation()public java.lang.String getDtdUrlPrefix()
I_CmsXmlConfigurationhttp://www.opencms.org/dtd/6.0/.
The full system id for the DTD is calculated like this:
.I_CmsXmlConfiguration.getDtdSystemLocation() + I_CmsXmlConfiguration.getDtdUrlPrefix()
getDtdUrlPrefix in interface I_CmsXmlConfigurationI_CmsXmlConfiguration.getDtdUrlPrefix()public java.lang.String getXmlFileName()
I_CmsXmlConfigurationopencms.xml.getXmlFileName in interface I_CmsXmlConfigurationI_CmsXmlConfiguration.getXmlFileName()public void initConfiguration()
I_CmsConfigurationParameterHandlerinitConfiguration in interface I_CmsConfigurationParameterHandlerI_CmsConfigurationParameterHandler.initConfiguration()public void loadXmlConfiguration() throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException - in case of XML parse errorsjava.io.IOException - in case of file IO errorspublic void setAdminCms(CmsObject cms)
cms - the admin CmsObjectpublic void setConfiguration(CmsParameterConfiguration propertyConfiguration)
opencms.properties.propertyConfiguration - the configuration read from the opencms.propertiesgetConfiguration()public void writeConfiguration(java.lang.Class<?> clazz) throws java.io.IOException, CmsConfigurationException
clazz - the configuration class to write the XML forjava.io.IOException - in case of I/O errors while writingCmsConfigurationException - if the given class is not a valid configuration class