/* *+------------------------------------------------------------------------+ *| Licensed Materials - Property of IBM *| *| BI and PM: BUX *| *| (C) Copyright IBM Corp. 2009 *| *| US Government Users Restricted Rights - Use, duplication or *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp. *| *+------------------------------------------------------------------------+ */ dojo.provide("CubeViewPropertiesPane"); dojo.require("dojo.string"); dojo.require("bux.i18n"); dojo.require("bux.Helper"); dojo.require("bux.iwidget.filter.Filter"); dojo.require("bux.dialogs.WidgetPropertiesFromJSON"); dojo.require("bux.layout.TableContainer"); dojo.require("dijit.form.TextBox"); dojo.require("dijit.form.CheckBox"); dojo.declare("CubeViewPropertiesPane", [bux.dialogs.WidgetPropertiesFromJSON], { sourceWidget: null, labelInput: null, tabTitle: "Cube View", webLabelInput:null, cubeLabelInput: null, cubeViewLabelInput: null, accessLabelInput:null, serverLabelInput: null, userNameLabelInput: null, passwordLabelInput: null, cancelPropertiesCallback: null, getReadStore: function (url){ //return null; return new dojo.data.ItemFileReadStore( { url : this.sourceWidget.iContext.io.rewriteURI(url) }); }, refreshCubes: function() { var _propDialog = this; if (this.cubeViewLabelInput != null) { this.cubeViewLabelInput.destroy(); } this.cubeViewLabelInput = new dijit.form.FilteringSelect({ labelAttr: "name", valueAttr: "name", searchAttr: "name", value: "" , store: this.getReadStore( "../sms/Tm1/cubes/" + _propDialog.properties.label.value + "/" + _propDialog.properties.serverLabel.value), onChange : function (value) { _propDialog.properties.cubeViewLabel.value = this.attr('value'); }}, document.createElement('div')); dojo.place(this.cubeViewLabelInput.domNode, this.id + "_cubeViewLabelInput"); }, refreshServers: function() { var _propDialog = this; if (this.serverLabelInput != null) { this.serverLabelInput.destroy(); } this.serverLabelInput =new dijit.form.FilteringSelect({ labelAttr: "name", valueAttr: "name", searchAttr: "name", value: "", store: this.getReadStore("../sms/Tm1/servers/" + _propDialog.properties.label.value), onChange : function (value) { _propDialog.properties.serverLabel.value = this.attr('value'); _propDialog.refreshCubes(); } }, document.createElement('div')); dojo.place(this.serverLabelInput.domNode, this.id + "_serverLabelInput"); }, generateWidgetPropertiesUI: function() { var _propDialog = this; this.labelInput = new dijit.form.TextBox({ value: _propDialog.properties.label }); this.webLabelInput = new dijit.form.TextBox({ value: _propDialog.properties.webLabel }); this.serverLabelInput =new dijit.form.TextBox({ labelAttr: "name", valueAttr: "name", searchAttr: "name", value: _propDialog.properties.serverLabel }, document.createElement('div')); this.cubeLabelInput = new dijit.form.TextBox({ labelAttr: "name", valueAttr: "name", searchAttr: "name", value: _propDialog.properties.cubeLabel }, document.createElement('div')); this.cubeViewLabelInput = new dijit.form.TextBox({ labelAttr: "name", valueAttr: "name", searchAttr: "name", value: _propDialog.properties.cubeViewLabel }, document.createElement('div')); this.accessLabelInput = new dijit.form.TextBox({ labelAttr: "name", valueAttr: "name", searchAttr: "name", value: _propDialog.properties.accessLabel }, document.createElement('div')); this.userNameLabelInput = new dijit.form.TextBox({ labelAttr: "name", valueAttr: "name", searchAttr: "name", value: _propDialog.properties.userNameLabel }, document.createElement('div')); this.passwordLabelInput = new dijit.form.TextBox({ labelAttr: "name", valueAttr: "name", searchAttr: "name", value: _propDialog.properties.passwordLabel }, document.createElement('div')); var configHTML; if (this.firstLine) { configHTML = '
' + this.firstLine + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
'; } else { configHTML = '
' + ' Specify the cubeView Information ' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
'; } this.domNode.innerHTML = configHTML.replace(/\{\$ID\}/g, this.id); if (this.firstLine) { dojo.place(this.webLabelInput.domNode, this.id + "_webLabelInput"); dojo.place(this.accessLabelInput.domNode, this.id + "_accessLabelInput"); } dojo.place(this.labelInput.domNode, this.id + "_labelInput"); dojo.place(this.serverLabelInput.domNode, this.id + "_serverLabelInput"); dojo.place(this.cubeLabelInput.domNode, this.id + "_cubeLabelInput"); dojo.place(this.cubeViewLabelInput.domNode, this.id + "_cubeViewLabelInput"); dojo.place(this.userNameLabelInput.domNode, this.id + "_userNameLabelInput"); dojo.place(this.passwordLabelInput.domNode, this.id + "_passwordLabelInput"); }, onOk: function() { if (this.okPropertiesCallback) { this.okPropertiesCallback(); return; } this.inherited(arguments); }, onCancel: function() { if (this.cancelPropertiesCallback) { this.cancelPropertiesCallback(); return; } this.inherited(arguments); }, sizeToFitContents: function(){ if (dojo.isIE || dojo.isTrident) { //This needs to be revisited at some point, however because of the //manner in which this dialog is populated, IE cannot properly size this tab. dojo.contentBox(this.domNode, { w: 440, h: 472 }); } else { this.inherited(arguments); } }, destroy: function () { this.inherited(arguments); if (this.cubeViewLabelInput != null) { this.cubeViewLabelInput.destroy(); } }, validate: function (){ var _bValid = true; if (!_bValid){ this.disableOK(true); }else{ this.disableOK(false); } return _bValid; } } );