Changeset 7186


Ignore:
Timestamp:
2004-04-06T09:24:53+12:00 (20 years ago)
Author:
cs025
Message:

Merged changes; slow widening of configuration options.

Location:
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build
Files:
2 edited

Legend:

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

    r6895 r7186  
    5656    recogniser = new TextRecogniser(docList);
    5757    recogniserManager.addRecogniser(recogniser);
     58    recogniser = new JPEGRecogniser(docList);
     59    recogniserManager.addRecogniser(recogniser);
     60    recogniser = new ExtXMLRecogniser(docList);
     61    recogniserManager.addRecogniser(recogniser);
    5862    recogniser = new MetadataRecogniser(docList);
    5963    recogniserManager.addRecogniser(recogniser);
     
    6266    this.extractorManager  = new ExtractorManager(this.docList);
    6367    this.extractorManager.addExtractor(new IndexExtractor());
     68    this.extractorManager.addExtractor(new ExtXMLExtractor());
    6469    this.extractorManager.addExtractor(new MetaXMLExtractor());
    6570   
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/CollectionManager.java

    r6896 r7186  
    6767   
    6868  class CollectionClassifier
    69   { File file;
     69  { URL    file;
    7070    String type;
    7171    List fields;
    7272    String sort;
    7373
    74     public CollectionClassifier(String type, Node node)
     74    public CollectionClassifier(URL parentURL, String type, Node node)
    7575    { this.type = type;
    7676      this.fields = new ArrayList();
     
    9090          continue;
    9191
    92         this.file = new File(urlString);
     92        try {
     93          URL url = new URL(parentURL, urlString);
     94          this.file = url;
     95          System.out.println(url);
     96        }
     97        catch (java.net.MalformedURLException malEx) {
     98          System.out.println(malEx);
     99        }
    93100      }
    94101      else if (name.equals("field")) {
    95102        String fieldName = DOMUtils.getNodeChildText(children.item(c));
     103        System.out.println("Adding field " + fieldName);
    96104        this.fields.add(fieldName.toString());
    97105      }
     
    109117    return null;
    110118      }
     119      System.out.println(this.type.toLowerCase());
    111120      if (this.type.toLowerCase().equals("hierarchy")) {
    112121    return new HierarchyClassifier(this.file, this.fields, this.sort);
     
    180189    this.buildDocNo = 1;
    181190  }
    182     public void setBuildManager(BuildManager build_man) {
    183     this.buildManager = build_man;
    184     }
    185 
    186   private void configureBrowsers(Node node)
     191
     192  public void setBuildManager(BuildManager build_man)
     193  { this.buildManager = build_man;
     194  }
     195
     196  private void configureBrowsers(Node node, File etcFile)
    187197  { CollectionClassifier classifier = null;
     198    URL etcURL = null;
     199
     200    try {
     201      etcURL = new URL("file://"+etcFile.toString());
     202    }
     203    catch (java.net.MalformedURLException malEx) {
     204      System.out.println(malEx);
     205    }
    188206
    189207    NodeList children = node.getChildNodes();
     
    206224
    207225    String type = attribute.getNodeValue();
    208     classifier = new CollectionClassifier(type, children.item(c));
     226    classifier = new CollectionClassifier(etcURL, type, children.item(c));
    209227   
    210228    System.out.println("Found classifier " + type);
     
    251269
    252270    // the name is a plugin element
    253     if (name.equals(GSXML.SEARCH_ELEM)) {
     271
     272    if (name.equals("doctype")) {
     273      System.out.println("document type");
     274      NamedNodeMap typeAttributes = children.item(c).getAttributes();
     275      Node typeAttribute = typeAttributes.getNamedItem("type");
     276      String documentType = null;
     277
     278      NodeList childNodes = children.item(c).getChildNodes();
     279      for (int n = 0; n < childNodes.getLength(); n ++)
     280      { if (childNodes.item(n).getNodeType() == org.w3c.dom.Node.TEXT_NODE)
     281        { String label = childNodes.item(n).getNodeValue();
     282              label.trim();
     283          if (label.length() > 0) {
     284        documentType = label;
     285        System.out.println("Document type " + documentType);
     286          }
     287        }
     288      }
     289    }
     290    else if (name.equals(GSXML.SEARCH_ELEM)) {
    254291      // pick up attributes from the <search> tag now...
    255292      NamedNodeMap searchAttributes = children.item(c).getAttributes();
     
    283320    }
    284321    else if (name.equals(GSXML.BROWSE_ELEM))
    285     { this.configureBrowsers(children.item(c));
     322    { this.configureBrowsers(children.item(c), collectionConfig);
    286323    }
    287324    // TODO: other elements - make a factory-method approach here...
Note: See TracChangeset for help on using the changeset viewer.