PlanAnalyticsConnectionStringPane.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. "use strict";
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: Cognos Analytics
  5. * Copyright IBM Corp. 2017
  6. * US Government Users Restricted Rights - Use, duplication or disclosure
  7. * restricted by GSA ADP Schedule Contract with IBM Corp.
  8. */
  9. define(['bi/admin/datasource/slideout/ConnectionStringEditorPane', 'bi/admin/nls/StringResource'], function (ConnectionStringEditorPane, StringResource) {
  10. /**
  11. * Sample content view that extends the glass View class
  12. */
  13. var PlanAnalyticsConnectionStringPane = ConnectionStringEditorPane.extend({
  14. init: function init(options) {
  15. PlanAnalyticsConnectionStringPane.inherited('init', this, arguments);
  16. $.extend(this, options);
  17. },
  18. renderBody: function renderBody($body) {
  19. return this._renderBody({
  20. 'el': this.$el.find(".bi-admin-pane-body"),
  21. 'glassContext': this.glassContext,
  22. 'name': 'TM1ConnectionSettings',
  23. 'items': [{
  24. 'name': 'TM1AdminHost',
  25. 'label': StringResource.get('datasourceTM1AdminHost'),
  26. 'value': this.parseInfo.tm1Params.tm1AdminHost,
  27. 'type': 'TextArea',
  28. 'multiline': true,
  29. 'disabled': false,
  30. 'ellipses': true,
  31. 'editable': this.isEditable(),
  32. 'onChange': function (name, value) {
  33. this.parseInfo.tm1Params.tm1AdminHost = value;
  34. }.bind(this)
  35. }, {
  36. 'name': 'TM1ServerPort',
  37. 'label': StringResource.get('datasourceTM1ServerPort'),
  38. 'value': this.parseInfo.tm1Params.tm1Port,
  39. 'type': 'SingleLineValue',
  40. 'id': 'TM1ServerPort',
  41. 'multiline': true,
  42. 'disabled': false,
  43. 'ellipses': true,
  44. 'editable': this.isEditable(),
  45. 'validator': {
  46. 'maxLength': '8',
  47. 'isNumber': true,
  48. 'numericRange': {
  49. 'min': 0
  50. }
  51. },
  52. 'onChange': function (name, value) {
  53. this.parseInfo.tm1Params.tm1Port = value;
  54. }.bind(this)
  55. }, {
  56. 'type': 'CheckBox',
  57. 'controlOnLeft': true,
  58. 'label': StringResource.get('useSSL'),
  59. 'ariaLabel': StringResource.get('useSSL'),
  60. 'name': 'Protocol',
  61. 'disabled': !this.isEditable(),
  62. 'checked': this.parseInfo.tm1Params.tm1UseSSL,
  63. 'onChange': function (name, value) {
  64. this.parseInfo.tm1Params.tm1UseSSL = value;
  65. }.bind(this)
  66. }]
  67. });
  68. },
  69. _postRender: function _postRender() {
  70. return this.$el;
  71. },
  72. setFocus: function setFocus() {
  73. $('textarea.v_TM1AdminHost').focus();
  74. }
  75. });
  76. return PlanAnalyticsConnectionStringPane;
  77. });