public class CmsWorkplaceEditorConfiguration
extends java.lang.Object
Holds all necessary information about an OpenCms editor which is stored in the "editor_configuration.xml" file in each editor folder.
Provides methods to get the editor information for the editor manager.
限定符和类型 | 字段和说明 |
---|---|
protected static java.lang.String |
A_NAME
Name of the name attribute.
|
static java.lang.String |
DOCUMENT_NODE
Name of the root document node.
|
protected static java.lang.String |
N_AGENT
Name of the single user agent node.
|
protected static java.lang.String |
N_CLASS
Name of the resource type class node.
|
protected static java.lang.String |
N_LABEL
Name of the editor label node.
|
protected static java.lang.String |
N_MAPTO
Name of the resource type subnode mapto.
|
protected static java.lang.String |
N_NAME
Name of the resource type subnode name.
|
protected static java.lang.String |
N_PARAM
Name of the param node.
|
protected static java.lang.String |
N_PARAMS
Name of the params node.
|
protected static java.lang.String |
N_RANKING
Name of the resource type subnode ranking.
|
protected static java.lang.String |
N_RESOURCETYPES
Name of the resourcetypes node.
|
protected static java.lang.String |
N_TYPE
Name of the resource type node.
|
protected static java.lang.String |
N_USERAGENTS
Name of the useragents node.
|
protected static java.lang.String |
N_WIDGETEDITOR
Name of the widgeteditor node.
|
构造器和说明 |
---|
CmsWorkplaceEditorConfiguration(byte[] xmlData,
java.lang.String editorUri,
java.lang.String name)
Constructor with xml data String.
|
限定符和类型 | 方法和说明 |
---|---|
java.util.List<java.util.regex.Pattern> |
getBrowserPattern()
Returns the list of compiled browser patterns.
|
java.lang.String |
getEditorLabel()
Returns the editor label key used for the localized nice name.
|
java.lang.String |
getEditorUri()
Returns the editor workplace URI.
|
java.lang.String |
getMappingForResourceType(java.lang.String resourceType)
Returns the mapping for the given resource type.
|
java.lang.String |
getName()
Gets the name of the editor configuration (usually the folder name under /system/workplace/editors).
|
java.util.Map<java.lang.String,java.lang.String> |
getParameters()
Gets the map of additional editor parameters.
|
float |
getRankingForResourceType(java.lang.String resourceType)
Returns the ranking value for the given resource type.
|
java.util.Map<java.lang.String,java.lang.String[]> |
getResourceTypes()
Returns the valid resource types of the editor.
|
java.util.List<java.lang.String> |
getUserAgentsRegEx()
Returns the valid user agents regular expressions of the editor.
|
java.lang.String |
getWidgetEditor()
Returns the widget editor class for rich text editing.
|
boolean |
isValidConfiguration()
Returns if the current configuration is valid.
|
boolean |
isWidgetEditor()
Returns if the editor is usable as a widget editor for rich text editing.
|
boolean |
matchesBrowser(java.lang.String currentBrowser)
Tests if the current browser is matching the configuration.
|
boolean |
matchesResourceType(java.lang.String resourceType)
Returns if the configuration is suitable for the given resource type.
|
public static final java.lang.String DOCUMENT_NODE
protected static final java.lang.String A_NAME
protected static final java.lang.String N_AGENT
protected static final java.lang.String N_CLASS
protected static final java.lang.String N_LABEL
protected static final java.lang.String N_MAPTO
protected static final java.lang.String N_NAME
protected static final java.lang.String N_PARAM
protected static final java.lang.String N_PARAMS
protected static final java.lang.String N_RANKING
protected static final java.lang.String N_RESOURCETYPES
protected static final java.lang.String N_TYPE
protected static final java.lang.String N_USERAGENTS
protected static final java.lang.String N_WIDGETEDITOR
public CmsWorkplaceEditorConfiguration(byte[] xmlData, java.lang.String editorUri, java.lang.String name)
xmlData
- the XML data String containing the information about the editoreditorUri
- the editor workplace URIname
- the editor configuration namepublic java.util.List<java.util.regex.Pattern> getBrowserPattern()
public java.lang.String getEditorLabel()
public java.lang.String getEditorUri()
public java.lang.String getMappingForResourceType(java.lang.String resourceType)
resourceType
- the resource type name to checkpublic java.lang.String getName()
public java.util.Map<java.lang.String,java.lang.String> getParameters()
public float getRankingForResourceType(java.lang.String resourceType)
resourceType
- the current resource typepublic java.util.Map<java.lang.String,java.lang.String[]> getResourceTypes()
A single map item has the resource type name as key, the value is a String array with two entries:
public java.util.List<java.lang.String> getUserAgentsRegEx()
public java.lang.String getWidgetEditor()
public boolean isValidConfiguration()
public boolean isWidgetEditor()
public boolean matchesBrowser(java.lang.String currentBrowser)
currentBrowser
- the users browser String to testpublic boolean matchesResourceType(java.lang.String resourceType)
resourceType
- the resource type to check