Changeset 4719
- Timestamp:
- 2003-06-18T12:47:30+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2Retrieve.java
r4707 r4719 303 303 /** parent is true if this node is definitely the parent of something, 304 304 * child is true is it definitely is a child of something - just for efficiency purposes */ 305 protected Element createDocNode(String doc_id, boolean parent, boolean child) {305 protected Element createDocNode(String node_id, boolean parent, boolean child) { 306 306 307 307 // create this here or pass it in? 308 DBInfo db_info = gdbm_src_.getInfo(doc_id);308 DBInfo info = gdbm_src_.getInfo(node_id); 309 309 Element node; 310 if (isClassifier( doc_id)) {310 if (isClassifier(node_id)) { 311 311 node = doc_.createElement(GSXML.CLASS_NODE_ELEM); 312 String childtype = db_info.getInfo("childtype");312 String childtype = info.getInfo("childtype"); 313 313 String orientation=""; 314 314 if (childtype.equals("HList")) { … … 319 319 node.setAttribute(GSXML.CLASS_NODE_ORIENTATION_ATT, orientation); 320 320 } else { 321 321 322 node = doc_.createElement(GSXML.DOC_NODE_ELEM); 322 if (/*!child &&*/ OID.isTop(doc_id)) { 323 324 String top_id = OID.getTop(node_id); 325 boolean is_top = (top_id.equals(node_id) ? true : false); 326 327 String children = info.getInfo("contains"); 328 boolean is_leaf = (children.equals("") ? true : false); 329 330 // set teh node type att 331 if (is_top) { 323 332 node.setAttribute(GSXML.NODE_TYPE_ATT, GSXML.NODE_TYPE_ROOT); 324 } else if ( !parent && isLeafNode(doc_id)) {333 } else if (is_leaf) { 325 334 node.setAttribute(GSXML.NODE_TYPE_ATT, GSXML.NODE_TYPE_LEAF); 326 335 } else { 327 336 node.setAttribute(GSXML.NODE_TYPE_ATT, GSXML.NODE_TYPE_INTERIOR); 328 337 } 329 } 330 node.setAttribute(GSXML.NODE_ID_ATT, doc_id); 338 339 // set teh doc type att 340 if (is_top && is_leaf) { // a single section document 341 node.setAttribute(GSXML.DOC_TYPE_ATT, "simple"); 342 343 } else { 344 345 if (!is_top) { // we need to look at the top info 346 info = gdbm_src_.getInfo(top_id); 347 } 348 349 String childtype = info.getInfo("childtype"); 350 if (childtype.equals("Paged")) { 351 node.setAttribute(GSXML.DOC_TYPE_ATT, "paged"); 352 } else { 353 node.setAttribute(GSXML.DOC_TYPE_ATT, "hierarchy"); 354 } 355 } 356 357 } 358 node.setAttribute(GSXML.NODE_ID_ATT, node_id); 331 359 return node; 332 360
Note:
See TracChangeset
for help on using the changeset viewer.