Package org.ametys.cms.repository
Class WorkflowAwareContentHelper
- java.lang.Object
-
- org.ametys.cms.repository.WorkflowAwareContentHelper
-
public final class WorkflowAwareContentHelper extends Object
Provides helper methods to use theWorkflowAwareContentAPI onJCRAmetysObjects.
-
-
Field Summary
Fields Modifier and Type Field Description static StringMETADATA_CURRENT_STEP_IDConstants for currentStepId Metadata*static StringMETADATA_LAST_PROPOSAL_DATEName of the metadata storing the proposal date.static StringMETADATA_WORKFLOW_IDConstants for workflowId Metadata*
-
Constructor Summary
Constructors Modifier Constructor Description privateWorkflowAwareContentHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longgetCurrentStepId(JCRAmetysObject object)Get an object's current step ID.static ZonedDateTimegetProposalDate(ModifiableDataAwareVersionableAmetysObject object)Get an object's proposal date.static longgetWorkflowId(JCRAmetysObject object)Get an object's workflow ID.static voidremoveWorkflowId(JCRAmetysObject object)Remove the workflow ID property if exists on an objectstatic voidsetCurrentStepId(JCRAmetysObject object, long stepId)Set an object's current step ID.static voidsetProposalDate(ModifiableDataAwareVersionableAmetysObject object, ZonedDateTime proposalDate)Set an object's proposal date.static voidsetWorkflowId(JCRAmetysObject object, long workflowId)Set an object's workflow ID.
-
-
-
Field Detail
-
METADATA_WORKFLOW_ID
public static final String METADATA_WORKFLOW_ID
Constants for workflowId Metadata*- See Also:
- Constant Field Values
-
METADATA_CURRENT_STEP_ID
public static final String METADATA_CURRENT_STEP_ID
Constants for currentStepId Metadata*- See Also:
- Constant Field Values
-
METADATA_LAST_PROPOSAL_DATE
public static final String METADATA_LAST_PROPOSAL_DATE
Name of the metadata storing the proposal date.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WorkflowAwareContentHelper
private WorkflowAwareContentHelper()
-
-
Method Detail
-
getWorkflowId
public static long getWorkflowId(JCRAmetysObject object) throws AmetysRepositoryException
Get an object's workflow ID.- Parameters:
object- the object.- Returns:
- the object's workflow ID.
- Throws:
AmetysRepositoryException- if an error occurs.
-
setWorkflowId
public static void setWorkflowId(JCRAmetysObject object, long workflowId) throws AmetysRepositoryException
Set an object's workflow ID.- Parameters:
object- the object.workflowId- the workflow ID to set.- Throws:
AmetysRepositoryException- if an error occurs.
-
removeWorkflowId
public static void removeWorkflowId(JCRAmetysObject object)
Remove the workflow ID property if exists on an object- Parameters:
object- The Ametys object
-
getCurrentStepId
public static long getCurrentStepId(JCRAmetysObject object) throws AmetysRepositoryException
Get an object's current step ID.- Parameters:
object- the object.- Returns:
- the object's current step ID.
- Throws:
AmetysRepositoryException- if an error occurs.
-
setCurrentStepId
public static void setCurrentStepId(JCRAmetysObject object, long stepId) throws AmetysRepositoryException
Set an object's current step ID.- Parameters:
object- the object.stepId- the current step ID to set.- Throws:
AmetysRepositoryException- if an error occurs.
-
getProposalDate
public static ZonedDateTime getProposalDate(ModifiableDataAwareVersionableAmetysObject object) throws AmetysRepositoryException
Get an object's proposal date.- Parameters:
object- the object.- Returns:
- the object's proposal date.
- Throws:
AmetysRepositoryException- if an error occurs.
-
setProposalDate
public static void setProposalDate(ModifiableDataAwareVersionableAmetysObject object, ZonedDateTime proposalDate) throws AmetysRepositoryException
Set an object's proposal date.- Parameters:
object- the object.proposalDate- the proposal date to set.- Throws:
AmetysRepositoryException- if an error occurs.
-
-