public class CollectionConfig
extends java.lang.Object
CollectionConfigReader
.CollectionConfig supports getting and setting of workflow status flags, default export directory path, etc. Existing collection configuration files are read at system startup time, but there need not be a config file for each collection. Config files are created by copying a default.xml file and modifying it as settings are edited.
CollectionConfig instances are registered in a CollectionRegistry
instance.
$Id $
Constructor and Description |
---|
CollectionConfig(CollectionConfigReader configReader)
Constructor for the CollectionConfig object
|
CollectionConfig(java.io.File configFile,
CollectionRegistry collectionRegistry)
Constructor for the CollectionConfig object
|
Modifier and Type | Method and Description |
---|---|
void |
clearNdrInfo()
Removes all content from the NDR info element.
|
void |
destroy()
Description of the Method
|
boolean |
flush()
Writes config file to disk and re-initializes data structures based on config.
|
java.lang.String |
getAgentHandle()
Gets the handle of the NDR agent object for this collection.
|
java.lang.String |
getAggregatorHandle()
Gets the handle of the NDR aggregator object for this collection.
|
java.util.List |
getAssignableStatusFlags()
Return a list of
StatusFlag beans that describe the statuses that
can be assigned to a record of this collection. |
java.lang.String |
getAuthority()
Gets the authority attribute of the CollectionConfig object
|
CollectionConfigReader |
getConfigReader()
Gets the configReader attribute of the CollectionConfig object
|
java.lang.String |
getExportDirectory()
Gets the exportDirectory attribute of the CollectionConfig object
|
StatusFlag |
getFinalStatusFlag()
Gets the finalStatusFlag for this collection.
|
java.lang.String |
getFinalStatusLabel()
Gets the finalStatusLabel (display string) for this collection.
|
java.lang.String |
getFinalStatusValue()
Convenience method to retrieve the FinalStatusFlagValue for this collection
from StatusFlags.
|
java.lang.String |
getId()
Gets the id attribute of the CollectionConfig object
|
IDGenerator |
getIDGenerator()
Gets the iDGenerator attribute of the CollectionConfig object
|
java.lang.String |
getIdPrefix()
Gets the idPrefix for this collection.
|
java.lang.String |
getMetadataProviderHandle()
Gets the handle of this collections metadataProvider object in the NDR.
|
java.lang.String |
getNdrOaiLink()
Gets the ndrOaiLink for this collection, which is the "itemId" of
Collection Metadata records stored in the NDR, and which is inserted in
the InfoStream of item-level metadata records when they are written to the NDR.
|
java.lang.String |
getNdrServer() |
java.util.List |
getSelectableStatusFlags()
Returns a list of StatusFlags defined by this collection that can be
selected for searching.
|
DcsSetInfo |
getSetInfo(RepositoryManager rm)
Gets the setInfo for this collection from the RepositoryManager.
|
java.lang.String |
getStatusFlagLabel(java.lang.String statusFlagValue)
Return the status flag label (the readable version) for the given status
flag value (which must be decoded if it is a final status flag).
|
java.util.List |
getStatusFlags()
Get sorted list of statusFlags defined in this collection for use in jsp,
where we need the StatusFlag object, not just the label.
|
java.util.List |
getStatusLabels()
Returns a sorted list of StatusFlag labels defined by this collection.
|
java.util.Map |
getStatusMap()
The StatusMap holds mappings from the StatusFlag values defined by this
collection to their corresponding StatusFlag instances.
|
boolean |
getSuggestionsAllowed() |
java.util.Map |
getTupleMap()
Gets the tupleMap for this collection.
|
java.lang.String |
getTupleValue(java.lang.String name)
Get the value of the named tuple.
|
java.lang.String |
getXmlFormat()
Gets the xmlFormat attribute of the CollectionConfig object
|
boolean |
isNDRCollection()
Convenience method to determine whether this collection is managed in the NDR.
|
java.lang.String |
nextID()
Get the next ID to be assigned for this collection.
|
void |
refresh()
Causes all values to be re-read from config file on disk.
|
void |
setAgentHandle(java.lang.String agentHandle)
Sets the handle of the NDR agent object for this collection.
|
void |
setAggregatorHandle(java.lang.String aggregatorHandle)
Sets the handle of the NDR aggregator object for this collection.
|
void |
setAuthority(java.lang.String authority)
Sets the authority attribute for this collection, which is used to determine whether
the collection is managed in the NDR.
|
void |
setExportDirectory(java.lang.String s)
Sets the exportDirectory attribute of the CollectionConfig object
|
void |
setFinalStatusLabel(java.lang.String s)
Sets the finalStatusLabel (the display label) for this collection's final Status.
|
void |
setId(java.lang.String id)
Sets the id attribute of the CollectionConfig object
|
void |
setIdPrefix(java.lang.String idPrefix)
Sets the idPrefix for this collection that is used to construct record IDs.
|
void |
setMetadataProviderHandle(java.lang.String metadataProviderHandle)
Sets the handle of this collections metadataProvider object in the NDR.
|
void |
setNdrOaiLink(java.lang.String link)
Sets the ndrOaiLink attribute of the CollectionConfig object
|
void |
setNdrServer(java.lang.String server)
Sets the ndrServer attribute of the CollectionConfig object
|
void |
setStatusMap(java.util.Map statusMap)
Write the contents of this collection's StatusMap to the collection-config
file.
|
void |
setSuggestionsAllowedd(boolean allowed) |
void |
setTupleMap(java.util.Map tupleMap)
Sets the tupleMap for this collection, which contains name, value pairs that
are automatically inserted into new metadata records.
|
void |
setTupleValue(java.lang.String name,
java.lang.String value)
Adds tuple entry to the tupleMap.
|
void |
setXmlFormat(java.lang.String xmlFormat)
Sets the xmlFormat attribute for this collection.
|
java.lang.String |
toString()
Description of the Method
|
void |
updateTuples(MetaDataFramework framework)
Ensure there is an element in the config file for each tuple defined in the
metaDataFramework for this collection.
|
public CollectionConfig(java.io.File configFile, CollectionRegistry collectionRegistry)
configFile
- Description of the ParametercollectionRegistry
- NOT YET DOCUMENTEDpublic CollectionConfig(CollectionConfigReader configReader)
configReader
- Description of the Parameterpublic IDGenerator getIDGenerator()
public java.lang.String nextID()
public void setIdPrefix(java.lang.String idPrefix)
idPrefix
- The new idPrefix valuepublic java.lang.String getIdPrefix()
public CollectionConfigReader getConfigReader()
public void updateTuples(MetaDataFramework framework) throws java.lang.Exception
framework
- NOT YET DOCUMENTEDjava.lang.Exception
- NOT YET DOCUMENTEDpublic java.lang.String getId()
public void setId(java.lang.String id)
id
- The new id valuepublic java.lang.String getXmlFormat()
public void setXmlFormat(java.lang.String xmlFormat)
xmlFormat
- The new xmlFormat valuepublic boolean getSuggestionsAllowed()
public void setSuggestionsAllowedd(boolean allowed)
public void clearNdrInfo()
public java.lang.String getAuthority()
public boolean isNDRCollection()
public void setAuthority(java.lang.String authority)
authority
- The new authority valuepublic java.lang.String getMetadataProviderHandle()
public void setMetadataProviderHandle(java.lang.String metadataProviderHandle)
metadataProviderHandle
- The new metadataProviderHandle valuepublic java.lang.String getAggregatorHandle()
public void setAggregatorHandle(java.lang.String aggregatorHandle)
aggregatorHandle
- The new aggregatorHandle valuepublic java.lang.String getAgentHandle()
public void setAgentHandle(java.lang.String agentHandle)
agentHandle
- The new agentHandle valuepublic java.lang.String getNdrOaiLink()
public void setNdrOaiLink(java.lang.String link)
link
- The new ndrOaiLink valuepublic java.lang.String getNdrServer()
public void setNdrServer(java.lang.String server)
link
- The new ndrServer valuepublic java.util.Map getStatusMap()
public java.util.Map getTupleMap()
public DcsSetInfo getSetInfo(RepositoryManager rm)
rm
- Description of the Parameterpublic void setStatusMap(java.util.Map statusMap)
statusMap
- The new statusMap valuepublic void setTupleMap(java.util.Map tupleMap)
tupleMap
- The new tupleMap valuepublic java.util.List getStatusLabels()
public java.lang.String getTupleValue(java.lang.String name)
name
- NOT YET DOCUMENTEDpublic void setTupleValue(java.lang.String name, java.lang.String value)
name
- The new tupleValue valuevalue
- The new tupleValue valuepublic java.lang.String getStatusFlagLabel(java.lang.String statusFlagValue)
statusFlagValue
- NOT YET DOCUMENTEDpublic java.util.List getStatusFlags()
public java.util.List getAssignableStatusFlags()
StatusFlag
beans that describe the statuses that
can be assigned to a record of this collection. The selectableStatusFlags
list is composed of the UNKNOWN_status plus those statuses that are defined
for the collection. The IMPORT status is not selectable, since it is only
assigned by the system.public java.util.List getSelectableStatusFlags()
public java.lang.String getExportDirectory()
public void setExportDirectory(java.lang.String s)
s
- The new exportDirectory valuepublic java.lang.String getFinalStatusValue()
public java.lang.String getFinalStatusLabel()
public StatusFlag getFinalStatusFlag()
public void setFinalStatusLabel(java.lang.String s)
s
- The new finalStatusLabel valuepublic boolean flush()
public void refresh()
public java.lang.String toString()
toString
in class java.lang.Object
public void destroy()