|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opencms.configuration.CmsConfigurationManager
public class CmsConfigurationManager
Configuration manager for digesting the OpenCms XML configuration.
Reads the individual configuration class nodes first and creaes new instances of the "base" configuration classes.
| Field Summary | |
|---|---|
static String |
DEFAULT_DTD_LOCATION
The location of the OpenCms configuration DTD if the default prefix is the system ID. |
static String |
DEFAULT_DTD_PREFIX
The default prefix for the OpenCms configuration DTD. |
protected static String |
N_CONFIG
The config node. |
protected static String |
N_CONFIGURATION
The configurations node. |
protected static String |
N_ROOT
The "opencms" root node of the XML configuration. |
| Fields inherited from interface org.opencms.configuration.I_CmsXmlConfiguration |
|---|
A_ALIAS, A_CLASS, A_COUNT, A_DESTINATION, A_ENABLED, A_FROM, A_HANDLER, A_ICON, A_ID, A_KEY, A_NAME, A_ORDER, A_PASSWORD, 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_VALUE |
| Fields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler |
|---|
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD |
| Constructor Summary | |
|---|---|
CmsConfigurationManager(String baseFolder)
Creates a new OpenCms configuration manager. |
|
| Method Summary | |
|---|---|
void |
addConfiguration(I_CmsXmlConfiguration configuration)
Adds a configuration object to the configuration manager. |
void |
addConfigurationParameter(String paramName,
String paramValue)
Adds a configuration parameter to this parameter configurable class instance. |
void |
addXmlDigesterRules(Digester digester)
Digests an XML node and creates an instance of this configurable class. |
Element |
generateXml(Element parent)
Generates the XML element for this configurable class. |
Document |
generateXml(I_CmsXmlConfiguration configuration)
Creates the XML document build from the provided configuration. |
File |
getBackupFolder()
Returns the backup folder. |
Map |
getConfiguration()
Returns the configuration of this parameter configurable class instance, or null if the class does not need to be configured. |
I_CmsXmlConfiguration |
getConfiguration(Class clazz)
Returns a specific configuration from the list of initialized configurations. |
List |
getConfigurations()
Returns the list of all initialized configurations. |
String |
getDtdFilename()
Returns the name of the DTD file for this XML configuration, e.g. |
String |
getDtdSystemLocation()
Returns the internal system location of the DTD file for this XML configuration, e.g. |
String |
getDtdUrlPrefix()
Returns the external system id prefix of the DTD file for this XML configuration, e.g. |
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 |
setConfiguration(Map legacyConfiguration)
Sets the configuration read from the legacy "opencms.properties". |
void |
writeConfiguration(Class clazz)
Writes the XML configuration for the provided configuration instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_DTD_LOCATION
public static final String DEFAULT_DTD_PREFIX
protected static final String N_CONFIG
protected static final String N_CONFIGURATION
protected static final String N_ROOT
| Constructor Detail |
|---|
public CmsConfigurationManager(String baseFolder)
baseFolder - base folder where XML configurations to load are located| Method Detail |
|---|
public void addConfiguration(I_CmsXmlConfiguration configuration)
configuration - the configuration to add
public void addConfigurationParameter(String paramName,
String paramValue)
I_CmsConfigurationParameterHandler
addConfigurationParameter 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(Digester digester)
I_CmsXmlConfiguration
addXmlDigesterRules in interface I_CmsXmlConfigurationdigester - the digester to useI_CmsXmlConfiguration.addXmlDigesterRules(org.apache.commons.digester.Digester)public Element generateXml(Element parent)
I_CmsXmlConfiguration
generateXml in interface I_CmsXmlConfigurationparent - the parent element in the XML tree
I_CmsXmlConfiguration.generateXml(org.dom4j.Element)public Document generateXml(I_CmsXmlConfiguration configuration)
configuration - the configuration to build the XML for
public File getBackupFolder()
public Map getConfiguration()
I_CmsConfigurationParameterHandlernull if the class does not need to be configured.
All elements in the configuration are key, value String pairs,
set using the I_CmsConfigurationParameterHandler.addConfigurationParameter(String, String) method
during initialization of the loader.
Implementations will (should) not to return a direct reference to the internal configuration but just a copy of it, to avoid unwanted external manipulation.
getConfiguration in interface I_CmsConfigurationParameterHandlernullI_CmsConfigurationParameterHandler.getConfiguration()public I_CmsXmlConfiguration getConfiguration(Class clazz)
clazz - the configuration class that should be returned
null if this is not foundpublic List getConfigurations()
public String getDtdFilename()
I_CmsXmlConfigurationopencms-configuration.dtd.
getDtdFilename in interface I_CmsXmlConfigurationI_CmsXmlConfiguration.getDtdFilename()public 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 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 String getXmlFileName()
I_CmsXmlConfigurationopencms.xml.
getXmlFileName in interface I_CmsXmlConfigurationI_CmsXmlConfiguration.getXmlFileName()public void initConfiguration()
I_CmsConfigurationParameterHandler
initConfiguration in interface I_CmsConfigurationParameterHandlerI_CmsConfigurationParameterHandler.initConfiguration()
public void loadXmlConfiguration()
throws SAXException,
IOException
SAXException - in case of XML parse errors
IOException - in case of file IO errorspublic void setConfiguration(Map legacyConfiguration)
legacyConfiguration - the configuration read from the legacy "opencms.properties"
public void writeConfiguration(Class clazz)
throws IOException,
CmsConfigurationException
clazz - the configuration class to write the XML for
IOException - in case of I/O errors while writing
CmsConfigurationException - if the given class is not a valid configuration class
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||