Changeset 31774
- Timestamp:
- 2017-07-03T13:46:36+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/QueryAction.java
r31285 r31774 76 76 // get the format info - there may be global format info in the collection that searching needs 77 77 Element format_elem = getFormatInfo(to, userContext); 78 // set the format type 79 format_elem.setAttribute(GSXML.TYPE_ATT, "search"); 80 // for now just add to the response 81 page_response.appendChild(doc.importNode(format_elem, true)); 82 83 //if (request_type.indexOf("d") != -1) 84 //{ 78 if (format_elem != null) { 79 // set the format type 80 format_elem.setAttribute(GSXML.TYPE_ATT, "search"); 81 // for now just add to the response 82 page_response.appendChild(doc.importNode(format_elem, true)); 83 } 85 84 // get the service description 86 85 // we have been asked for the service description … … 91 90 // process the message 92 91 Element mr_info_response = (Element) this.mr.process(mr_info_message); 92 93 boolean does_paging = false; 94 93 95 // the response 94 95 96 Element service_response = (Element) GSXML.getChildByTagName(mr_info_response, GSXML.RESPONSE_ELEM); 96 97 97 Element service_description = (Element) doc.importNode(GSXML.getChildByTagName(service_response, GSXML.SERVICE_ELEM), true); 98 99 100 // have we been asked to return it as part of the response? 98 Element service_description = (Element)GSXML.getChildByTagName(service_response, GSXML.SERVICE_ELEM); 99 if (service_description != null) { 100 service_description = (Element) doc.importNode(service_description, true); 101 102 Element meta_list =(Element) GSXML.getChildByTagName(service_description, GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 103 if (meta_list != null) { 104 String value = GSXML.getMetadataValue(meta_list, "does_paging"); 105 if (value.equals("true")) { 106 does_paging = true; 107 } 108 } 109 110 if (does_paging == false) { 111 // we will do the paging, so lets add in a hitsPerPage param to the service 112 addHitsParamToService(doc, service_description, lang); 113 } 114 } 115 //Element service_description = (Element) doc.importNode(GSXML.getChildByTagName(service_response, GSXML.SERVICE_ELEM), true); 116 117 118 // have we been asked to return the service description 119 // as part of the response? 101 120 if (request_type.indexOf("d") != -1) { 102 page_response.appendChild(service_description); 121 if (service_description != null) { 122 page_response.appendChild(service_description); 123 } 103 124 addCollectionsHierarchy(page_response,userContext); 104 125 } 105 //} 106 boolean does_paging = false; 107 Element meta_list =(Element) GSXML.getChildByTagName(service_description, GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 108 if (meta_list != null) { 109 String value = GSXML.getMetadataValue(meta_list, "does_paging"); 110 if (value.equals("true")) { 111 does_paging = true; 112 } 113 } 114 115 if (does_paging == false) { 116 // we will do the paging, so lets add in a hitsPerPage param to the service 117 addHitsParamToService(doc, service_description, lang); 118 } 126 119 127 if (request_type.indexOf("r") == -1) 120 128 {
Note:
See TracChangeset
for help on using the changeset viewer.