Changeset 7310


Ignore:
Timestamp:
2004-05-12T13:07:29+12:00 (20 years ago)
Author:
kjdon
Message:

moved translateOID to GS3OID - will need to move it somewhere else maybe once we need to get info from the database, but for now it can live here

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/util/GS3OID.java

    r6514 r7310  
    4141
    4242    }
     43
     44    // put this here for now - may need to go with SQL stuff later
     45    public static String translateOID(String oid) {
     46   
     47    int p = oid.lastIndexOf('.');
     48    if (p != oid.length()-3) {
     49        System.out.println("translateoid error: '.' is not the third to last char!!");
     50        return oid;
     51    }
     52   
     53    String top = oid.substring(0, p);
     54    String suff = oid.substring(p+1);
     55    if (suff.equals("pr")) {
     56        return getParent(top);
     57    } else if (suff.equals("rt")) {
     58        return getTop(top);
     59    }
     60    return oid;
     61
     62    }
     63
    4364}
Note: See TracChangeset for help on using the changeset viewer.