public class DescribeStep extends AbstractProcessingStep
This class performs all the behind-the-scenes processing that this particular step requires. This class's methods are utilized by both the JSP-UI and the Manakin XML-UI
SubmissionConfig,
SubmissionStepConfig,
AbstractProcessingStep| Modifier and Type | Field and Description |
|---|---|
protected ChoiceAuthorityService |
choiceAuthorityService |
static String |
LANGUAGE_QUALIFIER |
protected MetadataAuthorityService |
metadataAuthorityService |
static int |
STATUS_MISSING_REQUIRED_FIELDS |
static int |
STATUS_MORE_INPUT_REQUESTED
STATUS / ERROR FLAGS (returned by doProcessing() if an error occurs or
additional user interaction may be required)
(Do NOT use status of 0, since it corresponds to STATUS_COMPLETE flag
defined in the JSPStepManager class)
|
authorizeService, bitstreamService, bundleService, CANCEL_BUTTON, collectionService, configurationService, itemService, LAST_PAGE_REACHED, metadataFieldService, NEXT_BUTTON, PREVIOUS_BUTTON, PROGRESS_BAR_PREFIX, SELECT_CHANGE, STATUS_COMPLETE| Constructor and Description |
|---|
DescribeStep()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
doProcessing(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
SubmissionInfo subInfo)
Do any processing of the information input by the user, and/or perform
step processing (if no user interaction required)
|
static String |
getDefaultLanguageQualifier() |
static String |
getFieldName(DCInput input)
Return the HTML / DRI field name for the given input.
|
static DCInputsReader |
getInputsReader() |
static DCInputsReader |
getInputsReader(String filename) |
int |
getNumberOfPages(javax.servlet.http.HttpServletRequest request,
SubmissionInfo subInfo)
Retrieves the number of pages that this "step" extends over.
|
protected List<String> |
getRepeatedParameter(javax.servlet.http.HttpServletRequest request,
String metadataField,
String param)
Get repeated values from a form.
|
protected TreeMap<Integer,String> |
getRepeatedParameterWithTheirIndices(javax.servlet.http.HttpServletRequest request,
String metadataField,
String param)
This Methode has the same function as the getRepeatedParameter.
|
protected void |
readDate(Context context,
javax.servlet.http.HttpServletRequest request,
Item item,
String schema,
String element,
String qualifier)
Fill out a metadata date field with the value from a form.
|
protected void |
readNames(Context context,
javax.servlet.http.HttpServletRequest request,
Item item,
String schema,
String element,
String qualifier,
boolean repeated)
Set relevant metadata fields in an item from name values in the form.
|
protected void |
readSeriesNumbers(Context context,
javax.servlet.http.HttpServletRequest request,
Item item,
String schema,
String element,
String qualifier,
boolean repeated)
Set relevant metadata fields in an item from series/number values in the
form.
|
protected void |
readText(Context context,
javax.servlet.http.HttpServletRequest request,
Item item,
String schema,
String element,
String qualifier,
boolean repeated,
String lang,
boolean hasLanguageTag)
Fill out an item's metadata values from a plain standard text field.
|
addErrorField, addErrorMessage, clearErrorFields, getCurrentPage, getErrorFields, getErrorMessage, setCurrentPagepublic static final int STATUS_MORE_INPUT_REQUESTED
public static final int STATUS_MISSING_REQUIRED_FIELDS
public static final String LANGUAGE_QUALIFIER
protected final ChoiceAuthorityService choiceAuthorityService
protected final MetadataAuthorityService metadataAuthorityService
public DescribeStep()
throws javax.servlet.ServletException
javax.servlet.ServletExceptionpublic int doProcessing(Context context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SubmissionInfo subInfo) throws javax.servlet.ServletException, IOException, SQLException, AuthorizeException
It is this method's job to save any data to the underlying database, as necessary, and return error messages (if any) which can then be processed by the appropriate user interface (JSP-UI or XML-UI)
NOTE: If this step is a non-interactive step (i.e. requires no UI), then it should perform *all* of its processing in this method!
doProcessing in class AbstractProcessingStepcontext - current DSpace contextrequest - current servlet request objectresponse - current servlet response objectsubInfo - submission info objectjavax.servlet.ServletExceptionIOExceptionSQLExceptionAuthorizeExceptionpublic int getNumberOfPages(javax.servlet.http.HttpServletRequest request,
SubmissionInfo subInfo)
throws javax.servlet.ServletException
This method may just return 1 for most steps (since most steps consist of a single page). But, it should return a number greater than 1 for any "step" which spans across a number of HTML pages. For example, the configurable "Describe" step (configured using input-forms.xml) overrides this method to return the number of pages that are defined by its configuration file.
Steps which are non-interactive (i.e. they do not display an interface to the user) should return a value of 1, so that they are only processed once!
getNumberOfPages in class AbstractProcessingSteprequest - The HTTP RequestsubInfo - The current submission information objectjavax.servlet.ServletExceptionpublic static DCInputsReader getInputsReader() throws javax.servlet.ServletException
javax.servlet.ServletExceptionpublic static DCInputsReader getInputsReader(String filename) throws javax.servlet.ServletException
filename - file to get the input reader forjavax.servlet.ServletExceptionpublic static String getDefaultLanguageQualifier()
protected void readNames(Context context, javax.servlet.http.HttpServletRequest request, Item item, String schema, String element, String qualifier, boolean repeated) throws SQLException
request - the request objectitem - the item to updateschema - the metadata schemaelement - the metadata elementqualifier - the metadata qualifier, or null if unqualifiedrepeated - set to true if the field is repeatable on the formSQLExceptionprotected void readText(Context context, javax.servlet.http.HttpServletRequest request, Item item, String schema, String element, String qualifier, boolean repeated, String lang, boolean hasLanguageTag) throws SQLException
request - the request objectitem - the item to updateschema - the short schema nameelement - the metadata elementqualifier - the metadata qualifier, or null if unqualifiedrepeated - set to true if the field is repeatable on the formlang - language to set (ISO code)hasLanguageTag - to check if the field has a language tagSQLExceptionprotected void readDate(Context context, javax.servlet.http.HttpServletRequest request, Item item, String schema, String element, String qualifier) throws SQLException
request - the request objectitem - the item to updateschema - the metadata schemaelement - the metadata elementqualifier - the metadata qualifier, or null if unqualifiedSQLExceptionprotected void readSeriesNumbers(Context context, javax.servlet.http.HttpServletRequest request, Item item, String schema, String element, String qualifier, boolean repeated) throws SQLException
request - the request objectitem - the item to updateschema - the metadata schemaelement - the metadata elementqualifier - the metadata qualifier, or null if unqualifiedrepeated - set to true if the field is repeatable on the formSQLExceptionprotected List<String> getRepeatedParameter(javax.servlet.http.HttpServletRequest request, String metadataField, String param)
This method can also handle "composite fields" (metadata fields which may require multiple params, etc. a first name and last name).
request - the HTTP request containing the form informationmetadataField - the metadata field which can store repeated valuesparam - the repeated parameter on the page (used to fill out the
metadataField)protected TreeMap<Integer,String> getRepeatedParameterWithTheirIndices(javax.servlet.http.HttpServletRequest request, String metadataField, String param)
request - the HTTP request containing the form informationmetadataField - the metadata field which can store repeated valuesparam - the repeated parameter on the page (used to fill out the
metadataField)Copyright © 2016 DuraSpace. All Rights Reserved.