- Timestamp:
- 2018-02-12T22:22:51+13:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/DocumentAction.java
r32111 r32128 527 527 // Add the documentNode to the list 528 528 Element dm_doc_node = doc.createElement(GSXML.DOC_NODE_ELEM); 529 dm_doc_list.appendChild(dm_doc_node); 529 if (needSectionContent(params)) { 530 if (doc_node_id.equals(document_id)) { 531 dm_doc_list.appendChild(dm_doc_node); 532 } 533 } else { 534 dm_doc_list.appendChild(dm_doc_node); 535 } 536 //dm_doc_list.appendChild(dm_doc_node); 530 537 dm_doc_node.setAttribute(GSXML.NODE_ID_ATT, doc_node_id); 531 538 dm_doc_node.setAttribute(GSXML.NODE_TYPE_ATT, doc_node.getAttribute(GSXML.NODE_TYPE_ATT)); … … 535 542 536 543 } 537 538 544 // we also want a metadata request to the top level document to get 539 545 // assocfilepath - this could be cached too … … 584 590 for (int i = 0; i < doc_nodes.getLength(); i++) 585 591 { 586 GSXML.mergeMetadataLists(doc_nodes.item(i), dm_response_docs.item(i)); 592 String node_idd = ((Element)doc_nodes.item(i)).getAttribute(GSXML.NODE_ID_ATT); 593 Node dcNode = GSXML.getNamedElement(dm_response_doc_list, "documentNode", GSXML.NODE_ID_ATT, node_idd); 594 GSXML.mergeMetadataLists(doc_nodes.item(i), dcNode); 587 595 } 588 596 // get the top level doc metadata out … … 623 631 } 624 632 Element dc_response_message = (Element) this.mr.process(dc_message); 633 625 634 if (processErrorElements(dc_response_message, page_response)) 626 635 { 627 636 return result; 637 628 638 } 629 639 Element dc_response_doc_list = (Element) GSXML.getNodeByPath(dc_response_message, path); … … 635 645 for (int i = 0; i < doc_nodes.getLength(); i++) 636 646 { 637 Node content = GSXML.getChildByTagName((Element) dc_response_docs.item(i), GSXML.NODE_CONTENT_ELEM); 647 String node_id = ((Element)doc_nodes.item(i)).getAttribute(GSXML.NODE_ID_ATT); 648 //Node content = GSXML.getChildByTagName((Element) dc_response_docs.item(i), GSXML.NODE_CONTENT_ELEM); 649 Node docNode = GSXML.getNamedElement(dc_response_doc_list, "documentNode", GSXML.NODE_ID_ATT, node_id); 650 Node content = GSXML.getChildByTagName(docNode, GSXML.NODE_CONTENT_ELEM); 638 651 if (content != null) 639 652 { 640 653 if (highlight_query_terms) 641 654 { 642 String node_id = ((Element)doc_nodes.item(i)).getAttribute(GSXML.NODE_ID_ATT);655 643 656 content = highlightQueryTerms(request, node_id, (Element) content); 644 657 } … … 799 812 return true; 800 813 } 801 814 815 private boolean needSectionContent(HashMap<String, Serializable> params) { 816 String document_id = (String) params.get(GSParams.DOCUMENT); 817 String ilt = (String) params.get(GSParams.INLINE_TEMPLATE); 818 String iltPrefix = "<xsl:template match=\"/\"><text><xsl:for-each select=\"/page/pageResponse/document//documentNode[@nodeID ="; 819 if (ilt != null && ilt.startsWith(iltPrefix) && document_id != null) { 820 return true; 821 } 822 823 return false; 824 } 802 825 /** 803 826 * this method gets the collection description, the format info, the list of
Note:
See TracChangeset
for help on using the changeset viewer.