Changeset 3999 for trunk/gsdl3/src/java/org/greenstone
- Timestamp:
- 2003-03-26T12:13:45+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/action/QueryAction.java
r3987 r3999 75 75 String to = GSPath.appendLink(collection, service_name); 76 76 77 //create teh pageREsponse 78 Element page_response = doc_.createElement(GSXML.PAGE_RESPONSE_ELEM); 79 page.appendChild(page_response); 80 77 81 // the second part of the page is the service description 78 82 // for now get this again from the service. … … 86 90 mr_info_message.appendChild(format_request); 87 91 92 // also get the coll description 93 Element coll_about_request = GSXML.createBasicRequest(doc_, GSXML.REQUEST_TYPE_DESCRIBE, collection, lang); 94 mr_info_message.appendChild(coll_about_request); 95 96 // process the messages 88 97 Element mr_info_response = (Element) mr_.process(mr_info_message); 89 98 90 String path = GSPath.appendLink(GSXML.RESPONSE_ELEM, GSXML.SERVICE_ELEM); 91 Element description = (Element)doc_.importNode(GSXML.getNodeByPath(mr_info_response, path), true); 92 Element pl = (Element)GSXML.getChildByTagName(description, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER); 99 // the three responses 100 NodeList responses = mr_info_response.getElementsByTagName(GSXML.RESPONSE_ELEM); 101 Element service_response = (Element)responses.item(0); 102 Element format_response = (Element)responses.item(1); 103 Element coll_response = (Element)responses.item(2); 104 105 Element service_description = (Element)doc_.importNode(GSXML.getChildByTagName(service_response, GSXML.SERVICE_ELEM), true); 106 page_response.appendChild(service_description); 107 108 Element pl = (Element)GSXML.getChildByTagName(service_description, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER); 93 109 94 110 if (pl !=null) { … … 124 140 } 125 141 126 // get the collection or cluster description 127 Element coll_about_message = doc_.createElement(GSXML.MESSAGE_ELEM); 128 Element coll_about_request = GSXML.createBasicRequest(doc_, GSXML.REQUEST_TYPE_DESCRIBE, collection, page.getAttribute(GSXML.LANG_ATT)); 129 coll_about_message.appendChild(coll_about_request); 130 Element coll_about_response = (Element)mr_.process(coll_about_message); 131 132 // add the response to the page 133 Element response = (Element) GSXML.getChildByTagName(coll_about_response, GSXML.RESPONSE_ELEM); 134 Element page_response = GSXML.duplicateWithNewName(doc_, response, "pageResponse", false); 135 page_response.appendChild(description); 136 137 Element format_response = (Element)mr_info_response.getElementsByTagName(GSXML.RESPONSE_ELEM).item(1); // the second response 142 143 // add the coll-response to the page 144 Element coll_description = (Element)GSXML.getChildByTagName(coll_response, GSXML.COLLECTION_ELEM); 145 page_response.appendChild(doc_.importNode(coll_description, true)); 146 138 147 139 148 // just a display request 140 149 if (request_type.equals("d")) { 141 page.appendChild(page_response);142 150 System.out.println("(QueryAction) Finished page:\n" + converter_.getPrettyString(page)); 143 151 // output the page … … 157 165 Element mr_query_response = (Element)mr_.process(mr_query_message); 158 166 159 path = GSPath.appendLink(GSXML.RESPONSE_ELEM, GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER);167 String path = GSPath.appendLink(GSXML.RESPONSE_ELEM, GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 160 168 Element query_result_metadata_list = (Element) GSXML.getNodeByPath(mr_query_response, path); 161 169 if (query_result_metadata_list == null) { … … 180 188 if (document_list == null) { 181 189 182 Element result_response = (Element)GSXML.getChildByTagName(mr_query_response, GSXML.RESPONSE_ELEM);183 184 page.appendChild(doc_.importNode(result_response, true));190 //Element result_response = (Element)GSXML.getChildByTagName(mr_query_response, GSXML.RESPONSE_ELEM); 191 192 //page.appendChild(doc_.importNode(result_response, true)); 185 193 GSXSLT.absoluteIncludePaths(style_doc, config_); 186 194 return (Element)transformer_.transform(style_doc, page); … … 231 239 } 232 240 233 // Add the pageResponse element to the page234 page.appendChild(page_response);235 241 // System.out.println("Query page:\n" + converter_.getPrettyString(page)); 236 242
Note:
See TracChangeset
for help on using the changeset viewer.