Class CmsExplorerTypeSettings

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CmsExplorerTypeSettings>

    public class CmsExplorerTypeSettings
    extends java.lang.Object
    implements java.lang.Comparable<CmsExplorerTypeSettings>, java.io.Serializable
    Holds all information to build the explorer context menu of a resource type and information for the new resource dialog.

    Objects of this type are sorted by their order value which specifies the order in the new resource dialog.

    Since:
    6.0.0
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addIconRule​(java.lang.String extension, java.lang.String icon, java.lang.String bigIcon, java.lang.String smallIconStyle, java.lang.String bigIconStyle)
      Adds a new icon rule to this explorer type.
      boolean addProperty​(java.lang.String propertyName, java.lang.String requiredOnUpload)
      Adds a property definition name to the list of editable properties.
      java.lang.Object clone()  
      int compareTo​(CmsExplorerTypeSettings other)  
      boolean equals​(java.lang.Object o)  
      CmsExplorerTypeAccess getAccess()
      Gets the access object of the type settings.
      java.lang.String getBigIcon()
      Returns the big icon.
      java.lang.String getBigIconStyle()
      Returns the big icon CSS style class.
      static java.lang.Integer getDefaultViewOrder​(java.lang.String typeName)
      Gets the default view order for the given type name (or null, if there is no default view order).
      java.lang.String getElementView()
      Gets the element view name.
      java.lang.String getIcon()
      Returns the icon path and file name of the explorer type setting.
      java.util.Map<java.lang.String,​CmsIconRule> getIconRules()
      Returns a map from file extensions to icon rules for this explorer type.
      java.lang.String getInfo()
      Returns the info.
      java.lang.String getKey()
      Returns the key name of the explorer type setting.
      java.lang.String getName()
      Returns the name of the explorer type setting.
      java.lang.String getNamePattern()
      Gets the name pattern.
      java.lang.String getNewResourceOrder()
      Returns the order for the new resource dialog of the explorer type setting.
      java.lang.String getOriginalIcon()
      Gets the original icon name from the configuration.
      java.util.List<java.lang.String> getProperties()
      Returns the list of properties of the explorer type setting.
      java.lang.String getReference()
      Returns the reference of the explorer type setting.
      java.lang.String getSmallIconStyle()
      Returns the small icon CSS style class.
      java.lang.String getTitleKey()
      Returns the titleKey.
      java.lang.Integer getViewOrder​(boolean useDefault)
      Gets the view order, optionally using a default value if the view order is not configured.
      boolean hasEditOptions()
      Returns true if this explorer type entry has explicit edit options set.
      int hashCode()  
      boolean isAddititionalModuleExplorerType()
      Indicates that this is an additional explorer type which is defined in a module.
      boolean isAutoSetNavigation()
      Returns true if navigation properties should automatically be added on resource creation.
      boolean isAutoSetTitle()
      Returns true if the title property should automatically be added on resource creation.
      boolean isCreatable()
      Returns if this type is creatable.
      boolean isEditable​(CmsObject cms, CmsResource resource)
      Checks if the current user has write permissions on the given resource.
      boolean isPropertiesEnabled()
      Returns if this explorer type setting uses a special properties dialog.
      boolean isPropertyRequiredOnUpload​(java.lang.String propName)
      Check if property is required on upload.
      boolean isShowNavigation()
      Returns if this explorer type setting displays the navigation properties in the special properties dialog.
      boolean isView()
      Returns true if this explorer type represents a view.
      void setAccess​(CmsExplorerTypeAccess access)
      Sets the access object of the type settings.
      void setAddititionalModuleExplorerType​(boolean addititionalModuleExplorerType)
      Sets the additional explorer type flag.
      void setAutoSetNavigation​(java.lang.String autoSetNavigation)
      Sets if navigation properties should automatically be added on resource creation.
      void setAutoSetTitle​(java.lang.String autoSetTitle)
      Sets if the title property should automatically be added on resource creation.
      void setBigIcon​(java.lang.String bigIcon)
      Sets the file name of the big icon for this explorer type.
      void setBigIconStyle​(java.lang.String bigIconStyle)
      Sets the big icon CSS style class.
      void setCreatable​(boolean creatable)
      Sets the creatable flag.
      void setCreatable​(java.lang.String creatable)
      Sets the creatable flag.
      void setEditOptions()
      Sets the flag if this explorer type entry has explicit edit options set.
      void setElementView​(java.lang.String elementView)
      Sets the reference of the explorer type setting.
      void setIcon​(java.lang.String icon)
      Sets the icon path and file name of the explorer type setting.
      void setInfo​(java.lang.String info)
      Sets the info.
      void setKey​(java.lang.String key)
      Sets the key name of the explorer type setting.
      void setName​(java.lang.String name)
      Sets the name of the explorer type setting.
      void setNewResourceOrder​(java.lang.String newResourceOrder)
      Sets the order for the new resource dialog of the explorer type setting.
      void setProperties​(java.util.List<java.lang.String> properties)
      Sets the list of properties of the explorer type setting.
      void setPropertiesEnabled​(boolean enabled)
      Sets if this explorer type setting uses a special properties dialog.
      void setPropertyDefaults​(java.lang.String enabled, java.lang.String showNavigation)
      Sets the default settings for the property display dialog.
      void setReference​(java.lang.String reference)
      Sets the reference of the explorer type setting.
      void setShowNavigation​(boolean navigation)
      Sets if this explorer type setting displays the navigation properties in the special properties dialog.
      void setSmallIconStyle​(java.lang.String smallIconStyle)
      Sets the small icon CSS style class.
      void setTitleKey​(java.lang.String titleKey)
      Sets the titleKey.
      void setTypeAttributes​(java.lang.String name, java.lang.String key, java.lang.String icon)
      Sets the basic attributes of the type settings.
      void setTypeAttributes​(java.lang.String name, java.lang.String key, java.lang.String icon, java.lang.String bigIcon, java.lang.String smallIconStyle, java.lang.String bigIconStyle, java.lang.String reference, java.lang.String elementView, java.lang.String isView, java.lang.String namePattern, java.lang.String viewOrder)
      Sets the basic attributes of the type settings.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getDefaultViewOrder

        public static java.lang.Integer getDefaultViewOrder​(java.lang.String typeName)
        Gets the default view order for the given type name (or null, if there is no default view order).

        Parameters:
        typeName - the type name
        Returns:
        the default view order for the type
      • addIconRule

        public void addIconRule​(java.lang.String extension,
                                java.lang.String icon,
                                java.lang.String bigIcon,
                                java.lang.String smallIconStyle,
                                java.lang.String bigIconStyle)
        Adds a new icon rule to this explorer type.

        Parameters:
        extension - the extension for the icon rule
        icon - the small icon
        bigIcon - the big icon
        smallIconStyle - the small icon CSS style class
        bigIconStyle - the big icon CSS style class
      • addProperty

        public boolean addProperty​(java.lang.String propertyName,
                                   java.lang.String requiredOnUpload)
        Adds a property definition name to the list of editable properties.

        Parameters:
        propertyName - the name of the property definition to add
        requiredOnUpload - if "true", mark the property as required after upload
        Returns:
        true if the property definition was added properly
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object
        See Also:
        Object.clone()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • getBigIcon

        public java.lang.String getBigIcon()
        Returns the big icon.

        Returns:
        an icon name
      • getBigIconStyle

        public java.lang.String getBigIconStyle()
        Returns the big icon CSS style class.

        Returns:
        the big icon style
      • getElementView

        public java.lang.String getElementView()
        Gets the element view name.

        Returns:
        the element view name
      • getIcon

        public java.lang.String getIcon()
        Returns the icon path and file name of the explorer type setting.

        Returns:
        the icon path and file name of the explorer type setting
      • getIconRules

        public java.util.Map<java.lang.String,​CmsIconRulegetIconRules()
        Returns a map from file extensions to icon rules for this explorer type.

        Returns:
        a map from file extensions to icon rules
      • getInfo

        public java.lang.String getInfo()
        Returns the info.

        Returns:
        the info
      • getKey

        public java.lang.String getKey()
        Returns the key name of the explorer type setting.

        Returns:
        the key name of the explorer type setting
      • getName

        public java.lang.String getName()
        Returns the name of the explorer type setting.

        Returns:
        the name of the explorer type setting
      • getNamePattern

        public java.lang.String getNamePattern()
        Gets the name pattern.

        Returns:
        the name pattern
      • getNewResourceOrder

        public java.lang.String getNewResourceOrder()
        Returns the order for the new resource dialog of the explorer type setting.

        Returns:
        the order for the new resource dialog of the explorer type setting
      • getOriginalIcon

        public java.lang.String getOriginalIcon()
        Gets the original icon name from the configuration.

        Returns:
        an icon name
      • getProperties

        public java.util.List<java.lang.String> getProperties()
        Returns the list of properties of the explorer type setting.

        Returns:
        the list of properties of the explorer type setting
      • getReference

        public java.lang.String getReference()
        Returns the reference of the explorer type setting.

        Returns:
        the reference of the explorer type setting
      • getSmallIconStyle

        public java.lang.String getSmallIconStyle()
        Returns the small icon CSS style class.

        Returns:
        the small icon style
      • getTitleKey

        public java.lang.String getTitleKey()
        Returns the titleKey.

        Returns:
        the titleKey
      • getViewOrder

        public java.lang.Integer getViewOrder​(boolean useDefault)
        Gets the view order, optionally using a default value if the view order is not configured.

        Parameters:
        useDefault - true if a default should be returned in the case where the view order is not configured
        Returns:
        the view order
      • hasEditOptions

        public boolean hasEditOptions()
        Returns true if this explorer type entry has explicit edit options set.

        Returns:
        true if this explorer type entry has explicit edit options set
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • isAddititionalModuleExplorerType

        public boolean isAddititionalModuleExplorerType()
        Indicates that this is an additional explorer type which is defined in a module.

        Returns:
        true or false
      • isAutoSetNavigation

        public boolean isAutoSetNavigation()
        Returns true if navigation properties should automatically be added on resource creation.

        Returns:
        true if navigation properties should automatically be added on resource creation, otherwise false
      • isAutoSetTitle

        public boolean isAutoSetTitle()
        Returns true if the title property should automatically be added on resource creation.

        Returns:
        true if the title property should automatically be added on resource creation, otherwise false
      • isCreatable

        public boolean isCreatable()
        Returns if this type is creatable.

        Returns:
        true in case this type is creatable
      • isEditable

        public boolean isEditable​(CmsObject cms,
                                  CmsResource resource)
        Checks if the current user has write permissions on the given resource.

        Parameters:
        cms - the current cms context
        resource - the resource to check
        Returns:
        true if the current user has write permissions on the given resource
      • isPropertiesEnabled

        public boolean isPropertiesEnabled()
        Returns if this explorer type setting uses a special properties dialog.

        Returns:
        true, if this explorer type setting uses a special properties dialog
      • isPropertyRequiredOnUpload

        public boolean isPropertyRequiredOnUpload​(java.lang.String propName)
        Check if property is required on upload.
        Parameters:
        propName - the property name
        Returns:
        true if the property is required on upload
      • isShowNavigation

        public boolean isShowNavigation()
        Returns if this explorer type setting displays the navigation properties in the special properties dialog.

        Returns:
        true, if this explorer type setting displays the navigation properties in the special properties dialog
      • isView

        public boolean isView()
        Returns true if this explorer type represents a view.

        Returns:
        true if this explorer type represents a view
      • setAddititionalModuleExplorerType

        public void setAddititionalModuleExplorerType​(boolean addititionalModuleExplorerType)
        Sets the additional explorer type flag.

        Parameters:
        addititionalModuleExplorerType - true or false
      • setAutoSetNavigation

        public void setAutoSetNavigation​(java.lang.String autoSetNavigation)
        Sets if navigation properties should automatically be added on resource creation.

        Parameters:
        autoSetNavigation - true if properties should be added, otherwise false
      • setAutoSetTitle

        public void setAutoSetTitle​(java.lang.String autoSetTitle)
        Sets if the title property should automatically be added on resource creation.

        Parameters:
        autoSetTitle - true if title should be added, otherwise false
      • setBigIcon

        public void setBigIcon​(java.lang.String bigIcon)
        Sets the file name of the big icon for this explorer type.

        Parameters:
        bigIcon - the file name of the big icon
      • setBigIconStyle

        public void setBigIconStyle​(java.lang.String bigIconStyle)
        Sets the big icon CSS style class.

        Parameters:
        bigIconStyle - the big icon style to set
      • setCreatable

        public void setCreatable​(boolean creatable)
        Sets the creatable flag.

        Parameters:
        creatable - the non creatable flag to set
      • setCreatable

        public void setCreatable​(java.lang.String creatable)
        Sets the creatable flag.

        Parameters:
        creatable - the creatable flag to set
      • setEditOptions

        public void setEditOptions()
        Sets the flag if this explorer type entry has explicit edit options set.

        This is determined by the presence of the <editoptions> node in the Cms workplace configuration.

      • setElementView

        public void setElementView​(java.lang.String elementView)
        Sets the reference of the explorer type setting.

        Parameters:
        elementView - the element view
      • setIcon

        public void setIcon​(java.lang.String icon)
        Sets the icon path and file name of the explorer type setting.

        Parameters:
        icon - the icon path and file name of the explorer type setting
      • setInfo

        public void setInfo​(java.lang.String info)
        Sets the info.

        Parameters:
        info - the info to set
      • setKey

        public void setKey​(java.lang.String key)
        Sets the key name of the explorer type setting.

        Parameters:
        key - the key name of the explorer type setting
      • setName

        public void setName​(java.lang.String name)
        Sets the name of the explorer type setting.

        Parameters:
        name - the name of the explorer type setting
      • setNewResourceOrder

        public void setNewResourceOrder​(java.lang.String newResourceOrder)
        Sets the order for the new resource dialog of the explorer type setting.

        Parameters:
        newResourceOrder - the order for the new resource dialog of the explorer type setting
      • setProperties

        public void setProperties​(java.util.List<java.lang.String> properties)
        Sets the list of properties of the explorer type setting.

        Parameters:
        properties - the list of properties of the explorer type setting
      • setPropertiesEnabled

        public void setPropertiesEnabled​(boolean enabled)
        Sets if this explorer type setting uses a special properties dialog.

        Parameters:
        enabled - true, if this explorer type setting uses a special properties dialog
      • setPropertyDefaults

        public void setPropertyDefaults​(java.lang.String enabled,
                                        java.lang.String showNavigation)
        Sets the default settings for the property display dialog.

        Parameters:
        enabled - true, if this explorer type setting uses a special properties dialog
        showNavigation - true, if this explorer type setting displays the navigation properties in the special properties dialog
      • setReference

        public void setReference​(java.lang.String reference)
        Sets the reference of the explorer type setting.

        Parameters:
        reference - the reference of the explorer type setting
      • setShowNavigation

        public void setShowNavigation​(boolean navigation)
        Sets if this explorer type setting displays the navigation properties in the special properties dialog.

        Parameters:
        navigation - true, if this explorer type setting displays the navigation properties in the special properties dialog
      • setSmallIconStyle

        public void setSmallIconStyle​(java.lang.String smallIconStyle)
        Sets the small icon CSS style class.

        Parameters:
        smallIconStyle - the small icon CSS style class to set
      • setTitleKey

        public void setTitleKey​(java.lang.String titleKey)
        Sets the titleKey.

        Parameters:
        titleKey - the titleKey to set
      • setTypeAttributes

        public void setTypeAttributes​(java.lang.String name,
                                      java.lang.String key,
                                      java.lang.String icon)
        Sets the basic attributes of the type settings.

        Parameters:
        name - the name of the type setting
        key - the key name of the explorer type setting
        icon - the icon path and file name of the explorer type setting
      • setTypeAttributes

        public void setTypeAttributes​(java.lang.String name,
                                      java.lang.String key,
                                      java.lang.String icon,
                                      java.lang.String bigIcon,
                                      java.lang.String smallIconStyle,
                                      java.lang.String bigIconStyle,
                                      java.lang.String reference,
                                      java.lang.String elementView,
                                      java.lang.String isView,
                                      java.lang.String namePattern,
                                      java.lang.String viewOrder)
        Sets the basic attributes of the type settings.

        Parameters:
        name - the name of the type setting
        key - the key name of the explorer type setting
        icon - the icon path and file name of the explorer type setting
        bigIcon - the file name of the big icon
        smallIconStyle - the small icon CSS style class
        bigIconStyle - the big icon CSS style class
        reference - the reference of the explorer type setting
        elementView - the element view
        isView - 'true' if this type represents an element view
        namePattern - the name pattern
        viewOrder - the view order