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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CmsDialogOptions
getDeleteOptions(CmsObject cms, CmsContainerElementBean elementBean, CmsUUID pageContextId, java.util.Map<java.lang.String,java.lang.String[]> requestParams)
Returns a map of delete options.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.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.void
handleDelete(CmsObject cms, CmsContainerElementBean elementBean, java.lang.String deleteOption, CmsUUID pageContextId, java.util.Map<java.lang.String,java.lang.String[]> requestParams)
Executes the actual delete.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)
Creates a new resource to edit.CmsUUID
prepareForEdit(CmsObject cms, CmsContainerElementBean elementBean, java.lang.String editOption, CmsUUID pageContextId, java.util.Map<java.lang.String,java.lang.String[]> requestParams)
Prepares the resource to be edited.void
setParameters(java.util.Map<java.lang.String,java.lang.String> params)
Sets parameters for the edit handler.
-
-
-
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 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, 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 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, 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 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, 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 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
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 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, 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 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
void setParameters(java.util.Map<java.lang.String,java.lang.String> params)
Sets parameters for the edit handler.- Parameters:
params
- the parameters
-
-