Merged 'item-submission-JSPUI.xml' and 'item-submission-XMLUI.xml' files into a single 'item-submission.xml' configuration file (based on suggestions from Graham Triggs).

Small updates throughout API for Configurable Submission to support this merged configuration file (majority of changes in dspace-api and dspace-jspui modules).   Also includes updates to Configurable Submission documentation and small updates to I18N to make the XMLUI and JSPUI keys more parallel.

git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@2491 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Tim Donohue
2008-01-08 17:53:25 +00:00
parent 0b8f5dc31c
commit 80356f5c2e
31 changed files with 835 additions and 774 deletions

View File

@@ -48,7 +48,7 @@ import org.apache.log4j.Logger;
/**
* Class representing a single Item Submission config definition, organized into
* steps. This class represents the structure of a single 'submission-process'
* node in the item-submission-[UI Name].xml configuration file.
* node in the item-submission.xml configuration file.
*
* @see org.dspace.app.util.SubmissionConfigReader
* @see org.dspace.app.util.SubmissionStepConfig
@@ -73,7 +73,7 @@ public class SubmissionConfig
/**
* Constructs a new Submission Configuration object, based on the XML
* configuration file (item-submission-[UI Name].xml)
* configuration file (item-submission.xml)
*
* @param submissionName
* the submission process name

View File

@@ -56,7 +56,7 @@ import org.dspace.core.ConfigurationManager;
/**
* Item Submission configuration generator for DSpace. Reads and parses the
* installed submission process configuration file, item-submission-[UI name].xml, from
* installed submission process configuration file, item-submission.xml, from
* the configuration directory. This submission process definiton details the
* ordering of the steps (and number of steps) that occur during the Item
* Submission Process. There may be multiple Item Submission processes defined,
@@ -96,9 +96,6 @@ public class SubmissionConfigReader
private String configDir = ConfigurationManager.getProperty("dspace.dir")
+ File.separator + "config" + File.separator;
/** Name of the User Interface which this Submission Configuration corresponds to */
private String UIName;
/**
* Hashmap which stores which submission process configuration is used by
* which collection, computed from the item submission config file
@@ -125,27 +122,12 @@ public class SubmissionConfigReader
private SubmissionConfig lastSubmissionConfig = null;
/**
* Default Constructor - PRIVATE
* Load Submission Configuration from the
* item-submission.xml configuration file
*/
private SubmissionConfigReader()
public SubmissionConfigReader() throws ServletException
{
}
/**
* Load Submission Configuration for a specific user interface(UI).
* The submission configuration file name is formatted as follows:
* item-submission-UIName.xml
* <P>
* E.g. for a value of "XMLUI", uses the config file named
* item-submission-XMLUI.xml
*
* @param UIName
* the name of the UI to load the Submission configuration for
*/
public SubmissionConfigReader(String UIName) throws ServletException
{
this.UIName = UIName;
buildInputs(configDir + SUBMIT_DEF_FILE_PREFIX + "-" + UIName + SUBMIT_DEF_FILE_SUFFIX);
buildInputs(configDir + SUBMIT_DEF_FILE_PREFIX + SUBMIT_DEF_FILE_SUFFIX);
}
/**
@@ -218,7 +200,7 @@ public class SubmissionConfigReader
if (submitName == null)
{
throw new ServletException(
"No item submission process configuration designated as 'default' in 'submission-map' section of 'item-submission-" + getUIName() + ".xml'.");
"No item submission process configuration designated as 'default' in 'submission-map' section of 'item-submission.xml'.");
}
log.debug("Loading submission process config named '" + submitName
@@ -242,7 +224,7 @@ public class SubmissionConfigReader
{
throw new ServletException(
"Missing the Item Submission process config '" + submitName
+ "' (or unable to load) from 'item-submission-" + getUIName() + ".xml'.");
+ "' (or unable to load) from 'item-submission.xml'.");
}
log.debug("Submission process config '" + submitName
@@ -332,16 +314,16 @@ public class SubmissionConfigReader
if (!foundMap)
{
throw new ServletException(
"No collection to item submission map ('submission-map') found in 'item-submission-" + getUIName() + ".xml'");
"No collection to item submission map ('submission-map') found in 'item-submission.xml'");
}
if (!foundStepDefs)
{
throw new ServletException("No 'step-definitions' section found in 'item-submission-" + getUIName() + ".xml'");
throw new ServletException("No 'step-definitions' section found in 'item-submission.xml'");
}
if (!foundSubmitDefs)
{
throw new ServletException(
"No 'submission-definitions' section found in 'item-submission-" + getUIName() + ".xml'");
"No 'submission-definitions' section found in 'item-submission.xml'");
}
}
@@ -366,17 +348,17 @@ public class SubmissionConfigReader
if (id == null)
{
throw new SAXException(
"name-map element is missing collection-handle attribute in 'item-submission-" + getUIName() + ".xml'");
"name-map element is missing collection-handle attribute in 'item-submission.xml'");
}
if (value == null)
{
throw new SAXException(
"name-map element is missing submission-name attribute in 'item-submission-" + getUIName() + ".xml'");
"name-map element is missing submission-name attribute in 'item-submission.xml'");
}
if (content != null && content.length() > 0)
{
throw new SAXException(
"name-map element has content in 'item-submission-" + getUIName() + ".xml', it should be empty.");
"name-map element has content in 'item-submission.xml', it should be empty.");
}
collectionToSubmissionConfig.put(id, value);
} // ignore any child node that isn't a "name-map"
@@ -410,12 +392,12 @@ public class SubmissionConfigReader
if (stepID == null)
{
throw new SAXException(
"step element has no 'id' attribute in 'item-submission-" + getUIName() + ".xml', which is required in the 'step-definitions' section");
"step element has no 'id' attribute in 'item-submission.xml', which is required in the 'step-definitions' section");
}
else if (stepDefns.containsKey(stepID))
{
throw new SAXException(
"There are two step elements with the id '" + stepID + "' in 'item-submission-" + getUIName() + ".xml'");
"There are two step elements with the id '" + stepID + "' in 'item-submission.xml'");
}
HashMap stepInfo = processStepChildNodes("step-definition", nd);
@@ -428,7 +410,7 @@ public class SubmissionConfigReader
if (stepDefns.size() < 1)
{
throw new ServletException(
"step-definition section has no steps! A step with id='collection' is required in 'item-submission-" + getUIName() + ".xml'!");
"step-definition section has no steps! A step with id='collection' is required in 'item-submission.xml'!");
}
// Sanity check to see that the required "collection" step is defined
@@ -437,7 +419,7 @@ public class SubmissionConfigReader
throw new ServletException(
"The step-definition section is REQUIRED to have a step with id='"
+ SubmissionStepConfig.SELECT_COLLECTION_STEP
+ "' in 'item-submission-" + getUIName() + ".xml'! This step is used to ensure that a new item submission is assigned to a collection.");
+ "' in 'item-submission.xml'! This step is used to ensure that a new item submission is assigned to a collection.");
}
// Sanity check to see that the required "complete" step is defined
@@ -446,7 +428,7 @@ public class SubmissionConfigReader
throw new ServletException(
"The step-definition section is REQUIRED to have a step with id='"
+ SubmissionStepConfig.COMPLETE_STEP
+ "' in 'item-submission-" + getUIName() + ".xml'! This step is used to perform all processing necessary at the completion of the submission (e.g. starting workflow).");
+ "' in 'item-submission.xml'! This step is used to perform all processing necessary at the completion of the submission (e.g. starting workflow).");
}
}
@@ -482,13 +464,13 @@ public class SubmissionConfigReader
if (submitName == null)
{
throw new SAXException(
"'submission-process' element has no 'name' attribute in 'item-submission-" + getUIName() + ".xml'");
"'submission-process' element has no 'name' attribute in 'item-submission.xml'");
}
else if (submitNames.contains(submitName))
{
throw new SAXException(
"There are two 'submission-process' elements with the name '"
+ submitName + "' in 'item-submission-" + getUIName() + ".xml'.");
+ submitName + "' in 'item-submission.xml'.");
}
submitNames.add(submitName);
@@ -530,7 +512,7 @@ public class SubmissionConfigReader
+ submitName
+ " contains a step with id="
+ stepID
+ ". There is no step with this 'id' defined in the 'step-definition' section of 'item-submission-" + getUIName() + ".xml'.");
+ ". There is no step with this 'id' defined in the 'step-definition' section of 'item-submission.xml'.");
}
// Ignore all children of a step element with an
@@ -554,7 +536,7 @@ public class SubmissionConfigReader
{
throw new ServletException(
"Item Submission process config named "
+ submitName + " has no steps defined in 'item-submission-" + getUIName() + ".xml'");
+ submitName + " has no steps defined in 'item-submission.xml'");
}
// ALL Item Submission processes MUST BEGIN with selecting a
@@ -579,7 +561,7 @@ public class SubmissionConfigReader
if (numSubmitProcesses == 0)
{
throw new ServletException(
"No 'submission-process' elements/definitions found in 'item-submission-" + getUIName() + ".xml'");
"No 'submission-process' elements/definitions found in 'item-submission.xml'");
}
}
@@ -627,7 +609,7 @@ public class SubmissionConfigReader
{
String msg = "Required field " + missing
+ " missing in a 'step' in the " + configSection
+ " of the item submission configuration file ('item-submission-" + getUIName() + ".xml')";
+ " of the item submission configuration file ('item-submission.xml')";
throw new SAXException(msg);
}
@@ -706,12 +688,4 @@ public class SubmissionConfigReader
// Didn't find a text node
return null;
}
public String getUIName() {
return UIName;
}
private void setUIName(String name) {
UIName = name;
}
}

View File

@@ -128,10 +128,6 @@ public class SubmissionInfo
*
* @param request
* The HTTP Servlet Request object
* @param briefUIName
* The brief name of the User Interface to
* load the Submission Configuration and Information for
* (e.g. "jspui" or "xmlui")
* @param subItem
* The in-progress submission we are loading information for
*
@@ -140,19 +136,16 @@ public class SubmissionInfo
* @throws ServletException
* if an error occurs
*/
public static SubmissionInfo load(HttpServletRequest request,
String briefUIName, InProgressSubmission subItem) throws ServletException
public static SubmissionInfo load(HttpServletRequest request, InProgressSubmission subItem) throws ServletException
{
boolean forceReload = false;
SubmissionInfo subInfo = new SubmissionInfo();
// load SubmissionConfigReader only the first time
// or if we're using a different UI now.
if (submissionConfigReader == null ||
submissionConfigReader.getUIName() == null ||
!submissionConfigReader.getUIName().equals(briefUIName))
if (submissionConfigReader == null)
{
submissionConfigReader = new SubmissionConfigReader(briefUIName);
submissionConfigReader = new SubmissionConfigReader();
forceReload=true;
}
@@ -223,7 +216,7 @@ public class SubmissionInfo
/**
* Causes the SubmissionConfig to be completely reloaded from the XML
* configuration file (item-submission-[UI Name].xml).
* configuration file (item-submission.xml).
* <P>
* Note: This also reloads the progress bar info, since the progress bar
* depends entirely on the submission process (and its steps).

View File

@@ -48,7 +48,7 @@ import org.apache.log4j.Logger;
* Class representing configuration for a single step within an Item Submission
* Process. In other words, this is a single step in the SubmissionConfig class.
* This class represents the structure of a single 'step' node in the
* item-submission-[UI Name].xml configuration file.
* item-submission.xml configuration file.
*
* @see org.dspace.app.util.SubmissionConfigReader
* @see org.dspace.app.util.SubmissionConfig
@@ -80,18 +80,21 @@ public class SubmissionStepConfig
/** the name of the java processing class for this step */
private String processingClassName = null;
/** the review-jsp for this step */
private String reviewJSP = null;
/** whether or not this step is editable during workflow (default=true) */
private boolean workflowEditable = true;
/**
* The full name of the JSP-UI binding class for this step. This field is
* ONLY used by the JSP-UI.
**/
private String jspBindingClassName = null;
/**
* The full name of the Manakin XML-UI Transformer class which will generate
* the necessary DRI for displaying this class in Manakin. This field is
* ONLY used by the Manakin XML-UI.
*/
private String xmlUIClassName = null;
private String xmlBindingClassName = null;
/** The number of this step in the current SubmissionConfig */
private int number = -1;
@@ -119,8 +122,8 @@ public class SubmissionStepConfig
id = (String) stepMap.get("id");
heading = (String) stepMap.get("heading");
processingClassName = (String) stepMap.get("processing-class");
reviewJSP = (String) stepMap.get("review-jsp");
xmlUIClassName = (String) stepMap.get("xml-ui-class");
jspBindingClassName = (String) stepMap.get("jspui-binding");
xmlBindingClassName = (String) stepMap.get("xmlui-binding");
String wfEditString = (String) stepMap.get("workflow-editable");
if (wfEditString != null && wfEditString.length() > 0)
@@ -156,9 +159,8 @@ public class SubmissionStepConfig
/**
* Get the class which handles all processing for this step.
* <p>
* This class must extend either the org.dspace.submit.SubmissionStep class
* (for JSP UI) or org.dspace.submit.AbstractProcessingStep class (for
* Manakin XML UI).
* This class must extend the org.dspace.submit.AbstractProcessingStep class,
* and provide processing for BOTH the JSP-UI and XML-UI
*
* @return the class's full class path (e.g.
* "org.dspace.submit.step.MySampleStep")
@@ -168,36 +170,38 @@ public class SubmissionStepConfig
return processingClassName;
}
/**
* Get the review jsp for this step. The "review jsp" is a JSP page which
* will load all the user's answers given for this step to allow the user to
* review his/her answers.
*
* This "review jsp" is used by the "Verify" step to allow the user to
* verify/review all of his/her answers.
*
* @return the JSPs full path
*/
public String getReviewJSP()
{
return reviewJSP;
}
/**
* Retrieve the full class name of the Manakin Transformer which will
* generate this step's DRI, for display in Manakin XML-UI.
* <P>
* This class must extend the
* org.dspace.app.xmlui.submit.step.SubmissionStep class.
* org.dspace.app.xmlui.aspect.submission.StepTransformer class.
* <P>
* This property is only used by the Manakin XML-UI, and therefore is not
* relevant if you are using JSPs.
* relevant if you are using the JSP-UI.
*
* @return the full java class name of the Transformer for this class
* @return the full java class name of the Transformer to use for this step
*/
public String getXMLUIClassName()
{
return xmlUIClassName;
return xmlBindingClassName;
}
/**
* Retrieve the full class name of the JSP-UI "binding" class which will
* initialize and call the necessary JSPs for display in the JSP-UI
* <P>
* This class must extend the
* org.dspace.app.webui.submit.JSPStep class.
* <P>
* This property is only used by the JSP-UI, and therefore is not
* relevant if you are using the XML-UI (aka. Manakin).
*
* @return the full java class name of the JSPStep to use for this step
*/
public String getJSPUIClassName()
{
return jspBindingClassName;
}
/**

View File

@@ -126,6 +126,9 @@ public abstract class AbstractProcessingStep
/** List of all user interface fields which had errors during processing * */
private List errorFields = null;
private static String ERROR_FIELDS_ATTRIBUTE = "dspace.submit.error_fields";
/**
* Do any processing of the information input by the user, and/or perform
* step processing (if no user interaction required)
@@ -159,47 +162,84 @@ public abstract class AbstractProcessingStep
* step processing. This list is for usage in generating the appropriate
* error message(s) in the UI.
* <P>
* The list of fields which had errors should be set by the step's
* The list of fields which had errors should be set by the AbstractProcessingStep's
* doProcessing() method, so that it can be accessed later by whatever UI is
* generated.
*
* @param request
* current servlet request object
* @return List of error fields (as Strings)
*/
public final List getErrorFields()
public static final List getErrorFields(HttpServletRequest request)
{
return this.errorFields;
return (List) request.getAttribute(ERROR_FIELDS_ATTRIBUTE);
}
/**
* Add a single UI field to the internal list of all error fields (which can
* Sets th list of all UI fields which had errors that occurred during the
* step processing. This list is for usage in generating the appropriate
* error message(s) in the UI.
* <P>
* The list of fields which had errors should be set by the AbstractProcessingStep's
* doProcessing() method, so that it can be accessed later by whatever UI is
* generated.
*
* @param request
* current servlet request object
* @param errorFields
* List of all fields (as Strings) which had errors
*/
private static final void setErrorFields(HttpServletRequest request, List errorFields)
{
if(errorFields==null)
request.removeAttribute(ERROR_FIELDS_ATTRIBUTE);
else
request.setAttribute(ERROR_FIELDS_ATTRIBUTE, errorFields);
}
/**
* Add a single UI field to the list of all error fields (which can
* later be retrieved using getErrorFields())
* <P>
* The list of fields which had errors should be set by the step's
* The list of fields which had errors should be set by the AbstractProcessingStep's
* doProcessing() method, so that it can be accessed later by whatever UI is
* generated.
*
* @param fieldName
* the name of the field which had an error
*/
protected final void addErrorField(String fieldName)
protected static final void addErrorField(HttpServletRequest request, String fieldName)
{
if (this.errorFields == null)
//get current list
List errorFields = getErrorFields(request);
if (errorFields == null)
{
this.errorFields = new ArrayList();
errorFields = new ArrayList();
}
this.errorFields.add(fieldName);
//add this field
errorFields.add(fieldName);
//save updated list
setErrorFields(request, errorFields);
}
/**
* Clears the list of all fields that errored out during the previous step's
* processing.
*
* @param request
* current servlet request object
*
*/
protected final void clearErrorFields()
protected static final void clearErrorFields(HttpServletRequest request)
{
if (this.errorFields != null)
this.errorFields.clear();
//get current list
List errorFields = getErrorFields(request);
if (errorFields != null)
setErrorFields(request,null);
}
/**

View File

@@ -106,12 +106,8 @@ public class DescribeStep extends AbstractProcessingStep
/** Constructor */
public DescribeStep() throws ServletException
{
// load inputsReader only the first time
if (inputsReader == null)
{
// read configurable submissions forms data
inputsReader = new DCInputsReader();
}
//load the DCInputsReader
getInputsReader();
}
@@ -268,7 +264,7 @@ public class DescribeStep extends AbstractProcessingStep
// Step 3:
// Check to see if any fields are missing
clearErrorFields();
clearErrorFields(request);
for (int i = 0; i < inputs.length; i++)
{
DCValue[] values = item.getMetadata(inputs[i].getSchema(),
@@ -277,7 +273,7 @@ public class DescribeStep extends AbstractProcessingStep
if (inputs[i].isRequired() && values.length == 0)
{
// since this field is missing add to list of error fields
addErrorField(getFieldName(inputs[i]));
addErrorField(request, getFieldName(inputs[i]));
}
}
@@ -294,7 +290,7 @@ public class DescribeStep extends AbstractProcessingStep
return STATUS_MORE_INPUT_REQUESTED;
}
// if one or more fields errored out, return
else if (getErrorFields() != null && getErrorFields().size() > 0)
else if (getErrorFields(request) != null && getErrorFields(request).size() > 0)
{
return STATUS_MISSING_REQUIRED_FIELDS;
}
@@ -353,8 +349,15 @@ public class DescribeStep extends AbstractProcessingStep
*
* @return the current DCInputsReader
*/
public static DCInputsReader getInputsReader()
public static DCInputsReader getInputsReader() throws ServletException
{
// load inputsReader only the first time
if (inputsReader == null)
{
// read configurable submissions forms data
inputsReader = new DCInputsReader();
}
return inputsReader;
}

View File

@@ -232,6 +232,11 @@ public class InitialQuestionsStep extends AbstractProcessingStep
// to inform the user and make sure that's OK, before saving!
if (willRemoveTitles || willRemoveDate || willRemoveFiles)
{
//save what we will need to prune to request (for UI to process)
request.setAttribute("will.remove.titles", new Boolean(willRemoveTitles));
request.setAttribute("will.remove.date", new Boolean(willRemoveDate));
request.setAttribute("will.remove.files", new Boolean(willRemoveFiles));
return STATUS_VERIFY_PRUNE; // we will need to do pruning!
}
}

