Changeset 6497


Ignore:
Timestamp:
2004-01-14T16:27:03+13:00 (20 years ago)
Author:
cs025
Message:

Minor fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/extractor/MetaXMLExtractor.java

    r6453 r6497  
    3939    boolean      accumulate;
    4040    DocumentList documentList;
     41    List         documentIds;
     42    List         documents;
    4143
    4244    MetadataHandler(DocumentList documentList)
     
    7577      else if (localName.equals("FileSet"))
    7678      { // 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());   
    9580
    9681    if (documentIds != null && documentIds.size() > 0) {
    97       List documents = new ArrayList();
     82      this.documents = new ArrayList();
    9883     
    9984      Iterator idIterator = documentIds.iterator();
     
    10691        }
    10792      }
    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);
    109101      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();
    110125      while (docIterator.hasNext()) {
    111126        DocumentInterface document = (DocumentInterface) docIterator.next();
     
    114129        // TODO: tailor this to posting documents to *sections* as required...
    115130        document.addDocumentMetadata(new MetadataLabel(this.label), this.value.toString());
    116       }
     131      } 
    117132    }
    118133
Note: See TracChangeset for help on using the changeset viewer.