123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- "use strict";
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Cognos Analytics
- * Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['bi/admin/datasource/slideout/ConnectionStringEditorPane', 'bi/admin/nls/StringResource', 'jquery'], function (ConnectionStringEditorPane, StringResource, $) {
- /**
- * Sample content view that extends the glass View class
- */
- var MSASConnectionStringPane = ConnectionStringEditorPane.extend({
- _languageHelpLink: 'https://www.ibm.com/support/knowledgecenter/SSEP7J_11.1.0/com.ibm.swg.ba.cognos.ag_manage.doc/c_data_server_language_parameter.html',
- init: function init(options) {
- MSASConnectionStringPane.inherited('init', this, arguments);
- $.extend(this, options);
- if (!this.parseInfo.languageVal) {
- this.parseInfo.languageVal = 'en-us';
- }
- },
- renderBody: function renderBody($body) {
- var items = [{
- 'name': 'msasVersion',
- 'label': StringResource.get('msasType'),
- 'defaultValue': this.parseInfo.msasVersion,
- 'type': 'DropDown',
- 'readOnly': !this.isEditable(),
- 'multiline': true,
- 'options': [{
- label: 'HTTP XMLA',
- value: 'X8'
- }, {
- label: '2019',
- value: 'M19'
- }, {
- label: '2017',
- value: 'M17'
- }, {
- label: '2016',
- value: 'M16'
- }, {
- label: '2014',
- value: 'M14'
- }, {
- label: '2012',
- value: 'M12'
- }],
- 'onChange': this._toggleNamedInstance.bind(this)
- }, {
- 'name': 'serverUrl',
- 'label': StringResource.get('serverUrl'),
- 'value': this.parseInfo.serverUrl,
- 'type': 'TextArea',
- 'multiline': true,
- 'ellipses': true,
- 'editable': this.isEditable(),
- 'onChange': function (name, value) {
- this.parseInfo.serverUrl = value;
- }.bind(this)
- }, {
- 'name': 'language',
- 'label': StringResource.get('language'),
- 'value': this.parseInfo.languageVal,
- 'type': 'TextArea',
- 'multiline': true,
- 'ellipses': false,
- 'editable': this.isEditable(),
- 'onChange': function (name, value) {
- this.parseInfo.languageVal = value;
- }.bind(this)
- }, {
- 'name': 'namedInstance',
- 'label': StringResource.get('namedInstance'),
- 'value': this.parseInfo.namedInstance,
- 'type': 'TextArea',
- 'multiline': true,
- 'ellipses': true,
- 'editable': this.isEditable(),
- 'onChange': function (name, value) {
- this.parseInfo.namedInstance = value;
- }.bind(this)
- }];
- return this._renderBody({
- 'el': this.$el.find(".bi-admin-pane-body"),
- 'glassContext': this.glassContext,
- 'name': 'MSASConnectionSettings',
- 'items': items
- }).then(this._toggleNamedInstance.bind(this, null, this.parseInfo.msasVersion));
- },
- _addLanguageHelp: function _addLanguageHelp() {
- var $languageHelp = $(this.$el.find('.l_language'));
- $languageHelp.css('display', 'inline-flex');
- var $helpEl = $('<div tabindex="0" style="padding-left: 10px;" role="img" title="' + StringResource.get('learnMore') + '"><svg class="svgIcon dsSvgInfoIcon" role="presentation"><text>' + StringResource.get('learnMore') + '</text><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#common-titan_help"></use></svg></div>');
- $helpEl.on('primaryaction', function () {
- window.open(this._languageHelpLink, '_blank');
- }.bind(this));
- $languageHelp.append($helpEl);
- },
- _postRender: function _postRender() {
- this._addLanguageHelp();
- return this.$el;
- },
- setFocus: function setFocus() {
- $('textarea.v_serverUrl').focus();
- },
- _toggleNamedInstance: function _toggleNamedInstance(name, value) {
- this.parseInfo.msasVersion = value;
- var prop = this._propertyUIControl.getProperty('namedInstance');
- if (!value || value === 'X8') {
- prop.getHTMLControl().val('');
- prop.disable();
- } else {
- prop.enable();
- }
- }
- });
- return MSASConnectionStringPane;
- });
|