org.dspace.app.util
Class DCInputsReader

java.lang.Object
  extended by org.dspace.app.util.DCInputsReader

public class DCInputsReader
extends Object

Submission form generator for DSpace. Reads and parses the installation form definitions file, input-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: 4365 $
Author:
Brian S. Hughes

Field Summary
static String DEFAULT_COLLECTION
          The ID of the default collection.
 
Constructor Summary
DCInputsReader()
          Parse an XML encoded submission forms template file, and create a hashmap containing all the form information.
DCInputsReader(String fileName)
           
 
Method Summary
 DCInputSet getInputs(String collectionHandle)
          Returns the set of DC inputs used for a particular collection, or the default set if no inputs defined for the collection
 int getNumberInputPages(String collectionHandle)
          Return the number of pages the inputs span for a desginated collection
 List getPairs(String name)
           
 Iterator getPairsNameIterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_COLLECTION

public static final String DEFAULT_COLLECTION
The ID of the default collection. Will never be the ID of a named collection

See Also:
Constant Field Values
Constructor Detail

DCInputsReader

public DCInputsReader()
               throws DCInputsReaderException
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

DCInputsReader

public DCInputsReader(String fileName)
               throws DCInputsReaderException
Throws:
DCInputsReaderException
Method Detail

getPairsNameIterator

public Iterator getPairsNameIterator()

getPairs

public List getPairs(String name)

getInputs

public DCInputSet getInputs(String collectionHandle)
                     throws DCInputsReaderException
Returns the set of DC inputs used for a particular collection, or the default set if no inputs defined for the collection

Parameters:
collectionHandle - collection's unique Handle
Returns:
DC input set
Throws:
DCInputsReaderException - if no default set defined

getNumberInputPages

public int getNumberInputPages(String collectionHandle)
                        throws DCInputsReaderException
Return the number of pages the inputs span for a desginated collection

Parameters:
collectionHandle - collection's unique Handle
Returns:
number of pages of input
Throws:
DCInputsReaderException - if no default set defined


Copyright © 2010 DuraSpace. All Rights Reserved.