Package org.opencms.workplace.editors
Class CmsWorkplaceEditorManager
java.lang.Object
org.opencms.workplace.editors.CmsWorkplaceEditorManager
The editor manager stores information about all available configured editors in OpenCms.
This class provides methods and constants to select the right editor according to:
- the user preferences
- the users current browser
- the resource type
- the editor rankings
- Since:
- 6.0.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkAcaciaEditorAvailable
(CmsObject cms, CmsResource resource) Checks whether GWT widgets are available for all fields of a content.Returns a map of configurable editors for the workplace preferences dialog.protected String
getDefaultEditorUri
(CmsRequestContext context, String resourceType, String userAgent) Returns the default editor URI for the current resource type.getEditorConfiguration
(String name) Gets the editor configuration with the given name.protected List<CmsWorkplaceEditorConfiguration>
Returns the editor configuration objects.getEditorParameter
(CmsObject cms, String editor, String param) Gets the value of a global editor configuration parameter.protected String
getEditorUri
(CmsRequestContext context, String resourceType, String userAgent) Returns the editor URI for the current resource type.getWidgetEditor
(CmsRequestContext context, String userAgent) Returns the editor URI for the current resource type.boolean
Checks if there is an editor which can process the given resource.
-
Field Details
-
EDITOR_CONFIGURATION_FILENAME
The filename of the editor configuration XML file.- See Also:
-
EDITOR_FILENAME
The filename of the editor JSP.- See Also:
-
-
Constructor Details
-
CmsWorkplaceEditorManager
Creates a new editor manager.- Parameters:
cms
- an OpenCms context object that must have been initialized with "Admin" permissions
-
-
Method Details
-
checkAcaciaEditorAvailable
Checks whether GWT widgets are available for all fields of a content.- Parameters:
cms
- the current CMS contextresource
- the resource to check- Returns:
- false if for some fields the new Acacia widgets are not available
-
getConfigurableEditors
Returns a map of configurable editors for the workplace preferences dialog.This map has the resource type name as key, the value is a sorted map with the ranking as key and a CmsWorkplaceEditorConfiguration object as value.
- Returns:
- configurable editors for the workplace preferences dialog
-
getEditorConfiguration
Gets the editor configuration with the given name.- Parameters:
name
- the name of the editor configuration- Returns:
- the editor configuration
-
getEditorParameter
Gets the value of a global editor configuration parameter.- Parameters:
cms
- the CMS contexteditor
- the editor nameparam
- the name of the parameter- Returns:
- the editor parameter value
-
getWidgetEditor
Returns the editor URI for the current resource type.- Parameters:
context
- the request contextuserAgent
- the user agent String that identifies the browser- Returns:
- a valid editor URI for the resource type or null, if no editor matches
-
isEditorAvailableForResource
Checks if there is an editor which can process the given resource.- Parameters:
res
- the resource- Returns:
- true if the given resource can be edited with one of the configured editors
-
getDefaultEditorUri
protected String getDefaultEditorUri(CmsRequestContext context, String resourceType, String userAgent) Returns the default editor URI for the current resource type.- Parameters:
context
- the request contextresourceType
- the current resource typeuserAgent
- the user agent String that identifies the browser- Returns:
- a valid default editor URI for the resource type or null, if no editor matches
-
getEditorConfigurations
Returns the editor configuration objects.- Returns:
- the editor configuration objects
-
getEditorUri
Returns the editor URI for the current resource type.- Parameters:
context
- the request contextresourceType
- the current resource typeuserAgent
- the user agent String that identifies the browser- Returns:
- a valid editor URI for the resource type or null, if no editor matches
-