SAPBWConnectionPane.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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/common/slideout/BasePane', 'bi/admin/nls/StringResource', 'react', 'react-dom', 'ba-react-admin/ba-react-admin.min'], function (BasePane, StringResource, React, ReactDom, AdminReact) {
  10. var SAPBWConnectionPane = BasePane.extend({
  11. init: function init(options) {
  12. SAPBWConnectionPane.inherited('init', this, arguments);
  13. $.extend(this, options);
  14. this._connectionEditor = null;
  15. },
  16. renderBody: function renderBody() {
  17. var codePageArray = [{
  18. value: 1100,
  19. label: StringResource.get("sapbw_cp_1100")
  20. }, {
  21. value: 1160,
  22. label: StringResource.get("sapbw_cp_1160")
  23. }, {
  24. value: 1401,
  25. label: StringResource.get("sapbw_cp_1401")
  26. }, {
  27. value: 1404,
  28. label: StringResource.get("sapbw_cp_1404")
  29. }, {
  30. value: 1610,
  31. label: StringResource.get("sapbw_cp_1610")
  32. }, {
  33. value: 1614,
  34. label: StringResource.get("sapbw_cp_1614")
  35. }, {
  36. value: 1700,
  37. label: StringResource.get("sapbw_cp_1700")
  38. }, {
  39. value: 1704,
  40. label: StringResource.get("sapbw_cp_1704")
  41. }, {
  42. value: 1800,
  43. label: StringResource.get("sapbw_cp_1800")
  44. }, {
  45. value: 4102,
  46. label: StringResource.get("sapbw_cp_4102")
  47. }, {
  48. value: 4103,
  49. label: StringResource.get("sapbw_cp_4103")
  50. }, {
  51. value: 4110,
  52. label: StringResource.get("sapbw_cp_4110")
  53. }, {
  54. value: 8000,
  55. label: StringResource.get("sapbw_cp_8000")
  56. }, {
  57. value: 8300,
  58. label: StringResource.get("sapbw_cp_8300")
  59. }, {
  60. value: 8400,
  61. label: StringResource.get("sapbw_cp_8400")
  62. }, {
  63. value: 8500,
  64. label: StringResource.get("sapbw_cp_8500")
  65. }, {
  66. value: 8600,
  67. label: StringResource.get("sapbw_cp_8600")
  68. }];
  69. var codePageMap = {};
  70. _.each(codePageArray, function (cp) {
  71. codePageMap[cp.value] = cp.label;
  72. });
  73. var sapBwEditor = React.createElement(AdminReact.SAPBWConnectionEditor, {
  74. clickFunc: this.closeClick.bind(this),
  75. localizedStrings: {
  76. 'appServer': StringResource.get("sapbw_appServer"),
  77. 'sysNumber': StringResource.get("sapbw_sysNumber"),
  78. 'clientNumber': StringResource.get("sapbw_clientNumber"),
  79. 'codePage': StringResource.get("sapbw_codePage"),
  80. 'routerString': StringResource.get("sapbw_routerString"),
  81. 'destination': StringResource.get("sapbw_destination"),
  82. 'messageServer': StringResource.get("sapbw_messageServer"),
  83. 'logonType': StringResource.get("sapbw_logonType"),
  84. 'systemId': StringResource.get("sapbw_systemId"),
  85. 'logonGroup': StringResource.get("sapbw_logonGroup"),
  86. 'buttonLabel': StringResource.get("close")
  87. },
  88. logonTypes: [{
  89. label: StringResource.get("sapbw_appServer"),
  90. value: 'applicationServer'
  91. }, {
  92. label: StringResource.get("sapbw_destination"),
  93. value: 'destination'
  94. }, {
  95. label: StringResource.get("sapbw_messageServer"),
  96. value: 'messageServer'
  97. }],
  98. codePages: codePageArray,
  99. codePageMap: codePageMap,
  100. rtl: false,
  101. disabled: false,
  102. title: StringResource.get("sapbw_title")
  103. });
  104. this.title = StringResource.get("sapbw_title");
  105. this.connectionEditor = ReactDom.render(sapBwEditor, this.$el.find('.bi-admin-pane-body')[0]);
  106. this.connectionEditor.setState(this.parseInfo.sapbwParams);
  107. return Promise.resolve();
  108. },
  109. closeClick: function closeClick() {
  110. this.parseInfo.sapbwParams = this.connectionEditor.state;
  111. this.slideout.hide({
  112. force: true
  113. });
  114. }
  115. });
  116. return SAPBWConnectionPane;
  117. });