Changeset 24993 for main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java
- Timestamp:
- 2012-01-26T11:50:17+13:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java
r24979 r24993 21 21 import org.greenstone.gsdl3.util.GSXML; 22 22 import org.greenstone.gsdl3.util.GSPath; 23 import org.greenstone.gsdl3.util.UserContext; 23 24 24 25 import org.w3c.dom.Element; … … 147 148 result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS); 148 149 149 String lang = request.getAttribute(GSXML.LANG_ATT); 150 UserContext userContext = new UserContext(request); 151 150 152 // Get the parameters of the request 151 153 Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER); … … 182 184 } 183 185 // send the query to all colls 184 Element query_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_PROCESS, to_att.toString(), lang, "");186 Element query_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_PROCESS, to_att.toString(), userContext); 185 187 query_message.appendChild(query_request); 186 188 // should we add params individually? … … 257 259 protected boolean initCollectionList() 258 260 { 259 String lang = "en"; 260 String uid = ""; 261 UserContext userContext = new UserContext(); 262 userContext.setLanguage("en"); 263 userContext.setUserID(""); 264 261 265 // first, get the message router info 262 266 Element coll_list_message = this.doc.createElement(GSXML.MESSAGE_ELEM); 263 Element coll_list_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_DESCRIBE, "", lang, ""); // uid267 Element coll_list_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_DESCRIBE, "", userContext); // uid 264 268 coll_list_message.appendChild(coll_list_request); 265 269 logger.debug("coll list request = " + this.converter.getPrettyString(coll_list_request)); … … 281 285 Element c = (Element) colls.item(i); 282 286 String name = c.getAttribute(GSXML.NAME_ATT); 283 Element metadata_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_DESCRIBE, name, lang, uid);287 Element metadata_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_DESCRIBE, name, userContext); 284 288 metadata_message.appendChild(metadata_request); 285 289 } … … 331 335 result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS); 332 336 333 String lang = request.getAttribute(GSXML.LANG_ATT);337 UserContext userContext = new UserContext(request); 334 338 // Get the parameters of the request 335 339 Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER); … … 382 386 String cname = (String) e.getKey(); 383 387 Element doc_nodes = (Element) e.getValue(); 384 Element meta_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_PROCESS, GSPath.appendLink(cname, DOCUMENT_METADATA_RETRIEVE_SERVICE), lang, "");388 Element meta_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_PROCESS, GSPath.appendLink(cname, DOCUMENT_METADATA_RETRIEVE_SERVICE), userContext); 385 389 meta_request.appendChild(doc_nodes); 386 390 meta_request.appendChild(new_param_list.cloneNode(true));
Note:
See TracChangeset
for help on using the changeset viewer.