Changeset 5039
- Timestamp:
- 2003-07-25T16:38:55+12:00 (21 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer/msm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/msm/GreenstoneArchiveParser.java
r4674 r5039 39 39 import java.net.*; 40 40 import java.util.*; 41 import org.greenstone.gatherer.Configuration; 41 42 import org.greenstone.gatherer.Gatherer; 42 43 import org.greenstone.gatherer.collection.Collection; … … 62 63 public GreenstoneArchiveParser(GShellProgressMonitor progress, GShell shell) { 63 64 // We can only extract metadata if an extracted metadata set exists in our collection. 64 if(Gatherer.c_man.msm.getSet( "") != null) {65 if(Gatherer.c_man.msm.getSet(Utility.EXTRACTED_METADATA_NAMESPACE) != null) { 65 66 this.shell = shell; 66 67 // Determine the collection archive directory. … … 74 75 // Then extract the metadata from it. 75 76 if(document_file.exists()) { 76 extractMetadata(document_file);77 int count = extractMetadata(document_file); 77 78 // 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 String[] args = new String[2]; 80 args[0] = document_directories[i].getName(); 81 args[1] = String.valueOf(count); 82 shell.message(GShell.IMPORT, shell.typeAsString(GShell.IMPORT) + "> " + Gatherer.dictionary.get("GShell.Extracted", args), GShell.OK); 83 args = null; 79 84 progress.increment(); 80 85 } … … 115 120 ElementWrapper element = Gatherer.c_man.msm.getElement(name); 116 121 if(element == null) { 117 MetadataSet extracted_mds = Gatherer.c_man.msm.getSet( "ex");122 MetadataSet extracted_mds = Gatherer.c_man.msm.getSet(Utility.EXTRACTED_METADATA_NAMESPACE); 118 123 if(extracted_mds != null) { 119 element = extracted_mds.addElement(name );124 element = extracted_mds.addElement(name, Gatherer.config.interface_language); 120 125 } 121 126 } -
trunk/gli/src/org/greenstone/gatherer/msm/MetadataSetManager.java
r4933 r5039 386 386 // First we seperate off what set it is in, where we have '<set><namespace_separator><element>'. 387 387 if(name.indexOf(MSMUtils.NS_SEP) != -1) { 388 String namespace = name.substring(0, name.indexOf(MSMUtils.NS_SEP)); 389 // Retrieve the correct set if possible. 390 set = (MetadataSet)mds_hashtable.get(namespace); 391 namespace = null; 392 // Now retrieve the element name. 393 element = name.substring(name.indexOf(MSMUtils.NS_SEP) + 1); 388 if(name.startsWith(Utility.EXTRACTED_METADATA_NAMESPACE)) { 389 // Retrieve the correct set if possible. 390 set = (MetadataSet)mds_hashtable.get(""); 391 // Now retrieve the element name. 392 element = name.substring(name.indexOf(MSMUtils.NS_SEP) + 1); 393 } 394 else { 395 String namespace = name.substring(0, name.indexOf(MSMUtils.NS_SEP)); 396 // Retrieve the correct set if possible. 397 set = (MetadataSet)mds_hashtable.get(namespace); 398 namespace = null; 399 // Now retrieve the element name. 400 element = name.substring(name.indexOf(MSMUtils.NS_SEP) + 1); 401 } 394 402 } 395 403 else { 396 404 // No namespace so assume ns = "". 397 405 set = (MetadataSet)mds_hashtable.get(""); 398 406 element = name; 399 407 } 400 408 if(set != null) { 401 409 ///ystem.err.print("Trying to match element " + element +"?"); 402 410 Element temp = set.getElement(element); 403 411 if(temp != null) { … … 457 465 return (MetadataSet) mds_hashtable.get(name); 458 466 } 467 else if(name.equals(Utility.EXTRACTED_METADATA_NAMESPACE)) { 468 return (MetadataSet) mds_hashtable.get(""); 469 } 459 470 else { 460 471 ///ystem.err.println("Couldn't find metadata set."); 461 472 if(name.equals(HIDDEN)) { 462 473 return createHidden();
Note:
See TracChangeset
for help on using the changeset viewer.