ActiveReportIWidgetProperties.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. dojo.require("bux.reportViewer.Properties");
  13. dojo.provide("ActiveReportIWidgetProperties");
  14. dojo.declare("ActiveReportIWidgetProperties", [bux.reportViewer.Properties], {
  15. /*
  16. * @override
  17. */
  18. initializeDialogDisplayValues: function() {
  19. this.dialogDisplayValues = { activeReportState: { value: null, canUndo: false, runReport: false }
  20. };
  21. },
  22. getActiveReportState: function()
  23. {
  24. return this.getProperty("activeReportState");
  25. },
  26. setActiveReportState: function(oState)
  27. {
  28. this.setProperty("activeReportState", oState);
  29. },
  30. /*
  31. * @override
  32. */
  33. initialize: function( envParams )
  34. {
  35. if( this.isInitialized )
  36. {
  37. return;
  38. }
  39. this.isInitialized = true;
  40. this.initializeDialogSpec();
  41. },
  42. /*
  43. * @override
  44. */
  45. initializeDialogSpec: function()
  46. {
  47. var masterDialogSpecArray =
  48. [
  49. {
  50. columns:
  51. [
  52. {
  53. propertyName: 'originalReportLocation',
  54. uiElementType: 'text',
  55. label: this.getOriginalReportLocation(this.iWidget),
  56. allowWrapping: true
  57. }
  58. ]
  59. },
  60. {
  61. columns:
  62. [
  63. {
  64. propertyName: 'ActiveReportOutputVersion',
  65. uiElementType: 'text',
  66. label: this._getAcitveReportOutputVersion(this.iWidget),
  67. allowWrapping: true
  68. }
  69. ]
  70. }
  71. ];
  72. if (this.iWidget.isDebugMode()) {
  73. //Show public variables only in DEBUG mode
  74. masterDialogSpecArray.push(
  75. {
  76. columns:
  77. [
  78. {
  79. propertyName: 'PublicVariables',
  80. uiElementType: 'text',
  81. label: this._getPublicVariableNames(this.iWidget),
  82. allowWrapping: true
  83. }
  84. ]
  85. }
  86. );
  87. }
  88. this.masterDialogSpec = { rows: masterDialogSpecArray };
  89. },
  90. /*
  91. * returns string output version in the form to show on properties dialog
  92. */
  93. _getAcitveReportOutputVersion: function(widget)
  94. {
  95. var sVersion = widget.getActiveReportOutputVersion();
  96. if (sVersion == null) {
  97. sVersion = RV_RES.IDS_JS_PROPERTY_ACTIVEREPORT_OUTPUT_VERSION_UNAVAILABLE;
  98. }
  99. return (RV_RES.IDS_JS_PROPERTY_ACTIVEREPORT_OUTPUT_VERSION + " " + sVersion);
  100. },
  101. /*
  102. * returns concatenated public vairable names with type in the form to show on properties dialog
  103. */
  104. _getPublicVariableNames: function(widget)
  105. {
  106. var oNames = widget.getPublicVariableNames();
  107. var sNamesToDisplay = "";
  108. for (var name in oNames) {
  109. var sType = oNames[name];
  110. if (sNamesToDisplay.length>0) {
  111. sNamesToDisplay += ", ";
  112. }
  113. sNamesToDisplay += name;
  114. sNamesToDisplay += (sType === 'D')? ' (Discrete)' : '(Range)';
  115. }
  116. if (sNamesToDisplay.length>0) {
  117. sNamesToDisplay = "Public Variables: " + sNamesToDisplay;
  118. }
  119. return sNamesToDisplay;
  120. },
  121. /*
  122. * @override
  123. */
  124. _getReportWidgetTabTitle: function() {
  125. var reportWidgetTabTitle;
  126. if( this.iWidget && this.iWidget.getViewerObject() )
  127. {
  128. reportWidgetTabTitle = RV_RES.IDS_ACTIVE_REPORT_WIDGET_PROPERTY_TAB_TITLE;
  129. }
  130. return reportWidgetTabTitle;
  131. }
  132. });