org.dspace.submit.step
Class AccessStep

java.lang.Object
  extended by org.dspace.submit.AbstractProcessingStep
      extended by org.dspace.submit.step.AccessStep

public class AccessStep
extends AbstractProcessingStep

This class manages the access step during the submission

Author:
Fabio Bolognesi (fabio at atmire dot com), Mark Diggory (markd at atmire dot com), Ben Bosman (ben at atmire dot com)

Field Summary
static int EDIT_POLICY_STATUS_DUPLICATED_POLICY
           
static String FORM_ACCESS_BUTTON_ADD
           
static String FORM_EDIT_BUTTON_CANCEL
           
static String FORM_EDIT_BUTTON_SAVE
           
static int STATUS_DUPLICATED_POLICY
           
static int STATUS_EDIT_POLICY
           
static int STATUS_ERROR_FORMAT_DATE
           
static int STATUS_ERROR_MISSING_DATE
           
static int STATUS_ERROR_SELECT_GROUP
           
static String SUB_INFO_SELECTED_RP
           
 
Fields inherited from class org.dspace.submit.AbstractProcessingStep
CANCEL_BUTTON, LAST_PAGE_REACHED, NEXT_BUTTON, PREVIOUS_BUTTON, PROGRESS_BAR_PREFIX, SELECT_CHANGE, STATUS_COMPLETE
 
Constructor Summary
AccessStep()
           
 
Method Summary
static int checkForm(javax.servlet.http.HttpServletRequest request)
           
static boolean comeFromEditPolicy(javax.servlet.http.HttpServletRequest request)
           
 int doProcessing(Context context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SubmissionInfo subInfo)
          Do any processing of the information input by the user, and/or perform step processing (if no user interaction required)
static Date getEmbargoUntil(javax.servlet.http.HttpServletRequest request)
           
 int getNumberOfPages(javax.servlet.http.HttpServletRequest request, SubmissionInfo subInfo)
          Retrieves the number of pages that this "step" extends over.
static void removePolicy(Context context, String buttonPressed)
           
static int saveOrCancelEditPolicy(Context context, javax.servlet.http.HttpServletRequest request, SubmissionInfo subInfo, String buttonPressed, DSpaceObject dso, String name, int groupID, String reason)
           
static boolean wasAddPolicyPressed(String buttonPressed)
           
static boolean wasEditPolicyPressed(Context context, String buttonPressed, SubmissionInfo subInfo)
           
static boolean wasRemovePolicyPressed(String buttonPressed)
           
 
Methods inherited from class org.dspace.submit.AbstractProcessingStep
addErrorField, addErrorMessage, clearErrorFields, getCurrentPage, getErrorFields, getErrorMessage, setCurrentPage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_ERROR_FORMAT_DATE

public static final int STATUS_ERROR_FORMAT_DATE
See Also:
Constant Field Values

STATUS_ERROR_MISSING_DATE

public static final int STATUS_ERROR_MISSING_DATE
See Also:
Constant Field Values

STATUS_ERROR_SELECT_GROUP

public static final int STATUS_ERROR_SELECT_GROUP
See Also:
Constant Field Values

STATUS_DUPLICATED_POLICY

public static final int STATUS_DUPLICATED_POLICY
See Also:
Constant Field Values

EDIT_POLICY_STATUS_DUPLICATED_POLICY

public static final int EDIT_POLICY_STATUS_DUPLICATED_POLICY
See Also:
Constant Field Values

STATUS_EDIT_POLICY

public static final int STATUS_EDIT_POLICY
See Also:
Constant Field Values

SUB_INFO_SELECTED_RP

public static final String SUB_INFO_SELECTED_RP
See Also:
Constant Field Values

FORM_EDIT_BUTTON_CANCEL

public static final String FORM_EDIT_BUTTON_CANCEL
See Also:
Constant Field Values

FORM_EDIT_BUTTON_SAVE

public static final String FORM_EDIT_BUTTON_SAVE
See Also:
Constant Field Values

FORM_ACCESS_BUTTON_ADD

public static final String FORM_ACCESS_BUTTON_ADD
See Also:
Constant Field Values
Constructor Detail

AccessStep

public AccessStep()
Method Detail

doProcessing

public int doProcessing(Context context,
                        javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response,
                        SubmissionInfo subInfo)
                 throws javax.servlet.ServletException,
                        IOException,
                        SQLException,
                        AuthorizeException
Do any processing of the information input by the user, and/or perform step processing (if no user interaction required)

It is this method's job to save any data to the underlying database, as necessary, and return error messages (if any) which can then be processed by the appropriate user interface (JSP-UI or XML-UI)

NOTE: If this step is a non-interactive step (i.e. requires no UI), then it should perform *all* of its processing in this method!

Specified by:
doProcessing in class AbstractProcessingStep
Parameters:
context - current DSpace context
request - current servlet request object
response - current servlet response object
subInfo - submission info object
Returns:
Status or error flag which will be processed by doPostProcessing() below! (if STATUS_COMPLETE or 0 is returned, no errors occurred!)
Throws:
javax.servlet.ServletException
IOException
SQLException
AuthorizeException

wasEditPolicyPressed

public static boolean wasEditPolicyPressed(Context context,
                                           String buttonPressed,
                                           SubmissionInfo subInfo)
                                    throws SQLException
Throws:
SQLException

wasAddPolicyPressed

public static boolean wasAddPolicyPressed(String buttonPressed)
                                   throws SQLException
Throws:
SQLException

wasRemovePolicyPressed

public static boolean wasRemovePolicyPressed(String buttonPressed)
                                      throws SQLException
Throws:
SQLException

comeFromEditPolicy

public static boolean comeFromEditPolicy(javax.servlet.http.HttpServletRequest request)
                                  throws SQLException
Throws:
SQLException

saveOrCancelEditPolicy

public static int saveOrCancelEditPolicy(Context context,
                                         javax.servlet.http.HttpServletRequest request,
                                         SubmissionInfo subInfo,
                                         String buttonPressed,
                                         DSpaceObject dso,
                                         String name,
                                         int groupID,
                                         String reason)
                                  throws AuthorizeException,
                                         SQLException
Throws:
AuthorizeException
SQLException

removePolicy

public static void removePolicy(Context context,
                                String buttonPressed)
                         throws SQLException
Throws:
SQLException

checkForm

public static int checkForm(javax.servlet.http.HttpServletRequest request)

getEmbargoUntil

public static Date getEmbargoUntil(javax.servlet.http.HttpServletRequest request)

getNumberOfPages

public int getNumberOfPages(javax.servlet.http.HttpServletRequest request,
                            SubmissionInfo subInfo)
                     throws javax.servlet.ServletException
Retrieves the number of pages that this "step" extends over. This method is used to build the progress bar.

This method may just return 1 for most steps (since most steps consist of a single page). But, it should return a number greater than 1 for any "step" which spans across a number of HTML pages. For example, the configurable "Describe" step (configured using input-forms.xml) overrides this method to return the number of pages that are defined by its configuration file.

Steps which are non-interactive (i.e. they do not display an interface to the user) should return a value of 1, so that they are only processed once!

Specified by:
getNumberOfPages in class AbstractProcessingStep
Parameters:
request - The HTTP Request
subInfo - The current submission information object
Returns:
the number of pages in this step
Throws:
javax.servlet.ServletException


Copyright © 2012 DuraSpace. All Rights Reserved.