Changeset 4876
- Timestamp:
- 2003-07-03T16:15:16+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gdbm/GDBMWrapper.java
r4156 r4876 143 143 /** translates oids containing .pr, .fc, .lc, .ns, .ps into proper oids 144 144 * a suffix is expected to be present so test before using 145 * TODO: fc, lc, ns, ps, .rt */145 * TODO: fc, lc, ns, ps, .rt .ss*/ 146 146 public String translateOID(String oid) { 147 147 148 149 148 int p = oid.lastIndexOf('.'); 150 149 if (p != oid.length()-3) { … … 152 151 return oid; 153 152 } 154 153 155 154 String top = oid.substring(0, p); 156 155 String suff = oid.substring(p+1); … … 160 159 return OID.getTop(top); 161 160 } else { 162 System.out.println("looking up gdbm db"); 161 int sibling_num = 0; 162 if (suff.equals("ss")) { 163 // we have to remove the sib num before we get top 164 p = top.lastIndexOf('.'); 165 sibling_num = Integer.parseInt(top.substring(p+1)); 166 top = top.substring(0, p); 167 } 168 163 169 // need to get info out of gdbm db - 164 170 String doc_id = top; … … 166 172 doc_id = OID.getParent(top); 167 173 } 168 System.out.println("doc id to lok up is"+doc_id);169 174 DBInfo info = getInfo(doc_id); 170 175 if (info==null) { … … 185 190 return children[children.length-1]; 186 191 } else { 192 if (suff.equals("ss")) { 193 return children[sibling_num-1]; 194 } 187 195 // find the position that we are at. 188 196 int i=0;
Note:
See TracChangeset
for help on using the changeset viewer.