123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- /*
- *+------------------------------------------------------------------------+
- *| 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 =
- '<div id="{$ID}_configDescription" class="bux-widgetPropertiesDialog-ItemSpacing bux-dialog-info">' + this.firstLine + '</div>' +
- '<br/>' +
- '<div id="{$ID}_setLabel">' +
- '<div><label for="' + this.webLabelInput.id + '" class="bux-dialog-label">' + ' TM1Web Url: ' + '</label></div>' +
- '<div><span id="{$ID}_webLabelInput"></span></div>' +
- '</div>' +
- '<br/>' +
- '<div id="{$ID}_setLabel">' +
- '<div><label for="' + this.labelInput.id + '" class="bux-dialog-label">' + ' TM1 Host: ' + '</label></div>' +
- '<div><span id="{$ID}_labelInput"></span></div>' +
- '</div>' +
- '<br/>' +
- '<div id="{$ID}_setServerLabel">' +
- '<div><label for="' + this.serverLabelInput.id + '" class="bux-dialog-label">' + ' Server: ' + '</label></div>' +
- '<div><span id="{$ID}_serverLabelInput"></span></div>' +
- '</div>' +
- '<br/>' +
- '<div id="{$ID}_setCubeLabel">' +
- '<div><label for="' + this.cubeLabelInput.id + '" class="bux-dialog-label">' + ' Cube: ' + '</label></div>' +
- '<div><span id="{$ID}_cubeLabelInput"></span></div>' +
- '</div>' +
- '<br/>' +
- '<div id="{$ID}_setCubeViewLabel">' +
- '<div><label for="' + this.cubeViewLabelInput.id + '" class="bux-dialog-label">' + ' CubeView: ' + '</label></div>' +
- '<div><span id="{$ID}_cubeViewLabelInput"></span></div>' +
- '</div>' +
- '<br/>' +
- '<div id="{$ID}_setAccessLabel">' +
- '<div><label for="' + this.accessLabelInput.id + '" class="bux-dialog-label">' + ' AccessType: ' + '</label></div>' +
- '<div><span id="{$ID}_accessLabelInput"></span></div>' +
- '</div>' +
- '<br/>' +
- '<div id="{$ID}_setUserNameLabel">' +
- '<div><label for="' + this.userNameLabelInput.id + '" class="bux-dialog-label">' + ' UserName: ' + '</label></div>' +
- '<div><span id="{$ID}_userNameLabelInput"></span></div>' +
- '</div>' +
- '<br/>' +
- '<div id="{$ID}_setPasswordLabel">' +
- '<div><label for="' + this.passwordLabelInput.id + '" class="bux-dialog-label">' + ' Password: ' + '</label></div>' +
- '<div><span id="{$ID}_passwordLabelInput"></span></div>' +
- '</div>';
- } else {
- configHTML =
- '<div id="{$ID}_configDescription" class="bux-widgetPropertiesDialog-ItemSpacing bux-dialog-info">' + ' Specify the cubeView Information ' + '</div>' +
- '<br/>' +
- '<div id="{$ID}_setLabel">' +
- '<div><label for="' + this.labelInput.id + '" class="bux-dialog-label">' + ' TM1 Host: ' + '</label></div>' +
- '<div><span id="{$ID}_labelInput"></span></div>' +
- '</div>' +
- '<br/>' +
- '<div id="{$ID}_setServerLabel">' +
- '<div><label for="' + this.serverLabelInput.id + '" class="bux-dialog-label">' + ' Server: ' + '</label></div>' +
- '<div><span id="{$ID}_serverLabelInput"></span></div>' +
- '</div>' +
- '<br/>' +
- '<div id="{$ID}_setCubeLabel">' +
- '<div><label for="' + this.cubeLabelInput.id + '" class="bux-dialog-label">' + ' Cube: ' + '</label></div>' +
- '<div><span id="{$ID}_cubeLabelInput"></span></div>' +
- '</div>' +
- '<br/>' +
- '<div id="{$ID}_setCubeViewLabel">' +
- '<div><label for="' + this.cubeViewLabelInput.id + '" class="bux-dialog-label">' + ' CubeView: ' + '</label></div>' +
- '<div><span id="{$ID}_cubeViewLabelInput"></span></div>' +
- '</div>' +
- '<br/>' +
- '<div id="{$ID}_setUserNameLabel">' +
- '<div><label for="' + this.userNameLabelInput.id + '" class="bux-dialog-label">' + ' UserName: ' + '</label></div>' +
- '<div><span id="{$ID}_userNameLabelInput"></span></div>' +
- '</div>' +
- '<br/>' +
- '<div id="{$ID}_setPasswordLabel">' +
- '<div><label for="' + this.passwordLabelInput.id + '" class="bux-dialog-label">' + ' Password: ' + '</label></div>' +
- '<div><span id="{$ID}_passwordLabelInput"></span></div>' +
- '</div>';
- }
- 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;
- }
- }
- );
|