DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.ndr
Class CollectionImporter

java.lang.Object
  extended by 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 Summary
CollectionImporter(String mdpHandle, ServletContext servletContext)
          Constructor for the CollectionImporter object (with access to ServletContext)
CollectionImporter(String mdpHandle, String recordsPath, String configPath)
          Constructor for development and debugging purposes (servletContext is not available).
 
Method Summary
 Map doImport()
          NOT YET DOCUMENTED
 File getCollectionConfigFile()
          Gets the collectionConfigFile attribute of the CollectionImporter object
protected  MetaDataFramework getCollectionConfigFramework()
          Gets the collectionConfigFramework attribute of the CollectionImporter object
protected  MetaDataFramework getCollectionFramework()
          Gets the metaDataFramework attribute of the AbstractSchemEditAction object
 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.
 String getCollectionId()
          Determines a collectionId for the collection to be imported.
 void loadCollectionLevelMetadata()
          Write Collection-level metadata record to disk (NOT currently used).
 void loadItemLevelMetadata(CollectionConfig collectionConfig)
          Process MetadataWrappers in NDR response.
static void main(String[] args)
          NOT YET DOCUMENTED
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionImporter

public CollectionImporter(String mdpHandle,
                          ServletContext servletContext)
                   throws Exception
Constructor for the CollectionImporter object (with access to ServletContext)

Parameters:
servletContext - NOT YET DOCUMENTED
mdpHandle - 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:
recordsPath - NOT YET DOCUMENTED
configPath - NOT YET DOCUMENTED
mdpHandle - NOT YET DOCUMENTED
Throws:
Exception - NOT YET DOCUMENTED
Method Detail

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 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:

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:

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

DLESE Tools
v1.6.0