public class CmsDecoratorConfiguration extends java.lang.Object implements I_CmsDecoratorConfiguration
It uses uses the information of one or more to create the
pre- and postfixs for text decorations.CmsDecorationDefintion
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
XPATH_DECORATION
The xpath for the decoration configuration.
|
static java.lang.String |
XPATH_EXCLUDE
The xpath for the exclude configuration.
|
static java.lang.String |
XPATH_EXCLUDEATTR
The xpath for the exclude configuration.
|
static java.lang.String |
XPATH_USELOCALE
The xpath for the uselocale configuration.
|
| Constructor and Description |
|---|
CmsDecoratorConfiguration()
Constructor, creates a new, empty CmsDecoratorConfiguration.
|
CmsDecoratorConfiguration(CmsObject cms)
Constructor, creates a new, empty CmsDecoratorConfiguration.
|
CmsDecoratorConfiguration(CmsObject cms,
java.lang.String configFile)
Constructor, creates a new, CmsDecoratorConfiguration with a given config file.
|
CmsDecoratorConfiguration(CmsObject cms,
java.lang.String configFile,
java.util.Locale locale)
Constructor, creates a new, CmsDecoratorConfiguration with a given config file and locale.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDecorations(CmsDecorationDefintion decorationDefinition)
Adds decorations defined in a
object to the map of all decorations. |
CmsObject |
getCms()
Returns the cms.
|
java.lang.String |
getConfigFile()
Returns the configFile.
|
java.util.Locale |
getConfigurationLocale()
Returns the configurationLocale.
|
CmsDecorationDefintion |
getDecorationDefinition(CmsXmlContent configuration,
int i)
Builds a CmsDecorationDefintion from a given configuration file.
|
java.util.List<CmsDecorationDefintion> |
getDecorationDefinitions()
Returns the list with all
instances parsed from the config file. |
CmsDecorationBundle |
getDecorations()
Gets the decoration bundle.
|
java.util.List<java.lang.String> |
getExcludeattr()
Returns the excludeattr.
|
java.util.List<java.lang.String> |
getExcludes()
Returns the excludes.
|
java.util.Locale |
getLocale()
Returns the locale.
|
java.util.List<java.lang.String> |
getUsedDecorations()
Returns the usedDecorations.
|
boolean |
hasUsed(java.lang.String key)
Tests if a decoration key was used before in this configuration.
|
void |
init(CmsObject cms,
java.lang.String configFile,
java.util.Locale locale)
Initialises the configuration.
|
boolean |
isExcluded(java.lang.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(java.lang.String key)
Mark a decoration key as already used.
|
void |
resetMarkedDecorations()
Resets the used decoration keys.
|
void |
setCms(CmsObject cms)
Sets the cms.
|
void |
setConfigFile(java.lang.String configFile)
Sets the configFile.
|
void |
setConfigurationLocale(java.util.Locale configurationLocale)
Sets the configurationLocale.
|
void |
setDecorationDefinitions(java.util.List<CmsDecorationDefintion> decorationDefinitions)
Sets the decorationDefinitions.
|
void |
setDecorations(CmsDecorationBundle decorations)
Sets the decoration bundle, overwriting an exiting one.
|
void |
setExcludeattr(java.util.List<java.lang.String> excludeattr)
Sets the excludeattr.
|
void |
setExcludes(java.util.List<java.lang.String> excludes)
Sets the excludes.
|
void |
setLocale(java.util.Locale locale)
Sets the locale.
|
void |
setUsedDecorations(java.util.List<java.lang.String> usedDecorations)
Sets the usedDecorations.
|
java.lang.String |
toString() |
public static final java.lang.String XPATH_DECORATION
public static final java.lang.String XPATH_EXCLUDE
public static final java.lang.String XPATH_EXCLUDEATTR
public static final java.lang.String XPATH_USELOCALE
public CmsDecoratorConfiguration()
public CmsDecoratorConfiguration(CmsObject cms) throws CmsException
cms - the CmsObjectCmsException - if something goes wrongpublic CmsDecoratorConfiguration(CmsObject cms, java.lang.String configFile) throws CmsException
cms - the CmsObjectconfigFile - the configuration fileCmsException - if something goes wrongpublic CmsDecoratorConfiguration(CmsObject cms, java.lang.String configFile, java.util.Locale locale) throws CmsException
cms - the CmsObjectconfigFile - the configuration filelocale - to locale to build this configuration forCmsException - if something goes wrongpublic void addDecorations(CmsDecorationDefintion decorationDefinition) throws CmsException
CmsDecorationDefintion object to the map of all decorations.decorationDefinition - the CmsDecorationDefintion the decorations to be addedCmsException - if something goes wrongpublic java.lang.String getConfigFile()
public java.util.Locale getConfigurationLocale()
public CmsDecorationDefintion getDecorationDefinition(CmsXmlContent configuration, int i)
getDecorationDefinition in interface I_CmsDecoratorConfigurationconfiguration - the configuration filei - the number of the decoration definition to createpublic java.util.List<CmsDecorationDefintion> getDecorationDefinitions()
CmsDecorationDefintion
instances parsed from the config file.CmsDecorationDefintion instances
parsed from the config filepublic CmsDecorationBundle getDecorations()
getDecorations in interface I_CmsDecoratorConfigurationpublic java.util.List<java.lang.String> getExcludeattr()
public java.util.List<java.lang.String> getExcludes()
public java.util.Locale getLocale()
public java.util.List<java.lang.String> getUsedDecorations()
public boolean hasUsed(java.lang.String key)
hasUsed in interface I_CmsDecoratorConfigurationkey - the key to look forpublic void init(CmsObject cms, java.lang.String configFile, java.util.Locale locale) throws CmsException
I_CmsDecoratorConfigurationinit in interface I_CmsDecoratorConfigurationcms - the CmsObjectconfigFile - the configuration filelocale - to locale to build this configuration forCmsException - if something goes wrongI_CmsDecoratorConfiguration.init(org.opencms.file.CmsObject, java.lang.String, java.util.Locale)public boolean isExcluded(java.lang.String tag)
isExcluded in interface I_CmsDecoratorConfigurationtag - the tag to testpublic boolean isExcludedAttr(org.htmlparser.Tag tag)
I_CmsDecoratorConfigurationisExcludedAttr in interface I_CmsDecoratorConfigurationtag - the tag to testI_CmsDecoratorConfiguration.isExcludedAttr(org.htmlparser.Tag)public void markAsUsed(java.lang.String key)
markAsUsed in interface I_CmsDecoratorConfigurationkey - the key to markpublic void resetMarkedDecorations()
resetMarkedDecorations in interface I_CmsDecoratorConfigurationpublic void setConfigFile(java.lang.String configFile)
configFile - the configFile to setpublic void setConfigurationLocale(java.util.Locale configurationLocale)
configurationLocale - the configurationLocale to setpublic void setDecorationDefinitions(java.util.List<CmsDecorationDefintion> decorationDefinitions)
decorationDefinitions - the decorationDefinitions to setpublic void setDecorations(CmsDecorationBundle decorations)
decorations - new decoration bundlepublic void setExcludeattr(java.util.List<java.lang.String> excludeattr)
excludeattr - the excludeattr to setpublic void setExcludes(java.util.List<java.lang.String> excludes)
excludes - the excludes to setpublic void setLocale(java.util.Locale locale)
locale - the locale to setpublic void setUsedDecorations(java.util.List<java.lang.String> usedDecorations)
usedDecorations - the usedDecorations to setpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()