Class CollectionImporter

java.lang.Object
org.dlese.dpc.schemedit.ndr.CollectionImporter

public class CollectionImporter extends Object
Extracts data from a Collection Metadata object and loads it into the NCS data structures to create a collection, and then creates item-level metadata from MetadataObjects in the NDR (transforming to native format if possible).

ISSUE: can we import arbitrary collections, or is it REQUIRED that NCS-level information (e.g., format) is present.

Author:
Jonathan Ostwald
  • Constructor Details

    • CollectionImporter

      public CollectionImporter(String mdpHandle, ServletContext servletContext) throws Exception
      Constructor for the CollectionImporter object (with access to ServletContext)
      Parameters:
      mdpHandle - NOT YET DOCUMENTED
      servletContext - NOT YET DOCUMENTED
      Throws:
      Exception - NOT YET DOCUMENTED
    • CollectionImporter

      public CollectionImporter(String mdpHandle, String recordsPath, String configPath) throws Exception
      Constructor for development and debugging purposes (servletContext is not available).
      Parameters:
      mdpHandle - NOT YET DOCUMENTED
      recordsPath - NOT YET DOCUMENTED
      configPath - NOT YET DOCUMENTED
      Throws:
      Exception - NOT YET DOCUMENTED
  • Method Details

    • doImport

      public Map doImport() throws Exception
      NOT YET DOCUMENTED
      Returns:
      NOT YET DOCUMENTED
      Throws:
      Exception - NOT YET DOCUMENTED
    • getCollectionFramework

      protected MetaDataFramework getCollectionFramework() throws Exception
      Gets the metaDataFramework attribute of the AbstractSchemEditAction object
      Returns:
      The metaDataFramework value
      Throws:
      Exception - NOT YET DOCUMENTED
    • getCollectionConfigFramework

      protected MetaDataFramework getCollectionConfigFramework() throws Exception
      Gets the collectionConfigFramework attribute of the CollectionImporter object
      Returns:
      The collectionConfigFramework value
      Throws:
      Exception - NOT YET DOCUMENTED
    • getCollectionHistory

      public org.dom4j.Element getCollectionHistory()
      Gets the statusEntries element from the metadataProvider's dsc_data datastream, which reflect the collection's history, including status changes, imports and exports.
      Returns:
      The statusEntries element if one exists, or an "empty_history" element otherwise
    • loadCollectionLevelMetadata

      public void loadCollectionLevelMetadata() throws Exception
      Write Collection-level metadata record to disk (NOT currently used).
      Throws:
      Exception - NOT YET DOCUMENTED
    • getCollectionId

      public String getCollectionId()
      Determines a collectionId for the collection to be imported.

      Tries the following until a value is found:

      • collectionId property of mdpReader
      • setSpec property of mdpReader
      • creates a uniqueID number
      Returns:
      The collectionId value
    • getCollectionConfigFile

      public File getCollectionConfigFile()
      Gets the collectionConfigFile attribute of the CollectionImporter object
      Returns:
      The collectionConfigFile value
    • loadItemLevelMetadata

      public void loadItemLevelMetadata(CollectionConfig collectionConfig) throws Exception
      Process MetadataWrappers in NDR response.

      Extract the following from each MetaDataWrapper and write to file system:

      • pid
      • itemRecord
      • dcsDataRecord
      Parameters:
      collectionConfig - NOT YET DOCUMENTED
      Throws:
      Exception - NOT YET DOCUMENTED
    • main

      public static void main(String[] args) throws Exception
      NOT YET DOCUMENTED
      Parameters:
      args - NOT YET DOCUMENTED
      Throws:
      Exception - NOT YET DOCUMENTED