Class Action
java.lang.Object
org.dspace.xmlworkflow.state.actions.Action
- Direct Known Subclasses:
ProcessingAction,UserSelectionAction
This abstract class represents a workflow action.
Each step in the workflow consists of a number of actions.
This abstract action contains some utility methods and the methods
that each of these actions must implement including:
activating, execution, ....
- 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)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidactivate(Context c, XmlWorkflowItem wf) Called when a workflow item becomes eligible for this Action.voidAdds info in the metadata field dc.description.provenance about item being approved containing in which step it was approved, which user approved it and the timeprotected voidaddErrorField(jakarta.servlet.http.HttpServletRequest request, String fieldName) Add a single UI field to the list of all error fields (which can later be retrieved using getErrorFields())voidalertUsersOnActivation(Context c, XmlWorkflowItem wfi, RoleMembers members) Notify action role members that an item requires action.abstract ActionResultexecute(Context c, XmlWorkflowItem wfi, Step step, jakarta.servlet.http.HttpServletRequest request) Called when the action is to be performed.protected List<ActionAdvancedInfo>Returns a list of advanced info required by the advanced optionsReturns a list of advanced options that the user can select at this actionstatic ListgetErrorFields(jakarta.servlet.http.HttpServletRequest request) Return a list of all UI fields which had errors that occurred during the workflow processing.Returns a list of options that the user can select at this action which results in the next step in the workflowGet the configuration of this Action.Build provenance information for the action.protected booleanReturns true if this Action has advanced options, false if it doesn'tabstract booleanisAuthorized(Context context, jakarta.servlet.http.HttpServletRequest request, XmlWorkflowItem wfi) Is this client authorized to act on this item?protected booleanisOptionInParam(jakarta.servlet.http.HttpServletRequest request) Returns true if one of the options is a parameter of the requestvoidsetParent(WorkflowActionConfig parent) Configure this Action.
-
Constructor Details
-
Action
public Action()
-
-
Method Details
-
activate
public abstract void activate(Context c, XmlWorkflowItem wf) throws SQLException, IOException, AuthorizeException, WorkflowException Called when a workflow item becomes eligible for this Action.- Parameters:
c- current DSpace session.wf- the eligible item.- Throws:
SQLException- passed through.IOException- passed through.AuthorizeException- passed through.WorkflowException- passed through.
-
execute
public abstract ActionResult execute(Context c, XmlWorkflowItem wfi, Step step, jakarta.servlet.http.HttpServletRequest request) throws SQLException, AuthorizeException, IOException, WorkflowException Called when the action is to be performed.- Parameters:
c- current DSpace session.wfi- the item on which the action is to be performed.step- the workflow step in which the action is performed.request- the current client request.- Returns:
- the result of performing the action.
- Throws:
SQLException- passed through.AuthorizeException- passed through.IOException- passed through.WorkflowException- passed through.
-
getOptions
Returns a list of options that the user can select at this action which results in the next step in the workflow- Returns:
- A list of options of this action, resulting in the next step of the workflow
-
isOptionInParam
protected boolean isOptionInParam(jakarta.servlet.http.HttpServletRequest request) Returns true if one of the options is a parameter of the request- Parameters:
request- Action request- Returns:
- true if one of the options is a parameter of the request; false if none was found
-
getParent
Get the configuration of this Action.- Returns:
- details of this instance of an Action.
-
setParent
Configure this Action.- Parameters:
parent- details of this instance of an Action.
-
getProvenanceStartId
Build provenance information for the action.- Returns:
- a String identifying the step and action.
-
alertUsersOnActivation
public void alertUsersOnActivation(Context c, XmlWorkflowItem wfi, RoleMembers members) throws SQLException, IOException Notify action role members that an item requires action.- Parameters:
c- current DSpace session.wfi- the needy item.members- users who may fulfill the role.- Throws:
SQLException- passed through.IOException- passed through.
-
isAuthorized
public abstract boolean isAuthorized(Context context, jakarta.servlet.http.HttpServletRequest request, XmlWorkflowItem wfi) throws SQLException, AuthorizeException, IOException, WorkflowConfigurationException Is this client authorized to act on this item?- 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.
-
getErrorFields
Return a list of all UI fields which had errors that occurred during the workflow processing. This list is for usage in generating the appropriate error message(s) in the UI.- Parameters:
request- current servlet request object- Returns:
- List of error fields (as Strings)
-
addErrorField
Add a single UI field to the list of all error fields (which can later be retrieved using getErrorFields())- Parameters:
request- current servlet request objectfieldName- the name of the field which had an error
-
getAdvancedOptions
Returns a list of advanced options that the user can select at this action- Returns:
- A list of advanced options of this action, resulting in the next step of the workflow
-
isAdvanced
protected boolean isAdvanced()Returns true if this Action has advanced options, false if it doesn't- Returns:
- true if there are advanced options, false otherwise
-
getAdvancedInfo
Returns a list of advanced info required by the advanced options- Returns:
- A list of advanced info required by the advanced options
-
addApprovedProvenance
public void addApprovedProvenance(Context c, XmlWorkflowItem wfi) throws SQLException, AuthorizeException Adds info in the metadata field dc.description.provenance about item being approved containing in which step it was approved, which user approved it and the time- Parameters:
c- DSpace contactwfi- Workflow item we're adding workflow accept provenance on- Throws:
SQLExceptionAuthorizeException
-