ShareInterface.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /**
  2. * Licensed Materials - Property of IBM
  3. * IBM Cognos Products: Collaboration
  4. * (C) Copyright IBM Corp. 2018, 2019
  5. *
  6. * US Government Users Restricted Rights - Use, duplication or disclosure
  7. * restricted by GSA ADP Schedule Contract with IBM Corp.
  8. */
  9. define([], function () {
  10. 'use strict';
  11. /**
  12. * This class provides a means to declare a share and embed controller.
  13. * It plays the role of an interface, consumer can implement it.
  14. * e.g.
  15. * @example
  16. * {
  17. * "id": "com.ibm.bi.dashboard.shareAndEmbed",
  18. * "collectionItems": [{
  19. * "containerId": "com.ibm.bi.glass.common.sharedResources",
  20. * "id": "dashboard",
  21. * "label": "Share & Embed",
  22. * "types": ["exploration"],
  23. * "perspectives": ["dashboard"],
  24. * "actionController": "dashboard/glass/controllers/ShareActionHandler"
  25. * }]
  26. * }
  27. * @public
  28. * @interface ShareInterface
  29. */
  30. var ShareInterface = function ShareInterface() {
  31. /**
  32. * Called when the custom button/menu item is Clicked/Tapped
  33. *
  34. * @memberof ShareInterface
  35. * @public
  36. * @param {Object} context
  37. * @returns {Object} urlMap object containing an object like:
  38. * @example
  39. * {
  40. * "perspective": "dashboard",
  41. * "objRef": "i047E166063164D5DA85C8872A4574513",
  42. * "action":"view",
  43. * "mode":"dashboard"
  44. * }
  45. */
  46. this.execute = function (context) {
  47. void context;
  48. };
  49. /**
  50. * Called to decide if the Sharing entry should be shown or not.
  51. *
  52. * @memberof ShareInterface
  53. * @public
  54. * @param {Object} context
  55. * @returns {Boolean} true/false
  56. */
  57. this.isVisible = function (context) {
  58. void context;
  59. };
  60. /**
  61. * Returns an array of DOM elements to be capture for a screenshot.
  62. *
  63. * @memberof ShareInterface
  64. * @public
  65. * @param {object} context
  66. * @return {Promise} An array of objects like: <code>[{"el":domNode,"label":"text"}]</code>
  67. */
  68. this.getShareableItems = function (context) {
  69. void context;
  70. };
  71. /**
  72. * Returns information about the current asset.
  73. *
  74. * @memberof ShareInterface
  75. * @public
  76. * @param {object} context
  77. * @return {Promise} An object like: <code>[{"type":"dashboard","title":"Dashboard Name","subTitle":"Dashboard Tab 1","owner":"Sam Carter","saved":true}]</code>
  78. */
  79. this.getShareableInfo = function (context) {
  80. void context;
  81. };
  82. /**
  83. * Tells the controller that the Share panel is about to be shown.
  84. *
  85. * @memberof ShareInterface
  86. * @public
  87. * @param {object} options
  88. * @param {object} options.glassContext
  89. * @param {object} options.slideout
  90. * @return {Promise}
  91. */
  92. this.enterShareState = function (options) {
  93. void options;
  94. };
  95. /**
  96. * Tells the controller that the Share panel is about to be closed.
  97. *
  98. * @memberof ShareInterface
  99. * @public
  100. * @param {object} options
  101. * @param {object} options.glassContext
  102. * @param {object} options.slideout
  103. * @return {Promise}
  104. */
  105. this.leaveShareState = function (options) {
  106. void options;
  107. };
  108. /**
  109. * Asks the controller if it supports exporting to PDF. If this method
  110. * is not implemented, the default response will be `false`.
  111. *
  112. * @memberof ShareInterface
  113. * @public
  114. * @param {object} options
  115. * @param {object} options.glassContext
  116. * @return {Boolean}
  117. */
  118. this.canExportToPDF = function (options) {
  119. void options;
  120. };
  121. /**
  122. * Tells the controller to generate a PDF file. This will only be called
  123. * if the canExportToPDF function returns true.
  124. *
  125. * @memberof ShareInterface
  126. * @public
  127. * @param {object} options
  128. * @param {object} options.glassContext
  129. * @param {object} pageSize an object representing the size of the page
  130. * @param {object} printFilters print filters
  131. * @return {Promise}
  132. */
  133. this.exportToPDF = function (options, pageSize, printFilters) {
  134. void (options, pageSize, printFilters);
  135. };
  136. /**
  137. * Asks the action controller for its instrumentation data. The `action` will
  138. * be set as `shared` by collaboration when invoking the instrumentation's
  139. * track() method.
  140. *
  141. * @memberof ShareInterface
  142. * @public
  143. * @param {object} options
  144. * @param {object} options.glassContext
  145. * @return {object} instrumentation object data
  146. * @example
  147. * {
  148. * "objectId": "some_id",
  149. * "objectType": "type",
  150. * "details": {
  151. * ...
  152. * }
  153. * }
  154. */
  155. this.getInstrumentation = function (options) {
  156. void options;
  157. };
  158. };
  159. return ShareInterface;
  160. });
  161. ;
  162. var _temp = function () {
  163. if (typeof __REACT_HOT_LOADER__ === 'undefined') {
  164. return;
  165. }
  166. }();
  167. ;