Ignore:
Timestamp:
2004-01-15T11:31:28+13:00 (20 years ago)
Author:
cs025
Message:

Changed to using setDocumentMetadata for non-accumulate mode.

File:
1 edited

Legend:

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

    r6497 r6503  
    5858      }
    5959      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());   
    8061
    8162    if (documentIds != null && documentIds.size() > 0) {
     
    9374    }
    9475      }
     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      }
    9594      else if (localName.equals("Description"))
    9695      {
     
    128127        // Post to document
    129128        // 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        }
    131135      }
    132136    }
Note: See TracChangeset for help on using the changeset viewer.