Class CmsSitemapAttributeUpdater

java.lang.Object
org.opencms.ade.sitemap.CmsSitemapAttributeUpdater

public class CmsSitemapAttributeUpdater extends Object
Performs attribute changes in a sitemap configuration file CmsXmlContent instance.
  • Constructor Details

  • Method Details

    • computeUpdatesRelativeToInheritedValues

      Given a map of attribute values (usually from the attribute editor), this method computes the necessary updates to perform.

      Attribute values that match the inherited attribute from a parent sitemap configuration should cause the attribute to be removed.

      Parameters:
      newAttributes - the map of attributes
      config - the sitemap config we are currently working on
      Returns:
      the map of updates (with null values indicating that the key should be removed)
    • getAttributesFromContent

      Gets the sitemap attributes that are currently stored in the XML content.
      Returns:
      the map of sitemap attributes
    • getContent

      Gets the XML content which this object operates on.
      Returns:
      the XML content
    • replaceAttributes

      public void replaceAttributes(Map<String,String> allValues)
      Completely replaces the sitemap attributes in the XML content with the entries from the map passed as a parameter.
      Parameters:
      allValues - the new sitemap attributes that should replace the existing ones
    • saveAttributesFromEditorDialog

      public boolean saveAttributesFromEditorDialog(Map<String,String> attributes)
      Saves the attributes coming from the editor dialog.

      This method replaces values that match values inherited from a parent configuration with null (not set).

      Parameters:
      attributes - the attributes to save
      Returns:
      true if any changes were made
    • updateAttributes

      public boolean updateAttributes(Map<String,String> attributeUpdates)
      Performs a set of attribute changes.

      The map given as an argument may contain null values. In that case, the corresponding attribute is removed from the XML content.

      Parameters:
      attributeUpdates - a map of attributes
      Returns:
      true if any attribute changes were necessary in the XML content