Class UserSelectionAction
- java.lang.Object
-
- org.dspace.xmlworkflow.state.actions.Action
-
- org.dspace.xmlworkflow.state.actions.userassignment.UserSelectionAction
-
- Direct Known Subclasses:
AssignAction,AssignOriginalSubmitterAction,AutoAssignAction,ClaimAction,InheritUsersAction,NoUserSelectionAction
public abstract class UserSelectionAction extends Action
An action that associates workflow users with tasks. All the user selection actions must inherit from this action- Author:
- Bram De Schouwer (bram.deschouwer at dot com), Kevin Van de Velde (kevin at atmire dot com), Ben Bosman (ben at atmire dot com), Mark Diggory (markd at atmire dot com)
-
-
Field Summary
Fields Modifier and Type Field Description protected ClaimedTaskServiceclaimedTaskServiceprotected org.apache.logging.log4j.Loggerlogprotected PoolTaskServicepoolTaskServiceprotected WorkflowItemRoleServiceworkflowItemRoleService
-
Constructor Summary
Constructors Constructor Description UserSelectionAction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanisAuthorized(Context context, javax.servlet.http.HttpServletRequest request, XmlWorkflowItem wfi)Is this client authorized to act on this item?abstract booleanisFinished(XmlWorkflowItem wfi)abstract booleanisValidUserSelection(Context context, XmlWorkflowItem wfi, boolean hasUI)Check user constraints (enough users, group exists, ...).abstract voidregenerateTasks(Context c, XmlWorkflowItem wfi, RoleMembers roleMembers)Should a person have the option to repool the task the tasks will have to be regeneratedabstract booleanusesTaskPool()A boolean indicating wether or not the task pool is used for this type of user selection-
Methods inherited from class org.dspace.xmlworkflow.state.actions.Action
activate, addErrorField, alertUsersOnActivation, execute, getErrorFields, getOptions, getParent, getProvenanceStartId, isOptionInParam, setParent
-
-
-
-
Field Detail
-
log
protected org.apache.logging.log4j.Logger log
-
claimedTaskService
@Autowired(required=true) protected ClaimedTaskService claimedTaskService
-
poolTaskService
@Autowired(required=true) protected PoolTaskService poolTaskService
-
workflowItemRoleService
@Autowired(required=true) protected WorkflowItemRoleService workflowItemRoleService
-
-
Method Detail
-
isFinished
public abstract boolean isFinished(XmlWorkflowItem wfi)
-
isAuthorized
public boolean isAuthorized(Context context, javax.servlet.http.HttpServletRequest request, XmlWorkflowItem wfi) throws SQLException, AuthorizeException, IOException, WorkflowConfigurationException
Description copied from class:ActionIs this client authorized to act on this item?- Specified by:
isAuthorizedin classAction- Parameters:
context- current DSpace session.request- current client request.wfi- the workflow item in question.- Returns:
- true if authorized.
- Throws:
SQLException- passed through.AuthorizeException- passed through.IOException- passed through.WorkflowConfigurationException- if the workflow is mis-configured.
-
regenerateTasks
public abstract void regenerateTasks(Context c, XmlWorkflowItem wfi, RoleMembers roleMembers) throws SQLException, AuthorizeException, IOException
Should a person have the option to repool the task the tasks will have to be regenerated- Parameters:
c- the dspace contextwfi- the workflowitemroleMembers- the list of users for which tasks must be regenerated- Throws:
AuthorizeException- thrown if the current user isn't authorizedSQLException- An exception that provides information on a database access error or other errors.IOException- A general class of exceptions produced by failed or interrupted I/O operations.
-
isValidUserSelection
public abstract boolean isValidUserSelection(Context context, XmlWorkflowItem wfi, boolean hasUI) throws WorkflowConfigurationException, SQLException
Check user constraints (enough users, group exists, ...).- Parameters:
context- the dspace contextwfi- the workflow itemhasUI- whether or not the Step has a user interface- Returns:
- if the action is valid
- Throws:
WorkflowConfigurationException- if there is an error in the workflow configuration.SQLException- passed through.
-
usesTaskPool
public abstract boolean usesTaskPool()
A boolean indicating wether or not the task pool is used for this type of user selection- Returns:
- a boolean
-
-