Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.greenstone.gatherer.msm
Class LegacyCollectionImporter  view LegacyCollectionImporter download LegacyCollectionImporter.java

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byorg.greenstone.gatherer.msm.LegacyCollectionImporter
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class LegacyCollectionImporter
extends java.util.HashMap

Importing metadata from legacy collections requires three distinct steps: 1. Import hfiles and build value tree for the appropriate element. This is quite tricky as the only place to determine the relation between hfiles and the elements is the collect.cfg file. Fortunately we can reuse a lot of code from SearchForMetadata. 2. Recurses through the import folder of a legacy collection, and prompts the user how to transform old skool metadata names into the new and improved namespace standard. Because of the optimization of only opening each metadata.xml file once, this method is so different from GreenstoneMetadataParser that I decided not to try to hang to two together, but instead to create this new class. GLI's becoming bloatware. 3. At the same time watch for values which come from subject hierarchies, and replace with the new, confirmably unique, value. 4. Update collection configuration as we should now be able to fix the classify commands anyway Ok so that is four. Four distinct steps. Definately four. Couldn't possibly be more than six.


Nested Class Summary
private  class LegacyCollectionImporter.HFile
          Another basic HFile wrapper.
 
Nested classes inherited from class java.util.HashMap
 
Nested classes inherited from class java.util.AbstractMap
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
private  org.greenstone.gatherer.cdm.CollectionDesignManager cdm
           
private  java.io.File collection_folder
           
 
Fields inherited from class java.util.HashMap
 
Fields inherited from class java.util.AbstractMap
 
Constructor Summary
LegacyCollectionImporter(java.io.File collection_folder, org.greenstone.gatherer.cdm.CollectionDesignManager cdm)
          Constructor.
 
Method Summary
private  void checkForHierarchy(ElementWrapper element, org.w3c.dom.Element metadata_DOM_element)
           
 void importMetadata()
           
private  void importMetadata(java.io.File file)
          Processes the files in the import tree, editing metadata.xml files so they contain namespaced element names.
 void updateCDM()
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

cdm

private org.greenstone.gatherer.cdm.CollectionDesignManager cdm

collection_folder

private java.io.File collection_folder
Constructor Detail

LegacyCollectionImporter

public LegacyCollectionImporter(java.io.File collection_folder,
                                org.greenstone.gatherer.cdm.CollectionDesignManager cdm)
Constructor. The legacy collection importer object itself is a HashMap of element wrappers to HFile objects. Actually it starts off as a mapping of raw_element_name_str's to Files, but we hope to remedy that as we progress through importing metadata.

Method Detail

updateCDM

public void updateCDM()

importMetadata

public void importMetadata()

importMetadata

private void importMetadata(java.io.File file)
Processes the files in the import tree, editing metadata.xml files so they contain namespaced element names.


checkForHierarchy

private void checkForHierarchy(ElementWrapper element,
                               org.w3c.dom.Element metadata_DOM_element)