Class PackageParameters
- All Implemented Interfaces:
Serializable,Cloneable,Map<Object,Object>
- Version:
- $Revision$
- Author:
- Larry Stone
- See Also:
-
Field Summary
FieldsFields inherited from class java.util.Properties
defaults -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddProperty(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 PackageParameterscreate(jakarta.servlet.ServletRequest request) Creates new parameters object with the parameter values from a servlet request object.booleangetBooleanProperty(String key, boolean defaultAnswer) Returns boolean form of property with selectable defaultString[]getProperties(String key) Returns multiple property values in an array.booleanUtility method to tell if 'keep-existing' mode is enabled.booleanUtility method to tell if recursive mode is enabled.booleanUtility method to tell if replace mode is enabled.booleanUtility method to tell if restore mode is enabled.voidsetKeepExistingModeEnabled(boolean value) Utility method to enable/disable 'keep-existing' mode.voidsetRecursiveModeEnabled(boolean value) Utility method to enable/disable recursive mode.voidsetReplaceModeEnabled(boolean value) Utility method to enable/disable replace mode.voidsetRestoreModeEnabled(boolean value) Utility method to enable/disable restore mode.voidsetUseCollectionTemplate(boolean value) Utility method to enable/disable Collection Template for Item ingestion.voidsetWorkflowEnabled(boolean value) Utility method to enable/disable workflow for Item ingestion.booleanUtility method to tell if Items should use a Collection's template when they are created.booleanUtility method to tell if workflow is enabled for Item ingestion.Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
Field Details
-
SEPARATOR
- See Also:
-
SEPARATOR_REGEX
- See Also:
-
-
Constructor Details
-
PackageParameters
public PackageParameters() -
PackageParameters
-
-
Method Details
-
create
Creates new parameters object with the parameter values from a servlet request object.- Parameters:
request- - the request from which to take the values- Returns:
- new parameters object.
-
addProperty
Adds a value to a property; if property already has value(s), this is tacked onto the end, otherwise it acts like setProperty().- Parameters:
key- - the key to be placed into this property list.value- - the new value to add, corresponding to this key.- Returns:
- the previous value of the specified key in this property list, or null if it did not have one.
-
getProperties
Returns multiple property values in an array.- Parameters:
key- - the key to look for in this property list.- Returns:
- all values in an array, or null if this property is unset.
-
getBooleanProperty
Returns boolean form of property with selectable default- Parameters:
key- the key to look for in this property list.defaultAnswer- default to return if there is no such property- Returns:
- the boolean derived from the value of property, or default if it was not specified.
-
workflowEnabled
public boolean workflowEnabled()Utility method to tell if workflow is enabled for Item ingestion. Checks the Packager parameters.Defaults to 'true' if previously unset, as by default all DSpace Workflows should be enabled.
- Returns:
- boolean result
-
setWorkflowEnabled
public void setWorkflowEnabled(boolean value) Utility method to enable/disable workflow for Item ingestion.- Parameters:
value- boolean value (true = workflow enabled, false = workflow disabled)
-
restoreModeEnabled
public boolean restoreModeEnabled()Utility method to tell if restore mode is enabled. Checks the Packager parameters.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.
- Returns:
- boolean result
-
setRestoreModeEnabled
public void setRestoreModeEnabled(boolean value) Utility method to enable/disable restore mode.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.
- Parameters:
value- boolean value (true = restore enabled, false = restore disabled)
-
replaceModeEnabled
public boolean replaceModeEnabled()Utility method to tell if replace mode is enabled. Checks the Packager parameters.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.
- Returns:
- boolean result
-
setReplaceModeEnabled
public void setReplaceModeEnabled(boolean value) Utility method to enable/disable replace mode.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.
- Parameters:
value- boolean value (true = replace enabled, false = replace disabled)
-
keepExistingModeEnabled
public boolean keepExistingModeEnabled()Utility method to tell if 'keep-existing' mode is enabled. Checks the Packager parameters.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.
- Returns:
- boolean result
-
setKeepExistingModeEnabled
public void setKeepExistingModeEnabled(boolean value) Utility method to enable/disable 'keep-existing' mode.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.
- Parameters:
value- boolean value (true = replace enabled, false = replace disabled)
-
useCollectionTemplate
public boolean useCollectionTemplate()Utility method to tell if Items should use a Collection's template when they are created.Defaults to 'false' if previously unset.
- Returns:
- boolean result
-
setUseCollectionTemplate
public void setUseCollectionTemplate(boolean value) Utility method to enable/disable Collection Template for Item ingestion.When enabled, the Item will be installed using the parent collection's Item Template
- Parameters:
value- boolean value (true = template enabled, false = template disabled)
-
recursiveModeEnabled
public boolean recursiveModeEnabled()Utility method to tell if recursive mode is enabled. Checks the Packager parameters.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.
- Returns:
- boolean result
-
setRecursiveModeEnabled
public void setRecursiveModeEnabled(boolean value) Utility method to enable/disable recursive mode.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.
- Parameters:
value- boolean value (true = recursion enabled, false = recursion disabled)
-