Package org.ametys.cms.workflow.copy
Class EditContentByCopyFunction
- java.lang.Object
-
- org.ametys.plugins.workflow.AbstractWorkflowComponent
-
- org.ametys.cms.workflow.AbstractContentWorkflowComponent
-
- org.ametys.cms.workflow.copy.EditContentByCopyFunction
-
- All Implemented Interfaces:
com.opensymphony.workflow.FunctionProvider
,LogEnabled
,Serviceable
public class EditContentByCopyFunction extends AbstractContentWorkflowComponent implements com.opensymphony.workflow.FunctionProvider
Workflow function to edit a content using the duplication functionality
-
-
Field Summary
Fields Modifier and Type Field Description protected CopyContentMetadataComponent
_copyContentMetadataHelper
The metadata copy componentprotected ObservationManager
_observationManager
The observation managerstatic String
BASE_CONTENT_KEY
Constant for storing the base content used for the duplication into the transient variables map.static String
COPY_MAP_KEY
Constant for storing the map containing the duplication info into the transient variables map.static String
COPY_REPORT_KEY
Constant for storing the copy report object into the transient variables map.-
Fields inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
_contentHelper, CONTENT_KEY
-
Fields inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
_logger, _manager, CONTEXT_PARAMETERS_KEY, FAIL_CONDITIONS_KEY, RESULT_MAP_KEY, WORKFLOW_ERRORS_KEY, WORKFLOW_WARNS_KEY
-
-
Constructor Summary
Constructors Constructor Description EditContentByCopyFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_duplicateMetadata(Map transientVars, ModifiableContent content)
Duplicate the currently edited content by copying the metadata of the source content.protected void
_updateCommonMetadata(ModifiableContent content, UserIdentity user)
Updates common metadata (last contributor, last modification date, ...).void
execute(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps)
void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
getContent
-
Methods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
addWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser
-
-
-
-
Field Detail
-
BASE_CONTENT_KEY
public static final String BASE_CONTENT_KEY
Constant for storing the base content used for the duplication into the transient variables map.
-
COPY_MAP_KEY
public static final String COPY_MAP_KEY
Constant for storing the map containing the duplication info into the transient variables map.
-
COPY_REPORT_KEY
public static final String COPY_REPORT_KEY
Constant for storing the copy report object into the transient variables map.
-
_copyContentMetadataHelper
protected CopyContentMetadataComponent _copyContentMetadataHelper
The metadata copy component
-
_observationManager
protected ObservationManager _observationManager
The observation manager
-
-
Constructor Detail
-
EditContentByCopyFunction
public EditContentByCopyFunction()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractContentWorkflowComponent
- Throws:
ServiceException
-
execute
public void execute(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps) throws com.opensymphony.workflow.WorkflowException
- Specified by:
execute
in interfacecom.opensymphony.workflow.FunctionProvider
- Throws:
com.opensymphony.workflow.WorkflowException
-
_duplicateMetadata
protected void _duplicateMetadata(Map transientVars, ModifiableContent content) throws com.opensymphony.workflow.WorkflowException
Duplicate the currently edited content by copying the metadata of the source content.- Parameters:
transientVars
- the transient variables.content
- the destination content.- Throws:
com.opensymphony.workflow.WorkflowException
- if an error occurs.
-
_updateCommonMetadata
protected void _updateCommonMetadata(ModifiableContent content, UserIdentity user) throws com.opensymphony.workflow.WorkflowException
Updates common metadata (last contributor, last modification date, ...).- Parameters:
content
- the content.user
- the user.- Throws:
com.opensymphony.workflow.WorkflowException
- if an error occurs.
-
-