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
-
Constructor Summary
ConstructorDescriptionConstructor, 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 TypeMethodDescriptionvoid
addDecorations
(CmsDecorationDefintion decorationDefinition) Adds decorations defined in a
object to the map of all decorations.CmsDecorationDefintion
getCms()
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 all
instances parsed from the config file.CmsDecorationDefintion
Gets the decoration bundle.Returns the excludeattr.Returns the excludes.Returns the locale.Returns the usedDecorations.boolean
Tests if a decoration key was used before in this configuration.void
Initialises the configuration.boolean
isExcluded
(String tag) Tests if a tag is contained in the exclude list of the decorator.boolean
isExcludedAttr
(org.htmlparser.Tag tag) Tests if a tag has an attribute thatis contained in the exclude list of the decorator.void
markAsUsed
(String key) Mark a decoration key as already used.void
Resets the used decoration keys.void
Sets the cms.void
setConfigFile
(String configFile) Sets the configFile.void
setConfigurationLocale
(Locale configurationLocale) Sets the configurationLocale.void
setDecorationDefinitions
(List<CmsDecorationDefintion> decorationDefinitions) Sets the decorationDefinitions.void
setDecorations
(CmsDecorationBundle decorations) Sets the decoration bundle, overwriting an exiting one.void
setExcludeattr
(List<String> excludeattr) Sets the excludeattr.void
setExcludes
(List<String> excludes) Sets the excludes.void
Sets the locale.void
setUsedDecorations
(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 a
object to the map of all decorations.CmsDecorationDefintion
- Parameters:
decorationDefinition
- the
the 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:
getDecorationDefinition
in 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 all
instances parsed from the config file.CmsDecorationDefintion
- Returns:
- The list with all
instances parsed from the config fileCmsDecorationDefintion
-
getDecorations
Gets the decoration bundle.- Specified by:
getDecorations
in 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:
hasUsed
in interfaceI_CmsDecoratorConfiguration
- Parameters:
key
- the key to look for- Returns:
- true if this key was already used
-
init
Description copied from interface:I_CmsDecoratorConfiguration
Initialises the configuration.- Specified by:
init
in 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:
isExcluded
in 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_CmsDecoratorConfiguration
Tests if a tag has an attribute thatis contained in the exclude list of the decorator.- Specified by:
isExcludedAttr
in 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:
markAsUsed
in interfaceI_CmsDecoratorConfiguration
- Parameters:
key
- the key to mark
-
resetMarkedDecorations
Resets the used decoration keys.- Specified by:
resetMarkedDecorations
in 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
-