public class PackageParameters extends Properties
defaults
Constructor and Description |
---|
PackageParameters() |
PackageParameters(Properties defaults) |
Modifier and Type | Method and Description |
---|---|
Object |
addProperty(String key,
String value)
Adds a value to a property; if property already has value(s),
this is tacked onto the end, otherwise it acts like setProperty().
|
static PackageParameters |
create(javax.servlet.ServletRequest request)
Creates new parameters object with the parameter values from
a servlet request object.
|
boolean |
getBooleanProperty(String key,
boolean defaultAnswer)
Returns boolean form of property with selectable default
|
String[] |
getProperties(String key)
Returns multiple property values in an array.
|
boolean |
keepExistingModeEnabled()
Utility method to tell if 'keep-existing' mode is enabled.
|
boolean |
recursiveModeEnabled()
Utility method to tell if recursive mode is enabled.
|
boolean |
replaceModeEnabled()
Utility method to tell if replace mode is enabled.
|
boolean |
restoreModeEnabled()
Utility method to tell if restore mode is enabled.
|
void |
setKeepExistingModeEnabled(boolean value)
Utility method to enable/disable 'keep-existing' mode.
|
void |
setRecursiveModeEnabled(boolean value)
Utility method to enable/disable recursive mode.
|
void |
setReplaceModeEnabled(boolean value)
Utility method to enable/disable replace mode.
|
void |
setRestoreModeEnabled(boolean value)
Utility method to enable/disable restore mode.
|
void |
setUseCollectionTemplate(boolean value)
Utility method to enable/disable Collection Template for Item ingestion.
|
void |
setWorkflowEnabled(boolean value)
Utility method to enable/disable workflow for Item ingestion.
|
boolean |
useCollectionTemplate()
Utility method to tell if Items should use a Collection's template
when they are created.
|
boolean |
workflowEnabled()
Utility method to tell if workflow is enabled for Item ingestion.
|
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
public PackageParameters()
public PackageParameters(Properties defaults)
public static PackageParameters create(javax.servlet.ServletRequest request)
request
- - the request from which to take the valuespublic Object addProperty(String key, String value)
key
- - the key to be placed into this property list.value
- - the new value to add, corresponding to this key.public String[] getProperties(String key)
key
- - the key to look for in this property list.public boolean getBooleanProperty(String key, boolean defaultAnswer)
key
- the key to look for in this property list.defaultAnswer
- default to return if there is no such propertypublic boolean workflowEnabled()
Defaults to 'true' if previously unset, as by default all DSpace Workflows should be enabled.
public void setWorkflowEnabled(boolean value)
value
- boolean value (true = workflow enabled, false = workflow disabled)public boolean restoreModeEnabled()
Restore mode attempts to restore an missing/deleted object completely (including handle), based on contents of a package.
NOTE: restore mode should throw an error if it attempts to restore an object which already exists. Use 'keep-existing' or 'replace' mode to either skip-over (keep) or replace existing objects.
Defaults to 'false' if previously unset. NOTE: 'replace' mode and 'keep-existing' mode are special types of "restores". So, when either replaceModeEnabled() or keepExistingModeEnabled() is true, this method should also return true.
public void setRestoreModeEnabled(boolean value)
Restore mode attempts to restore an missing/deleted object completely (including handle), based on a given package's contents.
NOTE: restore mode should throw an error if it attempts to restore an object which already exists. Use 'keep-existing' or 'replace' mode to either skip-over (keep) or replace existing objects.
value
- boolean value (true = restore enabled, false = restore disabled)public boolean replaceModeEnabled()
Replace mode attempts to overwrite an existing object and replace it with the contents of a package. Replace mode is considered a special type of "restore", where the current object is being restored to a previous state.
Defaults to 'false' if previously unset.
public void setReplaceModeEnabled(boolean value)
Replace mode attempts to overwrite an existing object and replace it with the contents of a package. Replace mode is considered a special type of "restore", where the current object is being restored to a previous state.
value
- boolean value (true = replace enabled, false = replace disabled)public boolean keepExistingModeEnabled()
Keep-Existing mode is identical to 'restore' mode, except that it skips over any objects which are found to already be existing. It essentially restores all missing objects, but keeps existing ones intact.
Defaults to 'false' if previously unset.
public void setKeepExistingModeEnabled(boolean value)
Keep-Existing mode is identical to 'restore' mode, except that it skips over any objects which are found to already be existing. It essentially restores all missing objects, but keeps existing ones intact.
value
- boolean value (true = replace enabled, false = replace disabled)public boolean useCollectionTemplate()
Defaults to 'false' if previously unset.
public void setUseCollectionTemplate(boolean value)
When enabled, the Item will be installed using the parent collection's Item Template
value
- boolean value (true = template enabled, false = template disabled)public boolean recursiveModeEnabled()
Recursive mode should be enabled anytime one of the *All() methods is called (e.g. ingestAll(), replaceAll() or disseminateAll()). It recursively performs the same action on all related objects.
Defaults to 'false' if previously unset.
public void setRecursiveModeEnabled(boolean value)
Recursive mode should be enabled anytime one of the *All() methods is called (e.g. ingestAll(), replaceAll() or disseminateAll()). It recursively performs the same action on all related objects.
value
- boolean value (true = recursion enabled, false = recursion disabled)Copyright © 2016 DuraSpace. All Rights Reserved.