|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.dspace.app.webui.servlet.DSpaceServlet
org.dspace.app.webui.servlet.SubmissionController
public class SubmissionController
Submission Manager servlet for DSpace. Handles the initial submission of items, as well as the editing of items further down the line.
Whenever the submit servlet receives a GET request, this is taken to indicate the start of a fresh new submission, where no collection has been selected, and the submission process is started from scratch.
All other interactions happen via POSTs. Part of the post will normally be a (hidden) "step" parameter, which will correspond to the form that the user has just filled out. If this is absent, step 0 (select collection) is assumed, meaning that it's simple to place "Submit to this collection" buttons on collection home pages.
According to the step number of the incoming form, the values posted from the form are processed (using the process* methods), and the item updated as appropriate. The servlet then forwards control of the request to the appropriate JSP (from jsp/submit) to render the next stage of the process or an error if appropriate. Each of these JSPs may require that attributes be passed in. Check the comments at the top of a JSP to see which attributes are needed. All submit-related forms require a properly initialised SubmissionInfo object to be present in the the "submission.info" attribute. This holds the core information relevant to the submission, e.g. the item, personal workspace or workflow item, the submitting "e-person", and the target collection.
When control of the request reaches a JSP, it is assumed that all checks, interactions with the database and so on have been performed and that all necessary information to render the form is in memory. e.g. The SubmitFormInfo object passed in must be correctly filled out. Thus the JSPs do no error or integrity checking; it is the servlet's responsibility to ensure that everything is prepared. The servlet is fairly diligent about ensuring integrity at each step.
Each step has an integer constant defined below. The main sequence of the submission procedure always runs from 0 upwards, until SUBMISSION_COMPLETE. Other, not-in-sequence steps (such as the cancellation screen and the "previous version ID verification" screen) have numbers much higher than SUBMISSION_COMPLETE. These conventions allow the progress bar component of the submission forms to render the user's progress through the process.
SubmissionInfo,
SubmissionConfig,
SubmissionStepConfig,
JSPStepManager,
Serialized Form| Field Summary | |
|---|---|
static int |
FIRST_STEP
First step after "select collection" |
static int |
SELECT_COLLECTION
Selection collection step |
static int |
WORKFLOW_FIRST_STEP
For workflows, first step is step #0 (since Select Collection is already filtered out) |
| Constructor Summary | |
|---|---|
SubmissionController()
|
|
| Method Summary | |
|---|---|
protected void |
doDSGet(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Process an incoming HTTP GET. |
protected void |
doDSPost(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Process an incoming HTTP POST. |
static SubmissionStepConfig |
getCurrentStepConfig(javax.servlet.http.HttpServletRequest request,
SubmissionInfo si)
Get the configuration of the current step from parameters in the request, along with the current SubmissionInfo object. |
static SubmissionStepConfig |
getPreviousVisibleStep(javax.servlet.http.HttpServletRequest request,
SubmissionInfo si)
Return the previous "visibile" step in the item submission process if any, null otherwise. |
static int |
getStepReached(SubmissionInfo subInfo)
Find out which step a user has reached in the submission process. |
static SubmissionInfo |
getSubmissionInfo(Context context,
javax.servlet.http.HttpServletRequest request)
Reloads a filled-out submission info object from the parameters in the current request. |
static String |
getSubmissionParameters(Context context,
javax.servlet.http.HttpServletRequest request)
Return the submission info as hidden parameters for an HTML form on a JSP page. |
static boolean |
isBeginningOfStep(javax.servlet.http.HttpServletRequest request)
Get whether or not the current step has just begun. |
static boolean |
isCancellationInProgress(javax.servlet.http.HttpServletRequest request)
Get whether or not a cancellation is in progress (i.e. |
static boolean |
isFirstStep(javax.servlet.http.HttpServletRequest request,
SubmissionInfo si)
Checks if the current step is also the first "visibile" step in the item submission process. |
static void |
saveCurrentStepConfig(javax.servlet.http.HttpServletRequest request,
SubmissionStepConfig step)
Saves the current step configuration into the request. |
static void |
saveSubmissionInfo(javax.servlet.http.HttpServletRequest request,
SubmissionInfo si)
Saves the submission info object to the current request. |
static void |
setBeginningOfStep(javax.servlet.http.HttpServletRequest request,
boolean beginningOfStep)
Get whether or not the current step has just begun. |
void |
uploadFiles(Context context,
javax.servlet.http.HttpServletRequest request)
Upload any files found on the Request, and save them back as Request attributes, for further processing by the appropriate user interface. |
| Methods inherited from class org.dspace.app.webui.servlet.DSpaceServlet |
|---|
doGet, doPost |
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SELECT_COLLECTION
public static final int FIRST_STEP
public static final int WORKFLOW_FIRST_STEP
| Constructor Detail |
|---|
public SubmissionController()
| Method Detail |
|---|
protected void doDSGet(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException,
SQLException,
AuthorizeException
DSpaceServlet
doDSGet in class DSpaceServletcontext - a DSpace Context objectrequest - the HTTP requestresponse - the HTTP response
SQLException - if a database error occurs
AuthorizeException - if some authorization error occurs
javax.servlet.ServletException
IOException
protected void doDSPost(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException,
SQLException,
AuthorizeException
DSpaceServlet
doDSPost in class DSpaceServletcontext - a DSpace Context objectrequest - the HTTP requestresponse - the HTTP response
SQLException - if a database error occurs
AuthorizeException - if some authorization error occurs
javax.servlet.ServletException
IOException
public static SubmissionInfo getSubmissionInfo(Context context,
javax.servlet.http.HttpServletRequest request)
throws SQLException,
javax.servlet.ServletException
null is returned.
context - DSpace contextrequest - HTTP request
SQLException
javax.servlet.ServletException
public static void saveSubmissionInfo(javax.servlet.http.HttpServletRequest request,
SubmissionInfo si)
request - HTTP requestsi - the current submission info
public static SubmissionStepConfig getCurrentStepConfig(javax.servlet.http.HttpServletRequest request,
SubmissionInfo si)
null is returned.
request - HTTP requestsi - The current SubmissionInfo object
public static void saveCurrentStepConfig(javax.servlet.http.HttpServletRequest request,
SubmissionStepConfig step)
request - HTTP requeststep - The current SubmissionStepConfig
public static boolean isFirstStep(javax.servlet.http.HttpServletRequest request,
SubmissionInfo si)
request - HTTP requestsi - The current Submission Info
public static SubmissionStepConfig getPreviousVisibleStep(javax.servlet.http.HttpServletRequest request,
SubmissionInfo si)
null otherwise.
request - HTTP requestsi - The current Submission Info
public static boolean isBeginningOfStep(javax.servlet.http.HttpServletRequest request)
false is returned.
request - HTTP request
public static void setBeginningOfStep(javax.servlet.http.HttpServletRequest request,
boolean beginningOfStep)
false is returned.
request - HTTP requestbeginningOfStep - true if step just beganpublic static boolean isCancellationInProgress(javax.servlet.http.HttpServletRequest request)
request - HTTP request
public static String getSubmissionParameters(Context context,
javax.servlet.http.HttpServletRequest request)
throws SQLException,
javax.servlet.ServletException
context - DSpace contextrequest - HTTP request
SQLException
javax.servlet.ServletExceptionpublic static int getStepReached(SubmissionInfo subInfo)
subInfo - submission info object
public void uploadFiles(Context context,
javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
context - current DSpace contextrequest - current servlet request object
javax.servlet.ServletException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||