QueryResultColumn.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /**
  4. * Licensed Materials - Property of IBM
  5. * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2018, 2021
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. define(['../../../lib/@waca/dashboard-common/dist/core/APIFactory', '../../../api/DataItemAPI'], function (APIFactory, DataItemAPI) {
  9. var QueryResultColumn = function () {
  10. function QueryResultColumn(columnInfo) {
  11. _classCallCheck(this, QueryResultColumn);
  12. this.columnInfo = columnInfo;
  13. }
  14. QueryResultColumn.prototype.getAPI = function getAPI() {
  15. if (!this.api) {
  16. this.api = APIFactory.createAPI(this, [DataItemAPI]);
  17. }
  18. return this.api;
  19. };
  20. QueryResultColumn.prototype.getId = function getId() {
  21. return this.columnInfo.u;
  22. };
  23. QueryResultColumn.prototype.getLabel = function getLabel() {
  24. return this.columnInfo.d;
  25. };
  26. QueryResultColumn.prototype.getColumnId = function getColumnId() {
  27. return this.columnInfo.u;
  28. };
  29. QueryResultColumn.prototype.getAggregation = function getAggregation() {
  30. return this.columnInfo.aggregate;
  31. };
  32. QueryResultColumn.prototype.getDataType = function getDataType() {
  33. throw 'getDataType is not implemented for QueryResultColumn';
  34. };
  35. QueryResultColumn.prototype.isDateOrTimeType = function isDateOrTimeType() {
  36. throw 'isDateOrTimeType is not implemented for QueryResultColumn';
  37. };
  38. // ColumnInfo is extracted from the itemClass of the query response. Only the fact (measure) type has an aggregate value in the itemClass.
  39. QueryResultColumn.prototype.getType = function getType() {
  40. return this.columnInfo.aggregate ? 'fact' : 'attribute';
  41. };
  42. QueryResultColumn.prototype.getNavigationPathId = function getNavigationPathId() {
  43. throw 'getNavigationPathId is not implemented for QueryResultColumn';
  44. };
  45. QueryResultColumn.prototype.setNavigationPathId = function setNavigationPathId() {
  46. throw 'setNavigationPathId is not implemented for QueryResultColumn';
  47. };
  48. QueryResultColumn.prototype.setAggregation = function setAggregation() {
  49. throw 'setAggregation is not implemented for QueryResultColumn';
  50. };
  51. QueryResultColumn.prototype.hasDefaultAggregation = function hasDefaultAggregation() {
  52. throw 'hasDefaultAggregation is not implemented for QueryResultColumn';
  53. };
  54. QueryResultColumn.prototype.hasDefaultSort = function hasDefaultSort() {
  55. throw 'hasDefaultSort is not implemented for QueryResultColumn';
  56. };
  57. QueryResultColumn.prototype.hasDefaultFormat = function hasDefaultFormat() {
  58. throw 'hasDefaultFormat is not implemented for QueryResultColumn';
  59. };
  60. QueryResultColumn.prototype.getMetadataColumn = function getMetadataColumn() {
  61. throw 'getMetadataColumn is not implemented for QueryResultColumn';
  62. };
  63. QueryResultColumn.prototype.getFormat = function getFormat() {
  64. throw 'getFormat is not implemented for QueryResultColumn';
  65. };
  66. QueryResultColumn.prototype.setFormat = function setFormat() {
  67. throw 'setFormat is not implemented for QueryResultColumn';
  68. };
  69. QueryResultColumn.prototype.getSort = function getSort() {
  70. throw 'getSort is not implemented for QueryResultColumn';
  71. };
  72. QueryResultColumn.prototype.setSort = function setSort() {
  73. throw 'setSort is not implemented for QueryResultColumn';
  74. };
  75. QueryResultColumn.prototype.getTopBottom = function getTopBottom() {
  76. throw 'getTopBottom is not implemented for QueryResultColumn';
  77. };
  78. QueryResultColumn.prototype.setTopBottom = function setTopBottom() {
  79. throw 'setTopBottom is not implemented for QueryResultColumn';
  80. };
  81. QueryResultColumn.prototype.canDrillDown = function canDrillDown() {
  82. throw 'canDrillDown is not implemented for QueryResultColumn';
  83. };
  84. QueryResultColumn.prototype.drillDown = function drillDown() {
  85. throw 'drillDown is not implemented for QueryResultColumn';
  86. };
  87. QueryResultColumn.prototype.getDrillDownValue = function getDrillDownValue() {
  88. throw 'getDrillDownValue is not implemented for QueryResultColumn';
  89. };
  90. QueryResultColumn.prototype.drillUp = function drillUp() {
  91. throw 'drillUp is not implemented for QueryResultColumn';
  92. };
  93. QueryResultColumn.prototype.getDrillUpValue = function getDrillUpValue() {
  94. throw 'getDrillUpValue is not implemented for QueryResultColumn';
  95. };
  96. QueryResultColumn.prototype.clearDrill = function clearDrill() {
  97. throw 'clearDrill is not implemented for QueryResultColumn';
  98. };
  99. QueryResultColumn.prototype.setBinning = function setBinning() {
  100. throw 'setBinning is not implemented for QueryResultColumn';
  101. };
  102. QueryResultColumn.prototype.getBinning = function getBinning() {
  103. throw 'getBinning is not implemented for QueryResultColumn';
  104. };
  105. QueryResultColumn.prototype.hasModelSort = function hasModelSort() {
  106. throw 'hasModelSort is not implemented for QueryResultColumn';
  107. };
  108. QueryResultColumn.prototype.getUnion = function getUnion() {
  109. throw 'getUnion is not implemented for QueryResultColumn';
  110. };
  111. QueryResultColumn.prototype.isColumnUnavailable = function isColumnUnavailable() {
  112. throw 'isColumnUnavailable is not implemented for QueryResultColumn';
  113. };
  114. QueryResultColumn.prototype.serializeActions = function serializeActions() {
  115. throw 'serializeActions is not implemented for QueryResultColumn';
  116. };
  117. return QueryResultColumn;
  118. }();
  119. return QueryResultColumn;
  120. });
  121. //# sourceMappingURL=QueryResultColumn.js.map