org.opencms.workplace.editors
Interface I_CmsEditorActionHandler

All Known Implementing Classes:
CmsEditorActionDefault

public interface I_CmsEditorActionHandler

Provides a method for performing an individual action if the user pressed a special button in the editor.

You can define the class of your own editor action method in the OpenCms XML configuration files. The class you enter must implement this interface to perform the editor action.

Since:
6.0.0
Version:
$Revision: 1.9 $
Author:
Andreas Zahner

Field Summary
static String DIRECT_EDIT_AREA_END
          Prefix for direct edit end elements, used on JPS pages that supply the direct edit html.
static String DIRECT_EDIT_AREA_START
          Prefix for direct edit start elements, used on JPS pages that supply the direct edit html.
static String DIRECT_EDIT_INCLUDE_FILE_URI
          Key to identify the direct edit configuration file.
static String DIRECT_EDIT_INCLUDE_FILE_URI_DEFAULT
          Default direct edit include file URI.
static String DIRECT_EDIT_INCLUDES
          Element name for direct edit includes.
static String DIRECT_EDIT_MODE_DISABLED
          Constant for: direct edit mode disabled.
static String DIRECT_EDIT_MODE_ENABLED
          Constant for: direct edit mode enabled.
static String DIRECT_EDIT_MODE_INACTIVE
          Constant for: direct edit mode inactive.
static String DIRECT_EDIT_OPTION_DELETE
          Option value that indicates the "delete" button should be displayed.
static String DIRECT_EDIT_OPTION_EDIT
          Option value that indicates the "edit" button should be displayed.
static String DIRECT_EDIT_OPTION_NEW
          Option value that indicates the "new" button should be displayed.
static String DIRECT_EDIT_PARAM_BUTTONSTYLE
          Key to identify the edit button style, used on JPS pages that supply the direct edit html.
static String DIRECT_EDIT_PARAM_ELEMENT
          Key to identify the edit element, used on JPS pages that supply the direct edit html.
static String DIRECT_EDIT_PARAM_LOCALE
          Key to identify the edit language, used on JPS pages that supply the direct edit html.
static String DIRECT_EDIT_PARAM_NEWLINK
          Key to identify the link to use for the "new" button (if enabled).
static String DIRECT_EDIT_PARAM_OPTIONS
          Key to identify additional direct edit options, used e.g.
static String DIRECT_EDIT_PARAM_TARGET
          Key to identify the edit target, used on JPS pages that supply the direct edit html.
 
Method Summary
 void editorAction(CmsEditor editor, CmsJspActionElement jsp)
          Performs an action which is configurable in the implementation of the interface, e.g.
 String getButtonName()
          Returns the key name of the button displayed in the editor.
 String getButtonUrl(CmsJspActionElement jsp, String resourceName)
          Returns the URL of the button displayed in the editor.
 String getEditMode(CmsObject cmsObject, String filename, String element, ServletRequest req)
          Checks the current edit mode.
 boolean isButtonActive(CmsJspActionElement jsp, String resourceName)
          Returns true if the customized button should be active, otherwise false.
 

Field Detail

DIRECT_EDIT_AREA_END

static final String DIRECT_EDIT_AREA_END
Prefix for direct edit end elements, used on JPS pages that supply the direct edit html.

See Also:
Constant Field Values

DIRECT_EDIT_AREA_START

static final String DIRECT_EDIT_AREA_START
Prefix for direct edit start elements, used on JPS pages that supply the direct edit html.

See Also:
Constant Field Values

DIRECT_EDIT_INCLUDE_FILE_URI

static final String DIRECT_EDIT_INCLUDE_FILE_URI
Key to identify the direct edit configuration file.

See Also:
Constant Field Values

DIRECT_EDIT_INCLUDE_FILE_URI_DEFAULT

static final String DIRECT_EDIT_INCLUDE_FILE_URI_DEFAULT
Default direct edit include file URI.

See Also:
Constant Field Values

DIRECT_EDIT_INCLUDES

static final String DIRECT_EDIT_INCLUDES
Element name for direct edit includes.

See Also:
Constant Field Values

DIRECT_EDIT_MODE_DISABLED

