Package org.dspace.app.util
Class SubmissionConfigReader
- java.lang.Object
-
- org.dspace.app.util.SubmissionConfigReader
-
public class SubmissionConfigReader extends Object
Item Submission configuration generator for DSpace. Reads and parses the installed submission process configuration file, item-submission.xml, from the configuration directory. This submission process definition 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, where each definition is assigned a unique name. The file also specifies which collections use which Item Submission process. At a minimum, the definitions file must define a default mapping from the placeholder collection # to the distinguished submission process 'default'. Any collections that use a custom submission process are listed paired with the name of the item submission process they use.- Version:
- $Revision$
- Author:
- Tim Donohue based on DCInputsReader by Brian S. Hughes
- See Also:
SubmissionConfig,SubmissionStepConfig
-
-
Field Summary
Fields Modifier and Type Field Description protected static CollectionServicecollectionServiceCollection Service instance, needed to interact with collection's stored datastatic StringDEFAULT_COLLECTIONThe ID of the default collection.
-
Constructor Summary
Constructors Constructor Description SubmissionConfigReader()Load Submission Configuration from the item-submission.xml configuration file
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountSubmissionConfigs()List<SubmissionConfig>getAllSubmissionConfigs(Integer limit, Integer offset)Returns all the Item Submission process configs with paginationList<Collection>getCollectionsBySubmissionConfig(Context context, String submitName)StringgetDefaultSubmissionConfigName()SubmissionStepConfiggetStepConfig(String stepID)Returns a particular global step definition based on its ID.SubmissionConfiggetSubmissionConfigByCollection(String collectionHandle)Returns the Item Submission process config used for a particular collection, or the default if none is defined for the collectionSubmissionConfiggetSubmissionConfigByName(String submitName)Returns the Item Submission process configvoidreload()
-
-
-
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
-
collectionService
protected static final CollectionService collectionService
Collection Service instance, needed to interact with collection's stored data
-
-
Constructor Detail
-
SubmissionConfigReader
public SubmissionConfigReader() throws SubmissionConfigReaderExceptionLoad Submission Configuration from the item-submission.xml configuration file- Throws:
SubmissionConfigReaderException- if servlet error
-
-
Method Detail
-
reload
public void reload() throws SubmissionConfigReaderException- Throws:
SubmissionConfigReaderException
-
getDefaultSubmissionConfigName
public String getDefaultSubmissionConfigName()
- Returns:
- the name of the default submission configuration
-
getAllSubmissionConfigs
public List<SubmissionConfig> getAllSubmissionConfigs(Integer limit, Integer offset)
Returns all the Item Submission process configs with pagination- Parameters:
limit- max number of SubmissionConfig to returnoffset- number of SubmissionConfig to skip in the return- Returns:
- the list of SubmissionConfig
-
countSubmissionConfigs
public int countSubmissionConfigs()
-
getSubmissionConfigByCollection
public SubmissionConfig getSubmissionConfigByCollection(String collectionHandle)
Returns the Item Submission process config used for a particular collection, or the default if none is defined for the collection- Parameters:
collectionHandle- collection's unique Handle- Returns:
- the SubmissionConfig representing the item submission config
- Throws:
SubmissionConfigReaderException- if no default submission process configuration defined
-
getSubmissionConfigByName
public SubmissionConfig getSubmissionConfigByName(String submitName)
Returns the Item Submission process config- Parameters:
submitName- submission process unique name- Returns:
- the SubmissionConfig representing the item submission config
-
getStepConfig
public SubmissionStepConfig getStepConfig(String stepID) throws SubmissionConfigReaderException
Returns a particular global step definition based on its ID.Global step definitions are those defined in the
<step-definitions>section of the configuration file.- Parameters:
stepID- step's identifier- Returns:
- the SubmissionStepConfig representing the step
- Throws:
SubmissionConfigReaderException- if no default submission process configuration defined
-
getCollectionsBySubmissionConfig
public List<Collection> getCollectionsBySubmissionConfig(Context context, String submitName) throws IllegalStateException, SQLException
- Throws:
IllegalStateExceptionSQLException
-
-