DSRunAsView.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. "use strict";
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: admin
  5. * Copyright IBM Corp. 2019
  6. * US Government Users Restricted Rights
  7. * Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. */
  9. define(['bi/content_apps/RunAsJobOptionsView'], function (BasePane) {
  10. //NOSONAR: needed for amd
  11. var DSRunAsView = BasePane.extend({
  12. init: function init() {
  13. DSRunAsView.inherited('init', this, arguments);
  14. },
  15. _executeRequest: function _executeRequest() {
  16. this._getRequestParams().then(function () {
  17. this._validRequestParamsOptions();
  18. var jsonData = JSON.stringify(this._requestParams);
  19. var options = {
  20. 'headers': {
  21. 'Content-Type': 'application/vnd.ibm.bi.platform.execution+json; charset=UTF-8',
  22. 'Accept': 'application/json'
  23. },
  24. 'datatype': 'json',
  25. 'type': 'post',
  26. 'url': 'v1/datasets/' + this.objectInformation.id + '/executions',
  27. 'data': jsonData
  28. };
  29. return this.glassContext.getCoreSvc('.Ajax').ajax(options).catch(this._handleRunError.bind(this));
  30. }.bind(this));
  31. }
  32. });
  33. return DSRunAsView;
  34. });