- Timestamp:
- 2003-05-23T16:40:57+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/msm/GreenstoneArchiveParser.java
r4293 r4319 61 61 62 62 public GreenstoneArchiveParser(GShellProgressMonitor progress, GShell shell) { 63 this.shell = shell; 64 // Determine the collection archive directory. 65 File archive_directory = new File(Gatherer.c_man.getCollectionArchive()); 66 // For each of the hash coded directories within. 67 File document_directories[] = archive_directory.listFiles(); 68 for(int i = 0; i < document_directories.length; i++) { 69 // Find the doc.xml file within 70 if(document_directories[i].isDirectory()) { 71 File document_file = new File(document_directories[i], "doc.xml"); 72 // Then extract the metadata from it. 73 if(document_file.exists()) { 74 extractMetadata(document_file); 75 // Display a pretty progress message. 76 shell.fireMessage(GShell.IMPORT, shell.typeAsString(GShell.IMPORT) + "> " + Gatherer.dictionary.get("GShell.Extracted", document_directories[i].getName()), GShell.OK); 77 progress.increment(); 63 // We can only extract metadata if an extracted metadata set exists in our collection. 64 if(Gatherer.c_man.msm.getSet("") != null) { 65 this.shell = shell; 66 // Determine the collection archive directory. 67 File archive_directory = new File(Gatherer.c_man.getCollectionArchive()); 68 // For each of the hash coded directories within. 69 File document_directories[] = archive_directory.listFiles(); 70 for(int i = 0; i < document_directories.length; i++) { 71 // Find the doc.xml file within 72 if(document_directories[i].isDirectory()) { 73 File document_file = new File(document_directories[i], "doc.xml"); 74 // Then extract the metadata from it. 75 if(document_file.exists()) { 76 extractMetadata(document_file); 77 // Display a pretty progress message. 78 shell.fireMessage(GShell.IMPORT, shell.typeAsString(GShell.IMPORT) + "> " + Gatherer.dictionary.get("GShell.Extracted", document_directories[i].getName()), GShell.OK); 79 progress.increment(); 80 } 78 81 } 79 82 } … … 112 115 ElementWrapper element = Gatherer.c_man.msm.getElement(name); 113 116 if(element == null) { 114 MetadataSet greenstone_mds = Gatherer.c_man.msm.getSet("");115 element = greenstone_mds.addElement(name);117 MetadataSet extracted_mds = Gatherer.c_man.msm.getSet("ex"); 118 element = extracted_mds.addElement(name); 116 119 } 117 120 // If we successfully retrieved an element (and we should have) we can continue.
Note:
See TracChangeset
for help on using the changeset viewer.