Changeset 4029 for trunk/gsdl3


Ignore:
Timestamp:
2003-03-28T11:56:08+12:00 (21 years ago)
Author:
kjdon
Message:

new suffix rt (root) for OIDs

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

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gdbm/GDBMWrapper.java

    r3978 r4029  
    143143    /** translates oids containing .pr, .fc, .lc, .ns, .ps into proper oids
    144144     * a suffix is expected to be present so test before using
    145      * TODO: fc, lc, ns, ps */
     145     * TODO: fc, lc, ns, ps, .rt*/
    146146    public String translateOID(String oid) {
    147147
     
    160160    } else if (suff.equals("ns")) {
    161161    } else if (suff.equals("ps")) {
     162    } else if (suff.equals("rt")) {
     163        return OID.getTop(top);
    162164    }
    163165    return oid;
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/util/OID.java

    r3898 r4029  
    4646    return "\""+oid.substring(pos);
    4747    }
    48     /** returns true if oid uses .fc, .lc, .pr, .ns, .ps */
     48    /** returns true if oid uses .fc, .lc, .pr, .ns, .ps .rt (root) */
    4949    public static boolean needsTranslating(String oid) {
    5050    String tail = oid.substring(oid.length()-3);
    5151    return (tail.equals(".fc") || tail.equals(".lc") || tail.equals(".pr")
    52         || tail.equals(".ns") || tail.equals(".ps"));
     52        || tail.equals(".ns") || tail.equals(".ps") || tail.equals(".rt"));
    5353    }
    5454    /** strips suffix from end */
     
    5656    String tail = oid.substring(oid.length()-3);
    5757    while (tail.equals(".fc") || tail.equals(".lc") || tail.equals(".pr")
    58            || tail.equals(".ns") || tail.equals(".ps")) {
     58           || tail.equals(".ns") || tail.equals(".ps") || tail.equals(".rt")) {
    5959        oid = oid.substring(0, oid.length()-3);
    6060        tail = oid.substring(oid.length()-3);
Note: See TracChangeset for help on using the changeset viewer.