Changeset 28382 for main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/DepositorAction.java
- Timestamp:
- 2013-10-10T17:21:30+13:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/DepositorAction.java
r28202 r28382 43 43 { 44 44 Element request = (Element) GSXML.getChildByTagName(message, GSXML.REQUEST_ELEM); 45 45 Document doc = request.getOwnerDocument(); 46 46 47 UserContext uc = new UserContext((Element) request); 47 48 String currentUsername = uc.getUsername(); 48 49 49 Element responseMessage = this.doc.createElement(GSXML.MESSAGE_ELEM);50 Element response = GSXML.createBasicResponse( this.doc, this.getClass().getSimpleName());50 Element responseMessage = doc.createElement(GSXML.MESSAGE_ELEM); 51 Element response = GSXML.createBasicResponse(doc, this.getClass().getSimpleName()); 51 52 responseMessage.appendChild(response); 52 53 … … 226 227 formContainer.appendChild(callToPage); 227 228 228 Element cachedValueElement = this.doc.createElement("cachedValues");229 Element cachedValueElement = doc.createElement("cachedValues"); 229 230 response.appendChild(cachedValueElement); 230 231 try … … 232 233 for (int i = pageNum; i > 0; i--) 233 234 { 234 Element page = this.doc.createElement("pageCache");235 Element page = doc.createElement("pageCache"); 235 236 page.setAttribute("pageNum", "" + i); 236 237 String cachedValues = database.getUserData(currentUsername, "DE___" + collection + "___" + i + "___CACHED_VALUES"); 237 238 if (cachedValues != null) 238 239 { 239 page.appendChild( this.doc.createTextNode(cachedValues));240 page.appendChild(doc.createTextNode(cachedValues)); 240 241 cachedValueElement.appendChild(page); 241 242 } … … 287 288 { 288 289 ex.printStackTrace(); 289 GSXML.addError( this.doc, responseMessage, "Failed to copy the deposited file into the collection.");290 GSXML.addError(doc, responseMessage, "Failed to copy the deposited file into the collection."); 290 291 return responseMessage; 291 292 } … … 331 332 } 332 333 333 Element buildMessage = this.doc.createElement(GSXML.MESSAGE_ELEM);334 Element buildRequest = GSXML.createBasicRequest( this.doc, GSXML.REQUEST_TYPE_PROCESS, "ImportCollection", uc);334 Element buildMessage = doc.createElement(GSXML.MESSAGE_ELEM); 335 Element buildRequest = GSXML.createBasicRequest(doc, GSXML.REQUEST_TYPE_PROCESS, "ImportCollection", uc); 335 336 buildMessage.appendChild(buildRequest); 336 337 337 Element paramListElem = this.doc.createElement(GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);338 Element paramListElem = doc.createElement(GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER); 338 339 buildRequest.appendChild(paramListElem); 339 340 340 Element collectionParam = this.doc.createElement(GSXML.PARAM_ELEM);341 Element collectionParam = doc.createElement(GSXML.PARAM_ELEM); 341 342 paramListElem.appendChild(collectionParam); 342 343 collectionParam.setAttribute(GSXML.NAME_ATT, GSXML.COLLECTION_ATT); 343 344 collectionParam.setAttribute(GSXML.VALUE_ATT, collection); 344 345 345 Element documentsParam = this.doc.createElement(GSXML.PARAM_ELEM);346 Element documentsParam = doc.createElement(GSXML.PARAM_ELEM); 346 347 paramListElem.appendChild(documentsParam); 347 348 documentsParam.setAttribute(GSXML.NAME_ATT, "documents"); … … 350 351 Element buildResponseMessage = (Element) this.mr.process(buildMessage); 351 352 352 response.appendChild( this.doc.importNode(buildResponseMessage, true));353 response.appendChild(doc.importNode(buildResponseMessage, true)); 353 354 } 354 355 } … … 364 365 else 365 366 { 366 Element depositorPage = this.doc.createElement("depositorPage");367 Element depositorPage = doc.createElement("depositorPage"); 367 368 response.appendChild(depositorPage); 368 369 369 Element collList = getCollectionsInSite( );370 depositorPage.appendChild( this.doc.importNode(collList, true));370 Element collList = getCollectionsInSite(doc); 371 depositorPage.appendChild(doc.importNode(collList, true)); 371 372 } 372 373 … … 374 375 } 375 376 376 public Element getCollectionsInSite( )377 public Element getCollectionsInSite(Document doc) 377 378 { 378 Element message = this.doc.createElement(GSXML.MESSAGE_ELEM);379 Element request = GSXML.createBasicRequest( this.doc, GSXML.REQUEST_TYPE_DESCRIBE, "", new UserContext());379 Element message = doc.createElement(GSXML.MESSAGE_ELEM); 380 Element request = GSXML.createBasicRequest(doc, GSXML.REQUEST_TYPE_DESCRIBE, "", new UserContext()); 380 381 message.appendChild(request); 381 382 Element responseMessage = (Element) this.mr.process(message);
Note:
See TracChangeset
for help on using the changeset viewer.