Changeset 6503 for trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build
- Timestamp:
- 2004-01-15T11:31:28+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/extractor/MetaXMLExtractor.java
r6497 r6503 58 58 } 59 59 else if (localName.equals("Description")) 60 { 61 } 62 else if (localName.equals("Metadata")) 63 { this.label = attributes.getValue("name"); 64 this.value = new StringBuffer(); 65 66 String mode = attributes.getValue("mode"); 67 this.accumulate = mode.equals(ExtractorManager.ACCUMULATE_MODE); 68 } 69 } 70 71 public void endElement(String URI, String localName, String qName) 72 { if (localName.equals("FileName")) 73 { String file = this.value.toString(); 74 this.value = null; 75 this.files.add(file); 76 } 77 else if (localName.equals("FileSet")) 78 { // post the existing files item... 79 this.documentIds = this.documentList.findDocumentIdsUsingFiles(this.files, this.url.toString()); 60 { this.documentIds = this.documentList.findDocumentIdsUsingFiles(this.files, this.url.toString()); 80 61 81 62 if (documentIds != null && documentIds.size() > 0) { … … 93 74 } 94 75 } 76 else if (localName.equals("Metadata")) 77 { this.label = attributes.getValue("name"); 78 this.value = new StringBuffer(); 79 80 String mode = attributes.getValue("mode"); 81 this.accumulate = mode.equals(ExtractorManager.ACCUMULATE_MODE); 82 } 83 } 84 85 public void endElement(String URI, String localName, String qName) 86 { if (localName.equals("FileName")) 87 { String file = this.value.toString(); 88 this.value = null; 89 this.files.add(file); 90 } 91 else if (localName.equals("FileSet")) 92 { // post the existing files item... 93 } 95 94 else if (localName.equals("Description")) 96 95 { … … 128 127 // Post to document 129 128 // TODO: tailor this to posting documents to *sections* as required... 130 document.addDocumentMetadata(new MetadataLabel(this.label), this.value.toString()); 129 if (accumulate) { 130 document.addDocumentMetadata(new MetadataLabel(this.label), this.value.toString()); 131 } 132 else { 133 document.setDocumentMetadata(new MetadataLabel(this.label), this.value.toString()); 134 } 131 135 } 132 136 }
Note:
See TracChangeset
for help on using the changeset viewer.