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 Summary
Modifier and TypeMethodDescriptiongetDeleteOptions
(CmsObject cms, CmsContainerElementBean elementBean, CmsUUID pageContextId, Map<String, String[]> requestParams) Returns a map of delete options.getEditOptions
(CmsObject cms, CmsContainerElementBean elementBean, CmsUUID pageContextId, Map<String, String[]> requestParams, boolean isListElement) Returns a map of edit options.getNewOptions
(CmsObject cms, CmsContainerElementBean elementBean, CmsUUID pageContextId, Map<String, String[]> requestParam) Gets the options for the 'New' (plus) operation in the page editor.void
handleDelete
(CmsObject cms, CmsContainerElementBean elementBean, String deleteOption, CmsUUID pageContextId, Map<String, String[]> requestParams) Executes the actual delete.handleNew
(CmsObject cms, String newLink, Locale locale, String referenceSitePath, String modelFileSitePath, String postCreateHandler, CmsContainerElementBean element, CmsUUID pageId, Map<String, String[]> requestParams, String choice) Creates a new resource to edit.prepareForEdit
(CmsObject cms, CmsContainerElementBean elementBean, String editOption, CmsUUID pageContextId, Map<String, String[]> requestParams) Prepares the resource to be edited.void
setParameters
(Map<String, String> params) Sets parameters for the edit handler.
-
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 contextelementBean
- the container element to be deletedpageContextId
- the structure id of the context containerpagerequestParams
- 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 contextelementBean
- the container element to be editedpageContextId
- the structure id of the context containerpagerequestParams
- the request parametersisListElement
- 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 contextelementBean
- the container element bean from which the 'New' operation was initiatedpageContextId
- the structure id of the container pagerequestParam
- 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 CmsExceptionExecutes the actual delete.- Parameters:
cms
- the cms contextelementBean
- the container element to deletedeleteOption
- the selected delete optionpageContextId
- the structure id of the context containerpagerequestParams
- 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 CmsExceptionCreates a new resource to edit.- Parameters:
cms
- The CmsObject of the current requestnewLink
- A string, specifying where which new content should be created.locale
- The localereferenceSitePath
- site path of the currently edited content.modelFileSitePath
- site path of the model filepostCreateHandler
- optional class name of anI_CmsCollectorPostCreateHandler
which is invoked after the content has been created.element
- the container element beanpageId
- the page idrequestParams
- the request parameterschoice
- 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 CmsExceptionPrepares the resource to be edited.- Parameters:
cms
- the cms contextelementBean
- the container element to be editededitOption
- the selected edit optionpageContextId
- the structure id of the context containerpagerequestParams
- 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
Sets parameters for the edit handler.- Parameters:
params
- the parameters
-