org.dspace.submit.step
Class UploadStep

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

public class UploadStep
extends AbstractProcessingStep

Upload step for DSpace. Processes the actual upload of files for an item being submitted into DSpace.

This class performs all the behind-the-scenes processing that this particular step requires. This class's methods are utilized by both the JSP-UI and the Manakin XML-UI

Version:
$Revision: 4777 $
Author:
Tim Donohue
See Also:
SubmissionConfig, SubmissionStepConfig, AbstractProcessingStep

Field Summary
static String CANCEL_EDIT_BUTTON
          Button to cancel editing of file info *
static int STATUS_EDIT_BITSTREAM
           
static int STATUS_EDIT_COMPLETE
           
static int STATUS_INTEGRITY_ERROR
          STATUS / ERROR FLAGS (returned by doProcessing() if an error occurs or additional user interaction may be required) (Do NOT use status of 0, since it corresponds to STATUS_COMPLETE flag defined in the JSPStepManager class)
static int STATUS_NO_FILES_ERROR
           
static int STATUS_UNKNOWN_FORMAT
           
static int STATUS_UPLOAD_ERROR
           
static String SUBMIT_MORE_BUTTON
          Button to submit more files *
static String SUBMIT_SKIP_BUTTON
          Button to skip uploading a file *
static String SUBMIT_UPLOAD_BUTTON
          Button to upload a file *
 
Fields inherited from class org.dspace.submit.AbstractProcessingStep
CANCEL_BUTTON, LAST_PAGE_REACHED, NEXT_BUTTON, PREVIOUS_BUTTON, PROGRESS_BAR_PREFIX, STATUS_COMPLETE
 
Constructor Summary
UploadStep()
           
 
Method Summary
 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)
 int getNumberOfPages(javax.servlet.http.HttpServletRequest request, SubmissionInfo subInfo)
          Retrieves the number of pages that this "step" extends over.
protected  int processRemoveFile(Context context, Item item, int bitstreamID)
          Remove a file from an item
protected  int processSaveFileDescription(Context context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SubmissionInfo subInfo)
          Process input from the "change file description" page
protected  int processSaveFileFormat(Context context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SubmissionInfo subInfo)
          Process input from get file type page
protected  int processUploadFile(Context context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SubmissionInfo subInfo)
          Process the upload of a new file!
 
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

SUBMIT_UPLOAD_BUTTON

public static final String SUBMIT_UPLOAD_BUTTON
Button to upload a file *

See Also:
Constant Field Values

SUBMIT_SKIP_BUTTON

public static final String SUBMIT_SKIP_BUTTON
Button to skip uploading a file *

See Also:
Constant Field Values

SUBMIT_MORE_BUTTON

public static final String SUBMIT_MORE_BUTTON
Button to submit more files *

See Also:
Constant Field Values

CANCEL_EDIT_BUTTON

public static final String CANCEL_EDIT_BUTTON
Button to cancel editing of file info *

See Also:
Constant Field Values

STATUS_INTEGRITY_ERROR

public static final int STATUS_INTEGRITY_ERROR
STATUS / ERROR FLAGS (returned by doProcessing() if an error occurs or additional user interaction may be required) (Do NOT use status of 0, since it corresponds to STATUS_COMPLETE flag defined in the JSPStepManager class)

See Also:
Constant Field Values

STATUS_UPLOAD_ERROR

public static final int STATUS_UPLOAD_ERROR
See Also:
Constant Field Values

STATUS_NO_FILES_ERROR

public static final int STATUS_NO_FILES_ERROR
See Also:
Constant Field Values

STATUS_UNKNOWN_FORMAT

public static final int STATUS_UNKNOWN_FORMAT
See Also:
Constant Field Values

STATUS_EDIT_BITSTREAM

public static final int STATUS_EDIT_BITSTREAM
See Also:
Constant Field Values

STATUS_EDIT_COMPLETE

public static final int STATUS_EDIT_COMPLETE
See Also:
Constant Field Values
Constructor Detail

UploadStep

public UploadStep()
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

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

processRemoveFile

protected int processRemoveFile(Context context,
                                Item item,
                                int bitstreamID)
                         throws IOException,
                                SQLException,
                                AuthorizeException
Remove a file from an item

Parameters:
context - current DSpace context
item - Item where file should be removed from
bitstreamID - The id of bitstream representing the file to remove
Returns:
Status or error flag which will be processed by UI-related code! (if STATUS_COMPLETE or 0 is returned, no errors occurred!)
Throws:
IOException
SQLException
AuthorizeException

processUploadFile

protected int processUploadFile(Context context,
                                javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                SubmissionInfo subInfo)
                         throws javax.servlet.ServletException,
                                IOException,
                                SQLException,
                                AuthorizeException
Process the upload of a new file!

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 UI-related code! (if STATUS_COMPLETE or 0 is returned, no errors occurred!)
Throws:
javax.servlet.ServletException
IOException
SQLException
AuthorizeException

processSaveFileFormat

protected int processSaveFileFormat(Context context,
                                    javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    SubmissionInfo subInfo)
                             throws javax.servlet.ServletException,
                                    IOException,
                                    SQLException,
                                    AuthorizeException
Process input from get file type page

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 UI-related code! (if STATUS_COMPLETE or 0 is returned, no errors occurred!)
Throws:
javax.servlet.ServletException
IOException
SQLException
AuthorizeException

processSaveFileDescription

protected int processSaveFileDescription(Context context,
                                         javax.servlet.http.HttpServletRequest request,
                                         javax.servlet.http.HttpServletResponse response,
                                         SubmissionInfo subInfo)
                                  throws javax.servlet.ServletException,
                                         IOException,
                                         SQLException,
                                         AuthorizeException
Process input from the "change file description" page

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 UI-related code! (if STATUS_COMPLETE or 0 is returned, no errors occurred!)
Throws:
javax.servlet.ServletException
IOException
SQLException
AuthorizeException


Copyright © 2010 DuraSpace. All Rights Reserved.