Changeset 7269 for trunk


Ignore:
Timestamp:
2004-05-04T17:06:09+12:00 (20 years ago)
Author:
cs025
Message:

Minor configuration changes for classifiers

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

Legend:

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

    r6866 r7269  
    5959    }
    6060
    61     if (site==null) {
     61    if (site == null) {
    6262    System.err.println("you must specify the site name");
    6363    System.exit(0);
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/CollectionManager.java

    r7186 r7269  
    7171    List fields;
    7272    String sort;
    73 
    74     public CollectionClassifier(URL parentURL, String type, Node node)
     73    String className;
     74
     75    public CollectionClassifier(URL parentURL, String type, String className, Node node)
    7576    { this.type = type;
     77      this.className = className;
    7678      this.fields = new ArrayList();
    7779
     
    113115
    114116    public ClassifierInterface getClassifier()
    115     {
     117    { ClassifierInterface classifier = null;
     118
    116119      if (this.type == null) {
    117120    return null;
     
    119122      System.out.println(this.type.toLowerCase());
    120123      if (this.type.toLowerCase().equals("hierarchy")) {
    121     return new HierarchyClassifier(this.file, this.fields, this.sort);
     124    classifier = new HierarchyClassifier(this.className, this.file, this.fields, this.sort);
    122125      }
    123126      else if (this.type.toLowerCase().equals("azlist")) {
    124     return new AZListClassifier(this.fields);
    125       }
    126 
    127       return null;
     127    classifier = new AZListClassifier(this.fields);
     128      }
     129
     130      return classifier;
    128131    }
    129132  }
     
    216219
    217220      if (name.equals(GSXML.CLASSIFIER_ELEM))
    218       {
    219     NamedNodeMap atts = children.item(c).getAttributes();
     221      { NamedNodeMap atts = children.item(c).getAttributes();
     222
     223        // get the type attribute
    220224    Node attribute = atts.getNamedItem(GSXML.TYPE_ATT);
    221225    if (attribute == null) {
    222226      continue;
    223227    }
    224 
    225228    String type = attribute.getNodeValue();
    226     classifier = new CollectionClassifier(etcURL, type, children.item(c));
     229
     230        // get the type attribute
     231    attribute = atts.getNamedItem(GSXML.NAME_ATT);
     232    if (attribute == null) {
     233      continue;
     234    }
     235    String className = attribute.getNodeValue();
     236
     237    classifier = new CollectionClassifier(etcURL, type, className, children.item(c));
    227238   
    228239    System.out.println("Found classifier " + type);
Note: See TracChangeset for help on using the changeset viewer.