View File

@@ -59,6 +59,7 @@ import org.dspace.content.Bundle;
import org.dspace.content.FormatIdentifier;
import org.dspace.content.Item;
import org.dspace.core.Context;
import org.dspace.core.ConfigurationManager;
import org.dspace.submit.AbstractProcessingStep;
/**
@@ -465,8 +466,8 @@ public class UploadStep extends AbstractProcessingStep
Bitstream b = null;
//NOTE: File should already be uploaded.
//Manakin does this automatically.
//For JSP-UI, the JSPUploadStep.doProcessing() does the actual upload
//Manakin does this automatically via Cocoon.
//For JSP-UI, the SubmissionController.uploadFiles() does the actual upload
Enumeration attNames = request.getAttributeNames();

View File

@@ -855,6 +855,7 @@ jsp.submit.no-theses.info5 = Thank you for
jsp.submit.no-theses.title = Theses Not Accepted in DSpace
jsp.submit.progressbar.complete = Complete
jsp.submit.progressbar.describe = Describe
jsp.submit.progressbar.initial-questions = Describe
jsp.submit.progressbar.license = License
jsp.submit.progressbar.select = Select
jsp.submit.progressbar.upload = Upload

View File

@@ -553,7 +553,7 @@ public class MyDSpaceServlet extends DSpaceServlet
// Load the Submission Process for the collection this WSI is
// associated with
Collection c = wsi.getCollection();
SubmissionConfigReader subConfigReader = new SubmissionConfigReader(SubmissionController.UI_NAME);
SubmissionConfigReader subConfigReader = new SubmissionConfigReader();
SubmissionConfig subConfig = subConfigReader.getSubmissionConfig(c
.getHandle(), false);

View File

@@ -39,8 +39,13 @@
*/
package org.dspace.app.webui.servlet;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.SQLException;
import java.util.Enumeration;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -50,6 +55,7 @@ import org.apache.log4j.Logger;
import org.dspace.app.util.SubmissionInfo;
import org.dspace.app.util.SubmissionStepConfig;
import org.dspace.app.util.Util;
import org.dspace.app.webui.submit.JSPStepManager;
import org.dspace.app.webui.util.FileUploadRequest;
import org.dspace.app.webui.util.JSPManager;
@@ -62,6 +68,7 @@ import org.dspace.core.Context;
import org.dspace.core.LogManager;
import org.dspace.workflow.WorkflowItem;
import org.dspace.submit.AbstractProcessingStep;
import org.dspace.submit.step.UploadStep;
/**
* Submission Manager servlet for DSpace. Handles the initial submission of
@@ -124,9 +131,6 @@ public class SubmissionController extends DSpaceServlet
/** First step after "select collection" */
public static int FIRST_STEP = 1;
/** "Name" of the JSP User Interface - Used to load SubmissionInfo **/
public static String UI_NAME = "JSPUI";
/** path to the JSP shown once the submission is completed */
private static String COMPLETE_JSP = "/submit/complete.jsp";
@@ -170,7 +174,7 @@ public class SubmissionController extends DSpaceServlet
.parseInt(workspaceID));
//load submission information
SubmissionInfo si = SubmissionInfo.load(request, UI_NAME, wi);
SubmissionInfo si = SubmissionInfo.load(request, wi);
//TD: Special case - If a user is resuming a submission
//where the submission process now has less steps, then
@@ -214,7 +218,7 @@ public class SubmissionController extends DSpaceServlet
.parseInt(workflowID));
//load submission information
SubmissionInfo si = SubmissionInfo.load(request, UI_NAME, wi);
SubmissionInfo si = SubmissionInfo.load(request, wi);
//For workflows, first step is step #0
//(since Select Collection is already filtered out)
@@ -254,6 +258,9 @@ public class SubmissionController extends DSpaceServlet
&& (contentType.indexOf("multipart/form-data") != -1))
{
request = wrapMultipartRequest(request);
//also, upload any files and save their contents to Request (for later processing by UploadStep)
uploadFiles(context, request);
}
// Reload submission info from request parameters
@@ -394,7 +401,7 @@ public class SubmissionController extends DSpaceServlet
try
{
JSPStepManager stepManager = JSPStepManager.loadStep(currentStepConfig.getProcessingClassName());
JSPStepManager stepManager = JSPStepManager.loadStep(currentStepConfig);
//tell the step class to do its processing
boolean stepFinished = stepManager.processStep(context, request, response, subInfo);
@@ -482,20 +489,7 @@ public class SubmissionController extends DSpaceServlet
else
{
// The Submission is COMPLETE!!
/*
log.info(LogManager.getHeader(context, "submission_complete",
"Completed submission with id="
+ subInfo.getSubmissionItem().getID()));
// save that user has reached last step
userHasReached(subInfo, currentStepNum + 1);
// Start the workflow
WorkflowManager.start(context, (WorkspaceItem)subInfo.getSubmissionItem());
// commit changes to database & close context
context.complete();
*/
// save our current Submission information into the Request object
saveSubmissionInfo(request, subInfo);
@@ -905,19 +899,19 @@ public class SubmissionController extends DSpaceServlet
{
int workflowID = UIUtil.getIntParameter(request, "workflow_id");
info = SubmissionInfo.load(request, UI_NAME, WorkflowItem.find(context, workflowID));
info = SubmissionInfo.load(request, WorkflowItem.find(context, workflowID));
}
else if(request.getParameter("workspace_item_id") != null)
{
int workspaceID = UIUtil.getIntParameter(request,
"workspace_item_id");
info = SubmissionInfo.load(request, UI_NAME, WorkspaceItem.find(context, workspaceID));
info = SubmissionInfo.load(request, WorkspaceItem.find(context, workspaceID));
}
else
{
//by default, initialize Submission Info with no item
info = SubmissionInfo.load(request, UI_NAME, null);
info = SubmissionInfo.load(request, null);
}
// We must have a submission object if after the first step,
@@ -1297,4 +1291,70 @@ public class SubmissionController extends DSpaceServlet
throw new ServletException(e);
}
}
/**
* Upload any files found on the Request, and save them back as
* Request attributes, for further processing by the appropriate user interface.
*
* @param context
* current DSpace context
* @param request
* current servlet request object
*/
public void uploadFiles(Context context, HttpServletRequest request)
throws ServletException
{
FileUploadRequest wrapper = null;
String filePath = null;
InputStream fileInputStream = null;
try
{
// if we already have a FileUploadRequest, use it
if (Class.forName("org.dspace.app.webui.util.FileUploadRequest")
.isInstance(request))
{
wrapper = (FileUploadRequest) request;
}
else
{
// Wrap multipart request to get the submission info
wrapper = new FileUploadRequest(request);
}
Enumeration fileParams = wrapper.getFileParameterNames();
while(fileParams.hasMoreElements())
{
String fileName = (String) fileParams.nextElement();
File temp = wrapper.getFile(fileName);
//if file exists and has a size greater than zero
if (temp != null && temp.length() > 0)
{
// Read the temp file into an inputstream
fileInputStream = new BufferedInputStream(
new FileInputStream(temp));
filePath = wrapper.getFilesystemName(fileName);
// cleanup our temp file
temp.delete();
//save this file's info to request (for UploadStep class)
request.setAttribute(fileName + "-path", filePath);
request.setAttribute(fileName + "-inputstream", fileInputStream);
request.setAttribute(fileName + "-description", wrapper.getParameter("description"));
}
}
}
catch (Exception e)
{
// Problem with uploading
log.warn(LogManager.getHeader(context, "upload_error", ""), e);
throw new ServletException(e);
}
}
}

View File