static final String DIRECT_EDIT_MODE_DISABLED
Constant for: direct edit mode disabled.

See Also:
Constant Field Values

DIRECT_EDIT_MODE_ENABLED

static final String DIRECT_EDIT_MODE_ENABLED
Constant for: direct edit mode enabled.

See Also:
Constant Field Values

DIRECT_EDIT_MODE_INACTIVE

static final String DIRECT_EDIT_MODE_INACTIVE
Constant for: direct edit mode inactive.

See Also:
Constant Field Values

DIRECT_EDIT_OPTION_DELETE

static final String DIRECT_EDIT_OPTION_DELETE
Option value that indicates the "delete" button should be displayed.

See Also:
Constant Field Values

DIRECT_EDIT_OPTION_EDIT

static final String DIRECT_EDIT_OPTION_EDIT
Option value that indicates the "edit" button should be displayed.

See Also:
Constant Field Values

DIRECT_EDIT_OPTION_NEW

static final String DIRECT_EDIT_OPTION_NEW
Option value that indicates the "new" button should be displayed.

See Also:
Constant Field Values

DIRECT_EDIT_PARAM_BUTTONSTYLE

static final String DIRECT_EDIT_PARAM_BUTTONSTYLE
Key to identify the edit button style, used on JPS pages that supply the direct edit html.

See Also:
Constant Field Values

DIRECT_EDIT_PARAM_ELEMENT

static final String DIRECT_EDIT_PARAM_ELEMENT
Key to identify the edit element, used on JPS pages that supply the direct edit html.

See Also:
Constant Field Values

DIRECT_EDIT_PARAM_LOCALE

static final String DIRECT_EDIT_PARAM_LOCALE
Key to identify the edit language, used on JPS pages that supply the direct edit html.

See Also:
Constant Field Values

DIRECT_EDIT_PARAM_NEWLINK

static final String DIRECT_EDIT_PARAM_NEWLINK
Key to identify the link to use for the "new" button (if enabled).

See Also:
Constant Field Values

DIRECT_EDIT_PARAM_OPTIONS

static final String DIRECT_EDIT_PARAM_OPTIONS
Key to identify additional direct edit options, used e.g. to control which direct edit buttons are displayed

See Also:
Constant Field Values

DIRECT_EDIT_PARAM_TARGET

static final String DIRECT_EDIT_PARAM_TARGET
Key to identify the edit target, used on JPS pages that supply the direct edit html.

See Also:
Constant Field Values
Method Detail

editorAction

void editorAction(CmsEditor editor,
                  CmsJspActionElement jsp)
                  throws IOException,
                         JspException
Performs an action which is configurable in the implementation of the interface, e.g. save, exit, publish.

Parameters:
editor - the current editor instance
jsp - the JSP action element
Throws:
IOException - if a redirection fails
JspException - if including a JSP fails

getButtonName

String getButtonName()
Returns the key name of the button displayed in the editor.

Returns:
the key name of the button

getButtonUrl

String getButtonUrl(CmsJspActionElement jsp,
                    String resourceName)
Returns the URL of the button displayed in the editor.

Parameters:
jsp - the JSP action element
resourceName - the name of the edited resource
Returns:
the URL of the button

getEditMode

String getEditMode(CmsObject cmsObject,
                   String filename,
                   String element,
                   ServletRequest req)
Checks the current edit mode.

The mode is used to select the appropriate elements for displaying the direct edit button. If the resource is displayed in online project -> editmode = null If the resource is temporary -> editmode = inactive If the resource does not belong to the current project -> editmode = inactive If the current user has no write permissions on the resource -> editmode = inactive If the resource is locked for another user -> editmode = disabled Otherwise -> editmode = enabled

Parameters:
cmsObject - the cms object
filename - name of the resource
element - of the desired element or null
req - the current request
Returns:
the current edit mode ( null | inactive | disabled | enabled )

isButtonActive

boolean isButtonActive(CmsJspActionElement jsp,
                       String resourceName)
Returns true if the customized button should be active, otherwise false.

Parameters:
jsp - the JSP action element
resourceName - the name of the edited resource
Returns:
true if the customized button should be active, otherwise false