Changeset 25355 for main/trunk/greenstone3/src/java
- Timestamp:
- 2012-04-12T14:13:34+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/DocumentAction.java
r25305 r25355 97 97 String collection = (String) params.get(GSParams.COLLECTION); 98 98 String document_id = (String) params.get(GSParams.DOCUMENT); 99 if (document_id != null && document_id.equals("")) { 100 document_id = null; 99 if (document_id != null && document_id.equals("")) 100 { 101 document_id = null; 101 102 } 102 103 String href = (String) params.get(GSParams.HREF);//for an external link : get the href URL if it is existing in the params list 103 if (href != null && href.equals("")) { 104 href = null; 104 if (href != null && href.equals("")) 105 { 106 href = null; 105 107 } 106 108 String rl = (String) params.get(GSParams.RELATIVE_LINK);//for an external link : get the rl value if it is existing in the params list … … 110 112 return result; 111 113 } 112 if (rl != null && rl.equals("0")) { 113 // this is a true external link, we should have been directed to a different page or action 114 logger.error("rl value was 0, shouldn't get here"); 115 return result; 114 if (rl != null && rl.equals("0")) 115 { 116 // this is a true external link, we should have been directed to a different page or action 117 logger.error("rl value was 0, shouldn't get here"); 118 return result; 116 119 } 117 120 String document_type = (String) params.get(GSParams.DOCUMENT_TYPE); 118 if (document_type == null || 121 if (document_type == null || document_type.equals("")) 119 122 { 120 123 document_type = "simple"; … … 133 136 { 134 137 // we have to modify the doc name 135 doc_id_modifier = 138 doc_id_modifier = "." + sibling_num + ".ss"; 136 139 } 137 140 … … 156 159 } 157 160 } 158 161 159 162 UserContext userContext = new UserContext(request); 160 163 … … 181 184 if (document_id != null) 182 185 { 183 current_doc.setAttribute(GSXML.NODE_ID_ATT, document_id +doc_id_modifier);184 } 185 else 186 current_doc.setAttribute(GSXML.NODE_ID_ATT, document_id + doc_id_modifier); 187 } 188 else 186 189 { 187 190 current_doc.setAttribute(GSXML.HREF_ID_ATT, href); … … 324 327 doc_node.setAttribute(GSXML.NODE_ID_ATT, document_id); 325 328 } 326 else 329 else 327 330 { 328 331 doc_node.setAttribute(GSXML.HREF_ID_ATT, href); 329 332 330 333 } 331 334 the_document.appendChild(doc_node); … … 342 345 doc_node.setAttribute(GSXML.NODE_ID_ATT, document_id); 343 346 } 344 else 347 else 345 348 { 346 349 doc_node.setAttribute(GSXML.HREF_ID_ATT, href); … … 412 415 Element doc_node = this.doc.createElement(GSXML.DOC_NODE_ELEM); 413 416 // the node we want is the root document node 414 if (document_id != null) 417 if (document_id != null) 415 418 { 416 419 doc_node.setAttribute(GSXML.NODE_ID_ATT, document_id + ".rt"); 417 420 } 418 else 419 { 420 421 422 421 else 422 { 423 doc_node.setAttribute(GSXML.HREF_ID_ATT, href);// + ".rt"); 424 // can we assume that href is always a top level doc?? 425 //doc_node.setAttribute(GSXML.ID_MOD_ATT, ".rt"); 423 426 //doc_node.setAttribute("externalURL", has_rl); 424 427 } … … 507 510 { 508 511 // no content to add 509 if (dc_response_doc.getAttribute("external").equals("true")) { 510 511 //if (dc_response_doc_external != null) 512 //{ 512 if (dc_response_doc.getAttribute("external").equals("true")) 513 { 514 515 //if (dc_response_doc_external != null) 516 //{ 513 517 String href_id = dc_response_doc.getAttribute(GSXML.HREF_ID_ATT); 514 518 515 519 the_document.setAttribute("selectedNode", href_id); 516 520 the_document.setAttribute("external", href_id); 517 518 521 } 522 return result; 519 523 } 520 524 if (highlight_query_terms) … … 716 720 protected Element highlightQueryTerms(Element request, Element dc_response_doc_content) 717 721 { 718 719 722 // do the query again to get term info 720 723 Element cgi_param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
Note:
See TracChangeset
for help on using the changeset viewer.