java.lang.Object
java.util.AbstractMap
java.util.HashMap
org.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 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 |
| Fields inherited from class java.util.HashMap |
|
| Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
cdm
private org.greenstone.gatherer.cdm.CollectionDesignManager cdm
collection_folder
private java.io.File collection_folder
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.
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)