@@ -60,10 +60,10 @@ import org.dspace.core.Context;
import org.dspace.submit.AbstractProcessingStep;
/**
* Interface for DSpace Submission Steps which use the JSP UI.
* Abstract 'binding' class for DSpace Submission Steps which use the JSP-UI.
* <P>
* These methods revolve around the following: (1) pre-processing of data to
* prepare for display, (2) displaying data on JSP, and (3) processing of any
* prepare for display, (2) displaying the JSP, and (3) post-processing of any
* user input (or alternatively backend processing, for non-interactive steps).
* <P>
* For the JSP UI, the job of this class is to maintain the context of where the
@@ -78,7 +78,7 @@ import org.dspace.submit.AbstractProcessingStep;
* specified will be displayed</li>
* <li>If showJSP() was not specified from doPreProcessing(), then the
* doProcessing() method is called an the step completes immediately</li>
* <li>Call doProcessing() method after the user returns from the JSP, in order
* <li>Call doProcessing() method on appropriate AbstractProcessingStep after the user returns from the JSP, in order
* to process the user input</li>
* <li>Call doPostProcessing() method to determine if more user interaction is
* required, and if further JSPs need to be called.</li>
@@ -96,7 +96,7 @@ import org.dspace.submit.AbstractProcessingStep;
* @author Tim Donohue
* @version $Revision$
*/
public interface JSPStep
public abstract class JSPStep
{
/**
* Value to return from doPreProcessing to specify not to load any JSP Page
@@ -127,7 +127,7 @@ public interface JSPStep
* @param subInfo
* submission info object
*/
public void doPreProcessing(Context context, HttpServletRequest request,
public abstract void doPreProcessing(Context context, HttpServletRequest request,
HttpServletResponse response, SubmissionInfo subInfo)
throws ServletException, IOException, SQLException,
AuthorizeException;
@@ -155,8 +155,29 @@ public interface JSPStep
* @param status
* any status/errors reported by doProcessing() method
*/
public void doPostProcessing(Context context, HttpServletRequest request,
public abstract void doPostProcessing(Context context, HttpServletRequest request,
HttpServletResponse response, SubmissionInfo subInfo, int status)
throws ServletException, IOException, SQLException,
AuthorizeException;
/**
* Return the URL path (e.g. /submit/review-metadata.jsp) of the JSP
* which will review the information that was gathered in this Step.
* <P>
* This Review JSP is loaded by the 'Verify' Step, in order to dynamically
* generate a submission verification page consisting of the information
* gathered in all the enabled submission steps.
*
* @param context
* current DSpace context
* @param request
* current servlet request object
* @param response
* current servlet response object
* @param subInfo
* submission info object
*/
public abstract String getReviewJSP(Context context, HttpServletRequest request,
HttpServletResponse response, SubmissionInfo subInfo);
}

View File

@@ -60,33 +60,10 @@ import org.dspace.core.Context;
import org.dspace.submit.AbstractProcessingStep;
/**
* Abstract class for DSpace Submission Steps which use the JSP UI.
* Manages and processes all JSP-UI classes for DSpace Submission steps.
* <P>
* These methods revolve around the following: (1) pre-processing of data to
* prepare for display, (2) displaying data on JSP, and (3) processing of any
* user input (or alternatively backend processing, for non-interactive steps).
* <P>
* For the JSP UI, the job of this class is to maintain the context of where the
* user is within the current "step" of the submission process. Each "step" can
* consist of multiple "pages" (which roughly correspond to HTML displays), so
* this class helps manage which page the user should see next.
* <P>
* The methods of the JSPStepManager are called in this order:
* <ul>
* <li>Call doPreProcessing() method</li>
* <li>If showJSP() was specified from doPreProcessing(), then the JSP
* specified will be displayed</li>
* <li>If showJSP() was not specified from doPreProcessing(), then the
* doProcessing() method is called an the step completes immediately</li>
* <li>Call doProcessing() method after the user returns from the JSP, in order
* to process the user input</li>
* <li>Call doPostProcessing() method to determine if more user interaction is
* required, and if further JSPs need to be called.</li>
* <li>If there are more "pages" in this step then, the process begins again
* (for the new page).</li>
* <li>Once all pages are complete, control is forwarded back to the
* SubmissionController, and the next step is called.</li>
* </ul>
* This manager is utilized by the SubmissionController to appropriately
* load each JSP-UI step, and process any information returned by each step
*
* @see org.dspace.submit.AbstractProcessingStep
* @see org.dspace.app.webui.servlet.SubmissionController
@@ -101,9 +78,17 @@ public class JSPStepManager
private static Logger log = Logger.getLogger(JSPStepManager.class);
/**
* Current JSP step that is being processed by the JSPStepManager
* Current Processing class for step that is being processed by the JSPStepManager
* This is the class that performs processing of information entered in during a step
*/
private JSPStep step = null;
private AbstractProcessingStep stepProcessing = null;
/**
* Current JSP-UI binding class for step that is being processed by the JSPStepManager
* This is the class that manages calling all JSPs, and determines if additional processing
* of information (or confirmation) is necessary.
*/
private JSPStep stepJSPUI = null;
/**
* The SubmissionStepConfig object describing the current step
@@ -114,36 +99,62 @@ public class JSPStepManager
* Initialize the current JSPStepManager object, by loading the
* specified step class.
*
* @param JSPStepClassName
* the full class name of the JSPStep which
* this JSPStepManager should initialize with
* @param stepConfig
* the SubmissionStepConfig object which describes
* this step's configuration in the item-submission.xml
*
* @throws Exception
* if the JSPStep cannot be loaded or the class
* specified doesn't implement the JSPStep interface
*/
public static JSPStepManager loadStep(String JSPStepClassName) throws Exception
public static JSPStepManager loadStep(SubmissionStepConfig stepConfig) throws Exception
{
JSPStepManager stepManager = new JSPStepManager();
// load the step class (using the current class loader)
//save step configuration
stepManager.stepConfig = stepConfig;
/*
* First, load the step processing class (using the current class loader)
*/
ClassLoader loader = stepManager.getClass().getClassLoader();
Class stepClass = loader
.loadClass(JSPStepClassName);
.loadClass(stepConfig.getProcessingClassName());
Object stepInstance = stepClass.newInstance();
if(stepInstance instanceof JSPStep &&
stepInstance instanceof AbstractProcessingStep)
if(stepInstance instanceof AbstractProcessingStep)
{
// load the JSPStep interface for this step
stepManager.step = (JSPStep) stepClass.newInstance();
stepManager.stepProcessing = (AbstractProcessingStep) stepClass.newInstance();
}
else
{
throw new Exception("The submission step class specified by '" + JSPStepClassName +
"' EITHER does not implement the interface org.dspace.app.webui.JSPStep" +
" OR does not extend the class org.dspace.submit.AbstractProcessingStep!" +
throw new Exception("The submission step class specified by '" + stepConfig.getProcessingClassName() +
"' does not extend the class org.dspace.submit.AbstractProcessingStep!" +
" Therefore it cannot be used by the Configurable Submission as the <processing-class>!");
}
/*
* Next, load the step's JSPUI binding class (using the current class loader)
*/
stepClass = loader
.loadClass(stepConfig.getJSPUIClassName());
stepInstance = stepClass.newInstance();
if(stepInstance instanceof JSPStep)
{
// load the JSPStep interface for this step
stepManager.stepJSPUI = (JSPStep) stepClass.newInstance();
}
else
{
throw new Exception("The submission step class specified by '" + stepConfig.getJSPUIClassName() +
"' does not extend the class org.dspace.app.webui.JSPStep!" +
" Therefore it cannot be used by the Configurable Submission for the JSP user interface!");
}
@@ -187,27 +198,13 @@ public class JSPStepManager
SQLException, AuthorizeException
{
/*
* The following HttpServletRequest attributes are required by
* initializeStep():
*
* step = SubmissionStepConfig - the current Submission step
* configuration
*
* This method SHOULD NOT BE OVERRIDDEN, unless it's absolutely
* necessary. If you override this method, make sure you call the
* "doStepStart()" and "doStepEnd()" methods at the appropriate time in
* your initializeStep() method.
* your processStep() method.
*
*/
/*
* Load Submission Information & Step Information
*/
// retrieve our current Submission Process Step
this.stepConfig = SubmissionController
.getCurrentStepConfig(request, subInfo);
/*
* Figure out Current Page in this Step
*/
@@ -310,7 +307,7 @@ public class JSPStepManager
log.debug("Doing pre-processing for step " + this.getClass().getName());
// first, do any pre-processing and get the JSP to display
step.doPreProcessing(context, request, response, subInfo);
stepJSPUI.doPreProcessing(context, request, response, subInfo);
// Complete this step, if this response has not already
// been committed.
@@ -326,13 +323,13 @@ public class JSPStepManager
log.debug("Calling processing for step "
+ this.getClass().getName());
int errorFlag = ((AbstractProcessingStep)step).doProcessing(context, request, response, subInfo);
int errorFlag = stepProcessing.doProcessing(context, request, response, subInfo);
// if it didn't complete successfully, try and log this error!
if (errorFlag != AbstractProcessingStep.STATUS_COMPLETE)
{
// see if an error message was defined!
String errorMessage = ((AbstractProcessingStep)step).getErrorMessage(errorFlag);
String errorMessage = stepProcessing.getErrorMessage(errorFlag);
// if not defined, construct a dummy error
if (errorMessage == null)
@@ -424,7 +421,7 @@ public class JSPStepManager
// and need to do the processing for this step
log.debug("Calling processing for step " + this.getClass().getName());
int status = ((AbstractProcessingStep)step).doProcessing(context, request, response, subInfo);
int status = stepProcessing.doProcessing(context, request, response, subInfo);
log.debug("Calling post-processing for step "
+ this.getClass().getName());
@@ -432,7 +429,7 @@ public class JSPStepManager
// After doing the processing, we have to do any post-processing
// of any potential error messages, in case we need to re-display
// the JSP
step.doPostProcessing(context, request, response, subInfo, status);
stepJSPUI.doPostProcessing(context, request, response, subInfo, status);
int currentPage = AbstractProcessingStep.getCurrentPage(request);
@@ -539,7 +536,7 @@ public class JSPStepManager
protected final boolean hasMorePages(HttpServletRequest request,
SubmissionInfo subInfo, int pageNumber) throws ServletException
{
int numberOfPages = ((AbstractProcessingStep)step).getNumberOfPages(request, subInfo);
int numberOfPages = stepProcessing.getNumberOfPages(request, subInfo);
if (pageNumber < numberOfPages)
{
@@ -692,4 +689,30 @@ public class JSPStepManager
// save to request
request.setAttribute("jsp", pathToJSP);
}
/**
* Return the URL path (e.g. /submit/review-metadata.jsp) of the JSP
* which will review the information that was gathered in the currently
* loaded Step.
* <P>
* This Review JSP is loaded by the 'Verify' Step, in order to dynamically
* generate a submission verification page consisting of the information
* gathered in all the enabled submission steps.
*
* @param context
* current DSpace context
* @param request
* current servlet request object
* @param response
* current servlet response object
* @param subInfo
* submission info object
*/
public String getReviewJSP(Context context, HttpServletRequest request,
HttpServletResponse response, SubmissionInfo subInfo)
{
return stepJSPUI.getReviewJSP(context, request, response, subInfo);
}
}

View File

@@ -55,7 +55,7 @@ import org.dspace.core.Context;
import org.dspace.submit.step.CompleteStep;
/**
* This is the class which defines what happens once a submission completes!
* This is the JSP binding class which defines what happens once a submission completes!
* <P>
* This JSPCompleteStep class works with the SubmissionController servlet and
* when using the JSP-UI
@@ -68,12 +68,11 @@ import org.dspace.submit.step.CompleteStep;
*
* @see org.dspace.app.webui.servlet.SubmissionController
* @see org.dspace.app.webui.submit.JSPStep
* @see org.dspace.submit.step.CompleteStep
*
* @author Tim Donohue
* @version $Revision$
*/
public class JSPCompleteStep extends CompleteStep implements JSPStep
public class JSPCompleteStep extends JSPStep
{
/** log4j logger */
private static Logger log = Logger.getLogger(JSPCompleteStep.class);
@@ -142,5 +141,28 @@ public class JSPCompleteStep extends CompleteStep implements JSPStep
//No post-processing necessary, since submission is complete!
}
/**
* Return the URL path (e.g. /submit/review-metadata.jsp) of the JSP
* which will review the information that was gathered in this Step.
* <P>
* This Review JSP is loaded by the 'Verify' Step, in order to dynamically
* generate a submission verification page consisting of the information
* gathered in all the enabled submission steps.
*
* @param context
* current DSpace context
* @param request
* current servlet request object
* @param response
* current servlet response object
* @param subInfo
* submission info object
*/
public String getReviewJSP(Context context, HttpServletRequest request,
HttpServletResponse response, SubmissionInfo subInfo)
{
return NO_JSP; //no need to return a Review JSP as we are completed!
}
}

View File

@@ -61,12 +61,12 @@ import org.dspace.core.LogManager;
import org.dspace.submit.step.DescribeStep;
/**
* Describe step for DSpace submission process. Handles the pages that gather
* Describe step for DSpace JSP-UI submission process. Handles the pages that gather
* descriptive information (i.e. metadata) for an item being submitted into
* DSpace.
* <P>
* This JSPStepManager class works with the SubmissionController servlet
* for the JSP-UI
* This JSPStep class works with the SubmissionController servlet
* for the JSP-UI.
* <P>
* The following methods are called in this order:
* <ul>
@@ -75,7 +75,7 @@ import org.dspace.submit.step.DescribeStep;
* specified will be displayed</li>
* <li>If showJSP() was not specified from doPreProcessing(), then the
* doProcessing() method is called an the step completes immediately</li>
* <li>Call doProcessing() method after the user returns from the JSP, in order
* <li>Call doProcessing() method on appropriate AbstractProcessingStep after the user returns from the JSP, in order
* to process the user input</li>
* <li>Call doPostProcessing() method to determine if more user interaction is
* required, and if further JSPs need to be called.</li>
@@ -92,11 +92,14 @@ import org.dspace.submit.step.DescribeStep;
* @author Tim Donohue
* @version $Revision$
*/
public class JSPDescribeStep extends DescribeStep implements JSPStep
public class JSPDescribeStep extends JSPStep
{
/** JSP which displays HTML for this Class * */
private static final String DISPLAY_JSP = "/submit/edit-metadata.jsp";
/** JSP which reviews information gathered by DISPLAY_JSP * */
private static final String REVIEW_JSP = "/submit/review-metadata.jsp";
/** log4j logger */
private static Logger log = Logger.getLogger(JSPDescribeStep.class);
@@ -168,7 +171,7 @@ public class JSPDescribeStep extends DescribeStep implements JSPStep
AuthorizeException
{
// check what submit button was pressed in User Interface
String buttonPressed = UIUtil.getSubmitButton(request, NEXT_BUTTON);
String buttonPressed = UIUtil.getSubmitButton(request, DescribeStep.NEXT_BUTTON);
// this shouldn't happen...but just in case!
if (subInfo.getSubmissionItem() == null)
@@ -181,7 +184,7 @@ public class JSPDescribeStep extends DescribeStep implements JSPStep
}
// if user added an extra input field, stay on the same page
if (status == STATUS_MORE_INPUT_REQUESTED)
if (status == DescribeStep.STATUS_MORE_INPUT_REQUESTED)
{
// reload this same JSP to display extra input boxes
showEditMetadata(context, request, response, subInfo);
@@ -192,9 +195,9 @@ public class JSPDescribeStep extends DescribeStep implements JSPStep
// reload this same JSP to display removed entries
showEditMetadata(context, request, response, subInfo);
}
else if (status == STATUS_MISSING_REQUIRED_FIELDS)
else if (status == DescribeStep.STATUS_MISSING_REQUIRED_FIELDS)
{
List missingFields = getErrorFields();
List missingFields = DescribeStep.getErrorFields(request);
// return to current edit metadata screen if any fields missing
if (missingFields.size() > 0)
@@ -229,10 +232,33 @@ public class JSPDescribeStep extends DescribeStep implements JSPStep
Collection c = subInfo.getSubmissionItem().getCollection();
// requires configurable form info per collection
request.setAttribute("submission.inputs", getInputsReader().getInputs(c
request.setAttribute("submission.inputs", DescribeStep.getInputsReader().getInputs(c
.getHandle()));
// forward to edit-metadata JSP
JSPStepManager.showJSP(request, response, subInfo, DISPLAY_JSP);
}
/**
* Return the URL path (e.g. /submit/review-metadata.jsp) of the JSP
* which will review the information that was gathered in this Step.
* <P>
* This Review JSP is loaded by the 'Verify' Step, in order to dynamically
* generate a submission verification page consisting of the information
* gathered in all the enabled submission steps.
*
* @param context
* current DSpace context
* @param request
* current servlet request object
* @param response
* current servlet response object
* @param subInfo
* submission info object
*/
public String getReviewJSP(Context context, HttpServletRequest request,
HttpServletResponse response, SubmissionInfo subInfo)
{
return REVIEW_JSP;
}
}

View File

@@ -59,11 +59,11 @@ import org.dspace.core.Context;
import org.dspace.submit.step.InitialQuestionsStep;
/**
* Initial Submission servlet for DSpace. Handles the initial questions which
* Initial Submission servlet for DSpace JSP-UI. Handles the initial questions which
* are asked to users to gather information regarding what metadata needs to be
* gathered.
* <P>
* This JSPStepManager class works with the SubmissionController servlet
* This JSPStep class works with the SubmissionController servlet
* for the JSP-UI
*
* The following methods are called in this order:
@@ -73,7 +73,7 @@ import org.dspace.submit.step.InitialQuestionsStep;
* specified will be displayed</li>
* <li>If showJSP() was not specified from doPreProcessing(), then the
* doProcessing() method is called an the step completes immediately</li>
* <li>Call doProcessing() method after the user returns from the JSP, in order
* <li>Call doProcessing() method on appropriate AbstractProcessingStep after the user returns from the JSP, in order
* to process the user input</li>
* <li>Call doPostProcessing() method to determine if more user interaction is
* required, and if further JSPs need to be called.</li>
@@ -90,7 +90,7 @@ import org.dspace.submit.step.InitialQuestionsStep;
* @author Tim Donohue
* @version $Revision$
*/
public class JSPInitialQuestionsStep extends InitialQuestionsStep implements JSPStep
public class JSPInitialQuestionsStep extends JSPStep
{
/** JSP which displays initial questions * */
private static final String INITIAL_QUESTIONS_JSP = "/submit/initial-questions.jsp";
@@ -101,6 +101,9 @@ public class JSPInitialQuestionsStep extends InitialQuestionsStep implements JSP
/** JSP which tells the user that theses are not allowed * */
private static final String NO_THESES_JSP = "/submit/no-theses.jsp";
/** JSP which displays information to be reviewed during 'verify step' * */
private static final String REVIEW_JSP = "/submit/review-init.jsp";
/** log4j logger */
private static Logger log = Logger.getLogger(JSPInitialQuestionsStep.class);
@@ -178,7 +181,7 @@ public class JSPInitialQuestionsStep extends InitialQuestionsStep implements JSP
// then prune any excess data.
if (JSPStepManager.getLastJSPDisplayed(request).equals(VERIFY_PRUNE_JSP))
{
if (status == STATUS_CANCEL_PRUNE)
if (status == InitialQuestionsStep.STATUS_CANCEL_PRUNE)
{
// User cancelled pruning (show initial questions again)
showInitialQuestions(context, request, response, subInfo);
@@ -188,7 +191,7 @@ public class JSPInitialQuestionsStep extends InitialQuestionsStep implements JSP
else
// Otherwise, if just coming from "initial questions" page
{
if (status == STATUS_THESIS_REJECTED)
if (status == InitialQuestionsStep.STATUS_THESIS_REJECTED)
{
// Display no-theses JSP to user
JSPStepManager.showJSP(request, response, subInfo, NO_THESES_JSP);
@@ -199,7 +202,7 @@ public class JSPInitialQuestionsStep extends InitialQuestionsStep implements JSP
// If anything is going to be removed from the item as a result
// of changing the answer to one of the questions, we need
// to inform the user and make sure that's OK
if (status == STATUS_VERIFY_PRUNE)
if (status == InitialQuestionsStep.STATUS_VERIFY_PRUNE)
{
showVerifyPrune(context, request, response, subInfo,
multipleTitles, publishedBefore, multipleFiles);
@@ -276,15 +279,33 @@ public class JSPInitialQuestionsStep extends InitialQuestionsStep implements JSP
request.setAttribute("multiple.titles", new Boolean(multipleTitles));
request.setAttribute("published.before", new Boolean(publishedBefore));
request.setAttribute("multiple.files", new Boolean(multipleFiles));
request.setAttribute("will.remove.titles",
new Boolean(willRemoveTitles));
request.setAttribute("will.remove.date", new Boolean(willRemoveDate));
request.setAttribute("will.remove.files", new Boolean(willRemoveFiles));
request.setAttribute("button.pressed", UIUtil.getSubmitButton(request,
NEXT_BUTTON));
InitialQuestionsStep.NEXT_BUTTON));
// forward to verify prune JSP
// forward to initial questions JSP
JSPStepManager.showJSP(request, response, subInfo, VERIFY_PRUNE_JSP);
}
/**
* Return the URL path (e.g. /submit/review-metadata.jsp) of the JSP
* which will review the information that was gathered in this Step.
* <P>
* This Review JSP is loaded by the 'Verify' Step, in order to dynamically
* generate a submission verification page consisting of the information
* gathered in all the enabled submission steps.
*
* @param context
* current DSpace context
* @param request
* current servlet request object
* @param response
* current servlet response object
* @param subInfo
* submission info object
*/
public String getReviewJSP(Context context, HttpServletRequest request,
HttpServletResponse response, SubmissionInfo subInfo)
{
return REVIEW_JSP;
}
}

View File

@@ -64,10 +64,10 @@ import org.dspace.license.CreativeCommons;
import org.dspace.submit.step.LicenseStep;
/**
* License servlet for DSpace. Presents the user with license information
* License step for DSpace JSP-UI. Presents the user with license information
* required for all items submitted into DSpace.
* <P>
* This JSPStepManager class works with the SubmissionController servlet
* This JSPStep class works with the SubmissionController servlet
* for the JSP-UI
* <P>
* The following methods are called in this order:
@@ -77,7 +77,7 @@ import org.dspace.submit.step.LicenseStep;
* specified will be displayed</li>
* <li>If showJSP() was not specified from doPreProcessing(), then the
* doProcessing() method is called an the step completes immediately</li>
* <li>Call doProcessing() method after the user returns from the JSP, in order
* <li>Call doProcessing() method on appropriate AbstractProcessingStep after the user returns from the JSP, in order
* to process the user input</li>
* <li>Call doPostProcessing() method to determine if more user interaction is
* required, and if further JSPs need to be called.</li>
@@ -94,7 +94,7 @@ import org.dspace.submit.step.LicenseStep;
* @author Tim Donohue
* @version $Revision$
*/
public class JSPLicenseStep extends LicenseStep implements JSPStep
public class JSPLicenseStep extends JSPStep
{
/** JSP which displays default license information * */
private static final String LICENSE_JSP = "/submit/show-license.jsp";
@@ -137,7 +137,7 @@ public class JSPLicenseStep extends LicenseStep implements JSPStep
AuthorizeException
{
// if creative commons licensing is enabled, then it is page #1
if (CreativeCommons.isEnabled() && getCurrentPage(request) == 1)
if (CreativeCommons.isEnabled() && LicenseStep.getCurrentPage(request) == 1)
{
showCCLicense(context, request, response, subInfo);
}
@@ -176,7 +176,7 @@ public class JSPLicenseStep extends LicenseStep implements JSPStep
throws ServletException, IOException, SQLException,
AuthorizeException
{
String buttonPressed = Util.getSubmitButton(request, CANCEL_BUTTON);
String buttonPressed = Util.getSubmitButton(request, LicenseStep.CANCEL_BUTTON);
// JSP-UI Specific (only JSP UI has a "reject" button):
// License was explicitly rejected
@@ -251,4 +251,27 @@ public class JSPLicenseStep extends LicenseStep implements JSPStep
JSPStepManager.showJSP(request, response, subInfo, CC_LICENSE_JSP);
}
/**
* Return the URL path (e.g. /submit/review-metadata.jsp) of the JSP
* which will review the information that was gathered in this Step.
* <P>
* This Review JSP is loaded by the 'Verify' Step, in order to dynamically
* generate a submission verification page consisting of the information
* gathered in all the enabled submission steps.
*
* @param context
* current DSpace context
* @param request
* current servlet request object
* @param response
* current servlet response object
* @param subInfo
* submission info object
*/
public String getReviewJSP(Context context, HttpServletRequest request,
HttpServletResponse response, SubmissionInfo subInfo)
{
return NO_JSP; //signing off on license does not require reviewing
}
}

View File

@@ -68,11 +68,12 @@ import org.dspace.submit.step.SampleStep;
* <p>
* This step can be added to any Submission process (for testing purposes) by
* adding the following to the appropriate <submission-process> tag in the
* /config/item-submission-JSPUI.xml:
* /config/item-submission.xml:
*
* <step> <heading>Sample</heading>
* <class-name>org.dspace.app.webui.submit.step.JSPSampleStep</class-name>
* <review-jsp>/submit/sample-review.jsp</review-jsp>
* <step>
* <heading>Sample</heading>
* <processing-class>org.dspace.submit.step.SampleStep</processing-class>
* <jspui-binding>org.dspace.app.webui.submit.step.JSPSampleStep</jspui-binding>
* <workflow-editable>true</workflow-editable>
* </step>
*
@@ -84,7 +85,7 @@ import org.dspace.submit.step.SampleStep;
* specified will be displayed</li>
* <li>If showJSP() was not specified from doPreProcessing(), then the
* doProcessing() method is called an the step completes immediately</li>
* <li>Call doProcessing() method after the user returns from the JSP, in order
* <li>Call doProcessing() method on appropriate AbstractProcessingStep after the user returns from the JSP, in order
* to process the user input</li>
* <li>Call doPostProcessing() method to determine if more user interaction is
* required, and if further JSPs need to be called.</li>
@@ -101,11 +102,18 @@ import org.dspace.submit.step.SampleStep;
* @author Tim Donohue
* @version $Revision$
*/
public class JSPSampleStep extends SampleStep implements JSPStep
public class JSPSampleStep extends JSPStep
{
/** log4j logger */
private static Logger log = Logger.getLogger(JSPSampleStep.class);
/** JSP which displays the step to the user * */
private static final String DISPLAY_JSP = "/submit/sample-step.jsp";
/** JSP which displays information to be reviewed during 'verify step' * */
private static final String REVIEW_JSP = "/submit/review-sample.jsp";
/**
* Do any pre-processing to determine which JSP (if any) is used to generate
* the UI for this step. This method should include the gathering and
@@ -181,7 +189,7 @@ public class JSPSampleStep extends SampleStep implements JSPStep
request.setAttribute("my.url", myDSpaceURL);
// Tell JSPStepManager class to load "sample-step.jsp"
JSPStepManager.showJSP(request, response, subInfo, "/submit/sample-step.jsp");
JSPStepManager.showJSP(request, response, subInfo, DISPLAY_JSP);
}
/**
@@ -251,7 +259,7 @@ public class JSPSampleStep extends SampleStep implements JSPStep
// has more than one "page" within the Progress Bar. It can
// help you determine which Page the user just came from,
// as well as determine which JSP to load in doPreProcessing()
int currentPageNum = getCurrentPage(request);
int currentPageNum = SampleStep.getCurrentPage(request);
// This function returns the NAME of the button the user
// just pressed in order to submit the form.
@@ -289,7 +297,7 @@ public class JSPSampleStep extends SampleStep implements JSPStep
}
// Here's some sample error message processing!
if (status == STATUS_USER_INPUT_ERROR)
if (status == SampleStep.STATUS_USER_INPUT_ERROR)
{
// special processing for this error message
}
@@ -378,4 +386,28 @@ public class JSPSampleStep extends SampleStep implements JSPStep
// in most cases, you'll want to just return 1
return 1;
}
/**
* Return the URL path (e.g. /submit/review-metadata.jsp) of the JSP
* which will review the information that was gathered in this Step.
* <P>
* This Review JSP is loaded by the 'Verify' Step, in order to dynamically
* generate a submission verification page consisting of the information
* gathered in all the enabled submission steps.
*
* @param context
* current DSpace context
* @param request
* current servlet request object
* @param response
* current servlet response object
* @param subInfo
* submission info object
*/
public String getReviewJSP(Context context, HttpServletRequest request,
HttpServletResponse response, SubmissionInfo subInfo)
{
return REVIEW_JSP;
}
}

View File

@@ -62,9 +62,9 @@ import org.dspace.submit.step.SelectCollectionStep;
/**
* Step which controls selecting a Collection for the Item Submission process
* for DSpace.
* for DSpace JSP-UI
* <P>
* This JSPStepManager class works with the SubmissionController servlet
* This JSPStep class works with the SubmissionController servlet
* for the JSP-UI
* <P>
* The following methods are called in this order:
@@ -74,7 +74,7 @@ import org.dspace.submit.step.SelectCollectionStep;
* specified will be displayed</li>
* <li>If showJSP() was not specified from doPreProcessing(), then the
* doProcessing() method is called an the step completes immediately</li>
* <li>Call doProcessing() method after the user returns from the JSP, in order
* <li>Call doProcessing() method on appropriate AbstractProcessingStep after the user returns from the JSP, in order
* to process the user input</li>
* <li>Call doPostProcessing() method to determine if more user interaction is
* required, and if further JSPs need to be called.</li>
@@ -91,7 +91,7 @@ import org.dspace.submit.step.SelectCollectionStep;
* @author Tim Donohue
* @version $Revision$
*/
public class JSPSelectCollectionStep extends SelectCollectionStep implements JSPStep
public class JSPSelectCollectionStep extends JSPStep
{
/** JSP which displays HTML for this Class * */
private static final String SELECT_COLLECTION_JSP = "/submit/select-collection.jsp";
@@ -219,7 +219,7 @@ public class JSPSelectCollectionStep extends SelectCollectionStep implements JSP
{
// if the user didn't select a collection,
// send him/her back to "select a collection" page
if (status == STATUS_NO_COLLECTION)
if (status == SelectCollectionStep.STATUS_NO_COLLECTION)
{
// specify "no collection" error message should be displayed
request.setAttribute("no.collection", new Boolean(true));
@@ -227,10 +227,33 @@ public class JSPSelectCollectionStep extends SelectCollectionStep implements JSP
// reload this page, by re-calling doPreProcessing()
doPreProcessing(context, request, response, subInfo);
}
else if (status == STATUS_INVALID_COLLECTION)
else if (status == SelectCollectionStep.STATUS_INVALID_COLLECTION)
{
JSPManager.showInvalidIDError(request, response, request
.getParameter("collection"), Constants.COLLECTION);
}
}
/**
* Return the URL path (e.g. /submit/review-metadata.jsp) of the JSP
* which will review the information that was gathered in this Step.
* <P>
* This Review JSP is loaded by the 'Verify' Step, in order to dynamically
* generate a submission verification page consisting of the information
* gathered in all the enabled submission steps.
*
* @param context
* current DSpace context
* @param request
* current servlet request object
* @param response
* current servlet response object
* @param subInfo
* submission info object
*/
public String getReviewJSP(Context context, HttpServletRequest request,
HttpServletResponse response, SubmissionInfo subInfo)
{
return NO_JSP; //at this time, you cannot review what collection you selected.
}
}

View File

@@ -72,10 +72,10 @@ import org.dspace.core.LogManager;
import org.dspace.submit.step.UploadStep;
/**
* Upload step for DSpace. Handles the pages that revolve around uploading files
* Upload step for DSpace JSP-UI. Handles the pages that revolve around uploading files
* (and verifying a successful upload) for an item being submitted into DSpace.
* <P>
* This JSPStepManager class works with the SubmissionController servlet
* This JSPStep class works with the SubmissionController servlet
* for the JSP-UI
* <P>
* The following methods are called in this order:
@@ -85,7 +85,7 @@ import org.dspace.submit.step.UploadStep;
* specified will be displayed</li>
* <li>If showJSP() was not specified from doPreProcessing(), then the
* doProcessing() method is called an the step completes immediately</li>
* <li>Call doProcessing() method after the user returns from the JSP, in order
* <li>Call doProcessing() method on appropriate AbstractProcessingStep after the user returns from the JSP, in order
* to process the user input</li>
* <li>Call doPostProcessing() method to determine if more user interaction is
* required, and if further JSPs need to be called.</li>
@@ -102,7 +102,7 @@ import org.dspace.submit.step.UploadStep;
* @author Tim Donohue
* @version $Revision$
*/
public class JSPUploadStep extends UploadStep implements JSPStep
public class JSPUploadStep extends JSPStep
{
/** JSP to choose files to upload * */
private static final String CHOOSE_FILE_JSP = "/submit/choose-file.jsp";
@@ -122,6 +122,9 @@ public class JSPUploadStep extends UploadStep implements JSPStep
/** JSP to show any upload errors * */
private static final String UPLOAD_ERROR_JSP = "/submit/upload-error.jsp";
/** JSP to review uploaded files * */
private static final String REVIEW_JSP = "/submit/review-upload.jsp";
/** log4j logger */
private static Logger log = Logger.getLogger(JSPUploadStep.class);
@@ -167,99 +170,6 @@ public class JSPUploadStep extends UploadStep implements JSPStep
showUploadPage(context, request, response, subInfo, false);
}
/**
* Do any processing of the information input by the user, and/or perform
* step processing (if no user interaction required)
* <P>
* 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)
* <P>
* 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!
*
* @param context
* current DSpace context
* @param request
* current servlet request object
* @param response
* current servlet response object
* @param subInfo
* submission info object
* @return Status or error flag which will be processed by
* doPostProcessing() below! (if STATUS_COMPLETE or 0 is returned,
* no errors occurred!)
*/
public int doProcessing(Context context, HttpServletRequest request,
HttpServletResponse response, SubmissionInfo subInfo)
throws ServletException, IOException, SQLException,
AuthorizeException
{
//get button user pressed
String buttonPressed = Util.getSubmitButton(request, NEXT_BUTTON);
//JSP UI has to upload the file before it can do other UI-generic processing
FileUploadRequest wrapper = null;
String filePath = null;
InputStream fileInputStream = null;
String contentType = request.getContentType();
if (buttonPressed.equalsIgnoreCase(SUBMIT_UPLOAD_BUTTON))
{
// if multipart form, then we are uploading a file
if ((contentType != null)
&& (contentType.indexOf("multipart/form-data") != -1))
{
try
{
// if we already have a FileUploadRequest, use it
if (Class.forName("org.dspace.app.webui.util.FileUploadRequest")
.isInstance(request))
{
wrapper = (FileUploadRequest) request;
}
else
{
// Wrap multipart request to get the submission info
wrapper = new FileUploadRequest(request);
}
File temp = wrapper.getFile("file");
//if file exists and has a size greater than zero
if (temp != null && temp.length() > 0)
{
// Read the temp file into an inputstream
fileInputStream = new BufferedInputStream(
new FileInputStream(temp));
filePath = wrapper.getFilesystemName("file");
// cleanup our temp file
temp.delete();
}
//save file info to request (for UploadStep class)
request.setAttribute("file-path", filePath);
request.setAttribute("file-inputstream", fileInputStream);
request.setAttribute("file-description", wrapper.getParameter("description"));
}
catch (IOException ie)
{
// Problem with uploading
log.warn(LogManager.getHeader(context, "upload_error", ""), ie);
}
catch (Exception e)
{
throw new ServletException(e);
}
}
}
//call super method to finish UploadStep processing
return super.doProcessing(context, request, response, subInfo);
}
/**
* Do any post-processing after the step's backend processing occurred (in
* the doProcessing() method).
@@ -288,10 +198,10 @@ public class JSPUploadStep extends UploadStep implements JSPStep
throws ServletException, IOException, SQLException,
AuthorizeException
{
String buttonPressed = UIUtil.getSubmitButton(request, NEXT_BUTTON);
String buttonPressed = UIUtil.getSubmitButton(request, UploadStep.NEXT_BUTTON);
// Do we need to skip the upload entirely?
if (buttonPressed.equalsIgnoreCase(SUBMIT_SKIP_BUTTON))
if (buttonPressed.equalsIgnoreCase(UploadStep.SUBMIT_SKIP_BUTTON))
{
Bundle[] bundles = subInfo.getSubmissionItem().getItem()
.getBundles("ORIGINAL");
@@ -317,16 +227,16 @@ public class JSPUploadStep extends UploadStep implements JSPStep
// Check for Errors!
// ------------------------------
// if an error or message was passed back, determine what to do!
if (status != STATUS_COMPLETE)
if (status != UploadStep.STATUS_COMPLETE)
{
if (status == STATUS_INTEGRITY_ERROR)
if (status == UploadStep.STATUS_INTEGRITY_ERROR)
{
// Some type of integrity error occurred
log.warn(LogManager.getHeader(context, "integrity_error",
UIUtil.getRequestLogInfo(request)));
JSPManager.showIntegrityError(request, response);
}
else if (status == STATUS_UPLOAD_ERROR || status == STATUS_NO_FILES_ERROR)
else if (status == UploadStep.STATUS_UPLOAD_ERROR || status == UploadStep.STATUS_NO_FILES_ERROR)
{
// There was a problem uploading the file!
@@ -349,7 +259,7 @@ public class JSPUploadStep extends UploadStep implements JSPStep
JSPStepManager.showJSP(request, response, subInfo, UPLOAD_ERROR_JSP);
}
}
else if (status == STATUS_UNKNOWN_FORMAT)
else if (status == UploadStep.STATUS_UNKNOWN_FORMAT)
{
// user uploaded a file where the format is unknown to DSpace
@@ -360,7 +270,7 @@ public class JSPUploadStep extends UploadStep implements JSPStep
// As long as there are no errors, clicking Next
// should immediately send them to the next step
if (status == STATUS_COMPLETE && buttonPressed.equals(NEXT_BUTTON))
if (status == UploadStep.STATUS_COMPLETE && buttonPressed.equals(UploadStep.NEXT_BUTTON))
{
// just return, so user will continue on to next step!
return;
@@ -369,7 +279,7 @@ public class JSPUploadStep extends UploadStep implements JSPStep
// ------------------------------
// Check for specific buttons
// ------------------------------
if (buttonPressed.equals(SUBMIT_MORE_BUTTON))
if (buttonPressed.equals(UploadStep.SUBMIT_MORE_BUTTON))
{
// Upload another file (i.e. show the Choose File jsp again)
showChooseFile(context, request, response, subInfo);
@@ -614,4 +524,27 @@ public class JSPUploadStep extends UploadStep implements JSPStep
// load JSP which allows the user to select a file to upload
JSPStepManager.showJSP(request, response, subInfo, FILE_DESCRIPTION_JSP);
}
/**
* Return the URL path (e.g. /submit/review-metadata.jsp) of the JSP
* which will review the information that was gathered in this Step.
* <P>
* This Review JSP is loaded by the 'Verify' Step, in order to dynamically
* generate a submission verification page consisting of the information
* gathered in all the enabled submission steps.
*
* @param context
* current DSpace context
* @param request
* current servlet request object
* @param response
* current servlet response object
* @param subInfo
* submission info object
*/
public String getReviewJSP(Context context, HttpServletRequest request,
HttpServletResponse response, SubmissionInfo subInfo)
{
return REVIEW_JSP;
}
}

View File

@@ -94,7 +94,7 @@ import org.dspace.submit.step.VerifyStep;
* @author Tim Donohue
* @version $Revision$
*/
public class JSPVerifyStep extends VerifyStep implements JSPStep
public class JSPVerifyStep extends JSPStep
{
/** JSP which displays initial questions * */
public static final String VERIFY_JSP = "/submit/review.jsp";
@@ -173,14 +173,25 @@ public class JSPVerifyStep extends VerifyStep implements JSPStep
// load this step's information
SubmissionStepConfig s = subProcessConfig.getStep(stepNum);
// get this step's review JSP
String reviewJSP = s.getReviewJSP();
if ((reviewJSP != null) && (reviewJSP.length() > 0))
try
{
// save the path to this steps JSP to our reviewData Hashmap
// (with the key = stepNum.pageNum)
reviewData.put(stepAndPage, reviewJSP);
JSPStepManager stepManager = JSPStepManager.loadStep(s);
// get this step's review JSP
String reviewJSP = stepManager.getReviewJSP(context, request, response, subInfo);
if ((reviewJSP != null) && (reviewJSP.length() > 0))
{
// save the path to this steps JSP to our reviewData Hashmap
// (with the key = stepNum.pageNum)
reviewData.put(stepAndPage, reviewJSP);
}
}
catch(Exception e)
{
log.error("Problem loading Review JSP for step #" + s.getStepNumber() + ". ", e);
JSPManager.showIntegrityError(request, response);
return;
}
}
}
@@ -233,4 +244,27 @@ public class JSPVerifyStep extends VerifyStep implements JSPStep
{
// nothing to do from the Verify Step.
}
/**
* Return the URL path (e.g. /submit/review-metadata.jsp) of the JSP
* which will review the information that was gathered in this Step.
* <P>
* This Review JSP is loaded by the 'Verify' Step, in order to dynamically
* generate a submission verification page consisting of the information
* gathered in all the enabled submission steps.
*
* @param context
* current DSpace context
* @param request
* current servlet request object
* @param response
* current servlet response object
* @param subInfo
* submission info object
*/
public String getReviewJSP(Context context, HttpServletRequest request,
HttpServletResponse response, SubmissionInfo subInfo)
{
return NO_JSP; //no review JSP, since this is the verification step
}
}

View File

@@ -181,8 +181,9 @@ public class FileUploadRequest extends HttpServletRequestWrapper
public File getFile(String name)
{
String filename = getFilename(((FileItem) fileitems.get(name))
.getName());
FileItem temp = (FileItem) fileitems.get(name);
String tempName = temp.getName();
String filename = getFilename(tempName);
if ("".equals(filename.trim()))
{
return null;
@@ -190,6 +191,12 @@ public class FileUploadRequest extends HttpServletRequestWrapper
return new File(tempDir + File.separator + filename);
}
public Enumeration getFileParameterNames()
{
Collection c = fileitems.keySet();
return Collections.enumeration(c);
}
public Enumeration getFileNames()
{
return filenames.elements();

View File

@@ -122,10 +122,11 @@
String heading = (String) progressBarInfo.get(stepAndPage);
//if the heading contains a period (.), then assume
//it is referencing a property in Messages.properties
//it is referencing a key in Messages.properties
if(heading.indexOf(".") >= 0)
{
heading = LocaleSupport.getLocalizedMessage(pageContext, heading);
//prepend the existing key with "jsp." since we are using JSP-UI
heading = LocaleSupport.getLocalizedMessage(pageContext, "jsp." + heading);
}
//split into stepNum and pageNum

View File

@@ -281,7 +281,9 @@ abstract public class AbstractStep extends AbstractDSpaceTransformer
while(i.hasNext())
{
String entryNum = (String) i.next();
String entryNameKey = (String) progBarInfo.get(entryNum);
//Since we are using XML-UI, we need to prepend the heading key with "xmlui.Submission."
String entryNameKey = "xmlui.Submission." + (String) progBarInfo.get(entryNum);
//the value of entryNum is current step & page
//(e.g. 1.2 is page 2 of step 1)

View File

@@ -43,8 +43,6 @@ package org.dspace.app.xmlui.aspect.submission;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.servlet.ServletException;
@@ -78,8 +76,8 @@ import org.dspace.workflow.WorkflowManager;
* Since data validation is cumbersome inside a flow script this
* is a collection of methods to preform processing at each step
* of the flow, the flow script will ties these operations
* together in a meaningfull order but all actualy processing
* is done through these variaus processes.
* together in a meaningful order but all actually processing
* is done through these various processes.
*
* @author Scott Phillips
* @author Tim Donohue (modified for Configurable Submission)
@@ -89,10 +87,6 @@ public class FlowUtils {
private static Logger log = Logger.getLogger(FlowUtils.class);
/** "Name" of the XML-based User Interface - Used to load SubmissionInfo **/
private static String UI_NAME = "XMLUI";
/** Where the submissionInfo is stored on an HTTP Request object */
private final static String DSPACE_SUBMISSION_INFO = "dspace.submission.info";
@@ -190,7 +184,7 @@ public class FlowUtils {
.get(HttpEnvironment.HTTP_REQUEST_OBJECT);
// load submission info
subInfo = SubmissionInfo.load(httpRequest, UI_NAME, submission);
subInfo = SubmissionInfo.load(httpRequest, submission);
// Set the session ID
context.setExtraLogInfo("session_id="
@@ -456,7 +450,7 @@ public class FlowUtils {
//Load the Submission Process for the collection this WSI is associated with
Collection c = wsi.getCollection();
SubmissionConfigReader subConfigReader = new SubmissionConfigReader(UI_NAME);
SubmissionConfigReader subConfigReader = new SubmissionConfigReader();
SubmissionConfig subConfig = subConfigReader.getSubmissionConfig(c.getHandle(), false);
// Set the "stage_reached" column on the workspace item

View File

@@ -535,7 +535,7 @@ function processPage(workspaceID, stepConfig, page)
{
//save error fields to global ERROR_FIELDS variable,
//for step-specific post-processing
saveErrorFields(stepClass.getErrorFields());
saveErrorFields(stepClass.getErrorFields(getHttpRequest()));
}
else //otherwise, no errors at all
{

View File

@@ -489,15 +489,6 @@
<message key="xmlui.Submission.general.showfull">Show full item record</message>
<message key="xmlui.Submission.general.showsimple">Show simple item record</message>
<!-- submission progress bar messages -->
<message key="xmlui.Submission.general.progress.initial-questions">Initial Questions</message>
<message key="xmlui.Submission.general.progress.describe">Describe</message>
<message key="xmlui.Submission.general.progress.upload">Upload</message>
<message key="xmlui.Submission.general.progress.review">Review</message>
<message key="xmlui.Submission.general.progress.creative-commons">Creative Commons</message>
<message key="xmlui.Submission.general.progress.license">License</message>
<message key="xmlui.Submission.general.progress.complete">Complete</message>
<!-- org.dspace.app.xmlui.submission.CollectiovViewer -->
<message key="xmlui.Submission.CollectionViewer.link1">Submit a new item to this collection</message>
@@ -559,6 +550,15 @@
<message key="xmlui.Submission.Submissions.status_7">Submission has been archived</message>
<message key="xmlui.Submission.Submissions.status_unknown">Unknown state</message>
<!-- submission progress bar messages -->
<message key="xmlui.Submission.submit.progressbar.initial-questions">Initial Questions</message>
<message key="xmlui.Submission.submit.progressbar.describe">Describe</message>
<message key="xmlui.Submission.submit.progressbar.upload">Upload</message>
<message key="xmlui.Submission.submit.progressbar.verify">Review</message>
<message key="xmlui.Submission.submit.progressbar.creative-commons">Creative Commons</message>
<message key="xmlui.Submission.submit.progressbar.license">License</message>
<message key="xmlui.Submission.submit.progressbar.complete">Complete</message>
<!-- org.dspace.app.xmlui.Submission.submit.ResumeStep -->
<message key="xmlui.Submission.submit.ResumeStep.submit_resume">Resume</message>
<message key="xmlui.Submission.submit.ResumeStep.submit_cancel">Cancel</message>

View File

@@ -1,178 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE item-submission SYSTEM "item-submission.dtd">
<!-- XML-UI Configurable Submission configuration file -->
<!-- This XML configuration file allows you to configure the ordering -->
<!-- and number of the steps that occur in the Item Submission Process. -->
<item-submission>
<!-- The process-map maps collection handles to a particular Item -->
<!-- Submission Process. This requires that a collection's name be -->
<!-- unique, even within a community. DSpace does however insure that each-->
<!-- collection's handle is unique. Process-map provides the means to -->
<!-- associate a unique collection name with an Item Submission process. -->
<!-- The process-map also provides the special handle "default" (which is -->
<!-- never a collection), here mapped to "traditional". Any collection -->
<!-- which does not appear in this map will be associated with the mapping-->
<!-- for handle "default". -->
<submission-map>
<name-map collection-handle="default" submission-name="traditional" />
</submission-map>
<!-- The 'step-definitions' allows you to define steps which you may wish -->
<!-- to "share" amongst multiple submission-item definitions. In order to-->
<!-- share the same step definition, you can refer to it by its unique id -->
<!-- defined in this section. EVERY 'step' in this section MUST have a -->
<!-- unique identifier in the 'id' attribute! -->
<!-- -->
<!-- Each <step> REQUIRES the following attributes (@) and properties: -->
<!-- @id - The unique identifier for this step -->
<!-- <processing-class> - The class which will process all information for-->
<!-- this step. The class must extend the -->
<!-- 'org.dspace.submit.AbstractProcessingStep' class! -->
<!-- This property should reference the full path of the class-->
<!-- (e.g. org.dspace.submit.step.MyCustomStep) -->
<!-- -->
<!-- The following properties are OPTIONAL for each <step>: -->
<!-- <heading> - References the message text (from the -->
<!-- Messages.xml file) which will be used as this -->
<!-- step's heading in the progress-bar. If unspecified, -->
<!-- the step does not show up in the Progress Bar. -->
<!-- <xml-ui-class> - The class which acts as the XML-UI Transformer -->
<!-- for this step. This class must extend the -->
<!-- 'org.dspace.app.xmlui.submission.AbstractSubmissionStep'-->
<!-- class. This class must generate the body of a valid -->
<!-- XML DRI document which can be transformed by Manakin. -->
<!-- <workflow-editable> - whether or not this step will appear during the-->
<!-- "Edit Metadata" workflow approval process. This field-->
<!-- defaults to TRUE (which means it can be edited during -->
<!-- the "Edit Metadata" workflow stage) -->
<!-- -->
<!-- -->
<step-definitions>
<!-- The "collection" step is a "special step" which is *REQUIRED* to be-->
<!-- in this section! In DSpace, all submitted items must be -->
<!-- immediately assigned to a collection. This step ensures that a -->
<!-- collection is always selected. If a user is already submitting -->
<!-- from within a Collection (by clicking the "Submit to This -->
<!-- Collection" button) then this step will be automatically skipped. -->
<!-- In all other cases, this step ensures that the user *first* selects-->
<!-- a collection! -->
<!-- Since this is a "special step", it is *automatically* added at the -->
<!-- beginning of each 'submission-process' (therefore it should not be -->
<!-- referenced by any of the below 'submission-process' tags). Also as-->
<!-- a special step, it is currently NEVER editable in a workflow. -->
<step id="collection">
<heading></heading> <!--can specify heading, if you want it to appear in Progress Bar-->
<processing-class>org.dspace.submit.step.SelectCollectionStep</processing-class>
<xml-ui-class>org.dspace.app.xmlui.aspect.submission.submit.SelectCollectionStep</xml-ui-class>
<workflow-editable>false</workflow-editable>
</step>
<!-- The "complete" step is a "special step" which is *REQUIRED* to be -->
<!-- in this section! In DSpace, when a submission is completed, -->
<!-- a workflow is automatically kicked off (if one exists) -->
<!-- This "complete" step performs all backend processing that occurs -->
<!-- immediately upon completing the submission. -->
<!-- Since this is a "special step", it is *automatically* added at the -->
<!-- end of each 'submission-process' (therefore it should not be -->
<!-- referenced by any of the below 'submission-process' tags). Also as-->
<!-- a special step, it is currently NEVER editable in a workflow. -->
<step id="complete">
<heading>xmlui.Submission.general.progress.complete</heading>
<processing-class>org.dspace.submit.step.CompleteStep</processing-class>
<workflow-editable>false</workflow-editable>
</step>
</step-definitions>
<!-- The submission-definitions map lays out the detailed definition of -->
<!-- all the Item Submission Processes (and the ordering of their steps). -->
<!-- Each separate "submission-process" has a unique name as an attribute,-->
<!-- which matches one of the names in the process-map. One named -->
<!-- "submit-process" has the name "traditional"; as this name suggests, -->
<!-- it is the default item submission process, which gets used when -->
<!-- the specified collection has no correspondingly named submit-process.-->
<!-- -->
<!-- Each submit-process contains an ordered set of steps; each step -->
<!-- defines one "step" occurring during the process of submitting an -->
<!-- item. A step can either be reference by 'id' (in which case it must -->
<!-- be defined in <step-definitions> above), or defined completely here. -->
<!-- -->
<!-- If the step is not referred to by 'id', then the <step> REQUIRES the -->
<!-- following properties are defined: -->
<!-- <processing-class> - The class which will process all information for-->
<!-- this step. The class must extend the -->
<!-- 'org.dspace.submit.AbstractProcessingStep' class! -->
<!-- This property should reference the full path of the class-->
<!-- (e.g. org.dspace.submit.step.MyCustomStep) -->
<!-- -->
<!-- The following properties are OPTIONAL for each <step>: -->
<!-- <heading> - References the message text (from the -->
<!-- Messages.xml file) which will be used as this -->
<!-- step's heading in the progress-bar. If unspecified, -->
<!-- the Step does not show up in the Progress Bar. -->
<!-- <xml-ui-class> - The class which acts as the XML-UI Transformer -->
<!-- for this step. This class must extend the -->
<!-- 'org.dspace.app.xmlui.submission.AbstractSubmissionStep'-->
<!-- class. This class must generate the body of a valid -->
<!-- XML DRI document which can be transformed by Manakin. -->
<!-- <workflow-editable> - whether or not this step will appear during the-->
<!-- "Edit Metadata" workflow approval process. This field-->
<!-- defaults to TRUE (which means it can be edited during -->
<!-- the "Edit Metadata" workflow stage). Set to either -->
<!-- "true" or "false". -->
<!-- -->
<submission-definitions>
<!--This "traditional" process defines the DEFAULT item submission process-->
<submission-process name="traditional">
<!--Step 1 will be to gather initial information-->
<step>
<heading>xmlui.Submission.general.progress.initial-questions</heading>
<processing-class>org.dspace.submit.step.InitialQuestionsStep</processing-class>
<xml-ui-class>org.dspace.app.xmlui.aspect.submission.submit.InitialQuestionsStep</xml-ui-class>
<workflow-editable>true</workflow-editable>
</step>
<!--Step 2 will be to Describe the item.-->
<step>
<heading>xmlui.Submission.general.progress.describe</heading>
<processing-class>org.dspace.submit.step.DescribeStep</processing-class>
<xml-ui-class>org.dspace.app.xmlui.aspect.submission.submit.DescribeStep</xml-ui-class>
<workflow-editable>true</workflow-editable>
</step>
<!--Step 3 will be to Upload the item-->
<step>
<heading>xmlui.Submission.general.progress.upload</heading>
<processing-class>org.dspace.submit.step.UploadStep</processing-class>
<xml-ui-class>org.dspace.app.xmlui.aspect.submission.submit.UploadStep</xml-ui-class>
<workflow-editable>true</workflow-editable>
</step>
<!--Step 4 will be to Verify everything -->
<step>
<heading>xmlui.Submission.general.progress.review</heading>
<processing-class>org.dspace.submit.step.VerifyStep</processing-class>
<xml-ui-class>org.dspace.app.xmlui.aspect.submission.submit.ReviewStep</xml-ui-class>
<workflow-editable>true</workflow-editable>
</step>
<!--Step 5 will be to Sign off on the License-->
<step>
<heading>xmlui.Submission.general.progress.license</heading>
<processing-class>org.dspace.submit.step.LicenseStep</processing-class>
<xml-ui-class>org.dspace.app.xmlui.aspect.submission.submit.LicenseStep</xml-ui-class>
<workflow-editable>false</workflow-editable>
</step>
</submission-process>
</submission-definitions>
</item-submission>

View File

@@ -23,8 +23,8 @@
<!ELEMENT heading (#PCDATA) >
<!ELEMENT processing-class (#PCDATA)>
<!ELEMENT xml-ui-class (#PCDATA)>
<!ELEMENT review-jsp (#PCDATA)>
<!ELEMENT jspui-binding (#PCDATA)>
<!ELEMENT xmlui-binding (#PCDATA)>
<!ELEMENT workflow-editable (#PCDATA)>
<!-- 'submission-definitions' must contain at least one -->

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE item-submission SYSTEM "item-submission.dtd">
<!-- JSP-UI Configurable Submission configuration file -->
<!-- Configurable Submission configuration file -->
<!-- This XML configuration file allows you to configure the ordering -->
<!-- and number of the steps that occur in the Item Submission Process. -->
@@ -29,27 +29,38 @@
<!-- unique identifier in the 'id' attribute! -->
<!-- -->
<!-- Each <step> REQUIRES the following attributes (@) and properties: -->
<!-- @id - The unique identifier for this step -->
<!-- @id - The unique identifier for this step -->
<!-- -->
<!-- <processing-class> - The class which will process all information for-->
<!-- this step. The class must implement the -->
<!-- 'org.dspace.app.webui.submit.JSPStep' interface AND -->
<!-- extend 'org.dspace.submit.AbstractProcessingStep' -->
<!-- this step. The class must extend -->
<!-- 'org.dspace.submit.AbstractProcessingStep' -->
<!-- (or one of the org.dspace.submit.step.* classes) -->
<!-- This property should reference the full path of the class-->
<!-- (e.g. org.dspace.app.webui.submit.MyCustomJSPStep) -->
<!-- (e.g. org.dspace.submit.step.MyCustomStep) -->
<!-- -->
<!-- The following properties are OPTIONAL for each <step>: -->
<!-- <heading> - References the message text (from the -->
<!-- Messages.properties file) which will be used as this -->
<!-- step's heading in the progress-bar. If unspecified, -->
<!-- the step does not show up in the Progress Bar. -->
<!-- <review-jsp> - The context path (e.g. /submit/myJSP.jsp) of the JSP -->
<!-- which will give a READ-ONLY view of the users answers -->
<!-- for this entire step. This JSP is used by the -->
<!-- "Verify" step to allow the users to review his/her -->
<!-- for each previous step. If the <review-jsp> is -->
<!-- unspecified, the user will not be able to review -->
<!-- his/her answers for this <step> in the "Verify" step. -->
<!-- <heading> - References the message key, from the -->
<!-- Messages.properties file (JSP-UI) or messages.xml -->
<!-- (XML-UI) which will be used as this step's heading in -->
<!-- the progress-bar. If unspecified, the step does not -->
<!-- show up in the Progress Bar. Keys in the <heading> -->
<!-- are prefixed as follows in the appropriate -->
<!-- "messages" file: -->
<!-- XML-UI: "xmlui.Submission." prefix -->
<!-- JSP-UI: "jsp." prefix -->
<!-- <jspui-binding> - JSP-UI binding step class which will generate the JSP-->
<!-- based user interface for this step. The class must -->
<!-- extend 'org.dspace.app.webui.submit.JSPStep'. -->
<!-- This property should reference the full path of the -->
<!-- class. It is only necessary if you are using the -->
<!-- DSpace JSP-UI, and the step requires user interaction-->
<!-- <xmlui-binding> - XML-UI binding step class which will generate the -->
<!-- Manakin XML (DRI) structure for this step. The class-->
<!-- must extend -->
<!-- 'org.dspace.app.xmlui.aspect.submission.StepTransformer'.-->
<!-- This property should reference the full path of the -->
<!-- class. It is only necessary if you are using the -->
<!-- DSpace XML-UI, and the step requires user interaction-->
<!-- <workflow-editable> - whether or not this step will appear during the-->
<!-- "Edit Metadata" workflow approval process. This field-->
<!-- defaults to TRUE (which means it can be edited during -->
@@ -71,7 +82,9 @@
<!-- a special step, it is currently NEVER editable in a workflow. -->
<step id="collection">
<heading></heading> <!--can specify heading, if you want it to appear in Progress Bar-->
<processing-class>org.dspace.app.webui.submit.step.JSPSelectCollectionStep</processing-class>
<processing-class>org.dspace.submit.step.SelectCollectionStep</processing-class>
<jspui-binding>org.dspace.app.webui.submit.step.JSPSelectCollectionStep</jspui-binding>
<xmlui-binding>org.dspace.app.xmlui.aspect.submission.submit.SelectCollectionStep</xmlui-binding>
<workflow-editable>false</workflow-editable>
</step>
@@ -85,18 +98,18 @@
<!-- referenced by any of the below 'submission-process' tags). Also as-->
<!-- a special step, it is currently NEVER editable in a workflow. -->
<step id="complete">
<heading>jsp.submit.progressbar.complete</heading>
<processing-class>org.dspace.app.webui.submit.step.JSPCompleteStep</processing-class>
<heading>submit.progressbar.complete</heading>
<processing-class>org.dspace.submit.step.CompleteStep</processing-class>
<jspui-binding>org.dspace.app.webui.submit.step.JSPCompleteStep</jspui-binding>
<workflow-editable>false</workflow-editable>
</step>
<!-- This is the Sample Step which utilizes the JSPSampleStep class-->
<step id="sample">
<heading>Sample</heading>
<processing-class>org.dspace.app.webui.submit.step.JSPSampleStep</processing-class>
<review-jsp>/submit/sample-review.jsp</review-jsp>
<workflow-editable>true</workflow-editable>
<heading>Sample</heading>
<processing-class>org.dspace.submit.step.SampleStep</processing-class>
<jspui-binding>org.dspace.app.webui.submit.step.JSPSampleStep</jspui-binding>
<workflow-editable>true</workflow-editable>
</step>
</step-definitions>
@@ -124,17 +137,28 @@
<!-- (e.g. org.dspace.app.webui.submit.MyCustomJSPStep) -->
<!-- -->
<!-- The following properties are OPTIONAL for each <step>: -->
<!-- <heading> - References the message text (from the -->
<!-- Messages.properties file) which will be used as this -->
<!-- step's heading in the progress-bar. If unspecified, -->
<!-- the Step does not show up in the Progress Bar. -->
<!-- <review-jsp> - The context path (e.g. /submit/myJSP.jsp) of the JSP -->
<!-- which will give a READ-ONLY view of the users answers -->
<!-- for this entire step. This JSP is used by the -->
<!-- "Verify" step to allow the users to review his/her -->
<!-- for each previous step. If the <review-jsp> is -->
<!-- unspecified, the user will not be able to review -->
<!-- his/her answers for this <step> in the "Verify" step. -->
<!-- <heading> - References the message key, from the -->
<!-- Messages.properties file (JSP-UI) or messages.xml -->
<!-- (XML-UI) which will be used as this step's heading in -->
<!-- the progress-bar. If unspecified, the step does not -->
<!-- show up in the Progress Bar. Keys in the <heading> -->
<!-- are prefixed as follows in the appropriate -->
<!-- "messages" file: -->
<!-- XML-UI: "xmlui.Submission." prefix -->
<!-- JSP-UI: "jsp." prefix -->
<!-- <jspui-binding> - JSP-UI binding step class which will generate the JSP-->
<!-- based user interface for this step. The class must -->
<!-- extend 'org.dspace.app.webui.submit.JSPStep'. -->
<!-- This property should reference the full path of the -->
<!-- class. It is only necessary if you are using the -->
<!-- DSpace JSP-UI, and the step requires user interaction-->
<!-- <xmlui-binding> - XML-UI binding step class which will generate the -->
<!-- Manakin XML (DRI) structure for this step. The class-->
<!-- must extend -->
<!-- 'org.dspace.app.xmlui.aspect.submission.StepTransformer'.-->
<!-- This property should reference the full path of the -->
<!-- class. It is only necessary if you are using the -->
<!-- DSpace XML-UI, and the step requires user interaction-->
<!-- <workflow-editable> - whether or not this step will appear during the-->
<!-- "Edit Metadata" workflow approval process. This field-->
<!-- defaults to TRUE (which means it can be edited during -->
@@ -151,41 +175,47 @@
<!--Step 1 will be to gather initial information-->
<step>
<heading>jsp.submit.progressbar.describe</heading>
<processing-class>org.dspace.app.webui.submit.step.JSPInitialQuestionsStep</processing-class>
<review-jsp>/submit/review-init.jsp</review-jsp>
<heading>submit.progressbar.initial-questions</heading>
<processing-class>org.dspace.submit.step.InitialQuestionsStep</processing-class>
<jspui-binding>org.dspace.app.webui.submit.step.JSPInitialQuestionsStep</jspui-binding>
<xmlui-binding>org.dspace.app.xmlui.aspect.submission.submit.InitialQuestionsStep</xmlui-binding>
<workflow-editable>true</workflow-editable>
</step>
<!--Step 2 will be to Describe the item.-->
<step>
<heading>jsp.submit.progressbar.describe</heading>
<processing-class>org.dspace.app.webui.submit.step.JSPDescribeStep</processing-class>
<review-jsp>/submit/review-metadata.jsp</review-jsp>
<heading>submit.progressbar.describe</heading>
<processing-class>org.dspace.submit.step.DescribeStep</processing-class>
<jspui-binding>org.dspace.app.webui.submit.step.JSPDescribeStep</jspui-binding>
<xmlui-binding>org.dspace.app.xmlui.aspect.submission.submit.DescribeStep</xmlui-binding>
<workflow-editable>true</workflow-editable>
</step>
<!--Step 3 will be to Upload the item-->
<step>
<heading>jsp.submit.progressbar.upload</heading>
<processing-class>org.dspace.app.webui.submit.step.JSPUploadStep</processing-class>
<review-jsp>/submit/review-upload.jsp</review-jsp>
<heading>submit.progressbar.upload</heading>
<processing-class>org.dspace.submit.step.UploadStep</processing-class>
<jspui-binding>org.dspace.app.webui.submit.step.JSPUploadStep</jspui-binding>
<xmlui-binding>org.dspace.app.xmlui.aspect.submission.submit.UploadStep</xmlui-binding>
<workflow-editable>true</workflow-editable>
</step>
<!--Step 4 will be to Verify everything -->
<!--(this uses all the "review-jsp" tags set in the above steps to load the "Verify" page).-->
<step>
<heading>jsp.submit.progressbar.verify</heading>
<processing-class>org.dspace.app.webui.submit.step.JSPVerifyStep</processing-class>
<workflow-editable>true</workflow-editable>
<!--Step 4 will be to Verify/Review everything -->
<step>
<heading>submit.progressbar.verify</heading>
<processing-class>org.dspace.submit.step.VerifyStep</processing-class>
<jspui-binding>org.dspace.app.webui.submit.step.JSPVerifyStep</jspui-binding>
<xmlui-binding>org.dspace.app.xmlui.aspect.submission.submit.ReviewStep</xmlui-binding>
<workflow-editable>true</workflow-editable>
</step>
<!--Step 5 will be to Sign off on the License-->
<step>
<heading>jsp.submit.progressbar.license</heading>
<processing-class>org.dspace.app.webui.submit.step.JSPLicenseStep</processing-class>
<workflow-editable>false</workflow-editable>
<heading>submit.progressbar.license</heading>
<processing-class>org.dspace.submit.step.LicenseStep</processing-class>
<jspui-binding>org.dspace.app.webui.submit.step.JSPLicenseStep</jspui-binding>
<xmlui-binding>org.dspace.app.xmlui.aspect.submission.submit.LicenseStep</xmlui-binding>
<workflow-editable>false</workflow-editable>
</step>
</submission-process>

View File

@@ -31,21 +31,11 @@
<a name="configurationFile" id="configurationFile"></a>
<H2>Understanding the Submission Configuration File</H2>
<p><em>PLEASE NOTE: There are separate submission configuration files based on whether
you plan to use the DSpace JSP User Interface (JSP-UI) or the DSpace XML User Interface (XML-UI, aka. Manakin)</em>
<ul>
<li><code><i>[dspace]</i>/config/item-submission-JSPUI.xml</code> - This is the JSP-UI configuration file</li>
<li><code><i>[dspace]</i>/config/item-submission-XMLUI.xml</code> - This is the XML-UI configuration file</li>
</ul>
<p>The <code>[dspace]/config/item-submission.xml</code> contains the submission configurations for <em>both</em> the DSpace JSP user interface (JSP-UI) or the DSpace XML user interface
(XML-UI or Manakin). This configuration file contains detailed documentation within the file itself,
which should help you better understand how to best utilize it.
</p>
<p>DSpace will automatically know which <code>item-submission.xml</code> to utilize based on the DSpace user interface being used.
<em>However, should you wish to make configuration changes, you must make sure to do so in the correct <code>item-submission.xml</code>
file based on the DSpace user interface you are using!</em></p>
<p>Each of the <code>item-submission.xml</code> configuration files contains detailed documentation within the file itself,
which should help you better undertand how to best utilize it.</p>
<H3>The Structure of <CODE>item-submission.xml</CODE></H3>
<pre><code>
&lt;item-submission&gt;
@@ -91,14 +81,14 @@
<a name="#stepDefinitions" id="#stepDefinitions"></a>
<H3>Defining Steps (<code>&lt;step&gt;</code>) within the <CODE>item-submission.xml</CODE></H3>
<p>This section decribes how Steps of the Submission Process are defined within the <CODE>item-submission.xml</CODE>.</p>
<p>This section describes how Steps of the Submission Process are defined within the <CODE>item-submission.xml</CODE>.</p>
<H4>Where to place your <code>&lt;step&gt;</code> definitions</H4>
<p><code>&lt;step&gt;</code> definitions can appear in one of two places within the <CODE>item-submission.xml</CODE> configuration file.
<ol>
<li>Within the <code>&lt;step-definitions&gt;</code> section
<ul>
<li>This is for globally definied <code>&lt;step&gt;</code> definitions
<li>This is for globally defined <code>&lt;step&gt;</code> definitions
(i.e. steps which are used in multiple <code>&lt;submission-process&gt;</code>
definitions). Steps defined in this section <strong>must</strong> define
a unique <code>id</code> which can be used to reference this step.</li>
@@ -136,30 +126,32 @@
in which those steps will appear!</p>
<p>For example, the following defines a Submission Process where the
<em>License</em> step directly precedes the <em>Describe</em> step
<em>License</em> step directly precedes the <em>Initial Questions</em> step
(more information about the structure of the information under each &lt;step&gt;
tag can be found in the section on <a href="#stepStructure">Structure of the &lt;step&gt; Definition</a> below):
</p>
<p><em>(PLEASE NOTE: This example uses some syntax that is specific to the DSpace JSP user interface.)</em>
<pre><code>
&lt;submission-process&gt;
<em>&lt;!--Step 1 will be to Sign off on the License--&gt;</em>
&lt;step&gt;
&lt;heading&gt;jsp.submit.progressbar.license&lt;/heading&gt;
&lt;processing-class&gt;org.dspace.app.webui.submit.step.JSPLicenseStep&lt;/processing-class&gt;
&lt;heading&gt;submit.progressbar.license&lt;/heading&gt;
&lt;processing-class&gt;org.dspace.submit.step.LicenseStep&lt;/processing-class&gt;
&lt;jspui-binding&gt;org.dspace.app.webui.submit.step.JSPLicenseStep&lt;/jspui-binding&gt;
&lt;xmlui-binding&gt;org.dspace.app.xmlui.aspect.submission.submit.LicenseStep&lt;/xmlui-binding&gt;
&lt;workflow-editable&gt;false&lt;/workflow-editable&gt;
&lt;/step&gt;
<em>&lt;!--Step 2 will be to Describe the Item--&gt;</em>
<em>&lt;!--Step 2 will be to Ask Initial Questions--&gt;</em>
&lt;step&gt;
&lt;heading&gt;jsp.submit.progressbar.describe&lt;/heading&gt;
&lt;processing-class&gt;org.dspace.app.webui.submit.step.JSPDescribeStep&lt;/processing-class&gt;
&lt;review-jsp&gt;/submit/review-metadata.jsp&lt;/review-jsp&gt;
&lt;heading&gt;submit.progressbar.initial-questions&lt;/heading&gt;
&lt;processing-class&gt;org.dspace.submit.step.InitialQuestionsStep&lt;/processing-class&gt;
&lt;jspui-binding&gt;org.dspace.app.webui.submit.step.JSPInitialQuestionsStep&lt;/jspui-binding&gt;
&lt;xmlui-binding&gt;org.dspace.app.xmlui.aspect.submission.submit.InitialQuestionsStep&lt;/xmlui-binding&gt;
&lt;workflow-editable&gt;true&lt;/workflow-editable&gt;
&lt;/step&gt;
...
...[other steps]...
&lt;/submission-process&gt;
</code></pre>
</p>
@@ -167,59 +159,65 @@
<a name="stepStructure" id="stepStructure"></a>
<H4>Structure of the &lt;step&gt; Definition</H4>
<p>The actual structure of the &lt;step&gt; definition differs slightly, based on whether
you are using the DSpace JSP user interface (JSP-UI) or the DSpace XML user interface
(XML-UI or Manakin). Unfortunately the same structure cannot be shared between
these user interfaces, since they each use different manners of generating the user interface.</p>
<ul>
<li><a href="#stepStructureJSP">Structure of the &lt;step&gt; Definition for the JSP User Interface</a></li>
<li><a href="#stepStructureXML">Structure of the &lt;step&gt; Definition for the XML User Interface (Manakin)</a></li>
</ul>
<p>The same &lt;step&gt; definition is used by both the DSpace JSP user interface (JSP-UI) an the DSpace XML user interface
(XML-UI or Manakin). Therefore, you will notice each &lt;step&gt; definition contains information
specific to each of these two interfaces.</p>
<a name="stepStructureJSP" id="stepStructureJSP"></a>
<H5>Structure of the &lt;step&gt; Definition for the JSP User Interface</H5>
<p>The structure of the &lt;step&gt; Definition for the JSP UI is as follows:
<p>The structure of the &lt;step&gt; Definition is as follows:
<pre><code>
&lt;step&gt;
&lt;heading&gt;jsp.submit.progressbar.describe&lt;/heading&gt;
&lt;processing-class&gt;org.dspace.app.webui.submit.step.JSPDescribeStep&lt;/processing-class&gt;
&lt;review-jsp&gt;/submit/review-metadata.jsp&lt;/review-jsp&gt;
&lt;heading&gt;submit.progressbar.describe&lt;/heading&gt;
&lt;processing-class&gt;org.dspace.submit.step.DescribeStep&lt;/processing-class&gt;
&lt;jspui-binding&gt;org.dspace.app.webui.submit.step.JSPDescribeStep&lt;/jspui-binding&gt;
&lt;xmlui-binding&gt;org.dspace.app.xmlui.aspect.submission.submit.DescribeStep&lt;/xmlui-binding&gt;
&lt;workflow-editable&gt;true&lt;/workflow-editable&gt;
&lt;/step&gt;
&lt;/step&gt;
</code></pre>
</p>
<P>Each <CODE>step</CODE> contains the following elements, for the JSP UI. The required elements are so marked:</P>
<P>Each <CODE>step</CODE> contains the following elements. The required elements are so marked:</P>
<DL>
<DT><STRONG><CODE>heading</CODE></STRONG></DT>
<DD>Full I18N key (defined in <code>Messages.properties</code>) which corresponds to
the text that should be displayed in the Submission Progress Bar for this step.
<em>This need not be defined, if the step should not appear in the progress bar
(e.g. steps which are automatic and require no user interaction should not appear
in the progress bar).</em></DD>
<DD>Partial I18N key (defined in <code>Messages.properties</code> for JSP-UI or <code>messages.xml</code> for XML-UI) which corresponds to
the text that should be displayed in the submission Progress Bar for this step.
This partial I18N key is prefixed within either the Messages.properties or messages.xml file, depending on the interface you are using.
Therefore, to find the actual key, you will need to search for the partial key with the following prefix:
<ul>
<li>XML-UI: prefix is <code>xmlui.Submission.</code> (e.g. "xmlui.Submission.submit.progressbar.describe" for 'Describe' step)</li>
<li>JSP-UI: prefix is <code>jsp.</code> (e.g. "jsp.submit.progressbar.describe" for 'Describe' step)</li>
</ul>
<em>The 'heading' need not be defined if the step should not appear in the progress bar
(e.g. steps which perform automated processing, i.e. non-interactive, should not appear
in the progress bar).</em>
</DD>
<DT><STRONG><CODE>processing-class</CODE></STRONG> <EM>(Required)</EM></DT>
<DD>Full Java path to the JSP Processing Class for this Step.
All valid JSP step processing classes must implement the interface
`<code>org.dspace.app.webui.submit.JSPStep</code>` <strong>AND</strong>
extend the abstract `<code>org.dspace.submit.AbstractProcessingStep</code>` class
(or alternatively, extend one of the existing step processing classes in
<DD>Full Java path to the Processing Class for this Step. This Processing Class
<em>must</em> perform the primary processing of any information gathered in this step, <em>for both the XML-UI and JSP-UI</em>.
All valid step processing classes must extend the abstract `<code>org.dspace.submit.AbstractProcessingStep</code>` class
(or alternatively, extend one of the pre-existing step processing classes in
<code>org.dspace.submit.step.*</code>)</DD>
<DT><STRONG><CODE>review-jsp</CODE></STRONG></DT>
<DT><STRONG><CODE>jspui-binding</CODE></STRONG></DT>
<DD>The relative path to the JSP which displays a read-only version
of the information gathered during this step. This JSP should be very
simplistic in its form (most just display a simple table listing all
gathered information). For examples, see the JSPs beginning with <code>review-</code>
that exist within the <code>/jsp/submit</code> directory of DSpace.
<em>This need not be defined if the step has no information that should be later reviewed
(e.g. The License step doesn't need a review JSP as the act of
agreeing to a submission license is not considered reviewable)</em></DD>
<DD>Full Java path of the JSP-UI "binding" class for this Step. This "binding" class
should initialize and call the appropriate JSPs to display the step's user interface. A valid
JSP-UI "binding" class <em>must</em> extend the abstract `<code>org.dspace.app.webui.submit.JSPStep</code>` class.
<em>This property need not be defined if you are using the XML-UI interface, or for steps which
only perform automated processing, i.e. non-interactive steps.</em>
</DD>
<DT><STRONG><CODE>xmlui-binding</CODE></STRONG></DT>
<DD>Full Java path of the XML-UI "binding" class for this Step. This "binding" class
should generate the Manakin XML (DRI document) necessary to generate the step's user interface. A valid
XML-UI "binding" class <em>must</em> extend the abstract `<code>org.dspace.app.xmlui.submission.AbstractSubmissionStep</code>` class.
<em>This property need not be defined if you are using the JSP-UI interface, or for steps which
only perform automated processing, i.e. non-interactive steps.</em>
</DD>
<DT><STRONG><CODE>workflow-editable</CODE></STRONG></DT>
@@ -230,56 +228,6 @@
during that step).</DD>
</DL>
<a name="stepStructureXML" id="stepStructureXML"></a>
<H5>Structure of the &lt;step&gt; Definition for the XML User Interface (Manakin)</H5>
<p>The structure of the &lt;step&gt; Definition for the XML UI is as follows:
<pre><code>
&lt;step&gt;
&lt;heading&gt;jsp.submit.progressbar.describe&lt;/heading&gt;
&lt;processing-class&gt;org.dspace.submit.step.DescribeStep&lt;/processing-class&gt;
&lt;xml-ui-class&gt;org.dspace.app.xmlui.submission.submit.DescribeStep&lt;/xml-ui-class&gt;
&lt;workflow-editable&gt;true&lt;/workflow-editable&gt;
&lt;/step&gt;
</code></pre>
</p>
<P>Each <CODE>step</CODE> contains the following elements, for the XML UI. The required elements are so marked:</P>
<DL>
<DT><STRONG><CODE>heading</CODE></STRONG></DT>
<DD>Full I18N key (defined in Manakin's <code>config/i18n/messages.xml</code>) which corresponds to
the text that should be displayed in the Submission Progress Bar for this step.
<em>This need not be defined, if the step should not appear in the progress bar
(e.g. steps which are automatic and require no user interaction should not appear
in the progress bar).</em></DD>
<DT><STRONG><CODE>processing-class</CODE></STRONG> <EM>(Required)</EM></DT>
<DD>Full Java path to the Processing Class for this Step.
All step processing classes must extend the abstract `<code>org.dspace.submit.AbstractProcessingStep</code>` class,
and implement all necessary methods in that class.</DD>
<DT><STRONG><CODE>xml-ui-class</CODE></STRONG></DT>
<DD>Full Java path to the XML UI Transformer Class for this Step.
The Transformer class is responsible for generating the XML structure
which Manakin is able to understand (called DRI: Digital Repository Interface).
This class must extend the abstract `<code>org.dspace.app.xmlui.submission.AbstractSubmissionStep</code>` class,
and implement all necessary methods in that class.
<em>Note: This need not be defined if the step is automated and requires no user interaction (i.e. requires no user interface)</em></DD>
<DT><STRONG><CODE>workflow-editable</CODE></STRONG></DT>
<DD>Defines whether or not this step can be edited during the <em>Edit Metadata</em>
process with the DSpace approval/rejection workflow process. Possible values include <code>true</code>
and <code>false</code>. If undefined, defaults to <code>true</code> (which
means that workflow reviewers would be allowed to edit information gathered
during that step).</DD>
</DL>
<a name="stepOrdering" id="stepOrdering"></a>
<H2>Reordering/Removing Submission Steps</H2>
@@ -677,7 +625,7 @@
<a name="createStep" id="createStep"></a>
<H2>Creating new Submission Steps</H2>
<P>First, a warning: <em>Creating a new Submission Step requires some Java knowledge,
<P>First, a brief warning: <em>Creating a new Submission Step requires some Java knowledge,
and is therefore recommended to be undertaken by a Java programmer whenever possible</em></P>
<P>That being said, at a higher level, creating a new Submission Step
@@ -686,51 +634,38 @@
<ol>
<li>(<strong>Required</strong>) Create a new Step Processing class
<ul>
<li><strong>For JSP-UI only:</strong> If you need to create a step which <em>only</em>
works with the JSP UI,
then your step processing class <strong>must</strong> implement
the interface <code>org.dspace.app.webui.submit.JSPStep</code>
<strong>AND</strong> extend the abstract
<code>org.dspace.submit.AbstractProcessingStep</code> class.</li>
<li><strong>For XML-UI only:</strong> If you wish to create a step which <em>only</em>
works with the Manakin UI, you just need to extend and
implement all necessary methods within the abstract
<code>org.dspace.submit.AbstractProcessingStep</code> class.</li>
<li><strong>Both JSP-UI and XML-UI:</strong> If you wish to create a step which works
with either interface, you just need to create two classes:
<ol>
<li>First, a generic processing class which extends the
<code>org.dspace.submit.AbstractProcessingStep</code> class, which
will perform the backend processing for <strong>both</strong> the
JSP-UI and the XML-UI.
</li>
<li>Second, you need to create a JSP-specific processing class
which will implement the interface
<code>org.dspace.app.webui.submit.JSPStep</code>, and extends the
generic processing class you just created in #1 above.</li>
</ol>
</li>
<li>This class <strong>must</strong> extend the abstract
<code>org.dspace.submit.AbstractProcessingStep</code> class and
implement all methods defined by that abstract class.</li>
<li>This class should be built in such a way that it can process the
input gathered from <em>either</em> the XML-UI or JSP-UI interface.</li>
</ul>
</li>
<li>(<em>For JSP UI Steps only</em>) Create the JSPs to display
the user interface (<em>only necessary if your step requires user interaction</em>).
<li>(<em>For steps using JSP-UI</em>) Create the JSPs to display
the user interface. Create a new JSP-UI "binding" class to initialize
and call these JSPs.</li>
<ul>
<li>Any JSPs created should be loaded by the Step Processing
class by using one of the showJSP() method</li>
<li>Your JSP-UI "binding" class must extend the abstract class <code>org.dspace.app.webui.submit.JSPStep</code>
and implement all methods defined there. It's recommended to use one
of the classes in <code>org.dspace.app.webui.submit.step.*</code> as a reference.</li>
<li>Any JSPs created should be loaded by calling the showJSP() method of
the <code>org.dspace.app.webui.submit.JSPStepManager</code> class</li>
<li>If this step gathers information to be reviewed, you must
also create a Review JSP which will display a read-only view of
all data gathered during this step. You will find examples
all data gathered during this step. The path to this JSP must be returned
by your getReviewJSP() method. You will find examples
of Review JSPs (named similar to <code>review-<em>[step]</em>.jsp</code>) in the
<code><em>[dspace-source]</em>/jsp/submit</code> directory.</li>
</ul>
</li>
<li>(<em>For XML UI Steps only</em>) Create a Step Transformer
which will generate the DRI XML which Manakin requires
(<em>only necessary if your step requires user interaction</em>).
<li>(<em>For steps using XML-UI</em>) Create an XML-UI "binding" Step Transformer
which will generate the DRI XML which Manakin requires.
<ul>
<li>The Step Transformer must extend and implement
all necessary methods within the abstract
<code>org.dspace.app.xmlui.submission.AbstractSubmissionStep</code> class.</li>
all necessary methods within the abstract class
<code>org.dspace.app.xmlui.submission.AbstractSubmissionStep</code></li>
<li>It is useful to use the existing classes in
<code>org.dspace.app.xmlui.submission.submit.*</code> as references</li>
</ul>
</li>
<li>(<strong>Required</strong>) Add a valid Step Definition to the <code>item-submission.xml</code> configuration file.
@@ -747,6 +682,37 @@
</li>
</ol>
<a name="createStep" id="createStep"></a>
<H3>Creating a Non-Interactive Step</H3>
<p>
Non-interactive steps are ones that have no user interface and only perform backend processing.
You may find a need to create non-interactive steps which perform further processing of previously entered information.
</p>
<p>To create a non-interactive step, do the following:
<ol>
<li>Create the required Step Processing class, which extends the abstract
<code>org.dspace.submit.AbstractProcessingStep</code> class. In this class
add any processing which this step will perform.</li>
<li>Add your non-interactive step to your <code>item-submission.xml</code> at
the place where you wish this step to be called during the submission process.
For example, if you want it to be called <em>immediately after</em> the
existing 'Upload File' step, then place its configuration immediately after
the configuration for that 'Upload File' step. The configuration should look
similar to the following:<pre><code>&lt;step&gt;
&lt;processing-class&gt;org.dspace.submit.step.MyNonInteractveStep&lt;/processing-class&gt;
&lt;workflow-editable&gt;false&lt;/workflow-editable&gt;
&lt;/step&gt;</code></pre>
</li>
</ol>
</p>
<p>
Note: Non-interactive steps will not appear in the Progress Bar! Therefore,
your submitters will not even know they are there. However, because they are not
visible to your users, you should make sure that your non-interactive step does not
take a large amount of time to finish its processing and return control to the next step
(otherwise there will be a visible time delay in the user interface).</p>
<HR>