Package org.opencms.ade.configuration
Class CmsConfigurationReader
java.lang.Object
org.opencms.ade.configuration.CmsConfigurationReader
A class to parse ADE sitemap or module configuration files and create configuration objects from them.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Locale
The default locale for configuration objects.static final String
The AddContentReplacements node name.static final String
Node name for added formatters.static final String
Node name for the nested content with the added formatters.static final String
The AddPlugin node name.static final String
The AddPlugins node name.static final String
The Attribute node name.static final String
Node name for the attribute editor configuration reference.static final String
Node name for the 'Check reuse' option.static final String
The CopyInModels node name.static final String
The create content locally node name.static final String
The default node name.static final String
The description node name.static final String
The detail page node name.static final String
The detail pages disabled node name.static final String
The disabled node name.static final String
The DisabledFunctionsMode node name.static final String
The DisabledTypesMode node name.static final String
The discard model pages node name.static final String
The discard properties node name.static final String
The discard types node name.static final String
The display name node name.static final String
The element view node name.static final String
The error node name.static final String
The 'exclude external detail contents' node name.static final String
The folder node name.static final String
The formatter node name.static final String
The function node name.static final String
The function node name.static final String
The function reference node name.static final String
The 'include in site selector' node name.static final String
The IncludeName node name.static final String
The is default node name.static final String
The is preview node name.static final String
The JSP node name.static final String
The Key node name.static final String
The localization node name.static final String
The master configuration node name.static final String
The max width node name.static final String
The min width node name.static final String
The model page node name.static final String
The folder name node name.static final String
The name pattern node name.static final String
The order node name.static final String
The page node name.static final String
The PageRelative node name.static final String
The folder path node name.static final String
The Plugin node name.static final String
The PreferDetailPagesForLocalContents node name.static final String
The prefer folder node name.static final String
The property node name.static final String
The property name node name.static final String
XML node name.static final String
Node name for the "Remove all formatters"-option.static final String
Field name for the 'Remove all functions' setting.static final String
The RemoveAllPlugins node name.static final String
The RemoveAllSharedSettingOverrides node name.static final String
Node name for removed formatters.static final String
Node name for the nested content with the removed formatters.static final String
The remove function node name.static final String
The RemovePlugin node name.static final String
The RemovePlugins node name.static final String
The resource type node name.static final String
The regex rule node name.static final String
The rule type node name.static final String
The SharedSettingOverride node name.static final String
The ShowInDefaultView node name.static final String
The type node name.static final String
The type name node name.static final String
The node name for the type ordering mode.static final String
Node name.static final String
The Value node name.static final String
XML node name.static final String
The widget node name.static final String
The widget node name.static final String
The widget configuration node name.static final String
Scheme for explorer type view links. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
getBoolean
(I_CmsXmlContentLocation parent, String name) Helper method to read a boolean value from the XML.Returns the list of function references.Returns the modelPageConfigs.static String
getString
(CmsObject cms, I_CmsXmlContentValueLocation location) Gets the string value of an XML content location.protected String
getString
(I_CmsXmlContentValueLocation location) Gets the string value of an XML content location.Parses the formatters to add.parseConfiguration
(String basePath, CmsXmlContent content) Parses a configuration XML content and creates a configuration object from it.protected void
Parses the detail pages from an XML content node.parseFolderOrName
(String basePath, I_CmsXmlContentLocation location) Parses a folder which may either be given as a path or as a folder name.parseFormatter
(String typeName, I_CmsXmlContentLocation node) Parses a formatter bean.protected CmsFormatterChangeSet
parseFormatterChangeSet
(String basePath, I_CmsXmlContentLocation node, boolean removeAllFormatters, boolean removeFunctions, Set<CmsUUID> functions, Set<CmsUUID> functionsToRemove) Parses the formatter change set.protected void
Parses a function reference node.void
Parses model page data from the XML content.static CmsPropertyConfig
parseProperty
(CmsObject cms, I_CmsXmlContentLocation field) Helper method to parse a property.Parses the set of formatters to remove.void
parseResourceTypeConfig
(String basePath, I_CmsXmlContentLocation node) Parses a resource type configuration element from the XML content.parseSitemapConfiguration
(String basePath, CmsResource configRes) Parses the sitemap configuration given the configuration file and base path.Reads the configurations of all modules and combines them into a single configuration object.
-
Field Details
-
DEFAULT_LOCALE
The default locale for configuration objects. -
N_ADD_CONTENT_RESTRICTION
The AddContentReplacements node name.- See Also:
-
N_ADD_FORMATTER
Node name for added formatters.- See Also:
-
N_ADD_FORMATTERS
Node name for the nested content with the added formatters.- See Also:
-
N_ADD_PLUGIN
The AddPlugin node name.- See Also:
-
N_ADD_PLUGINS
The AddPlugins node name.- See Also:
-
N_ATTRIBUTE
The Attribute node name.- See Also:
-
N_ATTRIBUTE_EDITOR_CONFIG
Node name for the attribute editor configuration reference.- See Also:
-
N_CHECK_REUSE
Node name for the 'Check reuse' option.- See Also:
-
N_COPY_IN_MODELS
The CopyInModels node name.- See Also:
-
N_CREATE_CONTENTS_LOCALLY
The create content locally node name.- See Also:
-
N_DEFAULT
The default node name.- See Also:
-
N_DESCRIPTION
The description node name.- See Also:
-
N_DETAIL_PAGE
The detail page node name.- See Also:
-
N_DETAIL_PAGES_DISABLED
The detail pages disabled node name.- See Also:
-
N_DISABLED
The disabled node name.- See Also:
-
N_DISABLED_FUNCTIONS_MODE
The DisabledFunctionsMode node name.- See Also:
-
N_DISABLED_TYPES_MODE
The DisabledTypesMode node name.- See Also:
-
N_DISCARD_MODEL_PAGES
The discard model pages node name.- See Also:
-
N_DISCARD_PROPERTIES
The discard properties node name.- See Also:
-
N_DISCARD_TYPES
The discard types node name.- See Also:
-
N_DISPLAY_NAME
The display name node name.- See Also:
-
N_ELEMENT_VIEW
The element view node name.- See Also:
-
N_ERROR
The error node name.- See Also:
-
N_EXCLUDE_EXTERNAL_DETAIL_CONTENTS
The 'exclude external detail contents' node name.- See Also:
-
N_FOLDER
The folder node name.- See Also:
-
N_FORMATTER
The formatter node name.- See Also:
-
N_FUNCTION
The function node name.- See Also:
-
N_FUNCTION_DEFAULT_PAGE
The function node name.- See Also:
-
N_FUNCTION_REF
The function reference node name.- See Also:
-
N_INCLUDE_IN_SITE_SELECTOR
The 'include in site selector' node name.- See Also:
-
N_INCLUDE_NAME
The IncludeName node name.- See Also:
-
N_IS_DEFAULT
The is default node name.- See Also:
-
N_IS_PREVIEW
The is preview node name.- See Also:
-
N_JSP
The JSP node name.- See Also:
-
N_KEY
The Key node name.- See Also:
-
N_LOCALIZATION
The localization node name.- See Also:
-
N_MASTER_CONFIG
The master configuration node name.- See Also:
-
N_MAX_WIDTH
The max width node name.- See Also:
-
N_MIN_WIDTH
The min width node name.- See Also:
-
N_MODEL_PAGE
The model page node name.- See Also:
-
N_NAME
The folder name node name.- See Also:
-
N_NAME_PATTERN
The name pattern node name.- See Also:
-
N_ORDER
The order node name.- See Also:
-
N_PAGE
The page node name.- See Also:
-
N_PAGE_RELATIVE
The PageRelative node name.- See Also:
-
N_PATH
The folder path node name.- See Also:
-
N_PLUGIN
The Plugin node name.- See Also:
-
N_PREFER_DETAIL_PAGES_FOR_LOCAL_CONTENTS
The PreferDetailPagesForLocalContents node name.- See Also:
-
N_PREFER_FOLDER
The prefer folder node name.- See Also:
-
N_PROPERTY
The property node name.- See Also:
-
N_PROPERTY_NAME
The property name node name.- See Also:
-
N_PROPERTY_NAME_ALIAS
XML node name.- See Also:
-
N_REMOVE_ALL_FORMATTERS
Node name for the "Remove all formatters"-option.- See Also:
-
N_REMOVE_ALL_FUNCTIONS
Field name for the 'Remove all functions' setting.- See Also:
-
N_REMOVE_ALL_PLUGINS
The RemoveAllPlugins node name.- See Also:
-
N_REMOVE_ALL_SHARED_SETTING_OVERRIDES
The RemoveAllSharedSettingOverrides node name.- See Also:
-
N_REMOVE_FORMATTER
Node name for removed formatters.- See Also:
-
N_REMOVE_FORMATTERS
Node name for the nested content with the removed formatters.- See Also:
-
N_REMOVE_FUNCTIONS
The remove function node name.- See Also:
-
N_REMOVE_PLUGIN
The RemovePlugin node name.- See Also:
-
N_REMOVE_PLUGINS
The RemovePlugins node name.- See Also:
-
N_RESOURCE_TYPE
The resource type node name.- See Also:
-
N_RULE_REGEX
The regex rule node name.- See Also:
-
N_RULE_TYPE
The rule type node name.- See Also:
-
N_SHARED_SETTING_OVERRIDE
The SharedSettingOverride node name.- See Also:
-
N_SHOW_IN_DEFAULT_VIEW
The ShowInDefaultView node name.- See Also:
-
N_TYPE
The type node name.- See Also:
-
N_TYPE_NAME
The type name node name.- See Also:
-
N_TYPE_ORDERING_MODE
The node name for the type ordering mode.- See Also:
-
N_USE_FORMATTER_KEYS
Node name.- See Also:
-
N_VALUE
The Value node name.- See Also:
-
N_VALUE_TRANSLATION
XML node name.- See Also:
-
N_VISIBILITY
The widget node name.- See Also:
-
N_WIDGET
The widget node name.- See Also:
-
N_WIDGET_CONFIG
The widget configuration node name.- See Also:
-
VIEW_SCHEME
Scheme for explorer type view links.- See Also:
-
-
Constructor Details
-
CmsConfigurationReader
Creates a new configuration reader.- Parameters:
cms
- the CMS context which should be used to read the configuration data.
-
-
Method Details
-
getString
Gets the string value of an XML content location.- Parameters:
cms
- the CMS context to uselocation
- an XML content location- Returns:
- the string value of that XML content location
-
parseProperty
Helper method to parse a property.- Parameters:
cms
- the CMS context to usefield
- the location of the parent value- Returns:
- the parsed property configuration
-
getFunctionReferences
Returns the list of function references.- Returns:
- the list of function references
-
getModelPageConfigs
Returns the modelPageConfigs.- Returns:
- the modelPageConfigs
-
parseAddFormatters
Parses the formatters to add.- Parameters:
node
- the parent node- Returns:
- the set of keys of the formatters to add
-
parseConfiguration
public CmsADEConfigDataInternal parseConfiguration(String basePath, CmsXmlContent content) throws CmsException Parses a configuration XML content and creates a configuration object from it.- Parameters:
basePath
- the base pathcontent
- the XML content- Returns:
- the created configuration object with the data from the XML content
- Throws:
CmsException
- if something goes wrong
-
parseFolderOrName
public CmsContentFolderDescriptor parseFolderOrName(String basePath, I_CmsXmlContentLocation location) throws CmsException Parses a folder which may either be given as a path or as a folder name.- Parameters:
basePath
- the base path for the configurationlocation
- the XML content node from which to parse the folder- Returns:
- the folder bean
- Throws:
CmsException
- if something goes wrong
-
parseFormatter
Parses a formatter bean.- Parameters:
typeName
- the type name for which the formatter is being parsednode
- the node from which to parse the formatter data- Returns:
- the formatter bean from the XML
-
parseModelPage
Parses model page data from the XML content.- Parameters:
node
- the XML content node
-
parseRemoveFormatters
Parses the set of formatters to remove.- Parameters:
node
- the parent node- Returns:
- the set of formatters to remove
-
parseResourceTypeConfig
public void parseResourceTypeConfig(String basePath, I_CmsXmlContentLocation node) throws CmsException Parses a resource type configuration element from the XML content.- Parameters:
basePath
- the base path of the configurationnode
- the XML configuration node- Throws:
CmsException
- if something goes wrong
-
parseSitemapConfiguration
public CmsADEConfigDataInternal parseSitemapConfiguration(String basePath, CmsResource configRes) throws CmsException Parses the sitemap configuration given the configuration file and base path.- Parameters:
basePath
- the base pathconfigRes
- the configuration file resource- Returns:
- the parsed configuration data
- Throws:
CmsException
- if something goes wrong
-
readModuleConfigurations
Reads the configurations of all modules and combines them into a single configuration object.- Returns:
- the combined configuration object
-
getBoolean
Helper method to read a boolean value from the XML.If the element is not found in the XML, false is returned.
- Parameters:
parent
- the parent nodename
- the name of the XML content value- Returns:
- the boolean value
-
getString
Gets the string value of an XML content location.- Parameters:
location
- an XML content location- Returns:
- the string value of that XML content location
-
parseDetailPage
Parses the detail pages from an XML content node.- Parameters:
node
- the XML content node
-
parseFormatterChangeSet
protected CmsFormatterChangeSet parseFormatterChangeSet(String basePath, I_CmsXmlContentLocation node, boolean removeAllFormatters, boolean removeFunctions, Set<CmsUUID> functions, Set<CmsUUID> functionsToRemove) Parses the formatter change set.- Parameters:
basePath
- the configuration base pathnode
- the parent noderemoveAllFormatters
- flag, indicating if all formatters that are not explicitly added should be removedremoveFunctions
- if true, remove functionsfunctions
- the functions to addfunctionsToRemove
- the functions to remove- Returns:
- the formatter change set
-
parseFunctionReference
Parses a function reference node.- Parameters:
node
- the function reference node
-