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 Detail

      • getDeleteOptions

        CmsDialogOptions getDeleteOptions​(CmsObject cms,
                                          CmsContainerElementBean elementBean,
                                          CmsUUID pageContextId,
                                          java.util.Map<java.lang.String,​java.lang.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,
                                        java.util.Map<java.lang.String,​java.lang.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,
                                       java.util.Map<java.lang.String,​java.lang.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,
                          java.lang.String deleteOption,
                          CmsUUID pageContextId,
                          java.util.Map<java.lang.String,​java.lang.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

        java.lang.String handleNew​(CmsObject cms,
                                   java.lang.String newLink,
                                   java.util.Locale locale,
                                   java.lang.String referenceSitePath,
                                   java.lang.String modelFileSitePath,
                                   java.lang.String postCreateHandler,
                                   CmsContainerElementBean element,
                                   CmsUUID pageId,
                                   java.util.Map<java.lang.String,​java.lang.String[]> requestParams,
                                   java.lang.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,
                               java.lang.String editOption,
                               CmsUUID pageContextId,
                               java.util.Map<java.lang.String,​java.lang.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​(java.util.Map<java.lang.String,​java.lang.String> params)
        Sets parameters for the edit handler.

        Parameters:
        params - the parameters