Package lumis.content.workflow
Class WorkflowManager
- java.lang.Object
-
- lumis.content.workflow.WorkflowManager
-
- All Implemented Interfaces:
IWorkflowManager
public class WorkflowManager extends java.lang.Object implements IWorkflowManager
The default implementation for IWorkflowManager.- Since:
- 4.0.0
- Version:
- $Revision: 25082 $ $Date: 2022-06-17 13:20:15 -0300 (Fri, 17 Jun 2022) $
- See Also:
IWorkflowManager
-
-
Field Summary
-
Fields inherited from interface lumis.content.workflow.IWorkflowManager
ASSIGNED_TO_KEEP_SAME_VALUE
-
-
Constructor Summary
Constructors Constructor Description WorkflowManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
autoArchivePublishedContent(ContentLocale contentLocale, ITransaction transaction)
Used for the automatic content archiving process.boolean
contentMayBePublished(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, ITransaction transaction)
Deprecated.boolean
contentMayBePublished(SessionConfig sessionConfig, ContentLocale contentLocale, ITransaction transaction)
Indicates if a content version may be published according to its workflow state.void
createNewContentWorkflowMetaData(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, java.lang.String assignedTo, ITransaction transaction)
Deprecated.void
createNewContentWorkflowMetaData(SessionConfig sessionConfig, ContentLocale contentLocale, java.lang.String assignedTo, ITransaction transaction)
Creates a new content workflow metadata for a content locale.void
deleteAllContentWorkflowMetaData(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction)
Deletes all the workflow metadata that is assocated to a specified service instance.void
deleteContentWorkflowMetaData(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, ITransaction transaction)
Deprecated.void
deleteContentWorkflowMetaData(SessionConfig sessionConfig, ContentLocale contentLocale, ITransaction transaction)
Deletes the content workflow metadata of the given content locale.void
destroyServiceInstanceWorkflow(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction)
Destroys the service instance workflow, so that the service instance can be correctly removed.void
executeAction(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, java.lang.String performedTransitionId, java.lang.String newAssignedTo, ITransaction transaction)
Deprecated.void
executeAction(SessionConfig sessionConfig, ContentLocale contentLocale, java.lang.String performedTransitionId, java.lang.String newAssignedTo, ITransaction transaction)
Executes an action on a content's workflow.java.util.Collection<WorkflowStateConfig>
getAccessibleStates(SessionConfig sessionConfig, java.lang.String serviceInstanceId, boolean includeScopeAll, boolean includeScopeAssignedTo, ITransaction transaction)
Deprecated.java.util.Collection<WorkflowStateConfig>
getAccessibleStates(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.util.EnumSet<StateScope> scopes, ITransaction transaction)
Returns a collection of workflow's accessible states.java.util.Collection<WorkflowTransitionConfig>
getAccessibleTransitions(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, ITransaction transaction)
Deprecated.java.util.Collection<WorkflowTransitionConfig>
getAccessibleTransitions(SessionConfig sessionConfig, ContentLocale contentLocale, ITransaction transaction)
Returns the transitions that are accessible by thesessionConfig
's user for a specified contentLocale.java.util.Collection<WorkflowTransitionConfig>
getAccessibleTransitions(SessionConfig sessionConfig, WorkflowStateConfig state, java.lang.String serviceInstanceId, boolean includeScopeAssignedTo, ITransaction transaction)
Deprecated.java.util.Collection<WorkflowTransitionConfig>
getAccessibleTransitions(SessionConfig sessionConfig, WorkflowStateConfig state, java.lang.String serviceInstanceId, java.util.EnumSet<TransitionScope> scopes, ITransaction transaction)
Returns the transitions that are accessible by thesessionConfig
's user, originating from a specific workflow state in the specified service instance.java.util.Collection<WorkflowConfig>
getAllWorkflows(SessionConfig sessionConfig, ITransaction transaction)
Returns all registered workflows.ContentWorkflowMetaData
getContentWorkflowMetaData(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, ITransaction transaction)
Deprecated.ContentWorkflowMetaData
getContentWorkflowMetaData(SessionConfig sessionConfig, ContentLocale contentLocale, ITransaction transaction)
Returns the content workflow metadata for a content locale.java.util.Map<java.lang.String,java.lang.String>
getMetadataPrincipals(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction)
Returns a map of distinct principals that is assigned to content metadata in the given service instance.java.util.Collection<java.lang.String>
getPossibleAssignedTo(SessionConfig sessionConfig, java.lang.String serviceInstanceId, WorkflowStateConfig workflowState, ITransaction transaction)
Returns the possible assignedTo values for a workflow state.java.util.Collection<java.lang.String>
getPossibleAssignedToForAction(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, java.lang.String transitionId, ITransaction transaction)
Deprecated.protected java.util.Collection<java.lang.String>
getPrincipalRoles(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.lang.String principalId, ITransaction transaction)
WorkflowConfig
getServiceInstanceWorkflow(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction)
Returns the workflow of a service instance.WorkflowStateConfig
getState(SessionConfig sessionConfig, java.lang.String workflowId, java.lang.String stateId, ITransaction transaction)
Returns a workflow state.WorkflowTransitionConfig
getTransition(SessionConfig sessionConfig, java.lang.String workflowId, java.lang.String transitionId, ITransaction transaction)
Returns a workflow transition.java.util.List<WorkflowTransitionConfig>
getTransitionsByStateId(SessionConfig sessionConfig, java.lang.String workflowId, java.lang.String stateId, ITransaction transaction)
Returns the transitions for a workflow state.WorkflowConfig
getWorkflow(SessionConfig sessionConfig, java.lang.String workflowId, ITransaction transaction)
Returns a workflow.java.util.Collection<WorkflowPermission>
getWorkflowPermissions(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction)
Returns the permissions set for a workflow in a service instance.protected WorkflowConfig
getWorkflowToRegister(SessionConfig sessionConfig, java.lang.String workflowConfigPath, ITransaction transaction)
Returns theWorkflowConfig
instance to save in the register.boolean
hasEditPermission(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, ITransaction transaction)
Deprecated.boolean
hasEditPermission(SessionConfig sessionConfig, ContentLocale contentLocale, ITransaction transaction)
Returns true if the sessionConfig's user has edit permission to the specified content, according to the workflow's definition, state and assigned to.protected boolean
hasStatePermission(SessionConfig sessionConfig, java.util.Collection<java.lang.String> roles, WorkflowStateConfig state, java.util.EnumSet<StateScope> scopes, ITransaction transaction)
Checks if any of the roles have permission to the specified workflow state.protected boolean
hasTransitionPermission(SessionConfig sessionConfig, java.lang.String principalId, WorkflowTransitionConfig transition, ContentLocale contentLocale, java.lang.String serviceInstanceId, ITransaction transaction)
Checks if any of the principal have permission to the specified workflow transition.protected boolean
hasTransitionPermission(SessionConfig sessionConfig, java.util.Collection<java.lang.String> roles, WorkflowTransitionConfig transition, java.util.EnumSet<TransitionScope> transitionScopes, ITransaction transaction)
Checks if any of the roles have permission to the specified workflow transition.void
register(SessionConfig sessionConfig, java.lang.String workflowConfigPath, ITransaction transaction)
Register a workflow.void
registerOrUpdate(SessionConfig sessionConfig, java.lang.String workflowConfigPath, ITransaction transaction)
Register if workflow not exists.void
removeWorkflowPermissionsWithoutAcl()
Removes all workflow permissions entries where there does not exist an ACL entry for the same principal in the same service instance.void
setServiceInstanceWorkflow(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.lang.String workflowId, ITransaction transaction)
Sets the workflow to be used in a service instance.void
setWorkflowPermissions(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.util.Collection<WorkflowPermission> permissions, ITransaction transaction)
Updates the workflow permissions in a service instance.void
unregister(SessionConfig sessionConfig, java.lang.String workflowId, ITransaction transaction)
Removes a workflow from the register.void
updateRegister(SessionConfig sessionConfig, java.lang.String workflowId, ITransaction transaction)
Updates the register of a workflow.
-
-
-
Method Detail
-
getWorkflowToRegister
protected WorkflowConfig getWorkflowToRegister(SessionConfig sessionConfig, java.lang.String workflowConfigPath, ITransaction transaction) throws ManagerException, PortalException
Returns theWorkflowConfig
instance to save in the register.- Parameters:
sessionConfig
- the user session information.workflowConfigPath
- workflow configuration path.transaction
- the transaction for persistence access.- Returns:
- the
WorkflowConfig
instance to save in the register. - Throws:
ManagerException
PortalException
- Since:
- 4.0.5
-
register
public void register(SessionConfig sessionConfig, java.lang.String workflowConfigPath, ITransaction transaction) throws ManagerException, PortalException
Register a workflow.- Specified by:
register
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- the user session information.workflowConfigPath
- the path, relative to the definition directory, to the directory with the workflow's definition.transaction
- the transaction for persistence access.- Throws:
ManagerException
PortalException
-
updateRegister
public void updateRegister(SessionConfig sessionConfig, java.lang.String workflowId, ITransaction transaction) throws ManagerException, PortalException
Updates the register of a workflow.- Specified by:
updateRegister
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- the user session information.workflowId
- the workflow id.transaction
- the transaction for persistence access.- Throws:
ManagerException
PortalException
-
registerOrUpdate
public void registerOrUpdate(SessionConfig sessionConfig, java.lang.String workflowConfigPath, ITransaction transaction) throws ManagerException, PortalException
Register if workflow not exists. Otherwise, update. WARN, this method is accessed by reflection.- Parameters:
sessionConfig
- the session configuration.workflowConfigPath
- the workflow configuration path.transaction
- the transaction.- Throws:
ManagerException
PortalException
- Since:
- 12.4.0
-
unregister
public void unregister(SessionConfig sessionConfig, java.lang.String workflowId, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Removes a workflow from the register.- Specified by:
unregister
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- the user session information.workflowId
- the workflow's identifier.transaction
- the transaction for persistence access.- Throws:
PortalException
-
getAllWorkflows
public java.util.Collection<WorkflowConfig> getAllWorkflows(SessionConfig sessionConfig, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Returns all registered workflows.- Specified by:
getAllWorkflows
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- the user session information.transaction
- the transaction for persistence access.- Returns:
- a collection with all registered workflows.
- Throws:
PortalException
-
getWorkflow
public WorkflowConfig getWorkflow(SessionConfig sessionConfig, java.lang.String workflowId, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Returns a workflow.- Specified by:
getWorkflow
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- the user session information.workflowId
- the workflow's identifier.transaction
- the transaction for persistence access.- Returns:
- the workflow.
- Throws:
PortalException
-
getTransitionsByStateId
public java.util.List<WorkflowTransitionConfig> getTransitionsByStateId(SessionConfig sessionConfig, java.lang.String workflowId, java.lang.String stateId, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Returns the transitions for a workflow state.- Specified by:
getTransitionsByStateId
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- the user session information.workflowId
- the identifier of the state's workflow.stateId
- the state's identifier.transaction
- the transaction for persistence access.- Returns:
- a list with the state's transitions.
- Throws:
PortalException
-
hasStatePermission
protected boolean hasStatePermission(SessionConfig sessionConfig, java.util.Collection<java.lang.String> roles, WorkflowStateConfig state, java.util.EnumSet<StateScope> scopes, ITransaction transaction) throws PortalException
Checks if any of the roles have permission to the specified workflow state.- Parameters:
sessionConfig
- the current session information.roles
- a collection with the roles ids.state
- the workflow state.scopes
- the scopes to have the permission verifiedtransaction
- the transaction for persistence access.- Returns:
- true if any roles has permission to the specified workflow resource, false otherwise.
- Throws:
PortalException
- Since:
- 6.0.2
-
hasTransitionPermission
protected boolean hasTransitionPermission(SessionConfig sessionConfig, java.util.Collection<java.lang.String> roles, WorkflowTransitionConfig transition, java.util.EnumSet<TransitionScope> transitionScopes, ITransaction transaction) throws PortalException
Checks if any of the roles have permission to the specified workflow transition.- Parameters:
sessionConfig
- the current session information.roles
- a collection with the roles ids.transition
- the workflow transition.scopes
- the scopes to have the permission verifiedtransaction
- the transaction for persistence access.- Returns:
- true if any roles has permission to the specified workflow resource, false otherwise.
- Throws:
PortalException
- Since:
- 6.0.2
-
getPrincipalRoles
protected java.util.Collection<java.lang.String> getPrincipalRoles(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.lang.String principalId, ITransaction transaction) throws PortalException
- Throws:
PortalException
-
hasTransitionPermission
protected boolean hasTransitionPermission(SessionConfig sessionConfig, java.lang.String principalId, WorkflowTransitionConfig transition, ContentLocale contentLocale, java.lang.String serviceInstanceId, ITransaction transaction) throws PortalException
Checks if any of the principal have permission to the specified workflow transition.- Parameters:
sessionConfig
- the current session information.principalId
- the principal id.transition
- the workflow transition.contentLocale
- the content locale specific object. If null, assignedTo scoped permissions will be ignored.serviceInstanceId
- the content service instance id.transaction
- the transaction for persistence access.- Returns:
- true if the principal has permission to access the specified workflow resource, false otherwise.
- Throws:
PortalException
- Since:
- 6.0.2
-
getAccessibleTransitions
@Deprecated public java.util.Collection<WorkflowTransitionConfig> getAccessibleTransitions(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, ITransaction transaction) throws PortalException
Deprecated.Description copied from interface:IWorkflowManager
Returns the transitions that are accessible by thesessionConfig
's user for a specified content.- Specified by:
getAccessibleTransitions
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- the user session information.itemId
- the content's itemId.serviceInstanceId
- the content's service instance identifier.sourceId
- the content's source identifier.transaction
- the transaction for persistence access.- Returns:
- a collection with the transitions.
- Throws:
PortalException
-
getAccessibleTransitions
public java.util.Collection<WorkflowTransitionConfig> getAccessibleTransitions(SessionConfig sessionConfig, ContentLocale contentLocale, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Returns the transitions that are accessible by thesessionConfig
's user for a specified contentLocale.- Specified by:
getAccessibleTransitions
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- the user session information.contentLocale
- the contentLocale.transaction
- the transaction for persistence access.- Returns:
- a collection with the transitions.
- Throws:
PortalException
-
getAccessibleTransitions
@Deprecated public java.util.Collection<WorkflowTransitionConfig> getAccessibleTransitions(SessionConfig sessionConfig, WorkflowStateConfig state, java.lang.String serviceInstanceId, boolean includeScopeAssignedTo, ITransaction transaction) throws PortalException
Deprecated.Description copied from interface:IWorkflowManager
Returns the transitions that are accessible by thesessionConfig
's user, originating from a specific workflow state in the specified service instance.- Specified by:
getAccessibleTransitions
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- the user session information.state
- the transition state origin.serviceInstanceId
- the service instance identifier.includeScopeAssignedTo
- if true, transitions that the user has permission to access only when the content is assigned to him are also included in the returned collection.transaction
- the transaction for persistence access.- Returns:
- a collection with the transitions.
- Throws:
PortalException
-
getAccessibleStates
@Deprecated public java.util.Collection<WorkflowStateConfig> getAccessibleStates(SessionConfig sessionConfig, java.lang.String serviceInstanceId, boolean includeScopeAll, boolean includeScopeAssignedTo, ITransaction transaction) throws PortalException
Deprecated.Description copied from interface:IWorkflowManager
Returns a collection of workflow's accessible states.- Specified by:
getAccessibleStates
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.serviceInstanceId
- the content service instance id.includeScopeAll
- if the states with permission scope all are to be included.includeScopeAssignedTo
- if the states with permission scope assigned to are to be included.transaction
- the transaction for persistence access.- Returns:
- a collection with the workflow's accessible states.
- Throws:
PortalException
-
getState
public WorkflowStateConfig getState(SessionConfig sessionConfig, java.lang.String workflowId, java.lang.String stateId, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Returns a workflow state.- Specified by:
getState
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- the user session information.workflowId
- the identifier of the state's workflow.stateId
- the state's identifier.transaction
- the transaction for persistence access.- Returns:
- the state.
- Throws:
PortalException
-
getTransition
public WorkflowTransitionConfig getTransition(SessionConfig sessionConfig, java.lang.String workflowId, java.lang.String transitionId, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Returns a workflow transition.- Specified by:
getTransition
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- the user session information.workflowId
- the identifier of the state's workflow.transitionId
- the transition's identifier.transaction
- the transaction for persistence access.- Returns:
- the transition.
- Throws:
PortalException
-
getServiceInstanceWorkflow
public WorkflowConfig getServiceInstanceWorkflow(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Returns the workflow of a service instance.- Specified by:
getServiceInstanceWorkflow
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.serviceInstanceId
- the service instance's id.transaction
- the transaction for persistence access.- Throws:
PortalException
-
setServiceInstanceWorkflow
public void setServiceInstanceWorkflow(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.lang.String workflowId, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Sets the workflow to be used in a service instance.- Specified by:
setServiceInstanceWorkflow
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.serviceInstanceId
- the service instance's id.workflowId
- the workflow's id.transaction
- the transaction for persistence access.- Throws:
PortalException
-
destroyServiceInstanceWorkflow
public void destroyServiceInstanceWorkflow(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Destroys the service instance workflow, so that the service instance can be correctly removed. This method should be called only prior to a service instance removal.- Specified by:
destroyServiceInstanceWorkflow
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.serviceInstanceId
- the service instance's id.transaction
- the transaction for persistence access.- Throws:
PortalException
-
deleteAllContentWorkflowMetaData
public void deleteAllContentWorkflowMetaData(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Deletes all the workflow metadata that is assocated to a specified service instance.- Specified by:
deleteAllContentWorkflowMetaData
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- the user session information.serviceInstanceId
- the service instance identifier.transaction
- the transaction for persistence access.- Throws:
PortalException
-
getWorkflowPermissions
public java.util.Collection<WorkflowPermission> getWorkflowPermissions(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Returns the permissions set for a workflow in a service instance.- Specified by:
getWorkflowPermissions
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.serviceInstanceId
- the service instance's id.transaction
- the transaction for persistence access.- Returns:
- a WorkflowPermission collection.
- Throws:
PortalException
-
setWorkflowPermissions
public void setWorkflowPermissions(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.util.Collection<WorkflowPermission> permissions, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Updates the workflow permissions in a service instance.- Specified by:
setWorkflowPermissions
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.serviceInstanceId
- the service instance's id.permissions
- the set of permissions to be set in the service instance. All previous permissions will be deleted.transaction
- the transaction for persistence access.- Throws:
PortalException
-
getContentWorkflowMetaData
public ContentWorkflowMetaData getContentWorkflowMetaData(SessionConfig sessionConfig, ContentLocale contentLocale, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Returns the content workflow metadata for a content locale.- Specified by:
getContentWorkflowMetaData
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.contentLocale
- the content locale-specific object.transaction
- the transaction for persistence access.- Returns:
- the content workflow metadata.
- Throws:
PortalException
-
getContentWorkflowMetaData
@Deprecated public ContentWorkflowMetaData getContentWorkflowMetaData(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, ITransaction transaction) throws PortalException
Deprecated.Description copied from interface:IWorkflowManager
Returns the content workflow metadata for a content.- Specified by:
getContentWorkflowMetaData
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.itemId
- the content's item id.serviceInstanceId
- the content's service instance id.sourceId
- the content's source id.transaction
- the transaction for persistence access.- Returns:
- the content workflow metadata.
- Throws:
PortalException
-
createNewContentWorkflowMetaData
@Deprecated public void createNewContentWorkflowMetaData(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, java.lang.String assignedTo, ITransaction transaction) throws PortalException
Deprecated.Description copied from interface:IWorkflowManager
Creates the content workflow metadata for a new content.- Specified by:
createNewContentWorkflowMetaData
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.itemId
- the content's item id.serviceInstanceId
- the content's service instance id.sourceId
- the content's source id.assignedTo
- the principal identifier to be assigned to.transaction
- the transaction for persistence access.- Throws:
PortalException
-
createNewContentWorkflowMetaData
public void createNewContentWorkflowMetaData(SessionConfig sessionConfig, ContentLocale contentLocale, java.lang.String assignedTo, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Creates a new content workflow metadata for a content locale.- Specified by:
createNewContentWorkflowMetaData
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.contentLocale
- the content locale.assignedTo
- the principal identifier to be assigned to.transaction
- the transaction for persistence access.- Throws:
PortalException
-
deleteContentWorkflowMetaData
@Deprecated public void deleteContentWorkflowMetaData(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, ITransaction transaction) throws PortalException
Deprecated.Description copied from interface:IWorkflowManager
Deletes the content workflow metadata of the given content.- Specified by:
deleteContentWorkflowMetaData
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.itemId
- the content's item id.serviceInstanceId
- the content's service instance id.sourceId
- the content's source id.transaction
- the transaction for persistence access.- Throws:
PortalException
-
deleteContentWorkflowMetaData
public void deleteContentWorkflowMetaData(SessionConfig sessionConfig, ContentLocale contentLocale, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Deletes the content workflow metadata of the given content locale.- Specified by:
deleteContentWorkflowMetaData
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.contentLocale
- the content locale.transaction
- the transaction for persistence access.- Throws:
PortalException
-
executeAction
@Deprecated public void executeAction(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, java.lang.String performedTransitionId, java.lang.String newAssignedTo, ITransaction transaction) throws PortalException
Deprecated.Description copied from interface:IWorkflowManager
Executes an action on a content's workflow.- Specified by:
executeAction
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.itemId
- the content's item id.serviceInstanceId
- the content's service instance id.sourceId
- the content's source id.performedTransitionId
- the transition action performed. If null, no transition is performed.newAssignedTo
- the new assigned to principal id.transaction
- the transaction for persistence access.- Throws:
PortalException
-
executeAction
public void executeAction(SessionConfig sessionConfig, ContentLocale contentLocale, java.lang.String performedTransitionId, java.lang.String newAssignedTo, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Executes an action on a content's workflow.After the action is executed, this method sends a
WorkflowActionExecutedEvent
.- Specified by:
executeAction
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.contentLocale
- the content locale specific object.performedTransitionId
- the transition action performed. If null, no transition is performed.newAssignedTo
- the new assigned to principal id.transaction
- the transaction for persistence access.- Throws:
PortalException
-
hasEditPermission
@Deprecated public boolean hasEditPermission(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, ITransaction transaction) throws PortalException
Deprecated.Description copied from interface:IWorkflowManager
Returns true if the sessionConfig's user has edit permission to the specified item, according to the workflow's definition, state and assigned to.If there is no workflow, or no content workflow metadata, true is returned.
- Specified by:
hasEditPermission
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.itemId
- the content's item id.serviceInstanceId
- the content's service instance id.sourceId
- the content's source id.transaction
- the transaction for persistence access.- Returns:
- true if the user has the permission, false otherwise.
- Throws:
PortalException
-
hasEditPermission
public boolean hasEditPermission(SessionConfig sessionConfig, ContentLocale contentLocale, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Returns true if the sessionConfig's user has edit permission to the specified content, according to the workflow's definition, state and assigned to.If there is no workflow, or no content workflow metadata, true is returned.
- Specified by:
hasEditPermission
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.contentLocale
- the content.transaction
- the transaction for persistence access.- Returns:
- true if the user has the permission, false otherwise.
- Throws:
PortalException
-
getPossibleAssignedToForAction
@Deprecated public java.util.Collection<java.lang.String> getPossibleAssignedToForAction(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, java.lang.String transitionId, ITransaction transaction) throws PortalException
Deprecated.Description copied from interface:IWorkflowManager
Returns the possible assignedTo values for a workflow transition.- Specified by:
getPossibleAssignedToForAction
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.serviceInstanceId
- the content's service instance id.sourceId
- the content's source id.transitionId
- the workflow's transition id.transaction
- the transaction for persistence access.- Returns:
- a collection of principals ids that may be assigned to a content in the given workflow state.
- Throws:
PortalException
-
getPossibleAssignedTo
public java.util.Collection<java.lang.String> getPossibleAssignedTo(SessionConfig sessionConfig, java.lang.String serviceInstanceId, WorkflowStateConfig workflowState, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Returns the possible assignedTo values for a workflow state.- Specified by:
getPossibleAssignedTo
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.serviceInstanceId
- the service instance identifier.workflowState
- the workflow's state.transaction
- the transaction for persistence access.- Returns:
- a collection of principals identifiers that may be assigned to a content in the specified state.
- Throws:
PortalException
-
contentMayBePublished
@Deprecated public boolean contentMayBePublished(SessionConfig sessionConfig, java.lang.String itemId, java.lang.String serviceInstanceId, java.lang.String sourceId, ITransaction transaction) throws PortalException
Deprecated.- Specified by:
contentMayBePublished
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.itemId
- the content's item id.serviceInstanceId
- the content's service instance id.sourceId
- the content's source id.transaction
- the transaction for persistence access.- Returns:
- true if the content may be published, according to its workflow state, false otherwise.
- Throws:
PortalException
-
contentMayBePublished
public boolean contentMayBePublished(SessionConfig sessionConfig, ContentLocale contentLocale, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Indicates if a content version may be published according to its workflow state.- Specified by:
contentMayBePublished
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.contentLocale
- the content version.transaction
- the transaction for persistence access.- Returns:
- true if it may be published, according to its workflow state, false otherwise.
- Throws:
PortalException
-
autoArchivePublishedContent
public boolean autoArchivePublishedContent(ContentLocale contentLocale, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Used for the automatic content archiving process. Performs a transition to a directly reachable archival state, if any.If the given content version is not in a published state or is already in an archived state or is not after its publishing period then nothing is done.
- Specified by:
autoArchivePublishedContent
in interfaceIWorkflowManager
- Parameters:
contentLocale
- the content version.transaction
- the transaction for persistence access.- Returns:
- true if the content version was archived, or false if nothing was done.
- Throws:
PortalException
-
removeWorkflowPermissionsWithoutAcl
public void removeWorkflowPermissionsWithoutAcl() throws PortalException
Removes all workflow permissions entries where there does not exist an ACL entry for the same principal in the same service instance. Called when ACLs are updated.- Throws:
PortalException
- Since:
- 5.0.0
-
getMetadataPrincipals
public java.util.Map<java.lang.String,java.lang.String> getMetadataPrincipals(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction) throws PortalException
Returns a map of distinct principals that is assigned to content metadata in the given service instance.- Parameters:
sessionConfig
- the user session information.serviceInstanceId
- the service instance's id.transaction
- the transaction for persistence access.- Returns:
- map of principals.
- Throws:
PortalException
- Since:
- 5.6.1
-
getAccessibleStates
public java.util.Collection<WorkflowStateConfig> getAccessibleStates(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.util.EnumSet<StateScope> scopes, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Returns a collection of workflow's accessible states.- Specified by:
getAccessibleStates
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.serviceInstanceId
- the content service instance id.scopes
- states scope that the user has permission to accessStateScope
}transaction
- the transaction for persistence access.- Returns:
- a collection with the workflow's accessible states.
- Throws:
PortalException
-
getAccessibleTransitions
public java.util.Collection<WorkflowTransitionConfig> getAccessibleTransitions(SessionConfig sessionConfig, WorkflowStateConfig state, java.lang.String serviceInstanceId, java.util.EnumSet<TransitionScope> scopes, ITransaction transaction) throws PortalException
Description copied from interface:IWorkflowManager
Returns the transitions that are accessible by thesessionConfig
's user, originating from a specific workflow state in the specified service instance.- Specified by:
getAccessibleTransitions
in interfaceIWorkflowManager
- Parameters:
sessionConfig
- user session information.state
- the transition state origin.serviceInstanceId
- the content service instance id.scopes
- transitions scopes that the user has permission to accessTransitionScope
}transaction
- the transaction for persistence access.- Throws:
PortalException
-
-