Class CmsPropertyEditorHelper

    • Method Detail

      • updateWysiwygConfig

        public static void updateWysiwygConfig​(java.util.Map<java.lang.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

        public java.util.Map<CmsUUID,​java.util.Map<java.lang.String,​CmsXmlContentProperty>> getDefaultProperties​(java.util.List<CmsUUID> structureIds)
                                                                                                                      throws CmsException
        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
      • 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
      • 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

        protected java.util.Map<java.lang.String,​CmsClientPropertyconvertProperties​(java.util.List<CmsProperty> properties)
        Converts CmsProperty objects to CmsClientProperty objects.

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

        protected java.util.Map<java.lang.String,​CmsXmlContentPropertygetDefaultPropertiesForType​(java.lang.String typeName)
        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

        protected java.util.Map<java.lang.String,​CmsPropertygetPropertiesByName​(java.util.List<CmsProperty> properties)
        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