Changeset 28860
- Timestamp:
- 2014-02-27T14:25:44+13:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ServiceRack.java
r27087 r28860 78 78 79 79 /** XML element for describe requests - the container doc */ 80 80 protected Document doc = null; 81 81 82 82 /** … … 223 223 224 224 NodeList requests = message.getElementsByTagName(GSXML.REQUEST_ELEM); 225 Element mainResult = this.doc.createElement(GSXML.MESSAGE_ELEM); 225 Document doc = this.converter.newDOM(); 226 Element mainResult = doc.createElement(GSXML.MESSAGE_ELEM); 226 227 if (requests.getLength() == 0) 227 228 { … … 240 241 if (response != null) 241 242 { 242 mainResult.appendChild( this.doc.importNode(response, true));243 mainResult.appendChild(doc.importNode(response, true)); 243 244 } 244 245 … … 247 248 { 248 249 Element response = processFormat(request); 249 mainResult.appendChild( this.doc.importNode(response, true));250 mainResult.appendChild(doc.importNode(response, true)); 250 251 } 251 252 else … … 311 312 if (response != null) 312 313 { 313 mainResult.appendChild( this.doc.importNode(response, true));314 mainResult.appendChild(doc.importNode(response, true)); 314 315 } 315 316 else … … 317 318 // add in a dummy response 318 319 logger.error("adding in an error element\n"); 319 response = this.doc.createElement(GSXML.RESPONSE_ELEM);320 GSXML.addError( this.doc, response, error_string.toString());320 response = doc.createElement(GSXML.RESPONSE_ELEM); 321 GSXML.addError(doc, response, error_string.toString()); 321 322 mainResult.appendChild(response); 322 323 … … 335 336 protected Element processDescribe(Element request) 336 337 { 337 338 Element response = this.doc.createElement(GSXML.RESPONSE_ELEM);338 Document doc = this.converter.newDOM(); 339 Element response = doc.createElement(GSXML.RESPONSE_ELEM); 339 340 response.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_DESCRIBE); 340 341 … … 343 344 if (to.equals("")) 344 345 { // return the service list 345 response.appendChild(getServiceList(lang));346 response.appendChild(doc.importNode(getServiceList(lang), true)); 346 347 return response; 347 348 } … … 378 379 if (description != null) 379 380 { // may be null if non-existant service 380 response.appendChild(description);381 response.appendChild(doc.importNode(description, true)); 381 382 } 382 383 return response; … … 389 390 protected Element processFormat(Element request) 390 391 { 391 Element response = this.doc.createElement(GSXML.RESPONSE_ELEM); 392 Document doc = this.converter.newDOM(); 393 Element response = doc.createElement(GSXML.RESPONSE_ELEM); 392 394 response.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_FORMAT); 393 395 … … 402 404 if (this.format_info_map.containsKey(to)) 403 405 { 404 response.appendChild( response.getOwnerDocument().importNode(getServiceFormat(to), true));406 response.appendChild(doc.importNode(getServiceFormat(to), true)); 405 407 if (_globalFormat != null) 406 408 { 407 response.appendChild( response.getOwnerDocument().importNode(GSXML.duplicateWithNewName(response.getOwnerDocument(), _globalFormat, GSXML.GLOBAL_FORMAT_ELEM, false), true));409 response.appendChild(GSXML.duplicateWithNewName(doc, _globalFormat, GSXML.GLOBAL_FORMAT_ELEM, false)); 408 410 } 409 411 response.setAttribute(GSXML.FROM_ATT, to);
Note:
See TracChangeset
for help on using the changeset viewer.