Class CmsWorkplaceEditorManager

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

public class CmsWorkplaceEditorManager extends Object
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 Details

  • 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

      public static boolean checkAcaciaEditorAvailable(CmsObject cms, CmsResource resource)
      Checks whether GWT widgets are available for all fields of a content.

      Parameters:
      cms - the current CMS context
      resource - 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

      public String getEditorParameter(CmsObject cms, String editor, String param)
      Gets the value of a global editor configuration parameter.
      Parameters:
      cms - the CMS context
      editor - the editor name
      param - the name of the parameter
      Returns:
      the editor parameter value
    • getWidgetEditor

      public String getWidgetEditor(CmsRequestContext context, String userAgent)
      Returns the editor URI for the current resource type.

      Parameters:
      context - the request context
      userAgent - 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 context
      resourceType - the current resource type
      userAgent - 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

      protected String getEditorUri(CmsRequestContext context, String resourceType, String userAgent)
      Returns the editor URI for the current resource type.

      Parameters:
      context - the request context
      resourceType - the current resource type
      userAgent - the user agent String that identifies the browser
      Returns:
      a valid editor URI for the resource type or null, if no editor matches