SlotAPI.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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: Dashboard
  6. * (C) Copyright IBM Corp. 2018, 2020
  7. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. */
  9. /**
  10. * @interface SlotAPI
  11. * @classdesc API class that is used to control a slot.
  12. * @example slots.getSlot(<slotId>)
  13. * @example slots.getSlotList()[<index>]
  14. * @example slots.getMappingInfoList()[<index>].slot
  15. */
  16. define([], function () {
  17. var SlotAPI = function () {
  18. function SlotAPI() {
  19. _classCallCheck(this, SlotAPI);
  20. }
  21. /**
  22. * @function SlotAPI#getId
  23. * @description Returns the slot ID.
  24. * @public
  25. *
  26. * @returns {String} Slot ID
  27. *
  28. */
  29. SlotAPI.prototype.getId = function getId() {};
  30. /**
  31. * @function SlotAPI#getDataViewId
  32. * @description Returns the data view ID that this slot is associated with.
  33. * @private
  34. *
  35. * @returns {String} View ID
  36. *
  37. */
  38. // getDataViewId() {}
  39. /**
  40. * @function SlotAPI#addDataItemsMapping
  41. * @description Adds new metadata columns to the slot.
  42. * @public
  43. *
  44. * @param {String[]} dataItemIds Ordered array of dataItem IDs to add to the slot
  45. * @param {Number} position Position to place the new metadata columns. By default (position = -1); metadata columns are appended at the end.
  46. * @param {Object} [transactionToken]
  47. *
  48. */
  49. SlotAPI.prototype.addDataItemsMapping = function addDataItemsMapping() {};
  50. /**
  51. * @function SlotAPI#removeDataItemsMapping
  52. * @description Removes the existing data items.
  53. * @public
  54. *
  55. * @param {String[]} dataItemIds Ordered array of dataItem IDs to remove from the slot
  56. * @param {Object} [transactionToken]
  57. *
  58. */
  59. SlotAPI.prototype.removeDataItemsMapping = function removeDataItemsMapping() {};
  60. /**
  61. * @function SlotAPI#addDataItems
  62. * @description Adds new metadata columns to the slot. This creates the dataItem and maps it to the slot.
  63. * @public
  64. *
  65. * @param {String[]} dataItemIds Ordered array of dataItem IDs to add to the slot
  66. * @param {Number} position Position to place the new metadata columns. By default (position = -1); metadata columns are appended at the end.
  67. * @param {Object} [transactionToken]
  68. *
  69. */
  70. SlotAPI.prototype.addDataItems = function addDataItems() {};
  71. /**
  72. * @function SlotAPI#removeDataItems
  73. * @description Removes the existing data items. This deletes the dataItem and removes the mapping.
  74. * @public
  75. *
  76. * @param {String[]} dataItemIds Ordered array of dataItem IDs to remove from the slot.
  77. * @param {Object} [transactionToken]
  78. *
  79. */
  80. SlotAPI.prototype.removeDataItems = function removeDataItems() {};
  81. /**
  82. * @function SlotAPI#getDataItemList
  83. * @description Returns a list of data items that are assigned to the slot.
  84. * @public
  85. * @param {boolean} ignoreDefaultDataItemMapping Defaults to false to ignore default mappings of the visualization.
  86. * @returns {DataItemAPI[]} Array of data items
  87. */
  88. SlotAPI.prototype.getDataItemList = function getDataItemList() {};
  89. /**
  90. * @function SlotAPI#getDataItem
  91. * @description Returns the dataItem with the given ID.
  92. * @public
  93. *
  94. * @param {String} dataItemId Unique dataItem ID
  95. *
  96. * @returns {dataItemAPI} Associated data item (or null)
  97. */
  98. SlotAPI.prototype.getDataItem = function getDataItem() /* dataItemId */{};
  99. /**
  100. * @function SlotAPI#supportsColumns
  101. * @description This method will check to make sure that the columns being dropped into the slots have the correct taxonomy class and family as per these rules:
  102. * 1) If the slot has no taxonomy defined, then it accepts all data columns
  103. * 2) If the slot is a lot/long, then it can accept columns that are also lat/long or if they do not have a taxonomy defined, then the slot will also accept numbers
  104. * 3) If the slot has a taxonomy defined which is not lat/long then it accepts everything except for lat/long columns
  105. * @private
  106. * @param {MetadataColumnAPI[]} metadataColumns Array of metadata columns
  107. *
  108. * @returns {Boolean} Returns true if the items are supported; otherwise false.
  109. */
  110. SlotAPI.prototype.supportsColumns = function supportsColumns() /* metadataColumns */{};
  111. /**
  112. * @function SlotAPI#getDefinition
  113. * @description Returns the slot definition.
  114. * @public
  115. *
  116. * @returns {SlotDefinitionAPI}
  117. */
  118. SlotAPI.prototype.getDefinition = function getDefinition() {};
  119. /**
  120. * @function SlotAPI#isStacked
  121. * @description Returns true if the slot is mapped to more than one item and the items are stacked.
  122. * @private
  123. *
  124. * @returns {Boolean} isStacked
  125. */
  126. SlotAPI.prototype.isStacked = function isStacked() {};
  127. /**
  128. * @function SlotAPI#hasUnavailableMetadataColumns
  129. * @description Returns true if the slot is mapped to at least one unavailable column.
  130. * @public
  131. *
  132. * @returns {Boolean} hasUnavailableMetadataColumns
  133. */
  134. SlotAPI.prototype.hasUnavailableMetadataColumns = function hasUnavailableMetadataColumns() {};
  135. return SlotAPI;
  136. }();
  137. return SlotAPI;
  138. });
  139. //# sourceMappingURL=SlotAPI.js.map