DashboardContentProvider.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 (C) Copyright IBM Corp. 2020
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. /**
  9. * @class DashboardContentProvider
  10. * @hideconstructor
  11. * @classdesc API provider class to create Dashboard ContentAPI instances
  12. */
  13. define(['../../../../../canvas/DashboardContent', '../../../../../lib/@waca/dashboard-common/dist/core/APIFactory', '../../../../../lib/@waca/dashboard-common/dist/api/ContentProviderAPI'], function (DashboardContent, APIFactory, ContentProviderAPI) {
  14. var DashboardContentProvider = function () {
  15. function DashboardContentProvider(_ref) {
  16. var features = _ref.features;
  17. _classCallCheck(this, DashboardContentProvider);
  18. this._api = APIFactory.createAPI(this, [ContentProviderAPI]);
  19. features['ContentFactory'].registerProvider(this._api);
  20. }
  21. DashboardContentProvider.prototype.getAPI = function getAPI() {
  22. return this._api;
  23. };
  24. DashboardContentProvider.prototype.getTypeList = function getTypeList() {
  25. return ['dashboard'];
  26. };
  27. DashboardContentProvider.prototype.addModel = function addModel() {
  28. throw new Error('Not supported.');
  29. };
  30. DashboardContentProvider.prototype.createContent = function createContent(options) {
  31. return new DashboardContent(options);
  32. };
  33. return DashboardContentProvider;
  34. }();
  35. return DashboardContentProvider;
  36. });
  37. //# sourceMappingURL=DashboardContentProvider.js.map