Changeset 7303 for trunk


Ignore:
Timestamp:
2004-05-11T14:01:08+12:00 (20 years ago)
Author:
kjdon
Message:

now AZListCLassifier has a name parameter, and I modified slightly what gets written to the database - top level node no longer has a parent and its description is 'Classifier', lower nodes use the key as their anme and description for now

File:
1 edited

Legend:

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

    r7188 r7303  
    2929  MultiMap         alphaMap;
    3030  List             fields;
    31 
     31    String name;
    3232  class AZDocumentItem
    3333  { public DocumentID documentId;
     
    8080  }
    8181
    82   public AZListClassifier(List fields)
    83   { this.fields = fields;
     82  public AZListClassifier(String name, List fields)
     83    { this.name = name;
     84      this.fields = fields;
    8485    this.alphaMap = new MultiMap();
    8586    //  System.out.println("AZList :"+fields.size());
     
    199200    insert = new GS3SQLInsert("classifiers");
    200201
    201     if (parentId.length() > 0) {
    202       insert.addValue("ParentID", parentId);
    203     }
    204     else {
    205       insert.addValue("ParentID", label);
    206     }
     202    insert.addValue("ParentID", parentId);
    207203
    208204    action = insert;
     
    251247    Iterator keys;
    252248 
    253     String prefix = "CLAZ"+this.fields.get(0).toString();
    254 
     249    String prefix = this.name;
     250    if (prefix==null || prefix.equals("")) {
     251    prefix = "CLAZ"+this.fields.get(0).toString();
     252    // TODO: write this name back to collectionConfig.xml
     253    }
    255254    int leafCount = 0;
    256255    keys = this.alphaMap.keySet().iterator();
     
    264263    }
    265264
    266     int parentClassify = this.writeSQLClassifyNode(connection, "", 0, prefix, "", "", leafCount);
     265    int parentClassify = this.writeSQLClassifyNode(connection, "", 0, prefix, "", "Classifier", leafCount);
    267266
    268267    if (parentClassify < 0)
     
    283282    String className = prefix + "." + key.toString();
    284283
    285     int classifyRef = this.writeSQLClassifyNode(connection, prefix, nodeOrder, className, "", "", childDocs.size());
     284    int classifyRef = this.writeSQLClassifyNode(connection, prefix, nodeOrder, className, key.toString(), key.toString(), childDocs.size());
    286285
    287286    // note the child documents...
Note: See TracChangeset for help on using the changeset viewer.