NewReportAction.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 NewReportAction() {
  13. this._viewerIWidget = null;
  14. this._packageSearchPath = null;
  15. this._webContentRoot = null;
  16. this._gateway = null;
  17. this._capabilitiesXml = null;
  18. this._cafContextId = null;
  19. }
  20. NewReportAction.prototype = new EditContentAction();
  21. NewReportAction.prototype.parent = EditContentAction.prototype;
  22. NewReportAction.prototype.clearSelections = function() {};
  23. NewReportAction.prototype.getCognosViewer = function() {
  24. return this.getViewerIWidget().getViewerObject();
  25. };
  26. NewReportAction.prototype.setRequestParms = function(params) {
  27. this.parent.setRequestParms.call(this, params);
  28. this._packageSearchPath = params.packageSearchPath;
  29. this._viewerIWidget = params.viewerIWidget;
  30. this._webContentRoot = params.webContentRoot;
  31. this._gateway = params.gateway;
  32. this._capabilitiesXml = params.capabilitiesXml;
  33. this._cafContextId = params.cafContextId;
  34. };
  35. NewReportAction.prototype.getViewerIWidget = function() {
  36. return this._viewerIWidget;
  37. };
  38. NewReportAction.prototype.getGateway = function() {
  39. return this._gateway;
  40. };
  41. NewReportAction.prototype.getCapabilitiesXml = function() {
  42. return this._capabilitiesXml;
  43. };
  44. NewReportAction.prototype.getCafContextId = function() {
  45. return this._cafContextId ? this._cafContextId : "";
  46. };
  47. NewReportAction.prototype.getWebContent = function() {
  48. return this._webContentRoot;
  49. };
  50. NewReportAction.prototype.setReportSettings = function() {
  51. var oContext = {
  52. "showOpenTransition" : false,
  53. "model" : this._packageSearchPath
  54. };
  55. var buaWindow = this.getBUAWindow();
  56. buaWindow.Application.SetBUAContext(oContext);
  57. };
  58. /**
  59. * Adds any extra parameters needed when creating a new report
  60. */
  61. NewReportAction.prototype.addExtraLaunchParameters = function(RSParameters) {
  62. RSParameters.model = this._packageSearchPath;
  63. };
  64. NewReportAction.prototype.cancelPressed = function() {
  65. this.getViewerIWidget().iContext.iEvents.fireEvent("com.ibm.bux.widget.action", null, { action: 'deleteWidget' });
  66. };
  67. /**
  68. * Get the information from CWA and recall the onLoad of the Viewer iWidget
  69. */
  70. NewReportAction.prototype.runUpdatedReportFromBUA = function() {
  71. var iWidget = this.getViewerIWidget();
  72. iWidget.setAttributeValue("reportCreatedInCW", "true");
  73. var oContext = this.getBUAWindow().Application.GetBUAContext();
  74. iWidget.setNewReportInfo({
  75. "ui.spec" : oContext.reportXML,
  76. "m_tracking" : oContext.tracking ? oContext.tracking : "",
  77. "parameterValues" : oContext.parameterValues ? oContext.parameterValues : ""
  78. });
  79. iWidget.onLoad();
  80. };