Changeset 13962


Ignore:
Timestamp:
2007-03-12T09:56:48+13:00 (17 years ago)
Author:
shaoqun
Message:

added a method to get a particular metadata(indicated by key) of a classifer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2Browse.java

    r13270 r13962  
    169169    }
    170170
     171    protected String getMetadata(String node_id, String key){
     172    DBInfo info = this.gdbm_src.getInfo(node_id);
     173    if (info == null) {
     174        return "";
     175    }
     176
     177    Set keys = info.getKeys();
     178    Iterator it = keys.iterator();
     179    while(it.hasNext()) {
     180        String key_in = (String)it.next();
     181        String value = info.getInfo(key);
     182        if (key_in.equals(key)){
     183        return value;
     184        }
     185    }
     186   
     187    return "";
     188
     189    }
     190
    171191    /** get the metadata for the classifier node node_id
    172192     * returns a metadataList element:
Note: See TracChangeset for help on using the changeset viewer.