ViewerHttpRequestConfig.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2013
  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. function ViewerHttpRequestConfig() {
  13. this.reportStatus = {}; // object that holds callbacks for all the different report statuses
  14. this.UI = {}; // object that contains the requestIndicator and workingDialog objects
  15. }
  16. ViewerHttpRequestConfig.prototype.configure = function(configuration) {
  17. applyJSONProperties(this, configuration);
  18. };
  19. ViewerHttpRequestConfig.prototype.getRequestIndicator = function() {
  20. if (this.UI) {
  21. return this.UI.requestIndicator ? this.UI.requestIndicator : null;
  22. }
  23. };
  24. ViewerHttpRequestConfig.prototype.getWorkingDialog = function() {
  25. if (this.UI) {
  26. return this.UI.workingDialog ? this.UI.workingDialog : null;
  27. }
  28. };
  29. ViewerHttpRequestConfig.prototype.getReportStatusCallback = function(status) {
  30. if (this.reportStatus) {
  31. var callback = this.reportStatus[status];
  32. if (callback) {
  33. return callback;
  34. }
  35. if (status == "complete" && this.reportStatus["initialComplete"]) {
  36. var tempCallback = this.reportStatus["initialComplete"];
  37. this.reportStatus["initialComplete"] = null;
  38. return tempCallback;
  39. }
  40. }
  41. return null;
  42. };