- Timestamp:
- 2004-10-08T09:46:12+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/msm/parsers/GreenstoneMetadataParser.java
r8022 r8236 39 39 import javax.swing.*; 40 40 import javax.swing.tree.*; 41 import org.greenstone.gatherer.DebugStream; 41 42 import org.greenstone.gatherer.Gatherer; 42 43 import org.greenstone.gatherer.cdm.CommandTokenizer; … … 93 94 /** Locate and import any metadata parsed by this metadata parser given the file involved and its previous incarnation. */ 94 95 public boolean process(FileNode destination, FileNode origin, boolean folder_level, boolean dummy_run) { 95 Gatherer.println("GreenstoneMetadataParser: Process " + origin + ": ");96 DebugStream.println("GreenstoneMetadataParser: Process " + origin + ": "); 96 97 int counter = 0; 97 98 dialog_cancelled = false; … … 114 115 if(possible_cfg_file.exists() && (possible_gimport_directory.exists() || possible_import_directory.exists())) { 115 116 found = true; 116 Gatherer.println("Found greenstone collection at " + collection_dir.getAbsolutePath());117 DebugStream.println("Found greenstone collection at " + collection_dir.getAbsolutePath()); 117 118 } 118 119 else { … … 131 132 132 133 // 2. If a collection configuration file was found, attempt to merge in any mdses and make note of those that are successfully imported (by removing reference from collect.cfg). 133 Gatherer.println("Merging in any metadata sets found.");134 DebugStream.println("Merging in any metadata sets found."); 134 135 if(collect_cfg != null) { 135 136 ArrayList mdses = collect_cfg.getMetadataSets(); … … 143 144 144 145 // 3. Locate all of the metadata.xml files that may have an affect on the origin file. Make sure the metadata.xml closest to the origin files directory is last (to ensure property inheritance regarding accumulate/overwrite). 145 Gatherer.println("Searching for metadata.xml files");146 DebugStream.println("Searching for metadata.xml files"); 146 147 ArrayList search_files = new ArrayList(); 147 148 File file = origin.getFile(); … … 176 177 for(int i = 0; i < search_files.size(); i++) { 177 178 MetadataXMLFileSearch a_search = (MetadataXMLFileSearch) search_files.get(i); 178 Gatherer.println("Search " + a_search.file.getAbsolutePath() + " for " + (a_search.filename != null ? a_search.filename : ".*"));179 Gatherer.println("Search at the " + (folder_level ? "Folder" : "Filename") + " level");179 DebugStream.println("Search " + a_search.file.getAbsolutePath() + " for " + (a_search.filename != null ? a_search.filename : ".*")); 180 DebugStream.println("Search at the " + (folder_level ? "Folder" : "Filename") + " level"); 180 181 // Retrieve the document 181 182 BasicGDMDocument document = getDocument(a_search.file); … … 194 195 search_files = null; 195 196 // Finally assign the metadata 196 Gatherer.println("Found " + metadata.size() + " pieces of metadata for " + destination);197 DebugStream.println("Found " + metadata.size() + " pieces of metadata for " + destination); 197 198 if(metadata.size() > 0) { 198 199 addMetadata(origin, destination, metadata, collection_dir, collect_cfg, dummy_run); … … 493 494 directorymetadata_element = null; 494 495 } 495 catch (Exception e rror) {496 Gatherer.self.printStackTrace(error);496 catch (Exception exception) { 497 DebugStream.printStackTrace(exception); 497 498 } 498 499 return metadatum; … … 583 584 directorymetadata_element = null; 584 585 } 585 catch (Exception e rror) {586 Gatherer.self.printStackTrace(error);586 catch (Exception exception) { 587 DebugStream.printStackTrace(exception); 587 588 } 588 589 // Cache the result, given that these external metadata.xmls are taken to be static at the time of reading (if you happen to be sourcing information from a opened collection that someone is working on, too bad. … … 703 704 } 704 705 catch(Exception error) { 705 Gatherer.printStackTrace(error);706 DebugStream.printStackTrace(error); 706 707 collect_cfg = null; 707 708 }
Note:
See TracChangeset
for help on using the changeset viewer.