Class DuplicateModalHandler

All Implemented Interfaces:
JcmsConstants, JaliosConstants

public class DuplicateModalHandler extends EditPublicationHandler
Handler dedicated to publication duplication.
  • Field Details

    • opDuplicate

      protected boolean opDuplicate
    • selectedWorkspace

      protected Workspace selectedWorkspace
    • origRedirect

      protected String origRedirect
      The original redirect URL.

      To be reused in the edit JSP url user will be redirected to after duplication, as a "?redirect=" HTTP parameter.

      Since:
      jcms-10.0.8 / JCMS-10823
    • copy

      protected Publication copy
      The copy created -if any- during duplicate operation.

      Protected access, originally created for unittest purpose.

      Since:
      jcms-10.0.8 / JCMS-10823
  • Constructor Details

    • DuplicateModalHandler

      public DuplicateModalHandler()
  • Method Details

    • setRedirect

      public void setRedirect(String url)
      Saves a backup of original redirect, for later use if needed.

      Original redirect will be appended to the editPub.jsp URL as an encodedURL "redirect=" parameter.

      Overrides:
      setRedirect in class JcmsFormHandler
      Parameters:
      url - Value to assign to redirect.
      Since:
      jcms-10.0.8 / JCMS-10823
    • processAction

      public boolean processAction() throws IOException
      Description copied from class: JcmsFormHandler
      Method to be implemented to check/validate action to be performed and process them.

      Default implementation is to return false. No need to call super method.

      This method may NOT be invoked at all if security validation are not met.

      You must ensure your handler and JSP can work properly without any code invoked in this method.

      Overrides:
      processAction in class EditPublicationHandler
      Returns:
      false if no redirection is needed, true otherwise
      Throws:
      IOException - IO Exception
    • validateDuplicate

      protected boolean validateDuplicate() throws IOException
      Throws:
      IOException
    • performDuplicate

      protected boolean performDuplicate() throws IOException
      Throws:
      IOException
    • getModalTitle

      public String getModalTitle()
    • getWorkspaceSettings

      public ControlSettings getWorkspaceSettings()
      Overrides:
      getWorkspaceSettings in class EditPublicationHandler
    • getCategorySettings

      public ControlSettings getCategorySettings()
    • setOpDuplicate

      public void setOpDuplicate(String v)
    • setSelectedWorkspace

      public void setSelectedWorkspace(String id)
    • showModalEditionChange

      public boolean showModalEditionChange()
      Description copied from class: EditPublicationHandler
      Check if the "Advanced edition" or "Simple edition" button should be displayed in modal footer.

      The default implementation of this method is to check for request attribute EditPublicationHandler.SHOW_MODAL_EDITION_CHANGE. If the attribute is not set, the button is displayed only when editing an existing publication (i.e. EditPublicationHandler.getPublication() is not null), and hidden when creating a new one.

      You can set the attribute to a custom value or provide a custom FormHandler to override this behavior.

      See jcore/modalPubFormHandler.jspf for use of this method.

      Overrides:
      showModalEditionChange in class EditPublicationHandler
      Returns:
      true to display the button, false to hide it