requestManager.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2001, 2011
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or
  8. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *|
  10. *+------------------------------------------------------------------------+
  11. */
  12. // Gloabl Definitions
  13. var gDispatcher = new CDispatcher();
  14. function sendDispatcherRequest(params, callback)
  15. {
  16. var request = gDispatcher.createRequest(goApplicationManager.get("scriptEngine"), params, callback);
  17. gDispatcher.dispatchRequest(request);
  18. return request;
  19. }
  20. function sendDispatcherRequestWithXMLResponse(params, callback)
  21. {
  22. var request = gDispatcher.createRequest(goApplicationManager.get("scriptEngine"), params, callback);
  23. request.setResponseType("XML");
  24. gDispatcher.dispatchRequest(request);
  25. return request;
  26. }
  27. function getDispatcherRequestStatus(request)
  28. {
  29. return gDispatcher.getRequestStatus(request);
  30. }
  31. function setDispatcherErrorHandler(errorFunction)
  32. {
  33. gDispatcher.setErrorHandlerFunction(errorFunction);
  34. }
  35. function cancelDispatcherRequest(request)
  36. {
  37. return gDispatcher.cancelRequest(request);
  38. }
  39. function testResponse(response)
  40. {
  41. alert("testResponse got this response: [" + response + "]");
  42. }
  43. function testResponseWin(response)
  44. {
  45. var sPath = "../" + qs_dir + "/blankNewWin.html";
  46. var newWin = window.open(sPath);
  47. newWin.document.write(response);
  48. newWin.document.close();
  49. }