Changeset 6497
- Timestamp:
- 2004-01-14T16:27:03+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/extractor/MetaXMLExtractor.java
r6453 r6497 39 39 boolean accumulate; 40 40 DocumentList documentList; 41 List documentIds; 42 List documents; 41 43 42 44 MetadataHandler(DocumentList documentList) … … 75 77 else if (localName.equals("FileSet")) 76 78 { // post the existing files item... 77 } 78 else if (localName.equals("Description")) 79 { 80 } 81 else if (localName.equals("Metadata")) 82 { List documentIds; 83 84 documentIds = this.documentList.findDocumentIdsUsingFiles(this.files, this.url.toString()); 85 86 MetaXMLExtractor.postMetadata(this.url, this.files, 87 this.label, this.value.toString(), 88 this.accumulate); 89 if (documentIds != null) { 90 Iterator iterator = documentIds.iterator(); 91 while (iterator.hasNext()) { 92 System.out.println("Matches file " + iterator.next().toString()); 93 } 94 } 79 this.documentIds = this.documentList.findDocumentIdsUsingFiles(this.files, this.url.toString()); 95 80 96 81 if (documentIds != null && documentIds.size() > 0) { 97 Listdocuments = new ArrayList();82 this.documents = new ArrayList(); 98 83 99 84 Iterator idIterator = documentIds.iterator(); … … 106 91 } 107 92 } 108 93 } 94 } 95 else if (localName.equals("Description")) 96 { 97 if (this.documents != null && documents.size() > 0) { 98 // write out the modified documents 99 // TODO: nicer/more generalised interface for this and related activity in 100 // extractor manager (actually, enricher manager); 109 101 Iterator docIterator = documents.iterator(); 102 while (docIterator.hasNext()) { 103 DocumentInterface document = (DocumentInterface) docIterator.next(); 104 105 // System.out.println("Writing modified document " + document.getID()); 106 documentList.modifiedDocument(document); 107 } 108 } 109 } 110 else if (localName.equals("Metadata")) 111 { MetaXMLExtractor.postMetadata(this.url, this.files, 112 this.label, this.value.toString(), 113 this.accumulate); 114 /* 115 if (documentIds != null) { 116 Iterator iterator = documentIds.iterator(); 117 while (iterator.hasNext()) { 118 System.out.println("Matches file " + iterator.next().toString()); 119 } 120 } 121 */ 122 123 if (documentIds != null && documentIds.size() > 0) { 124 Iterator docIterator = this.documents.iterator(); 110 125 while (docIterator.hasNext()) { 111 126 DocumentInterface document = (DocumentInterface) docIterator.next(); … … 114 129 // TODO: tailor this to posting documents to *sections* as required... 115 130 document.addDocumentMetadata(new MetadataLabel(this.label), this.value.toString()); 116 } 131 } 117 132 } 118 133
Note:
See TracChangeset
for help on using the changeset viewer.