Package org.opencms.ade.configuration
Class CmsElementView
- java.lang.Object
-
- org.opencms.ade.configuration.CmsElementView
-
public class CmsElementView extends java.lang.Object
Represents a element view for the container page editor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsElementView.ElementViewComparator
The element view comparator.
-
Field Summary
Fields Modifier and Type Field Description static CmsElementView
DEFAULT_ELEMENT_VIEW
The default element view.static int
DEFAULT_ORDER
Default order if not configured.static java.lang.String
GUI_ELEMENT_VIEW_DEFAULT_TITLE_0
The default element view title key.static java.lang.String
N_ORDER
The order node.static java.lang.String
N_TITLE
The title node.static java.lang.String
N_TITLE_KEY
The title key node.static java.lang.String
PARENT_NONE
Special value indicating that no view is selected (used for parent view selection).
-
Constructor Summary
Constructors Constructor Description CmsElementView(CmsObject cms, CmsResource resource)
Constructor.CmsElementView(CmsUUID id)
Creates a new view with the given id, but initializes no other fields.CmsElementView(CmsExplorerTypeSettings explorerType)
Creates a new element view based on the given explorer type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsExplorerTypeSettings
getExplorerType()
Gets the explorer type settings.static CmsUUID
getExplorerTypeViewId(java.lang.String typeName)
Helper method to compute the uuid for views based on explorer types.CmsUUID
getId()
Returns the element view id.int
getOrder()
The order.CmsUUID
getParentViewId()
Gets the parent view id (null if there is no parent view).CmsResource
getResource()
Returns the element view resource.java.lang.String
getTitle(CmsObject cms, java.util.Locale locale)
Returns the element view title.boolean
hasPermission(CmsObject cms, CmsResource folder)
Checks whether the current user has permissions to use the element view.boolean
isOther()
'Other types' view, for everything that isn't assigned to any other view.
-
-
-
Field Detail
-
DEFAULT_ELEMENT_VIEW
public static final CmsElementView DEFAULT_ELEMENT_VIEW
The default element view.
-
DEFAULT_ORDER
public static final int DEFAULT_ORDER
Default order if not configured.- See Also:
- Constant Field Values
-
GUI_ELEMENT_VIEW_DEFAULT_TITLE_0
public static final java.lang.String GUI_ELEMENT_VIEW_DEFAULT_TITLE_0
The default element view title key.- See Also:
- Constant Field Values
-
N_ORDER
public static final java.lang.String N_ORDER
The order node.- See Also:
- Constant Field Values
-
N_TITLE
public static final java.lang.String N_TITLE
The title node.- See Also:
- Constant Field Values
-
N_TITLE_KEY
public static final java.lang.String N_TITLE_KEY
The title key node.- See Also:
- Constant Field Values
-
PARENT_NONE
public static final java.lang.String PARENT_NONE
Special value indicating that no view is selected (used for parent view selection).- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsElementView
public CmsElementView(CmsExplorerTypeSettings explorerType)
Creates a new element view based on the given explorer type.- Parameters:
explorerType
- the explorer type
-
CmsElementView
public CmsElementView(CmsObject cms, CmsResource resource) throws java.lang.Exception
Constructor.- Parameters:
cms
- the cms contextresource
- the group resource- Throws:
java.lang.Exception
- if parsing the resource fails
-
CmsElementView
public CmsElementView(CmsUUID id)
Creates a new view with the given id, but initializes no other fields.- Parameters:
id
- the id
-
-
Method Detail
-
getExplorerTypeViewId
public static CmsUUID getExplorerTypeViewId(java.lang.String typeName)
Helper method to compute the uuid for views based on explorer types.- Parameters:
typeName
- the explorer type name- Returns:
- the element view id computed from the type name
-
getExplorerType
public CmsExplorerTypeSettings getExplorerType()
Gets the explorer type settings.- Returns:
- the explorer type
-
getOrder
public int getOrder()
The order.- Returns:
- the order
-
getParentViewId
public CmsUUID getParentViewId()
Gets the parent view id (null if there is no parent view).- Returns:
- the parent view id
-
getResource
public CmsResource getResource()
Returns the element view resource.- Returns:
- the element view resource
-
getTitle
public java.lang.String getTitle(CmsObject cms, java.util.Locale locale)
Returns the element view title.- Parameters:
cms
- the cms contextlocale
- the locale- Returns:
- the title
-
hasPermission
public boolean hasPermission(CmsObject cms, CmsResource folder)
Checks whether the current user has permissions to use the element view.- Parameters:
cms
- the cms contextfolder
- used for permission checks for explorertype based views- Returns:
true
if the current user has permissions to use the element view
-
isOther
public boolean isOther()
'Other types' view, for everything that isn't assigned to any other view.- Returns:
- true if this is the 'other types' view
-
-