requestManager.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /****************************************************************
  2. ** Licensed Materials - Property of IBM
  3. **
  4. ** IBM Cognos Products: drill
  5. **
  6. ** (C) Copyright IBM Corp. 2001, 2010
  7. **
  8. ** US Government Users Restricted Rights - Use, duplication or
  9. ** disclosure restricted by GSA ADP Schedule Contract with
  10. ** IBM Corp.
  11. *****************************************************************/
  12. // Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  13. // Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  14. // Gloabl Definitions
  15. var sPopUpWebRoot = ".."; // default this to a relative location
  16. if (window.g_PS_getWebRoot)
  17. {
  18. if (g_PS_getWebRoot() != "")
  19. sPopUpWebRoot = g_PS_getWebRoot(); // set up the official path to the C8 web root
  20. }
  21. var gDispatcher = new CDispatcher();
  22. function sendDispatcherRequest(params, callback)
  23. {
  24. var request = gDispatcher.createRequest(cfgGet("SCRIPT_ENGINE"), params, callback);
  25. gDispatcher.dispatchRequest(request);
  26. return request;
  27. }
  28. function getDispatcherRequestStatus(request)
  29. {
  30. return gDispatcher.getRequestStatus(request);
  31. }
  32. function setDispatcherErrorHandler(errorFunction)
  33. {
  34. gDispatcher.setErrorHandlerFunction(errorFunction);
  35. }
  36. function cancelDispatcherRequest(request)
  37. {
  38. return gDispatcher.cancelRequest(request);
  39. }
  40. function testResponse(response)
  41. {
  42. alert("testResponse got this response: [" + response + "]");
  43. }
  44. function testResponseWin(response)
  45. {
  46. typeof qs_dir != "undefined" ? qs_dir : (qs_dir = "qs");
  47. var sPath = sPopUpWebRoot + qs_dir + "/blankNewWin.html";
  48. if (typeof sNewWinSkin != "undefined" && sNewWinSkin != "")
  49. {
  50. sPath += "?skin=" + sNewWinSkin;
  51. }
  52. var newWin = window.open(sPath);
  53. newWin.document.write(response);
  54. newWin.document.close();
  55. }