Package org.ametys.plugins.bpm.jcr
Class JCRWorkflow
- java.lang.Object
-
- org.ametys.plugins.repository.AbstractAmetysObject
-
- org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
-
- org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject<JCRWorkflowFactory>
-
- org.ametys.plugins.bpm.jcr.JCRWorkflow
-
- All Implemented Interfaces:
Workflow
,ACLAmetysObject
,AmetysObject
,JCRAmetysObject
,JCRTraversableAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,ModifiableTraversableAmetysObject
,RemovableAmetysObject
,TraversableAmetysObject
public class JCRWorkflow extends DefaultTraversableAmetysObject<JCRWorkflowFactory> implements Workflow
Class representing of workflow, backed by a JCR node.
-
-
Field Summary
Fields Modifier and Type Field Description private static String
NODE_NAME_ALLOWED_GROUP
private static String
NODE_NAME_ALLOWED_GROUPS
private static String
NODE_NAME_ALLOWED_USER
private static String
NODE_NAME_ALLOWED_USERS
private static String
NODE_NAME_ATTACHMENTS
private static String
NODE_NAME_OWNER
private static String
NODE_NAME_WORKFLOW_VARIABLES
private static String
PROPERTY_DESCRIPTION
private static String
PROPERTY_TITLE
private static String
PROPERTY_WORKFLOW_DEFINITION
-
Constructor Summary
Constructors Constructor Description JCRWorkflow(Node node, String parentPath, JCRWorkflowFactory factory)
Creates anJCRWorkflow
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GroupIdentity[]
getAllowedGroups()
Get the list of groups allowed to create a process from this workflowUserIdentity[]
getAllowedUsers()
Get the list of users allowed to create a process from this workflowString
getDescription()
Get the workflow descriptionUserIdentity
getOwner()
Get the owner of the workflowResourceCollection
getRootAttachments()
Retrieves the attachments root nodeString
getTitle()
Get the workflow titleObject
getVariable(String variableName)
Get the value of a variable of the workflowString
getWorkflowDefinition()
Get the workflow definition linked to this workflowvoid
setAllowedGroups(GroupIdentity[] allowedGroups)
Set the list of groups allowed to create a process from this workflowvoid
setAllowedUsers(UserIdentity[] allowedUsers)
Set the list of users allowed to create a process from this workflowvoid
setDescription(String description)
Set the workflow descriptionvoid
setOwner(UserIdentity owner)
Set the owner of the workflowvoid
setTitle(String title)
Set the workflow titlevoid
setVariable(String variableName, Object value)
Set the value of a variable of the workflowvoid
setWorkflowDefinition(String workflowDefId)
Set the workflow definition linked to this workflow-
Methods inherited from class org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, createChild, disallowInheritance, getAllowedGroups, getAllowedProfilesForAnonymous, getAllowedProfilesForAnyConnectedUser, getAllowedProfilesForGroups, getAllowedProfilesForUser, getAllowedProfilesForUsers, getAllowedUsers, getChild, getChildren, getDeniedGroups, getDeniedProfilesForAnonymous, getDeniedProfilesForAnyConnectedUser, getDeniedProfilesForGroups, getDeniedProfilesForUser, getDeniedProfilesForUsers, getDeniedUsers, hasChild, isInheritanceDisallowed, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers
-
Methods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChanges
-
Methods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
Methods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNode
-
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
-
Methods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolder
-
Methods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
-
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChildAt, getChildPosition
-
-
-
-
Field Detail
-
PROPERTY_DESCRIPTION
private static final String PROPERTY_DESCRIPTION
- See Also:
- Constant Field Values
-
PROPERTY_TITLE
private static final String PROPERTY_TITLE
- See Also:
- Constant Field Values
-
NODE_NAME_OWNER
private static final String NODE_NAME_OWNER
- See Also:
- Constant Field Values
-
PROPERTY_WORKFLOW_DEFINITION
private static final String PROPERTY_WORKFLOW_DEFINITION
- See Also:
- Constant Field Values
-
NODE_NAME_ALLOWED_USERS
private static final String NODE_NAME_ALLOWED_USERS
- See Also:
- Constant Field Values
-
NODE_NAME_ALLOWED_USER
private static final String NODE_NAME_ALLOWED_USER
- See Also:
- Constant Field Values
-
NODE_NAME_ALLOWED_GROUPS
private static final String NODE_NAME_ALLOWED_GROUPS
- See Also:
- Constant Field Values
-
NODE_NAME_ALLOWED_GROUP
private static final String NODE_NAME_ALLOWED_GROUP
- See Also:
- Constant Field Values
-
NODE_NAME_WORKFLOW_VARIABLES
private static final String NODE_NAME_WORKFLOW_VARIABLES
- See Also:
- Constant Field Values
-
NODE_NAME_ATTACHMENTS
private static final String NODE_NAME_ATTACHMENTS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JCRWorkflow
public JCRWorkflow(Node node, String parentPath, JCRWorkflowFactory factory)
Creates anJCRWorkflow
.- Parameters:
node
- the node backing thisAmetysObject
parentPath
- the parentPath in the Ametys hierarchyfactory
- the JCRWorkflowFactory which created the AmetysObject
-
-
Method Detail
-
getTitle
public String getTitle() throws AmetysRepositoryException
Description copied from interface:Workflow
Get the workflow title- Specified by:
getTitle
in interfaceWorkflow
- Returns:
- The workflow title
- Throws:
AmetysRepositoryException
- If a repository error occurred
-
setTitle
public void setTitle(String title)
Description copied from interface:Workflow
Set the workflow title
-
getWorkflowDefinition
public String getWorkflowDefinition() throws AmetysRepositoryException
Description copied from interface:Workflow
Get the workflow definition linked to this workflow- Specified by:
getWorkflowDefinition
in interfaceWorkflow
- Returns:
- The workflow definition id
- Throws:
AmetysRepositoryException
- If a repository error occurred
-
setWorkflowDefinition
public void setWorkflowDefinition(String workflowDefId)
Description copied from interface:Workflow
Set the workflow definition linked to this workflow- Specified by:
setWorkflowDefinition
in interfaceWorkflow
- Parameters:
workflowDefId
- The workflow definition id
-
getDescription
public String getDescription() throws AmetysRepositoryException
Description copied from interface:Workflow
Get the workflow description- Specified by:
getDescription
in interfaceWorkflow
- Returns:
- The description
- Throws:
AmetysRepositoryException
- If a repository error occurred
-
setDescription
public void setDescription(String description)
Description copied from interface:Workflow
Set the workflow description- Specified by:
setDescription
in interfaceWorkflow
- Parameters:
description
- The description
-
getVariable
public Object getVariable(String variableName) throws AmetysRepositoryException
Description copied from interface:Workflow
Get the value of a variable of the workflow- Specified by:
getVariable
in interfaceWorkflow
- Parameters:
variableName
- The name of the variable to retrieve- Returns:
- The value of the variable
- Throws:
AmetysRepositoryException
- If a repository error occurred
-
setVariable
public void setVariable(String variableName, Object value)
Description copied from interface:Workflow
Set the value of a variable of the workflow- Specified by:
setVariable
in interfaceWorkflow
- Parameters:
variableName
- The name of the variable to setvalue
- The value to set
-
getOwner
public UserIdentity getOwner() throws AmetysRepositoryException
Description copied from interface:Workflow
Get the owner of the workflow- Specified by:
getOwner
in interfaceWorkflow
- Returns:
- The owner
- Throws:
AmetysRepositoryException
- If a repository error occurred
-
setOwner
public void setOwner(UserIdentity owner)
Description copied from interface:Workflow
Set the owner of the workflow
-
getAllowedUsers
public UserIdentity[] getAllowedUsers() throws AmetysRepositoryException
Description copied from interface:Workflow
Get the list of users allowed to create a process from this workflow- Specified by:
getAllowedUsers
in interfaceWorkflow
- Returns:
- The list of allowed users
- Throws:
AmetysRepositoryException
- If a repository error occurred
-
setAllowedUsers
public void setAllowedUsers(UserIdentity[] allowedUsers)
Description copied from interface:Workflow
Set the list of users allowed to create a process from this workflow- Specified by:
setAllowedUsers
in interfaceWorkflow
- Parameters:
allowedUsers
- The list of allowed users
-
getAllowedGroups
public GroupIdentity[] getAllowedGroups() throws AmetysRepositoryException
Description copied from interface:Workflow
Get the list of groups allowed to create a process from this workflow- Specified by:
getAllowedGroups
in interfaceWorkflow
- Returns:
- The list of allowed groups
- Throws:
AmetysRepositoryException
- If a repository error occurred
-
setAllowedGroups
public void setAllowedGroups(GroupIdentity[] allowedGroups)
Description copied from interface:Workflow
Set the list of groups allowed to create a process from this workflow- Specified by:
setAllowedGroups
in interfaceWorkflow
- Parameters:
allowedGroups
- The list of allowed groups
-
getRootAttachments
public ResourceCollection getRootAttachments() throws AmetysRepositoryException
Description copied from interface:Workflow
Retrieves the attachments root node- Specified by:
getRootAttachments
in interfaceWorkflow
- Returns:
- The the attachments root node
- Throws:
AmetysRepositoryException
- if an error occurs.
-
-