Interface I_CmsEditHandler

All Known Implementing Classes:
CmsDateSeriesEditHandler

public interface I_CmsEditHandler
Edit handlers are optional and can be configured within the XSD-schema of a resource type.

Edit handlers may be used to enhance content editing within the container page editor. They allow edit pre-processing, and specific delete operations.

  • Method Details

    • getDeleteOptions

      CmsDialogOptions getDeleteOptions(CmsObject cms, CmsContainerElementBean elementBean, CmsUUID pageContextId, Map<String,String[]> requestParams)
      Returns a map of delete options. The value being the option description displayed to the user.

      Parameters:
      cms - the cms context
      elementBean - the container element to be deleted
      pageContextId - the structure id of the context containerpage
      requestParams - the request parameters
      Returns:
      the available delete options
    • getEditOptions

      CmsDialogOptions getEditOptions(CmsObject cms, CmsContainerElementBean elementBean, CmsUUID pageContextId, Map<String,String[]> requestParams, boolean isListElement)
      Returns a map of edit options. The value being the option description displayed to the user.

      Parameters:
      cms - the cms context
      elementBean - the container element to be edited
      pageContextId - the structure id of the context containerpage
      requestParams - the request parameters
      isListElement - in case a list element, not a container element is about to be edited
      Returns:
      the available edit options
    • getNewOptions

      CmsDialogOptions getNewOptions(CmsObject cms, CmsContainerElementBean elementBean, CmsUUID pageContextId, Map<String,String[]> requestParam)
      Gets the options for the 'New' (plus) operation in the page editor.

      If this returns null, the default behavior for the 'New' operation will be used instead.

      Parameters:
      cms - the cms context
      elementBean - the container element bean from which the 'New' operation was initiated
      pageContextId - the structure id of the container page
      requestParam - the request parameters
      Returns:
      the available options, or null if the default behavior should be used
    • handleDelete

      void handleDelete(CmsObject cms, CmsContainerElementBean elementBean, String deleteOption, CmsUUID pageContextId, Map<String,String[]> requestParams) throws CmsException
      Executes the actual delete.

      Parameters:
      cms - the cms context
      elementBean - the container element to delete
      deleteOption - the selected delete option
      pageContextId - the structure id of the context containerpage
      requestParams - the request parameters
      Throws:
      CmsException - if something goes wrong
    • handleNew

      String handleNew(CmsObject cms, String newLink, Locale locale, String referenceSitePath, String modelFileSitePath, String postCreateHandler, CmsContainerElementBean element, CmsUUID pageId, Map<String,String[]> requestParams, String choice) throws CmsException
      Creates a new resource to edit.

      Parameters:
      cms - The CmsObject of the current request
      newLink - A string, specifying where which new content should be created.
      locale - The locale
      referenceSitePath - site path of the currently edited content.
      modelFileSitePath - site path of the model file
      postCreateHandler - optional class name of an I_CmsCollectorPostCreateHandler which is invoked after the content has been created.
      element - the container element bean
      pageId - the page id
      requestParams - the request parameters
      choice - the option chosen by the user
      Returns:
      The site-path of the newly created resource.
      Throws:
      CmsException - if something goes wrong
    • prepareForEdit

      CmsUUID prepareForEdit(CmsObject cms, CmsContainerElementBean elementBean, String editOption, CmsUUID pageContextId, Map<String,String[]> requestParams) throws CmsException
      Prepares the resource to be edited.

      Parameters:
      cms - the cms context
      elementBean - the container element to be edited
      editOption - the selected edit option
      pageContextId - the structure id of the context containerpage
      requestParams - the request parameters
      Returns:
      the structure id of the resource to be edited, may differ from the original element id
      Throws:
      CmsException - if something goes wrong
    • setParameters

      void setParameters(Map<String,String> params)
      Sets parameters for the edit handler.

      Parameters:
      params - the parameters