Package org.opencms.jsp.decorator
Class CmsDecoratorConfiguration
java.lang.Object
org.opencms.jsp.decorator.CmsDecoratorConfiguration
- All Implemented Interfaces:
I_CmsDecoratorConfiguration
The CmsDecoratorConfiguration initalizes and stores the text decorations.
It uses uses the information of one or more to create the
pre- and postfixs for text decorations.CmsDecorationDefintion
- Since:
- 6.1.3
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor, creates a new, empty CmsDecoratorConfiguration.Constructor, creates a new, empty CmsDecoratorConfiguration.CmsDecoratorConfiguration(CmsObject cms, String configFile) Constructor, creates a new, CmsDecoratorConfiguration with a given config file.CmsDecoratorConfiguration(CmsObject cms, String configFile, Locale locale) Constructor, creates a new, CmsDecoratorConfiguration with a given config file and locale. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDecorations(CmsDecorationDefintion decorationDefinition) Adds decorations defined in aobject to the map of all decorations.CmsDecorationDefintiongetCms()Returns the cms.Returns the configFile.Returns the configurationLocale.getDecorationDefinition(CmsXmlContent configuration, int i) Builds a CmsDecorationDefintion from a given configuration file.Returns the list with allinstances parsed from the config file.CmsDecorationDefintionGets the decoration bundle.Returns the excludeattr.Returns the excludes.Returns the locale.Returns the usedDecorations.booleanTests if a decoration key was used before in this configuration.voidInitialises the configuration.booleanisExcluded(String tag) Tests if a tag is contained in the exclude list of the decorator.booleanisExcludedAttr(org.htmlparser.Tag tag) Tests if a tag has an attribute thatis contained in the exclude list of the decorator.voidmarkAsUsed(String key) Mark a decoration key as already used.voidResets the used decoration keys.voidSets the cms.voidsetConfigFile(String configFile) Sets the configFile.voidsetConfigurationLocale(Locale configurationLocale) Sets the configurationLocale.voidsetDecorationDefinitions(List<CmsDecorationDefintion> decorationDefinitions) Sets the decorationDefinitions.voidsetDecorations(CmsDecorationBundle decorations) Sets the decoration bundle, overwriting an exiting one.voidsetExcludeattr(List<String> excludeattr) Sets the excludeattr.voidsetExcludes(List<String> excludes) Sets the excludes.voidSets the locale.voidsetUsedDecorations(List<String> usedDecorations) Sets the usedDecorations.toString()
-
Field Details
-
XPATH_DECORATION
The xpath for the decoration configuration.- See Also:
-
XPATH_EXCLUDE
The xpath for the exclude configuration.- See Also:
-
XPATH_EXCLUDEATTR
The xpath for the exclude configuration.- See Also:
-
XPATH_USELOCALE
The xpath for the uselocale configuration.- See Also:
-
-
Constructor Details
-
CmsDecoratorConfiguration
public CmsDecoratorConfiguration()Constructor, creates a new, empty CmsDecoratorConfiguration. -
CmsDecoratorConfiguration
Constructor, creates a new, empty CmsDecoratorConfiguration.- Parameters:
cms- the CmsObject- Throws:
CmsException- if something goes wrong
-
CmsDecoratorConfiguration
Constructor, creates a new, CmsDecoratorConfiguration with a given config file.- Parameters:
cms- the CmsObjectconfigFile- the configuration file- Throws:
CmsException- if something goes wrong
-
CmsDecoratorConfiguration
public CmsDecoratorConfiguration(CmsObject cms, String configFile, Locale locale) throws CmsException Constructor, creates a new, CmsDecoratorConfiguration with a given config file and locale.- Parameters:
cms- the CmsObjectconfigFile- the configuration filelocale- to locale to build this configuration for- Throws:
CmsException- if something goes wrong
-
-
Method Details
-
addDecorations
Adds decorations defined in aobject to the map of all decorations.CmsDecorationDefintion- Parameters:
decorationDefinition- thethe decorations to be addedCmsDecorationDefintion- Throws:
CmsException- if something goes wrong
-
getCms
Returns the cms.- Returns:
- the cms
-
getConfigFile
Returns the configFile.- Returns:
- the configFile
-
getConfigurationLocale
Returns the configurationLocale.- Returns:
- the configurationLocale
-
getDecorationDefinition
Builds a CmsDecorationDefintion from a given configuration file.- Specified by:
getDecorationDefinitionin interfaceI_CmsDecoratorConfiguration- Parameters:
configuration- the configuration filei- the number of the decoration definition to create- Returns:
- CmsDecorationDefintion created form configuration file
-
getDecorationDefinitions
Returns the list with allinstances parsed from the config file.CmsDecorationDefintion- Returns:
- The list with all
instances parsed from the config fileCmsDecorationDefintion
-
getDecorations
Gets the decoration bundle.- Specified by:
getDecorationsin interfaceI_CmsDecoratorConfiguration- Returns:
- the decoration bundle to be used
-
getExcludeattr
Returns the excludeattr.- Returns:
- the excludeattr
-
getExcludes
Returns the excludes.- Returns:
- the excludes
-
getLocale
Returns the locale.- Returns:
- the locale
-
getUsedDecorations
Returns the usedDecorations.- Returns:
- the usedDecorations
-
hasUsed
Tests if a decoration key was used before in this configuration.- Specified by:
hasUsedin interfaceI_CmsDecoratorConfiguration- Parameters:
key- the key to look for- Returns:
- true if this key was already used
-
init
Description copied from interface:I_CmsDecoratorConfigurationInitialises the configuration.- Specified by:
initin interfaceI_CmsDecoratorConfiguration- Parameters:
cms- the CmsObjectconfigFile- the configuration filelocale- to locale to build this configuration for- Throws:
CmsException- if something goes wrong- See Also:
-
isExcluded
Tests if a tag is contained in the exclude list of the decorator.- Specified by:
isExcludedin interfaceI_CmsDecoratorConfiguration- Parameters:
tag- the tag to test- Returns:
- true if the tag is in the exclode list, false othwerwise.
-
isExcludedAttr
Description copied from interface:I_CmsDecoratorConfigurationTests if a tag has an attribute thatis contained in the exclude list of the decorator.- Specified by:
isExcludedAttrin interfaceI_CmsDecoratorConfiguration- Parameters:
tag- the tag to test- Returns:
- true if the tag is in the exclude list, false otherwise.
- See Also:
-
markAsUsed
Mark a decoration key as already used.- Specified by:
markAsUsedin interfaceI_CmsDecoratorConfiguration- Parameters:
key- the key to mark
-
resetMarkedDecorations
Resets the used decoration keys.- Specified by:
resetMarkedDecorationsin interfaceI_CmsDecoratorConfiguration
-
setCms
Sets the cms.- Parameters:
cms- the cms to set
-
setConfigFile
Sets the configFile.- Parameters:
configFile- the configFile to set
-
setConfigurationLocale
Sets the configurationLocale.- Parameters:
configurationLocale- the configurationLocale to set
-
setDecorationDefinitions
Sets the decorationDefinitions.- Parameters:
decorationDefinitions- the decorationDefinitions to set
-
setDecorations
Sets the decoration bundle, overwriting an exiting one.- Parameters:
decorations- new decoration bundle
-
setExcludeattr
Sets the excludeattr.- Parameters:
excludeattr- the excludeattr to set
-
setExcludes
Sets the excludes.- Parameters:
excludes- the excludes to set
-
setLocale
Sets the locale.- Parameters:
locale- the locale to set
-
setUsedDecorations
Sets the usedDecorations.- Parameters:
usedDecorations- the usedDecorations to set
-
toString
-