SystemSettingService.js 939 B

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: admin
  5. * Copyright IBM Corp. 2017
  6. * US Government Users Restricted Rights - Use,
  7. * duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. */
  9. define(['underscore', 'bi/commons/ui/core/Class'], function (_, Class) {
  10. var SystemSettingService = Class.extend({
  11. init: function init(options) {
  12. SystemSettingService.inherited('init', this, arguments);
  13. _.extend(this, options);
  14. },
  15. getSystemSettings: function getSystemSettings(setting) {
  16. var ajaxService = this.glassContext.services.ajax;
  17. return setting.values.map(function (value) {
  18. var url = 'v1/configuration/keys/' + setting.name + '.' + value;
  19. var promise = ajaxService.ajax({
  20. 'type': 'GET',
  21. 'url': url
  22. });
  23. return promise;
  24. }.bind(this));
  25. }
  26. });
  27. return SystemSettingService;
  28. });