Class CmsFormatterChangeSet
- java.lang.Object
-
- org.opencms.ade.configuration.formatters.CmsFormatterChangeSet
-
- All Implemented Interfaces:
java.lang.Cloneable
public class CmsFormatterChangeSet extends java.lang.Object implements java.lang.Cloneable
This class represents the changes which can be made to formatters in a sitemap configuration file.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PREFIX_TYPE
The prefix used for types in the Add/RemoveFormatter fields in the configuration.
-
Constructor Summary
Constructors Constructor Description CmsFormatterChangeSet()
Creates an empty formatter change set.CmsFormatterChangeSet(java.util.Collection<java.lang.String> toRemove, java.util.Collection<java.lang.String> toAdd, java.lang.String siteRoot, boolean removeAllNonExplicitlyAdded, boolean removeFunctions, java.util.Set<CmsUUID> functions, java.util.Set<CmsUUID> functionsToRemove)
Creates a new formatter change set.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyToFormatters(CmsFormatterIndex formatterIndex, CmsFormatterConfigurationCacheState externalFormatters)
Applies this change set to a list of external (non schema-based) formatters.void
applyToTypes(java.util.Set<java.lang.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.CmsFormatterChangeSet
cloneWithNoRemovals()
Creates a clone of this object, but with the 'remove all functions/formatters' flags set to false.static java.lang.String
keyForType(java.lang.String typeName)
Produces the key for a given resource type.void
setDebugPath(java.lang.String debugPath)
Sets the debug path.
-
-
-
Field Detail
-
PREFIX_TYPE
public static final java.lang.String PREFIX_TYPE
The prefix used for types in the Add/RemoveFormatter fields in the configuration.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsFormatterChangeSet
public CmsFormatterChangeSet()
Creates an empty formatter change set.
-
CmsFormatterChangeSet
public CmsFormatterChangeSet(java.util.Collection<java.lang.String> toRemove, java.util.Collection<java.lang.String> toAdd, java.lang.String siteRoot, boolean removeAllNonExplicitlyAdded, boolean removeFunctions, java.util.Set<CmsUUID> functions, java.util.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 Detail
-
keyForType
public static java.lang.String keyForType(java.lang.String typeName)
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
public void applyToTypes(java.util.Set<java.lang.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.- Parameters:
types
- the set of types to apply the changes to
-
cloneWithNoRemovals
public CmsFormatterChangeSet 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
public void setDebugPath(java.lang.String debugPath)
Sets the debug path.- Parameters:
debugPath
- the debug path
-
-