Class Action
- java.lang.Object
-
- org.dspace.xmlworkflow.state.actions.Action
-
- Direct Known Subclasses:
ProcessingAction,UserSelectionAction
public abstract class Action extends Object
This abstract class represents an api action Each step in the xml 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 Constructor Description Action()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidactivate(Context c, XmlWorkflowItem wf)protected voidaddErrorField(javax.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)abstract ActionResultexecute(Context c, XmlWorkflowItem wfi, Step step, javax.servlet.http.HttpServletRequest request)static ListgetErrorFields(javax.servlet.http.HttpServletRequest request)Return a list of all UI fields which had errors that occurred during the workflow processing.abstract List<String>getOptions()Returns a list of options that the user can select at this action which results in the next step in the workflowWorkflowActionConfiggetParent()StringgetProvenanceStartId()abstract booleanisAuthorized(Context context, javax.servlet.http.HttpServletRequest request, XmlWorkflowItem wfi)protected booleanisOptionInParam(javax.servlet.http.HttpServletRequest request)Returns true if one of the options is a parameter of the requestvoidsetParent(WorkflowActionConfig parent)
-
-
-
Method Detail
-
activate
public abstract void activate(Context c, XmlWorkflowItem wf) throws SQLException, IOException, AuthorizeException, WorkflowException
-
execute
public abstract ActionResult execute(Context c, XmlWorkflowItem wfi, Step step, javax.servlet.http.HttpServletRequest request) throws SQLException, AuthorizeException, IOException, WorkflowException
-
getOptions
public abstract List<String> 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(javax.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
public WorkflowActionConfig getParent()
-
setParent
public void setParent(WorkflowActionConfig parent)
-
getProvenanceStartId
public String getProvenanceStartId()
-
alertUsersOnActivation
public void alertUsersOnActivation(Context c, XmlWorkflowItem wfi, RoleMembers members) throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
isAuthorized
public abstract boolean isAuthorized(Context context, javax.servlet.http.HttpServletRequest request, XmlWorkflowItem wfi) throws SQLException, AuthorizeException, IOException, WorkflowConfigurationException
-
getErrorFields
public static List getErrorFields(javax.servlet.http.HttpServletRequest request)
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
protected void addErrorField(javax.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())- Parameters:
request- current servlet request objectfieldName- the name of the field which had an error
-
-