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
,EnhancedFunction
,Initializable
,LogEnabled
,Serviceable
- Direct Known Subclasses:
AbstractCoursePartFunction
,CreateVersionFunction
,RemoveLiveLabelFunction
,ResetWorkflowIdFunction
,RestoreRevisionFunction
,SetCurrentStepIdAndNotifyFunction
,SetNotifiedFunction
,ValidateContentFunction
public abstract class AbstractContentFunction
extends AbstractContentWorkflowComponent
implements EnhancedFunction, Initializable
Abstract workflow function working on a Content, which provides common content methods.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.plugins.workflow.EnhancedFunction
EnhancedFunction.FunctionArgument
-
Field Summary
Modifier and TypeFieldDescriptionprotected ObservationManager
The observation managerprotected 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
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.workflow.EnhancedFunction
getArguments, getDescription
Methods inherited from interface com.opensymphony.workflow.FunctionProvider
execute
-
Field Details
-
_workflowProvider
The workflow provider. -
_observationManager
The observation manager
-
-
Constructor Details
-
AbstractContentFunction
public AbstractContentFunction()
-
-
Method Details
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
_addLockToken
protected void _addLockToken(WorkflowAwareContent content) throws com.opensymphony.workflow.WorkflowException, javax.jcr.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.javax.jcr.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, javax.jcr.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.javax.jcr.RepositoryException
- if an error occurs.
-