Class CmsPropertyEditorHelper

java.lang.Object
org.opencms.gwt.CmsPropertyEditorHelper
Direct Known Subclasses:
CmsNewResourceBuilder.PropertyEditorHelper

public class CmsPropertyEditorHelper extends Object
Helper class responsible for loading / saving properties when using the property dialog.

  • Constructor Details

  • Method Details

    • updateWysiwygConfig

      public static void updateWysiwygConfig(Map<String,CmsXmlContentProperty> propertyConfig, CmsObject cms, CmsResource resource)
      Updates the property configuration for properties using WYSIWYG widgets.

      Parameters:
      propertyConfig - the property configuration
      cms - the CMS context
      resource - the current resource (may be null)
    • getDefaultProperties

      Internal method for computing the default property configurations for a list of structure ids.

      Parameters:
      structureIds - the structure ids for which we want the default property configurations
      Returns:
      a map from the given structure ids to their default property configurations
      Throws:
      CmsException - if something goes wrong
    • loadPropertyData

      Loads the data needed for editing the properties of a resource.

      Parameters:
      id - the structure id of the resource
      Returns:
      the data needed for editing the properties
      Throws:
      CmsException - if something goes wrong
    • overrideStructureId

      public void overrideStructureId(CmsUUID structureId)
      Sets a structure id that overrides the one stored in a property change set.

      Parameters:
      structureId - the new structure id
    • saveProperties

      public void saveProperties(CmsPropertyChangeSet changes) throws CmsException
      Saves a set of property changes.

      Parameters:
      changes - the set of property changes
      Throws:
      CmsException - if something goes wrong
    • setUpdateIndex

      public void setUpdateIndex(boolean updateIndex)
      Sets the 'update index' flag to control whether the index should be updated after saving.
      Parameters:
      updateIndex - true if the index should be updated after saving
    • convertProperties

      Converts CmsProperty objects to CmsClientProperty objects.

      Parameters:
      properties - a list of server-side properties
      Returns:
      a map of client-side properties
    • getDefaultPropertiesForType

      Helper method to get the default property configuration for the given resource type.

      Parameters:
      typeName - the name of the resource type
      Returns:
      the default property configuration for the given type
    • getPropertiesByName

      Converts a list of properties to a map.

      Parameters:
      properties - the list of properties
      Returns:
      a map from property names to properties
    • isWritable

      protected boolean isWritable(CmsObject cms, CmsResource resource) throws CmsException
      Returns whether the current user has write permissions, the resource is lockable or already locked by the current user and is in the current project.

      Parameters:
      cms - the cms context
      resource - the resource
      Returns:
      true if the resource is writable
      Throws:
      CmsException - in case checking the permissions fails