Changeset 8673
- Timestamp:
- 2004-11-25T15:40:13+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gdbm/GDBMWrapper.java
r4876 r8673 129 129 // yes I think so. 130 130 /** converts a greenstone OID to internal docnum */ 131 public long oid2Docnum(String OID) {131 public long OID2Docnum(String OID) { 132 132 DBInfo info = getInfo(OID); 133 133 long real_num = Long.parseLong(info.getInfo("docnum")); … … 135 135 } 136 136 /** converts a docnum to greenstone OID */ 137 public String docnum2O id(long docnum) {137 public String docnum2OID(long docnum) { 138 138 DBInfo info = getInfo(Long.toString(docnum)); 139 139 String oid = info.getInfo("section"); … … 141 141 } 142 142 143 /** translates oids containing .pr, .fc, .lc, .ns, .ps into proper oids 143 /** converts a docnum to greenstone OID */ 144 public String extlink2OID(String extlink) { 145 DBInfo info = getInfo(extlink); 146 String oid = info.getInfo("section"); 147 return oid; 148 } 149 /** translates relative oids into proper oids: 150 * .pr (parent), .rt (root) .fc (first child), .lc (last child), 151 * .ns (next sibling), .ps (previous sibling) 144 152 * a suffix is expected to be present so test before using 145 153 * TODO: fc, lc, ns, ps, .rt .ss*/ … … 177 185 return top; 178 186 } 187 188 189 /** ATTACK OF THE RANDOM BLARG!!!! **/ 190 /** All your code are belong to me! **/ 191 179 192 String contains = info.getInfo("contains"); 180 contains.replaceAll("\"", doc_id);181 193 if (contains.equals("")) { 182 194 // something is wrong … … 203 215 204 216 if (suff.equals("ns")) { 205 if (i==children.length-1)return children[i]; 217 if (i==children.length-1) { 218 return children[i]; 219 } 206 220 return children[i+1]; 207 221 } else if (suff.equals("ps")) { 208 if (i==0) return children[i]; 222 if (i==0) { 223 return children[i]; 224 } 209 225 return children[i-1]; 210 226 }
Note:
See TracChangeset
for help on using the changeset viewer.