Class Action

  • Direct Known Subclasses:
    ProcessingAction, UserSelectionAction

    public abstract class Action
    extends Object
    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 Detail

      • Action

        public Action()
    • Method Detail

      • 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()
        Get the configuration of this Action.
        Returns:
        details of this instance of an Action.
      • setParent

        public void setParent​(WorkflowActionConfig parent)
        Configure this Action.
        Parameters:
        parent - details of this instance of an Action.
      • getProvenanceStartId

        public String getProvenanceStartId()
        Build provenance information for the action.
        Returns:
        a String identifying the step and action.
      • 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 object
        fieldName - the name of the field which had an error
      • getAdvancedOptions

        protected List<String> 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

        protected List<ActionAdvancedInfo> 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 contect
        wfi - Workflow item we're adding workflow accept provenance on
        Throws:
        SQLException
        AuthorizeException