Package org.dspace.app.util
Class DCInputsReader
java.lang.Object
org.dspace.app.util.DCInputsReader
Submission form generator for DSpace. Reads and parses the installation
form definitions file, submission-forms.xml, from the configuration directory.
A forms definition details the page and field layout of the metadata
collection pages used by the submission process. Each forms definition
starts with a unique name that gets associated with that form set.
The file also specifies which collections use which form sets. At a
minimum, the definitions file must define a default mapping from the
placeholder collection #0 to the distinguished form 'default'. Any
collections that use a custom form set are listed paired with the name
of the form set they use.
The definitions file also may contain sets of value pairs. Each value pair
will contain one string that the user reads, and a paired string that will
supply the value stored in the database if its sibling display value gets
selected from a choice list.
- Version:
- $Revision$
- Author:
- Brian S. Hughes
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParse an XML encoded submission forms template file, and create a hashmap containing all the form information.DCInputsReader(String fileName) -
Method Summary
Modifier and TypeMethodDescriptionintgetAllInputs(Integer limit, Integer offset) Returns all the Input forms with paginationgetInputFormNameByCollectionAndField(Collection collection, String field) getInputsByCollection(Collection collection) Returns the set of DC inputs used for a particular collection, or the default set if no inputs defined for the collectiongetInputsByFormName(String formName) Returns the set of DC inputs used for a particular input form
-
Field Details
-
DEFAULT_COLLECTION
The ID of the default collection. Will never be the ID of a named collection- See Also:
-
-
Constructor Details
-
DCInputsReader
Parse an XML encoded submission forms template file, and create a hashmap containing all the form information. This hashmap will contain three top level structures: a map between collections and forms, the definition for each page of each form, and lists of pairs of values that populate selection boxes.- Throws:
DCInputsReaderException- if input reader error
-
DCInputsReader
- Throws:
DCInputsReaderException
-
-
Method Details
-
getPairsNameIterator
-
getPairs
-
getInputsByCollection
Returns the set of DC inputs used for a particular collection, or the default set if no inputs defined for the collection- Parameters:
collection- collection for which search the set of DC inputs- Returns:
- DC input set
- Throws:
DCInputsReaderException- if no default set defined
-
getInputsBySubmissionName
- Throws:
DCInputsReaderException
-
getInputsByFormName
Returns the set of DC inputs used for a particular input form- Parameters:
formName- input form unique name- Returns:
- DC input set
- Throws:
DCInputsReaderException- if not found
-
countInputs
public int countInputs()- Returns:
- the number of defined input forms
-
getAllInputs
Returns all the Input forms with pagination- Parameters:
limit- max number of Input Forms to returnoffset- number of Input form to skip in the return- Returns:
- the list of input forms
- Throws:
DCInputsReaderException
-
getInputFormNameByCollectionAndField
public String getInputFormNameByCollectionAndField(Collection collection, String field) throws DCInputsReaderException - Throws:
DCInputsReaderException
-