Class CmsPreEditorAction


public class CmsPreEditorAction extends CmsDialog
Handles the actions that should be performed before opening the editor frameset.

For each resource type, a pre editor action class can be defined that is triggered in the workplace JSP /system/workplace/editors/editor.jsp before the editor is initially opened. If an action was performed, be sure to use the static method sendForwardToEditor(CmsDialog, Map) to open the editor after the action.

Since:
6.5.4
  • Constructor Details

    • CmsPreEditorAction

      Public constructor with JSP action element.

      Parameters:
      jsp - an initialized JSP action element
    • CmsPreEditorAction

      public CmsPreEditorAction(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
      Public constructor with JSP variables.

      Parameters:
      context - the JSP page context
      req - the JSP request
      res - the JSP response
  • Method Details

    • isPreEditorMode

      public static boolean isPreEditorMode(CmsDialog dialog)
      Returns if the dialog is currently running in pre editor action mode, depending on the presence of the original request parameters.

      Parameters:
      dialog - the dialog instance currently used
      Returns:
      true if the dialog is currently running in pre editor action mode, otherwise false
    • sendForwardToEditor

      public static void sendForwardToEditor(CmsDialog dialog)
      Forwards to the editor and opens it after the action was performed.

      Parameters:
      dialog - the dialog instance forwarding to the editor
    • sendForwardToEditor

      public static void sendForwardToEditor(CmsDialog dialog, Map<String,String[]> additionalParams)
      Forwards to the editor and opens it after the action was performed.

      Parameters:
      dialog - the dialog instance forwarding to the editor
      additionalParams - eventual additional request parameters for the editor to use
    • doPreAction

      public boolean doPreAction()
      Returns if an action has to be performed before opening the editor depending on the resource to edit and request parameter values.

      Returns:
      true if an action has to be performed, then the editor frameset is not generated
    • getOriginalParams

      Returns the original request parameters for the editor to pass to the pre editor action dialog.

      Returns:
      the original request parameters for the editor
    • checkRole

      protected void checkRole() throws CmsRoleViolationException
      Checks that the current user is a workplace user.

      Overrides:
      checkRole in class CmsWorkplace
      Throws:
      CmsRoleViolationException - if the user does not have the required role