ExtCatalogConnectionStringPane.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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', 'jquery'], function (ConnectionStringEditorPane, StringResource, $) {
  10. var ExtCatalogConnectionStringPane = ConnectionStringEditorPane.extend({
  11. _helpLink: 'https://www.ibm.com/support/knowledgecenter/SSEP7J_11.1.0/com.ibm.swg.ba.cognos.ag_manage.doc/c_manage_wkc.html',
  12. init: function init(options) {
  13. ExtCatalogConnectionStringPane.inherited('init', this, arguments);
  14. $.extend(this, options);
  15. },
  16. renderBody: function renderBody($body) {
  17. var items = [{
  18. 'id': 'adminJdbcUrl',
  19. 'name': 'jdbcUrl',
  20. 'label': StringResource.get('serverUrl'),
  21. 'value': this.parseInfo.serverUrl,
  22. 'type': 'TextArea',
  23. 'multiline': true,
  24. 'ellipses': true,
  25. 'editable': this.isEditable(),
  26. 'onChange': function (name, value) {
  27. this.parseInfo.serverUrl = value;
  28. }.bind(this)
  29. }, {
  30. 'id': 'adminConnectionParameters',
  31. 'name': 'connectionParameters',
  32. 'label': StringResource.get('connectionParameters'),
  33. 'type': 'TextArea',
  34. 'multiline': true,
  35. 'editable': this.isEditable(),
  36. 'onChange': function (name, value) {
  37. this.parseInfo.connectionProperties = value;
  38. }.bind(this),
  39. 'value': this.parseInfo.connectionProperties
  40. }];
  41. return this._renderBody({
  42. 'el': this.$el.find(".bi-admin-pane-body"),
  43. 'glassContext': this.glassContext,
  44. 'name': 'ExtCatalogConnectionSettings',
  45. 'items': items
  46. });
  47. },
  48. _addHelp: function _addHelp() {
  49. var $help = $(this.$el.find('.l_jdbcUrl'));
  50. $help.css('display', 'inline-flex');
  51. var $helpEl = $('<div tabindex="0" style="padding-left: 10px;" role="img" title="' + StringResource.get('learnMore') + '"><svg style="fill: #4178BE" class="svgIcon" role="presentation"><text>' + StringResource.get('learnMore') + '</text><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#common-titan_help"></use></svg></div>');
  52. $helpEl.on('primaryaction', function () {
  53. window.open(this._helpLink, '_blank');
  54. }.bind(this));
  55. $help.append($helpEl);
  56. },
  57. _postRender: function _postRender() {
  58. this._addHelp();
  59. return this.$el;
  60. },
  61. setFocus: function setFocus() {
  62. $('textarea.v_serverUrl').focus();
  63. }
  64. });
  65. return ExtCatalogConnectionStringPane;
  66. });