Package org.opencms.workplace.explorer
Class CmsExplorerTypeSettings
java.lang.Object
org.opencms.workplace.explorer.CmsExplorerTypeSettings
- All Implemented Interfaces:
Serializable
,Comparable<CmsExplorerTypeSettings>
public class CmsExplorerTypeSettings
extends Object
implements Comparable<CmsExplorerTypeSettings>, 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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The default big file type icon style class.static final String
The default small file type icon style class.static final String
The model group reuse big file type icon style class.static final String
The model group reuse small file type icon style class.static final String
The nav level big file type icon style class.static final String
The nav level small file type icon style class.static final int
The default order start value for context menu entries.static final String
The default order value for context menu separator entries without order attribute. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIconRule
(String extension, String icon, String bigIcon, String smallIconStyle, String bigIconStyle) Adds a new icon rule to this explorer type.boolean
addProperty
(String propertyName, String requiredOnUpload) Adds a property definition name to the list of editable properties.clone()
int
compareTo
(CmsExplorerTypeSettings other) boolean
Gets the access object of the type settings.Returns the big icon.Returns the big icon CSS style class.static Integer
getDefaultViewOrder
(String typeName) Gets the default view order for the given type name (or null, if there is no default view order).Gets the element view name.getIcon()
Returns the icon path and file name of the explorer type setting.Returns a map from file extensions to icon rules for this explorer type.getInfo()
Returns the info.getKey()
Returns the key name of the explorer type setting.getName()
Returns the name of the explorer type setting.Gets the name pattern.Returns the order for the new resource dialog of the explorer type setting.Gets the original icon name from the configuration.Returns the list of properties of the explorer type setting.Returns the reference of the explorer type setting.Returns the small icon CSS style class.Returns the titleKey.getViewOrder
(boolean useDefault) Gets the view order, optionally using a default value if the view order is not configured.boolean
Returns true if this explorer type entry has explicit edit options set.int
hashCode()
boolean
Indicates that this is an additional explorer type which is defined in a module.boolean
Returns true if navigation properties should automatically be added on resource creation.boolean
Returns true if the title property should automatically be added on resource creation.boolean
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
Returns if this explorer type setting uses a special properties dialog.boolean
isPropertyRequiredOnUpload
(String propName) Check if property is required on upload.boolean
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
(String autoSetNavigation) Sets if navigation properties should automatically be added on resource creation.void
setAutoSetTitle
(String autoSetTitle) Sets if the title property should automatically be added on resource creation.void
setBigIcon
(String bigIcon) Sets the file name of the big icon for this explorer type.void
setBigIconStyle
(String bigIconStyle) Sets the big icon CSS style class.void
setCreatable
(boolean creatable) Sets the creatable flag.void
setCreatable
(String creatable) Sets the creatable flag.void
Sets the flag if this explorer type entry has explicit edit options set.void
setElementView
(String elementView) Sets the reference of the explorer type setting.void
Sets the icon path and file name of the explorer type setting.void
Sets the info.void
Sets the key name of the explorer type setting.void
Sets the name of the explorer type setting.void
setNewResourceOrder
(String newResourceOrder) Sets the order for the new resource dialog of the explorer type setting.void
setProperties
(List<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
(String enabled, String showNavigation) Sets the default settings for the property display dialog.void
setReference
(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
(String smallIconStyle) Sets the small icon CSS style class.void
setTitleKey
(String titleKey) Sets the titleKey.void
setTypeAttributes
(String name, String key, String icon) Sets the basic attributes of the type settings.void
setTypeAttributes
(String name, String key, String icon, String bigIcon, String smallIconStyle, String bigIconStyle, String reference, String elementView, String isView, String namePattern, String viewOrder) Sets the basic attributes of the type settings.
-
Field Details
-
ICON_STYLE_DEFAULT_BIG
The default big file type icon style class.- See Also:
-
ICON_STYLE_DEFAULT_SMALL
The default small file type icon style class.- See Also:
-
ICON_STYLE_MODEL_GROUP_COPY_BIG
The model group reuse big file type icon style class.- See Also:
-
ICON_STYLE_MODEL_GROUP_COPY_SMALL
The model group reuse small file type icon style class.- See Also:
-
ICON_STYLE_NAV_LEVEL_BIG
The nav level big file type icon style class.- See Also:
-
ICON_STYLE_NAV_LEVEL_SMALL
The nav level small file type icon style class.- See Also:
-
ORDER_VALUE_DEFAULT_START
The default order start value for context menu entries.- See Also:
-
ORDER_VALUE_SEPARATOR_DEFAULT
The default order value for context menu separator entries without order attribute.- See Also:
-
-
Constructor Details
-
CmsExplorerTypeSettings
public CmsExplorerTypeSettings()Default constructor.
-
-
Method Details
-
getDefaultViewOrder
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(String extension, String icon, String bigIcon, String smallIconStyle, String bigIconStyle) Adds a new icon rule to this explorer type.- Parameters:
extension
- the extension for the icon ruleicon
- the small iconbigIcon
- the big iconsmallIconStyle
- the small icon CSS style classbigIconStyle
- the big icon CSS style class
-
addProperty
Adds a property definition name to the list of editable properties.- Parameters:
propertyName
- the name of the property definition to addrequiredOnUpload
- if "true", mark the property as required after upload- Returns:
- true if the property definition was added properly
-
clone
-
compareTo
- Specified by:
compareTo
in interfaceComparable<CmsExplorerTypeSettings>
- See Also:
-
equals
-
getAccess
Gets the access object of the type settings.- Returns:
- access object of the type settings
-
getBigIcon
Returns the big icon.- Returns:
- an icon name
-
getBigIconStyle
Returns the big icon CSS style class.- Returns:
- the big icon style
-
getElementView
Gets the element view name.- Returns:
- the element view name
-
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
Returns a map from file extensions to icon rules for this explorer type.- Returns:
- a map from file extensions to icon rules
-
getInfo
Returns the info.- Returns:
- the info
-
getKey
Returns the key name of the explorer type setting.- Returns:
- the key name of the explorer type setting
-
getName
Returns the name of the explorer type setting.- Returns:
- the name of the explorer type setting
-
getNamePattern
Gets the name pattern.- Returns:
- the name pattern
-
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
Gets the original icon name from the configuration.- Returns:
- an icon name
-
getProperties
Returns the list of properties of the explorer type setting.- Returns:
- the list of properties of the explorer type setting
-
getReference
Returns the reference of the explorer type setting.- Returns:
- the reference of the explorer type setting
-
getSmallIconStyle
Returns the small icon CSS style class.- Returns:
- the small icon style
-
getTitleKey
Returns the titleKey.- Returns:
- the titleKey
-
getViewOrder
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
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
-
isAddititionalModuleExplorerType
Indicates that this is an additional explorer type which is defined in a module.- Returns:
- true or false
-
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
Returns if this type is creatable.- Returns:
true
in case this type is creatable
-
isEditable
Checks if the current user has write permissions on the given resource.- Parameters:
cms
- the current cms contextresource
- the resource to check- Returns:
true
if the current user has write permissions on the given resource
-
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
Check if property is required on upload.- Parameters:
propName
- the property name- Returns:
- true if the property is required on upload
-
isView
Returns true if this explorer type represents a view.- Returns:
- true if this explorer type represents a view
-
setAccess
Sets the access object of the type settings.- Parameters:
access
- access object
-
setAddititionalModuleExplorerType
Sets the additional explorer type flag.- Parameters:
addititionalModuleExplorerType
- true or false
-
setAutoSetTitle
Sets if the title property should automatically be added on resource creation.- Parameters:
autoSetTitle
- true if title should be added, otherwise false
-
setBigIcon
Sets the file name of the big icon for this explorer type.- Parameters:
bigIcon
- the file name of the big icon
-
setBigIconStyle
Sets the big icon CSS style class.- Parameters:
bigIconStyle
- the big icon style to set
-
setCreatable
Sets the creatable flag.- Parameters:
creatable
- the non creatable flag to set
-
setCreatable
Sets the creatable flag.- Parameters:
creatable
- the creatable flag to set
-
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
Sets the reference of the explorer type setting.- Parameters:
elementView
- the element view
-
setIcon
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
Sets the info.- Parameters:
info
- the info to set
-
setKey
Sets the key name of the explorer type setting.- Parameters:
key
- the key name of the explorer type setting
-
setName
Sets the name of the explorer type setting.- Parameters:
name
- the name of the explorer type setting
-
setNewResourceOrder
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
Sets the list of properties of the explorer type setting.- Parameters:
properties
- the list of properties of the explorer type setting
-
setPropertiesEnabled
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
Sets the default settings for the property display dialog.- Parameters:
enabled
- true, if this explorer type setting uses a special properties dialogshowNavigation
- true, if this explorer type setting displays the navigation properties in the special properties dialog
-
setReference
Sets the reference of the explorer type setting.- Parameters:
reference
- the reference of the explorer type setting
-
setSmallIconStyle
Sets the small icon CSS style class.- Parameters:
smallIconStyle
- the small icon CSS style class to set
-
setTitleKey
Sets the titleKey.- Parameters:
titleKey
- the titleKey to set
-
setTypeAttributes
Sets the basic attributes of the type settings.- Parameters:
name
- the name of the type settingkey
- the key name of the explorer type settingicon
- the icon path and file name of the explorer type setting
-
setTypeAttributes
public void setTypeAttributes(String name, String key, String icon, String bigIcon, String smallIconStyle, String bigIconStyle, String reference, String elementView, String isView, String namePattern, String viewOrder) Sets the basic attributes of the type settings.- Parameters:
name
- the name of the type settingkey
- the key name of the explorer type settingicon
- the icon path and file name of the explorer type settingbigIcon
- the file name of the big iconsmallIconStyle
- the small icon CSS style classbigIconStyle
- the big icon CSS style classreference
- the reference of the explorer type settingelementView
- the element viewisView
- 'true' if this type represents an element viewnamePattern
- the name patternviewOrder
- the view order
-