Package org.ametys.cms.workflow
Class AbstractContentFunction
- java.lang.Object
-
- org.ametys.plugins.workflow.AbstractWorkflowComponent
-
- org.ametys.cms.workflow.AbstractContentWorkflowComponent
-
- org.ametys.cms.workflow.AbstractContentFunction
-
- All Implemented Interfaces:
com.opensymphony.workflow.FunctionProvider
,Initializable
,LogEnabled
,Serviceable
- Direct Known Subclasses:
CreateVersionFunction
,MoveLiveTagOnCoursePartFunction
,RemoveLiveLabelFunction
,RestoreRevisionFunction
,SetCurrentStepIdAndNotifyFunction
,SetNotifiedFunction
,ValidateContentFunction
public abstract class AbstractContentFunction extends AbstractContentWorkflowComponent implements com.opensymphony.workflow.FunctionProvider, Initializable
Abstract workflow function working on a Content, which provides common content methods.
-
-
Field Summary
Fields Modifier and Type Field Description protected ObservationManager
_observationManager
The observation managerprotected WorkflowProvider
_workflowProvider
The workflow provider.-
Fields inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
_contentHelper, CONTENT_KEY, HAS_CHANGED_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 AbstractContentFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_addLabel(WorkflowAwareContent content, String label)
Add a label on the content.protected void
_addLockToken(WorkflowAwareContent content)
Add the content lock token to the current session if the content is locked.protected void
_createVersion(WorkflowAwareContent content)
Persists the current version and create a new one.protected void
_setCurrentStepId(WorkflowAwareContent content, Map transientVars)
Set the content's current step ID without notifying the observers that the content's workflow has changed.protected void
_setCurrentStepIdAndNotify(WorkflowAwareContent content, Map transientVars)
Set the content's current step ID and notify the observers that the content's workflow has changed.void
initialize()
-
Methods inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
getContent, service
-
Methods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
addWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser
-
-
-
-
Field Detail
-
_workflowProvider
protected WorkflowProvider _workflowProvider
The workflow provider.
-
_observationManager
protected ObservationManager _observationManager
The observation manager
-
-
Constructor Detail
-
AbstractContentFunction
public AbstractContentFunction()
-
-
Method Detail
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
_addLockToken
protected void _addLockToken(WorkflowAwareContent content) throws com.opensymphony.workflow.WorkflowException, RepositoryException
Add the content lock token to the current session if the content is locked.- Parameters:
content
- the content.- Throws:
com.opensymphony.workflow.WorkflowException
- if an error occurs.RepositoryException
- if a repository error occurs.
-
_setCurrentStepId
protected void _setCurrentStepId(WorkflowAwareContent content, Map transientVars) throws com.opensymphony.workflow.WorkflowException
Set the content's current step ID without notifying the observers that the content's workflow has changed.- Parameters:
content
- the content.transientVars
- The workflow transient vars.- Throws:
com.opensymphony.workflow.WorkflowException
- if an error occurs.
-
_setCurrentStepIdAndNotify
protected void _setCurrentStepIdAndNotify(WorkflowAwareContent content, Map transientVars) throws com.opensymphony.workflow.WorkflowException
Set the content's current step ID and notify the observers that the content's workflow has changed.- Parameters:
content
- the content.transientVars
- The workflow transient vars.- Throws:
com.opensymphony.workflow.WorkflowException
- if an error occurs.
-
_createVersion
protected void _createVersion(WorkflowAwareContent content) throws com.opensymphony.workflow.WorkflowException
Persists the current version and create a new one.- Parameters:
content
- the content.- Throws:
com.opensymphony.workflow.WorkflowException
- if an error occurs.
-
_addLabel
protected void _addLabel(WorkflowAwareContent content, String label) throws com.opensymphony.workflow.WorkflowException, RepositoryException
Add a label on the content.- Parameters:
content
- the content.label
- the label to add.- Throws:
com.opensymphony.workflow.WorkflowException
- if an error occurs.RepositoryException
- if an error occurs.
-
-