DrillThroughDefinitionEntry.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. 'use strict';
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: Dashboard
  5. * (C) Copyright IBM Corp. 2018, 2019
  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/Model'], function (Model) {
  9. /**
  10. * Model which represents a drill through definition entry
  11. */
  12. var DrillThroughDefinitionEntry = Model.extend({
  13. whitelistAttrs: ['id', 'name', 'type', 'assetId', 'assetSearchPath', 'scope', 'modelRefs', 'mappings', 'ownerId', 'perspective'],
  14. init: function init(attrs) {
  15. DrillThroughDefinitionEntry.inherited('init', this, arguments);
  16. this.targetName = attrs.targetName;
  17. this.api = {
  18. getId: this._getId.bind(this),
  19. getName: this._getName.bind(this),
  20. getTargetName: this._getTargetName.bind(this),
  21. setTargetName: this._setTargetName.bind(this),
  22. getType: this._getType.bind(this),
  23. getAssetId: this._getAssetId.bind(this),
  24. setAssetId: this._setAssetId.bind(this),
  25. getAssetSearchPath: this._getAssetSearchPath.bind(this),
  26. setAssetSearchPath: this._setAssetSearchPath.bind(this),
  27. getPerspective: this._getPerspective.bind(this),
  28. setPerspective: this._setPerspective.bind(this),
  29. getScope: this._getScope.bind(this),
  30. getModelRefs: this._getModelRefs.bind(this),
  31. getMappings: this._getMappings.bind(this),
  32. update: this._update.bind(this),
  33. removeModelRef: this._removeModelRef.bind(this),
  34. getOwnerId: this._getOwnerId.bind(this)
  35. };
  36. },
  37. /**
  38. * @returns the public api to the drill through model that is accessible to clients.
  39. */
  40. getAPI: function getAPI() {
  41. return this.api;
  42. },
  43. _getId: function _getId() {
  44. return this.id;
  45. },
  46. _getName: function _getName() {
  47. return this.name;
  48. },
  49. _getType: function _getType() {
  50. return this.type;
  51. },
  52. _getAssetId: function _getAssetId() {
  53. return this.assetId;
  54. },
  55. _setAssetId: function _setAssetId(assetId) {
  56. this.assetId = assetId;
  57. },
  58. _getPerspective: function _getPerspective() {
  59. return this.perspective || 'authoring';
  60. },
  61. _setPerspective: function _setPerspective(perspective) {
  62. this.perspective = perspective;
  63. },
  64. _getAssetSearchPath: function _getAssetSearchPath() {
  65. return this.assetSearchPath;
  66. },
  67. _setAssetSearchPath: function _setAssetSearchPath(assetSearchPath) {
  68. this.assetSearchPath = assetSearchPath;
  69. },
  70. _getTargetName: function _getTargetName() {
  71. return this.targetName;
  72. },
  73. _setTargetName: function _setTargetName(targetName) {
  74. this.targetName = targetName;
  75. },
  76. _getScope: function _getScope() {
  77. return this.scope;
  78. },
  79. _getModelRefs: function _getModelRefs() {
  80. return this.modelRefs;
  81. },
  82. _getMappings: function _getMappings() {
  83. return this.mappings;
  84. },
  85. _update: function _update(context, options) {
  86. this.set(context, options);
  87. },
  88. _removeModelRef: function _removeModelRef() /* modelRef */{},
  89. _getOwnerId: function _getOwnerId() {
  90. return this.ownerId;
  91. }
  92. });
  93. return DrillThroughDefinitionEntry;
  94. });
  95. //# sourceMappingURL=DrillThroughDefinitionEntry.js.map