Class CmsFormatterChangeSet

java.lang.Object
org.opencms.ade.configuration.formatters.CmsFormatterChangeSet
All Implemented Interfaces:
Cloneable

public class CmsFormatterChangeSet extends Object implements Cloneable
This class represents the changes which can be made to formatters in a sitemap configuration file.

  • Field Details

  • Constructor Details

    • 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 remove
      toAdd - the formatter keys to add
      siteRoot - the site root of the current config
      removeAllNonExplicitlyAdded - flag, indicating if all formatters that are not explicitly added should be removed
      removeFunctions - if true, all functions are removed
      functions - the set of functions to enable
      functionsToRemove - the set of functions to remove
  • Method Details

    • keyForType

      public static String keyForType(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 operate
      externalFormatters - the formatter collection which should be used to add formatters which are not already present in 'formatters'
    • applyToTypes

      public void applyToTypes(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.

      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

      public void setDebugPath(String debugPath)
      Sets the debug path.
      Parameters:
      debugPath - the debug path