Class CollectionConfig

java.lang.Object
org.dlese.dpc.schemedit.config.CollectionConfig

public class CollectionConfig extends Object
Holds information about a collection that is accessed via a 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.

Version:
$Id: CollectionConfig.java,v 1.12 2009/03/20 23:33:56 jweather Exp $
Author:
ostwald

$Id $

  • Constructor Details

    • CollectionConfig

      public CollectionConfig(File configFile, CollectionRegistry collectionRegistry)
      Constructor for the CollectionConfig object
      Parameters:
      configFile - Description of the Parameter
      collectionRegistry - NOT YET DOCUMENTED
    • CollectionConfig

      public CollectionConfig(CollectionConfigReader configReader)
      Constructor for the CollectionConfig object
      Parameters:
      configReader - Description of the Parameter
  • Method Details

    • getIDGenerator

      public IDGenerator getIDGenerator()
      Gets the iDGenerator attribute of the CollectionConfig object
      Returns:
      The iDGenerator value
    • nextID

      public String nextID()
      Get the next ID to be assigned for this collection.
      Returns:
      NOT YET DOCUMENTED
    • setIdPrefix

      public void setIdPrefix(String idPrefix)
      Sets the idPrefix for this collection that is used to construct record IDs.
      Parameters:
      idPrefix - The new idPrefix value
    • getIdPrefix

      public String getIdPrefix()
      Gets the idPrefix for this collection.
      Returns:
      The idPrefix value
    • getConfigReader

      public CollectionConfigReader getConfigReader()
      Gets the configReader attribute of the CollectionConfig object
      Returns:
      The configReader value
    • updateTuples

      public void updateTuples(MetaDataFramework framework) throws Exception
      Ensure there is an element in the config file for each tuple defined in the metaDataFramework for this collection.
      Parameters:
      framework - NOT YET DOCUMENTED
      Throws:
      Exception - NOT YET DOCUMENTED
    • getId

      public String getId()
      Gets the id attribute of the CollectionConfig object
      Returns:
      The id value
    • setId

      public void setId(String id)
      Sets the id attribute of the CollectionConfig object
      Parameters:
      id - The new id value
    • getXmlFormat

      public String getXmlFormat()
      Gets the xmlFormat attribute of the CollectionConfig object
      Returns:
      The xmlFormat value
    • setXmlFormat

      public void setXmlFormat(String xmlFormat)
      Sets the xmlFormat attribute for this collection.
      Parameters:
      xmlFormat - The new xmlFormat value
    • getSuggestionsAllowed

      public boolean getSuggestionsAllowed()
    • setSuggestionsAllowedd

      public void setSuggestionsAllowedd(boolean allowed)
    • clearNdrInfo

      public void clearNdrInfo()
      Removes all content from the NDR info element.
    • getAuthority

      public String getAuthority()
      Gets the authority attribute of the CollectionConfig object
      Returns:
      The authority value
    • isNDRCollection

      public boolean isNDRCollection()
      Convenience method to determine whether this collection is managed in the NDR.
      Returns:
      true if the collection is managed in the NDR.
    • setAuthority

      public void setAuthority(String authority)
      Sets the authority attribute for this collection, which is used to determine whether the collection is managed in the NDR.
      Parameters:
      authority - The new authority value
    • getMetadataProviderHandle

      public String getMetadataProviderHandle()
      Gets the handle of this collections metadataProvider object in the NDR.
      Returns:
      The metadataProviderHandle value
    • setMetadataProviderHandle

      public void setMetadataProviderHandle(String metadataProviderHandle)
      Sets the handle of this collections metadataProvider object in the NDR.
      Parameters:
      metadataProviderHandle - The new metadataProviderHandle value
    • getAggregatorHandle

      public String getAggregatorHandle()
      Gets the handle of the NDR aggregator object for this collection.
      Returns:
      The aggregatorHandle value
    • setAggregatorHandle

      public void setAggregatorHandle(String aggregatorHandle)
      Sets the handle of the NDR aggregator object for this collection.
      Parameters:
      aggregatorHandle - The new aggregatorHandle value
    • getAgentHandle

      public String getAgentHandle()
      Gets the handle of the NDR agent object for this collection.
      Returns:
      The agentHandle value
    • setAgentHandle

      public void setAgentHandle(String agentHandle)
      Sets the handle of the NDR agent object for this collection.
      Parameters:
      agentHandle - The new agentHandle value
    • getNdrOaiLink

      public 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.
      Returns:
      The ndrOaiLink value
    • setNdrOaiLink

      public void setNdrOaiLink(String link)
      Sets the ndrOaiLink attribute of the CollectionConfig object
      Parameters:
      link - The new ndrOaiLink value
    • getNdrServer

      public String getNdrServer()
    • setNdrServer

      public void setNdrServer(String server)
      Sets the ndrServer attribute of the CollectionConfig object
      Parameters:
      link - The new ndrServer value
    • getStatusMap

      public Map getStatusMap()
      The StatusMap holds mappings from the StatusFlag values defined by this collection to their corresponding StatusFlag instances.
      Returns:
      The statusMap value
    • getTupleMap

      public Map getTupleMap()
      Gets the tupleMap for this collection. The tupleMap contains name/value pairs that are written into new metadata records.
      Returns:
      The tupleMap value
    • getSetInfo

      public DcsSetInfo getSetInfo(RepositoryManager rm)
      Gets the setInfo for this collection from the RepositoryManager.
      Parameters:
      rm - Description of the Parameter
      Returns:
      The setInfo value
    • setStatusMap

      public void setStatusMap(Map statusMap)
      Write the contents of this collection's StatusMap to the collection-config file.
      Parameters:
      statusMap - The new statusMap value
    • setTupleMap

      public void setTupleMap(Map tupleMap)
      Sets the tupleMap for this collection, which contains name, value pairs that are automatically inserted into new metadata records.
      Parameters:
      tupleMap - The new tupleMap value
    • getStatusLabels

      public List getStatusLabels()
      Returns a sorted list of StatusFlag labels defined by this collection.
      Returns:
      The statuses value
    • getTupleValue

      public String getTupleValue(String name)
      Get the value of the named tuple.
      Parameters:
      name - NOT YET DOCUMENTED
      Returns:
      The tupleValue value
    • setTupleValue

      public void setTupleValue(String name, String value)
      Adds tuple entry to the tupleMap.
      Parameters:
      name - The new tupleValue value
      value - The new tupleValue value
    • getStatusFlagLabel

      public String getStatusFlagLabel(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).
      Parameters:
      statusFlagValue - NOT YET DOCUMENTED
      Returns:
      The statusFlagLabel value
    • getStatusFlags

      public 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.
      Returns:
      The statusFlags value
    • getAssignableStatusFlags

      public List getAssignableStatusFlags()
      Return a list of 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.
      Returns:
      The assignableStatusFlags value
    • getSelectableStatusFlags

      public List getSelectableStatusFlags()
      Returns a list of StatusFlags defined by this collection that can be selected for searching. The selectable flags includes the assignable flags plus the reserved IMPORTED_STATUS_FLAG.
      Returns:
      The selectableStatusFlags value
    • getExportDirectory

      public String getExportDirectory()
      Gets the exportDirectory attribute of the CollectionConfig object
      Returns:
      The exportDirectory value
    • setExportDirectory

      public void setExportDirectory(String s)
      Sets the exportDirectory attribute of the CollectionConfig object
      Parameters:
      s - The new exportDirectory value
    • getFinalStatusValue

      public String getFinalStatusValue()
      Convenience method to retrieve the FinalStatusFlagValue for this collection from StatusFlags.
      Returns:
      The finalStatusValue value
    • getFinalStatusLabel

      public String getFinalStatusLabel()
      Gets the finalStatusLabel (display string) for this collection.
      Returns:
      The finalStatusLabel value
    • getFinalStatusFlag

      public StatusFlag getFinalStatusFlag()
      Gets the finalStatusFlag for this collection.
      Returns:
      The finalStatusFlag value
    • setFinalStatusLabel

      public void setFinalStatusLabel(String s)
      Sets the finalStatusLabel (the display label) for this collection's final Status.
      Parameters:
      s - The new finalStatusLabel value
    • flush

      public boolean flush()
      Writes config file to disk and re-initializes data structures based on config.
      Returns:
      Description of the Return Value
    • refresh

      public void refresh()
      Causes all values to be re-read from config file on disk.
    • toString

      public String toString()
      Description of the Method
      Overrides:
      toString in class Object
      Returns:
      Description of the Return Value
    • destroy

      public void destroy()
      Description of the Method