Package org.opencms.ade.sitemap
Class CmsSitemapAttributeUpdater
java.lang.Object
org.opencms.ade.sitemap.CmsSitemapAttributeUpdater
Performs attribute changes in a sitemap configuration file CmsXmlContent instance.
- 
Constructor SummaryConstructorsConstructorDescriptionCmsSitemapAttributeUpdater(CmsObject cms, CmsXmlContent sitemapConfig) Creates a new instance.
- 
Method SummaryModifier and TypeMethodDescriptioncomputeUpdatesRelativeToInheritedValues(Map<String, String> newAttributes, CmsADEConfigData config) Given a map of attribute values (usually from the attribute editor), this method computes the necessary updates to perform.Gets the sitemap attributes that are currently stored in the XML content.Gets the XML content which this object operates on.voidreplaceAttributes(Map<String, String> allValues) Completely replaces the sitemap attributes in the XML content with the entries from the map passed as a parameter.booleansaveAttributesFromEditorDialog(Map<String, String> attributes) Saves the attributes coming from the editor dialog.booleanupdateAttributes(Map<String, String> attributeUpdates) Performs a set of attribute changes.
- 
Constructor Details- 
CmsSitemapAttributeUpdaterCreates a new instance.- Parameters:
- cms- the CmsObject to use
- sitemapConfig- the sitemap configuration XML content
 
 
- 
- 
Method Details- 
computeUpdatesRelativeToInheritedValuespublic static Map<String,String> computeUpdatesRelativeToInheritedValues(Map<String, String> newAttributes, CmsADEConfigData config) 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)
 
- 
getAttributesFromContentGets the sitemap attributes that are currently stored in the XML content.- Returns:
- the map of sitemap attributes
 
- 
getContentGets the XML content which this object operates on.- Returns:
- the XML content
 
- 
replaceAttributesCompletely 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
 
- 
saveAttributesFromEditorDialogSaves 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
 
- 
updateAttributesPerforms 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
 
 
-