Class CmsFormatterChangeSet
java.lang.Object
org.opencms.ade.configuration.formatters.CmsFormatterChangeSet
- All Implemented Interfaces:
Cloneable
This class represents the changes which can be made to formatters in a sitemap configuration file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe prefix used for types in the Add/RemoveFormatter fields in the configuration. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty formatter change set.CmsFormatterChangeSet(Collection<String> toRemove, Collection<String> toAdd, String siteRoot, boolean removeAllNonExplicitlyAdded, boolean removeFunctions, Set<CmsUUID> functions, Set<CmsUUID> functionsToRemove) Creates a new formatter change set. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyToFormatters(CmsFormatterIndex formatterIndex, CmsFormatterConfigurationCacheState externalFormatters) Applies this change set to a list of external (non schema-based) formatters.voidapplyToTypes(Set<String> types) Applies the changes (addition or removal of schema formatters) to a set of resource type names, adding resource types for which schema formatters should be added and removing those for which schema formatters should be removed.Creates a clone of this object, but with the 'remove all functions/formatters' flags set to false.static StringkeyForType(String typeName) Produces the key for a given resource type.voidsetDebugPath(String debugPath) Sets the debug path.
-
Field Details
-
PREFIX_TYPE
The prefix used for types in the Add/RemoveFormatter fields in the configuration.- See Also:
-
-
Constructor Details
-
CmsFormatterChangeSet
public CmsFormatterChangeSet()Creates an empty formatter change set. -
CmsFormatterChangeSet
public CmsFormatterChangeSet(Collection<String> toRemove, Collection<String> toAdd, String siteRoot, boolean removeAllNonExplicitlyAdded, boolean removeFunctions, Set<CmsUUID> functions, Set<CmsUUID> functionsToRemove) Creates a new formatter change set.- Parameters:
toRemove- the formatter keys to removetoAdd- the formatter keys to addsiteRoot- the site root of the current configremoveAllNonExplicitlyAdded- flag, indicating if all formatters that are not explicitly added should be removedremoveFunctions- if true, all functions are removedfunctions- the set of functions to enablefunctionsToRemove- the set of functions to remove
-
-
Method Details
-
keyForType
Produces the key for a given resource type.- Parameters:
typeName- the resource type name- Returns:
- the key to use
-
applyToFormatters
public void applyToFormatters(CmsFormatterIndex formatterIndex, CmsFormatterConfigurationCacheState externalFormatters) Applies this change set to a list of external (non schema-based) formatters.- Parameters:
formatterIndex- the collection of formatters on which this change set should operateexternalFormatters- the formatter collection which should be used to add formatters which are not already present in 'formatters'
-
applyToTypes
Applies the changes (addition or removal of schema formatters) to a set of resource type names, adding resource types for which schema formatters should be added and removing those for which schema formatters should be removed.- Parameters:
types- the set of types to apply the changes to
-
cloneWithNoRemovals
Creates a clone of this object, but with the 'remove all functions/formatters' flags set to false.- Returns:
- a clone which disables removall of all functions/formatters
-
setDebugPath
Sets the debug path.- Parameters:
debugPath- the debug path
-