org.opencms.workplace.explorer
Class CmsExplorerTypeSettings

java.lang.Object
  extended byorg.opencms.workplace.explorer.CmsExplorerTypeSettings
All Implemented Interfaces:
java.lang.Comparable

public class CmsExplorerTypeSettings
extends java.lang.Object
implements java.lang.Comparable

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
Version:
$Revision: 1.20 $
Author:
Andreas Zahner

Field Summary
static int ORDER_VALUE_DEFAULT_START
          The default order start value for context menu entries.
static java.lang.String ORDER_VALUE_SEPARATOR_DEFAULT
          The default order value for context menu separator entries without order attribute.
 
Constructor Summary
CmsExplorerTypeSettings()
          Default constructor.
 
Method Summary
 void addContextMenuEntry(CmsExplorerContextMenuItem item)
          Adds a menu entry to the list of context menu items.
 void addContextMenuSeparator(CmsExplorerContextMenuItem item)
          Adds a menu separator to the list of context menu items.
 boolean addProperty(java.lang.String propertyName)
          Adds a property definition name to the list of editable properties.
 int compareTo(java.lang.Object obj)
           
 void createContextMenu()
          Adds all context menu entries to the context menu object.
 boolean equals(java.lang.Object o)
           
 CmsExplorerTypeAccess getAccess()
          Gets the access object of the type settings.
 CmsExplorerContextMenu getContextMenu()
          Returns the context menu.
 java.util.List getContextMenuEntries()
          Returns the list of context menu entries of the explorer type setting.
 java.lang.String getDescriptionImage()
          Returns the descriptionImage.
 java.lang.String getIcon()
          Returns the icon path and file name of the explorer type setting.
 java.lang.String getInfo()
          Returns the info.
 java.lang.String getJSEntries(CmsExplorerTypeSettings settings, int resTypeId, CmsMessages messages)
          Builds the Javascript to create the context menu.
 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 getNewResourceHandlerClassName()
          Returns the class name of the new resource handler used to create new resources of a specified resource type.
 java.lang.String getNewResourceOrder()
          Returns the order for the new resource dialog of the explorer type setting.
 java.lang.String getNewResourcePage()
          Returns the page.
 java.lang.String getNewResourceUri()
          Returns the URI for the new resource dialog of the explorer type setting.
 java.util.List 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 getTitleKey()
          Returns the titleKey.
 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 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 isShowNavigation()
          Returns if this explorer type setting displays the navigation properties in the special properties dialog.
 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 setContextMenuEntries(java.util.List entries)
          Sets the list of context menu entries of the explorer type setting.
 void setDescriptionImage(java.lang.String descriptionImage)
          Sets the descriptionImage.
 void setEditOptions()
          Sets the flag if this explorer type entry has explicit edit options set.
 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 setNewResourceHandlerClassName(java.lang.String newResourceHandlerClassName)
          Sets the class name of the new resource handler used to create new resources of a specified resource type.
 void setNewResourceOrder(java.lang.String newResourceOrder)
          Sets the order for the new resource dialog of the explorer type setting.
 void setNewResourcePage(java.lang.String page)
          Sets the page.
 void setNewResourceUri(java.lang.String newResourceUri)
          Sets the URI for the new resource dialog of the explorer type setting.
 void setProperties(java.util.List 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 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 reference)
          Sets the basic attributes of the type settings.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORDER_VALUE_DEFAULT_START

public static final int ORDER_VALUE_DEFAULT_START
The default order start value for context menu entries.

See Also:
Constant Field Values

ORDER_VALUE_SEPARATOR_DEFAULT

public static final java.lang.String ORDER_VALUE_SEPARATOR_DEFAULT
The default order value for context menu separator entries without order attribute.

See Also:
Constant Field Values
Constructor Detail

CmsExplorerTypeSettings

public CmsExplorerTypeSettings()
Default constructor.

Method Detail

addContextMenuEntry

public void addContextMenuEntry(CmsExplorerContextMenuItem item)
Adds a menu entry to the list of context menu items.

Parameters:
item - the entry item to add to the list

addContextMenuSeparator

public void addContextMenuSeparator(CmsExplorerContextMenuItem item)
Adds a menu separator to the list of context menu items.

Parameters:
item - the separator item to add to the list

addProperty

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

Parameters:
propertyName - the name of the property definition to add
Returns:
true if the property definition was added properly

compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)

createContextMenu

public void createContextMenu()
Adds all context menu entries to the context menu object.

This method has to be called when all context menu entries have been added to the list of entries.


equals

public boolean equals(java.lang.Object o)
See Also:
Object.equals(java.lang.Object)

getAccess

public CmsExplorerTypeAccess getAccess()
Gets the access object of the type settings.

Returns:
access object of the type settings

getContextMenu

public CmsExplorerContextMenu getContextMenu()
Returns the context menu.

Returns:
the context menu

getContextMenuEntries

public java.util.List getContextMenuEntries()
Returns the list of context menu entries of the explorer type setting.

Returns:
the list of context menu entries of the explorer type setting

getDescriptionImage

public java.lang.String getDescriptionImage()
Returns the descriptionImage.

Returns:
the descriptionImage

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

getInfo

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

Returns:
the info

getJSEntries

public java.lang.String getJSEntries(CmsExplorerTypeSettings settings,
                                     int resTypeId,
                                     CmsMessages messages)
Builds the Javascript to create the context menu.

Parameters:
settings - the explorer type settings for which the context menu is created
resTypeId - the id of the resource type which uses the context menu
messages - the messages to generate the context menu with (should be the workplace messages)
Returns:
the JavaScript output to create the context menu

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

getNewResourceHandlerClassName

public java.lang.String getNewResourceHandlerClassName()
Returns the class name of the new resource handler used to create new resources of a specified resource type.

Returns:
the class name of the new resource handler

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

getNewResourcePage

public java.lang.String getNewResourcePage()
Returns the page.

Returns:
the page

getNewResourceUri

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

Returns:
the URI for the new resource dialog of the explorer type setting

getProperties

public java.util.List 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

getTitleKey

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

Returns:
the titleKey

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()
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

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

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

setAccess

public void setAccess(CmsExplorerTypeAccess access)
Sets the access object of the type settings.

Parameters:
access - access object

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

setContextMenuEntries

public void setContextMenuEntries(java.util.List entries)
Sets the list of context menu entries of the explorer type setting.

Parameters:
entries - the list of context menu entries of the explorer type setting

setDescriptionImage

public void setDescriptionImage(java.lang.String descriptionImage)
Sets the descriptionImage.

Parameters:
descriptionImage - the descriptionImage 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.


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

setNewResourceHandlerClassName

public void setNewResourceHandlerClassName(java.lang.String newResourceHandlerClassName)
Sets the class name of the new resource handler used to create new resources of a specified resource type.

Parameters:
newResourceHandlerClassName - the class name of the new resource handler

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

setNewResourcePage

public void setNewResourcePage(java.lang.String page)
Sets the page.

Parameters:
page - the page to set

setNewResourceUri

public void setNewResourceUri(java.lang.String newResourceUri)
Sets the URI for the new resource dialog of the explorer type setting.

Parameters:
newResourceUri - the URI for the new resource dialog of the explorer type setting

setProperties

public void setProperties(java.util.List 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

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 reference)
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
reference - the reference of the explorer type setting