Class CmsWorkplaceEditorConfiguration

java.lang.Object
org.opencms.workplace.editors.CmsWorkplaceEditorConfiguration

Single editor configuration 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.

Since:
6.0.0
  • Field Details

  • Constructor Details

    • CmsWorkplaceEditorConfiguration

      public CmsWorkplaceEditorConfiguration(byte[] xmlData, String editorUri, String name)
      Constructor with xml data String.

      Parameters:
      xmlData - the XML data String containing the information about the editor
      editorUri - the editor workplace URI
      name - the editor configuration name
  • Method Details

    • getBrowserPattern

      Returns the list of compiled browser patterns.

      Returns:
      the list of compiled browser patterns
    • getEditorLabel

      Returns the editor label key used for the localized nice name.

      Returns:
      the editor label key used for the localized nice name
    • getEditorUri

      public String getEditorUri()
      Returns the editor workplace URI.

      Returns:
      the editor workplace URI
    • getMappingForResourceType

      public String getMappingForResourceType(String resourceType)
      Returns the mapping for the given resource type.

      Parameters:
      resourceType - the resource type name to check
      Returns:
      the mapping or null, if no mapping is specified
    • getName

      public String getName()
      Gets the name of the editor configuration (usually the folder name under /system/workplace/editors).

      Returns:
      the name of the editor configuration
    • getParameters

      Gets the map of additional editor parameters.

      Returns:
      the editor parameter map
    • getRankingForResourceType

      public float getRankingForResourceType(String resourceType)
      Returns the ranking value for the given resource type.

      Parameters:
      resourceType - the current resource type
      Returns:
      the ranking (the higher the better)
    • getResourceTypes

      Returns the valid resource types of the editor.

      A single map item has the resource type name as key, the value is a String array with two entries:

      • Entry 0: the ranking for the resource type
      • Entry 1: the mapping to another resource type or null

      Returns:
      the valid resource types of the editor
    • getUserAgentsRegEx

      Returns the valid user agents regular expressions of the editor.

      Returns:
      the valid user agents regular expressions of the editor
    • getWidgetEditor

      Returns the widget editor class for rich text editing.

      Returns:
      the widget editor class for rich text editing
    • isValidConfiguration

      public boolean isValidConfiguration()
      Returns if the current configuration is valid.

      Returns:
      true if no configuration errors were found, otherwise false
    • isWidgetEditor

      public boolean isWidgetEditor()
      Returns if the editor is usable as a widget editor for rich text editing.

      Returns:
      true if the editor is usable as a widget editor for rich text editing, otherwise false
    • matchesBrowser

      public boolean matchesBrowser(String currentBrowser)
      Tests if the current browser is matching the configuration.

      Parameters:
      currentBrowser - the users browser String to test
      Returns:
      true if the browser matches the configuration, otherwise false
    • matchesResourceType

      public boolean matchesResourceType(String resourceType)
      Returns if the configuration is suitable for the given resource type.

      Parameters:
      resourceType - the resource type to check
      Returns:
      true if the configuration matches the resource type