Package org.opencms.setup.xml
Class CmsXmlConfigUpdater
java.lang.Object
org.opencms.setup.xml.CmsXmlConfigUpdater
Class for updating the XML configuration files using a set of XSLT transforms.
The XSLT transforms are stored in the directory update/xmlupdate, together with a file transforms.xml
that contains the list of transformation files and the configuration files to which they should be applied to.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Need this so that 'dummy' entity resolver is also used for documents read with the document() function. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
Helper method for determining the position for a top-level configuration element in opencms-system.xml.boolean
isDone()
Checks if updater has tried to transform.void
Transforms a config file with an XSLT transform.void
Transforms the configuration.Gets validation errors either as a JSON string, or null if there are no validation errors.
-
Field Details
-
DEFAULT_XML
Default XML for new config files.- See Also:
-
-
Constructor Details
-
CmsXmlConfigUpdater
Creates a new instance.- Parameters:
xsltDir
- the directory containing the XSLT filesconfigDir
- the configuration directory
-
-
Method Details
-
getSystemConfigPosition
Helper method for determining the position for a top-level configuration element in opencms-system.xml.This can be used by XSL transformations to insert optional nodes for new features on the top level.
- Parameters:
name
- the element name- Returns:
- the position for the element name, or -1 if the position could not be determined
- Throws:
Exception
- if something goes wrong
-
isDone
Checks if updater has tried to transform.- Returns:
- boolean
-
transform
Transforms a config file with an XSLT transform.- Parameters:
name
- file name of the config filetransform
- file name of the XSLT file- Throws:
Exception
- if something goes wrong
-
transformConfig
Transforms the configuration.- Throws:
Exception
- if something goes wrong
-
validationErrors
Gets validation errors either as a JSON string, or null if there are no validation errors.- Returns:
- the validation error JSON
-