123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638 |
- /*
- *+------------------------------------------------------------------------+
- *| 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.
- *|
- *+------------------------------------------------------------------------+
- */
- // create script variables used to store TM1 callbacks
- var COGNOS_TM1_cubeWgtToolbarFuncs;
- var COGNOS_TM1_cubeWgtFilterFuncs;
- dojo.require("dojo.string");
- dojo.require("dojo._base.array");
- dojo.require("bux.i18n");
- dojo.require("bux.Helper");
- dojo.require("bux.data.UserPreferencesStore");
- dojo.provide("tm1ContentCubeViewerWidget");
- dojo.declare("tm1ContentCubeViewerWidget", null, {
- iframeCtrl: null,
- _paramgizmo_id: null,
- returnURL: null,
- initialHeight: 286,
- xmlhttp: null,
- commonDomain: null,
- bTurnOffCallbacks: false,
- tm1Toolbar: null,
- _currentRole: null,
- // ====== DefaultSize Support - Start ========
- _defaultWidth:700,
- _defaultHeight:400,
- _firstRender:true,
- // ====== DefaultSize Support - End ========
- // ====== Multilingual Support - Start ========
- _productLocale:null,
- _tm1messages:null,
- // ====== Multilingual Support - End ========
- _firstVisible:false,
-
- onSetVisible: function(evt) {
- if(!this._firstVisible && evt.payload.isVisible) {
- this._firstVisible = true;
- }
- },
- onLoad: function(evt) {
- if(!this._firstVisible && this.iContext._mm.widget.widgetInstance.itemSets.buxdelayedload.widgetVisible.value == "false") {
- setTimeout(dojo.hitch(this, this.onLoad), 50);
- return;
- }
- this._firstVisible = true;
-
- // ====== Multilingual Support - Start ========
- // Remember where we were loaded from: this is our path for future AJAX calls and .js loads
- dojo.registerModulePath("tm1ContentCubeViewerWidget",this.iContext.io.rewriteURI("js"));
- this.setLanguage().then(dojo.hitch(this, "continueOnLoad"));
- // ====== Multilingual Support - End ========
- },
- continueOnLoad: function() {
- this.getRole();
- this.createBasicWidgetToolbar();
- this.getWidgetAttributes();
- if (this.areTM1ParametersValid ()) {
- this.refreshView();
- } else {
- this.onGetProperties(null, true);
- }
- // ====== DefaultSize Support - Start ========
- //Delay the creation of some dynamic content to allow the widget to render first,
- //otherwise the dojo controlscannot properly render within its allowed real-estate.
- setTimeout(dojo.hitch(this,this.postLoadInit),1);
- // ====== DefaultSize Support - End ========
- },
-
- // ====== DefaultSize Support - Start ========
- postLoadInit: function()
- {
- // In this function, create the dynamic contents of the iWidget that are dojo objects based on dynamic HTML
-
- // call auto resize if it's the first time and is this widget was never saved.
- if (this._firstRender == true) {
- this._firstRender = false;
- var setDefaultSize = this.iContext.getiWidgetAttributes().getItemValue("setDefaultSize");
- if (setDefaultSize == "1") {
- // Next time the container dashboard loads, the default size must be ignored - as desired
- this.iContext.getiWidgetAttributes().setItemValue("setDefaultSize", "0");
- this.setPreferredSize();
- }
- }
- },
-
- getChrome: function() {
- var chromeObjectId = bux.Helper.widgetIdToChromeId(this.iContext.widgetId);
- var chromeObject = bux.Helper.getChromeById(chromeObjectId);
- return chromeObject;
- },
-
- setPreferredSize: function() {
- var chromeObject = this.getChrome();
- var newSize = {h: this._defaultHeight, w : this._defaultWidth};
- chromeObject.setPreferredSize(newSize);
- chromeObject.doChromeAutoResize();
- },
-
- // ====== DefaultSize Support - End ========
- // ====== Multilingual Support - Start ========
- updateView: function() {
- this.setLanguage();
- },
-
- setLanguage: function() {
- // Setup Localization tables - Use the BUX preferences for locale. Use Product locale for loading strings
- var curProductLocale=bux.Helper.getUserPreference("productLocale");
- if (this._productLocale != curProductLocale)
- {
- this._productLocale = curProductLocale;
- var deferred = new dojo.Deferred();
- var self = this;
- dojo.requireLocalization("tm1ContentCubeViewerWidget", "tm1ContentCubeViewerWidget_msg", curProductLocale);
- dojo.ready(function() {
- self._tm1messages = dojo.i18n.getLocalization("tm1ContentCubeViewerWidget", "tm1ContentCubeViewerWidget_msg", curProductLocale);
- deferred.resolve();
- });
-
- return deferred;
- }
- },
-
- // ====== Multilingual Support - End ========
- getRole: function () {
- if( this.iContext ) {
- var userProfileItemSet = this.iContext.getItemSet("buxuserprofile", false);
- if( userProfileItemSet ){
- var role = userProfileItemSet.getItemValue("currentUserRole");
- if( role && bux.UserRole.isValidRole(role) ) {
- this._currentRole = role;
- }
- }
- }
- },
- createBasicWidgetToolbar: function () {
- if (this.bTurnOffCallbacks) {
- var toolbarItems =
- [
- {
- _root:
- [
- {separator: true },
- {name: "Restart", action: "IDM_RESTART", label: this._tm1messages.MEN.TMX_MEN_BLUEDOT_RESTART, showLabel: false, "iconClass": "tutorial-toolbar-icon-canada"}
- ]
- }
- ];
- this.iContext.iEvents.fireEvent("com.ibm.bux.widgetchrome.toolbar.init", null, toolbarItems);
- } else {
- var toolbarItems =
- [
- {
- _root:
- [
- {separator: true },
- {name: "Refresh", action: "IDM_RECALCULATE", label: this._tm1messages.MEN.TMX_MEN_BLUEDOT_REFRESH, showLabel: false, "iconClass": "bux-refresh-image"},
- {name: "Reset", action: "IDM_RESET", label: this._tm1messages.MEN.TMX_MEN_BLUEDOT_RESET, showLabel: false, "iconClass": "tutorial-toolbar-icon-canada"},
- {name: "Restart", action: "IDM_RESTART", label: this._tm1messages.MEN.TMX_MEN_BLUEDOT_RESTART, showLabel: false, "iconClass": "tutorial-toolbar-icon-canada"}
- ]
- }
- ];
- this.iContext.iEvents.fireEvent("com.ibm.bux.widgetchrome.toolbar.init", null, toolbarItems);
- }
- },
- fireFilterChanged: function (dimName, subsetName, elemName) {
- var extraParams = "title_";
- extraParams += dimName;
- extraParams += "=";
- extraParams += encodeURIComponent(elemName);
- this.iContext.iEvents.fireEvent("Context filter change", null, extraParams);
- },
- createWidgetToolbar: function (inToolbar) {
- var temptoolbarItems;
- this.tm1Toolbar = inToolbar;
- var toolbarItems =
- [
- {
- _root:
- [
- {separator: true },
- {name: "Refresh", action: "IDM_RECALCULATE", label: this._tm1messages.MEN.TMX_MEN_BLUEDOT_REFRESH, showLabel: false, "iconClass": "bux-refresh-image"},
- {name: "Reset", action: "IDM_RESET", label: this._tm1messages.MEN.TMX_MEN_BLUEDOT_RESET, showLabel: false, "iconClass": "tutorial-toolbar-icon-canada"},
- {name: "Restart", action: "IDM_RESTART", label: this._tm1messages.MEN.TMX_MEN_BLUEDOT_RESTART, showLabel: false, "iconClass": "tutorial-toolbar-icon-canada"}
- ]
- }
- ];
- toolbarItems = this.addToolbutton(toolbarItems, "IDM_COMMIT");
- toolbarItems = this.addToolbutton(toolbarItems, "IDM_SAVEVIEW");
- toolbarItems = this.addToolbutton(toolbarItems, "IDM_SAVEAS");
- toolbarItems = this.addToolbuttonWithSubmenu (toolbarItems, "IDM_EXPORT");
- toolbarItems = this.addSeparator(toolbarItems);
- toolbarItems = this.addToolbutton(toolbarItems, "IDM_SAVEDATACHANGES");
- toolbarItems = this.addToolbutton(toolbarItems, "IDM_REVIEWDATACHANGES");
- toolbarItems = this.addSeparator(toolbarItems);
- toolbarItems = this.addToolbutton(toolbarItems, "IDM_RECALCULATE");
- toolbarItems = this.addToolbutton(toolbarItems, "IDM_TOGGLE_AUTOMATICRECALCULATE");
- toolbarItems = this.addToolbuttonWithSubmenu (toolbarItems, "IDM_SUPPRESS_ZEROS");
- toolbarItems = this.addSeparator(toolbarItems);
- toolbarItems = this.addToolbutton(toolbarItems, "IDM_CHART");
- toolbarItems = this.addToolbutton(toolbarItems, "IDM_CHARTANDGRID");
- toolbarItems = this.addToolbutton(toolbarItems, "IDM_GRID");
- toolbarItems = this.addToolbuttonWithSubmenu (toolbarItems, "IDM_CHART-SELECT");
- toolbarItems = this.addSeparator(toolbarItems);
- toolbarItems = this.addToolbutton(toolbarItems, "IDM_RESET_DATA");
- toolbarItems = this.addToolbutton(toolbarItems, "IDM_SANDBOX_UNDO");
- toolbarItems = this.addToolbutton(toolbarItems, "IDM_SANDBOX_REDO");
- toolbarItems = this.addSeparator(toolbarItems);
- toolbarItems = this.addToolbuttonWithSubmenu (toolbarItems, "IDM_SANDBOX");
- toolbarItems = this.addToolbuttonWithSubmenu (toolbarItems, "IDM_SANDBOXITEMS");
- this.iContext.iEvents.fireEvent("com.ibm.bux.widgetchrome.toolbar.init", null, toolbarItems);
- },
- addSeparator: function (toolbarItems) {
- var separator = { "separator": true };
- return toolbarItems.concat(separator);
- },
-
- addToolbutton: function (toolbarItems, toolbarAction) {
- if (this.isToolbuttonVisible(toolbarAction)) {
- return toolbarItems.concat(this.createSimpleToolbutton(toolbarAction));
- } else {
- return toolbarItems;
- }
- },
-
- addToolbuttonWithSubmenu: function (toolbarItems, toolbarAction) {
- if (this.isToolbuttonVisible(toolbarAction)) {
- return toolbarItems.concat(this.createToolbuttonWithSubmenu(toolbarAction));
- } else {
- return toolbarItems;
- }
- },
-
- createSimpleToolbutton: function (toolbarAction) {
- var toolbutton = {
- "name" : toolbarAction,
- "action" : toolbarAction,
- "label": this.getToolbuttonTooltip(toolbarAction),
- "iconClass": this.getToolbuttonImage(toolbarAction),
- "disabled": this.isToolbuttonDisabled(toolbarAction)
- }
- return toolbutton;
- },
- appendSandboxMenuChoice: function (menuItems, sandboxIndex, sandboxName, activeSandbox) {
- var toolbarAction = "SANDBOXCHOICE" + sandboxIndex;
- var toolbutton = {
- "name" : toolbarAction,
- "action" : toolbarAction,
- "label": sandboxName,
- "iconClass": (activeSandbox == sandboxName ? "tm1-menu-radioselection" : "tm1-menu-empty")
- }
- return menuItems.concat(toolbutton);
- },
- createToolbuttonWithSubmenu: function (toolbarAction) {
- var menuitems = null;
- if (toolbarAction == "IDM_EXPORT") {
- var menuItems = [];
- menuItems = this.addToolbutton(menuItems, "IDM_SLICE_TO_EXCEL");
- menuItems = this.addToolbutton(menuItems, "IDM_SNAPSHOT_TO_EXCEL");
- menuItems = this.addToolbutton(menuItems, "IDM_EXPORT_TO_PDF");
- var toolbutton = {
- "name" : toolbarAction,
- "action" : toolbarAction,
- "label": this.getToolbuttonTooltip(toolbarAction),
- "iconClass": this.getToolbuttonImage(toolbarAction),
- "disabled": this.isToolbuttonDisabled(toolbarAction),
- "items" : menuItems
- }
- return toolbutton;
- } else if (toolbarAction == "IDM_SUPPRESS_ZEROS") {
- var menuItems = [];
- menuItems = this.addToolbutton(menuItems, "IDM_SUPPRESS_ZEROS_ROWS_COLUMNS");
- menuItems = this.addToolbutton(menuItems, "IDM_SUPPRESS_ZEROS_ROWS");
- menuItems = this.addToolbutton(menuItems, "IDM_SUPPRESS_ZEROS_COLUMNS");
- var toolbutton = {
- "name" : toolbarAction,
- "action" : toolbarAction,
- "label": this.getToolbuttonTooltip(toolbarAction),
- "iconClass": this.getToolbuttonImage(toolbarAction),
- "disabled": this.isToolbuttonDisabled(toolbarAction),
- "items" : menuItems
- }
- return toolbutton;
- } else if (toolbarAction == "IDM_CHART-SELECT") {
- var menuItems = [];
- menuItems = this.addToolbuttonWithSubmenu (menuItems, "IDM_CHARTTYPE");
- menuItems = this.addToolbuttonWithSubmenu (menuItems, "IDM_CHARTPALETTE");
- menuItems = this.addToolbutton(menuItems, "IDM_SHOWLEGEND");
- menuItems = this.addToolbutton(menuItems, "IDM_3DVIEW");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_PROPERTIES");
- var toolbutton = {
- "name" : toolbarAction,
- "action" : toolbarAction,
- "label": this.getToolbuttonTooltip(toolbarAction),
- "iconClass": this.getToolbuttonImage(toolbarAction),
- "disabled": this.isToolbuttonDisabled(toolbarAction),
- "items" : menuItems
- }
- return toolbutton;
- } else if (toolbarAction == "IDM_CHARTTYPE") {
- var menuItems = [];
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_POINT");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_BUBBLE");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_LINE");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_SPLINE");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_STEPLINE");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_FASTLINE");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_BAR");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_STACKEDBAR");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_STACKEDBAR100");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_COLUMN");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_STACKEDCOLUMN");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_STACKEDCOLUMN100");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_AREA");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_STACKEDAREA");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_STACKEDAREA100");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_PIE");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_DOUGHNUT");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_STOCK");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_CANDLESTICK");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_RANGE");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_SPLINERANGE");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_GANTT");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_RANGECOLUMN");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_RADAR");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_POLAR");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_BOXPLOT");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_FUNNEL");
- menuItems = this.addToolbutton(menuItems, "IDM_CHART_PYRAMID");
- var toolbutton = {
- "name" : toolbarAction,
- "action" : toolbarAction,
- "label": this.getToolbuttonTooltip(toolbarAction),
- "iconClass": this.getToolbuttonImage(toolbarAction),
- "disabled": this.isToolbuttonDisabled(toolbarAction),
- "items" : menuItems
- }
- return toolbutton;
- } else if (toolbarAction == "IDM_CHARTPALETTE") {
- var menuItems = [];
- menuItems = this.addToolbutton(menuItems, "IDM_PALETTE_DEFAULT");
- menuItems = this.addToolbutton(menuItems, "IDM_PALETTE_STEEL");
- menuItems = this.addToolbutton(menuItems, "IDM_PALETTE_EARTH");
- menuItems = this.addToolbutton(menuItems, "IDM_PALETTE_GRAYS");
- menuItems = this.addToolbutton(menuItems, "IIDM_PALETTE_TRANSPARENT");
- menuItems = this.addToolbutton(menuItems, "IDM_PALETTE_EXCEL");
- menuItems = this.addToolbutton(menuItems, "IDM_PALETTE_BEIGE");
- menuItems = this.addToolbutton(menuItems, "IDM_PALETTE_BERRY");
- menuItems = this.addToolbutton(menuItems, "IDM_PALETTE_FIRE");
- menuItems = this.addToolbutton(menuItems, "IDM_PALETTE_GREEN");
- var toolbutton = {
- "name" : toolbarAction,
- "action" : toolbarAction,
- "label": this.getToolbuttonTooltip(toolbarAction),
- "iconClass": this.getToolbuttonImage(toolbarAction),
- "disabled": this.isToolbuttonDisabled(toolbarAction),
- "items" : menuItems
- }
- return toolbutton;
- } else if (toolbarAction == "IDM_SANDBOX") {
- var menuItems = [];
- menuItems = this.addToolbutton(menuItems, "IDM_CREATE_SANDBOX");
- menuItems = this.addToolbutton(menuItems, "IDM_DELETE_SANDBOX");
- var toolbutton = {
- "name" : toolbarAction,
- "action" : toolbarAction,
- "label": this.getToolbuttonTooltip(toolbarAction),
- "iconClass": this.getToolbuttonImage(toolbarAction),
- "disabled": this.isToolbuttonDisabled(toolbarAction),
- "items" : menuItems
- }
- return toolbutton;
- } else if (toolbarAction == "IDM_SANDBOXITEMS") {
- var menuItems = [];
- menuItems = this.appendSandboxMenuChoice(menuItems, 0, "[Base]", this.tm1Toolbar.ToolbarInfo.Sandbox.ActiveSandbox);
- if (this.tm1Toolbar.ToolbarInfo.Sandbox.SandboxList.length > 0) {
- for (i=0; i<this.tm1Toolbar.ToolbarInfo.Sandbox.SandboxList.length; i++) {
- menuItems = this.appendSandboxMenuChoice(menuItems, i+1, this.tm1Toolbar.ToolbarInfo.Sandbox.SandboxList[i], this.tm1Toolbar.ToolbarInfo.Sandbox.ActiveSandbox);
- }
- }
- var toolbutton = {
- "name" : toolbarAction,
- "action" : toolbarAction,
- "label": this.getToolbuttonTooltip(toolbarAction),
- "iconClass": this.getToolbuttonImage(toolbarAction),
- "disabled": this.isToolbuttonDisabled(toolbarAction),
- "items" : menuItems
- }
- return toolbutton;
- }
-
- var toolbutton = {
- "name" : toolbarAction,
- "action" : toolbarAction,
- "label": this.getToolbuttonTooltip(toolbarAction),
- "iconClass": this.getToolbuttonImage(toolbarAction),
- "disabled": this.isToolbuttonDisabled(toolbarAction),
- "items" : menuitems
- }
- return toolbutton;
- },
- getSandboxName: function(sandboxId) {
- if (sandboxId == 1) {
- return "[Base]";
- } else {
- return this.tm1Toolbar.ToolbarInfo.Sandbox.SandboxList[sandboxId - 1];
- }
- },
-
- getSandboxCheck: function (sandboxId) {
- if (this.getSandboxName(sandboxId) == this.tm1Toolbar.ToolbarInfo.Sandbox.ActiveSandbox) {
- return "tm1-menu-radioselection";
- } else {
- return "tm1-menu-empty";
- }
- },
-
- isToolbuttonVisible: function(toolbarAction) {
- if (toolbarAction == "IDM_SUPPRESS_ZEROS") {
- return this.tm1Toolbar.ToolbarInfo.SuppressZerosButton != null && this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.IsAdded;
- } else if (toolbarAction == "IDM_COMMIT") {
- return this.tm1Toolbar.ToolbarInfo.CommitSandboxButton != null && this.tm1Toolbar.ToolbarInfo.CommitSandboxButton.IsAdded;
- } else if (toolbarAction == "IDM_SAVEVIEW") {
- return this.tm1Toolbar.ToolbarInfo.SaveViewButton != null && this.tm1Toolbar.ToolbarInfo.SaveViewButton.IsAdded;
- } else if (toolbarAction == "IDM_SAVEAS") {
- return this.tm1Toolbar.ToolbarInfo.SaveAsViewButton != null && this.tm1Toolbar.ToolbarInfo.SaveAsViewButton.IsAdded;
- } else if (toolbarAction == "IDM_EXPORT") {
- return this.tm1Toolbar.ToolbarInfo.ExportButton != null && this.tm1Toolbar.ToolbarInfo.ExportButton.IsAdded;
- } else if (toolbarAction == "IDM_SLICE_TO_EXCEL") {
- return this.tm1Toolbar.ToolbarInfo.ExportButton != null && this.tm1Toolbar.ToolbarInfo.ExportButton.MenuItemSlice != null && this.tm1Toolbar.ToolbarInfo.ExportButton.MenuItemSlice.IsAdded;
- } else if (toolbarAction == "IDM_SNAPSHOT_TO_EXCEL") {
- return this.tm1Toolbar.ToolbarInfo.ExportButton != null && this.tm1Toolbar.ToolbarInfo.ExportButton.MenuItemSnapshot != null && this.tm1Toolbar.ToolbarInfo.ExportButton.MenuItemSnapshot.IsAdded;
- } else if (toolbarAction == "IDM_EXPORT_TO_PDF") {
- return this.tm1Toolbar.ToolbarInfo.ExportButton != null && this.tm1Toolbar.ToolbarInfo.ExportButton.MenuItemExportPDF != null && this.tm1Toolbar.ToolbarInfo.ExportButton.MenuItemExportPDF.IsAdded;
- } else if (toolbarAction == "IDM_SAVEDATACHANGES") {
- return this.tm1Toolbar.ToolbarInfo.SaveDataChangesButton != null && this.tm1Toolbar.ToolbarInfo.SaveDataChangesButton.IsAdded;
- } else if (toolbarAction == "IDM_REVIEWDATACHANGES") {
- return this.tm1Toolbar.ToolbarInfo.ReviewDataChangesButton != null && this.tm1Toolbar.ToolbarInfo.ReviewDataChangesButton.IsAdded;
- } else if (toolbarAction == "IDM_RECALCULATE") {
- return this.tm1Toolbar.ToolbarInfo.RecalcButton != null && this.tm1Toolbar.ToolbarInfo.RecalcButton.IsAdded;
- } else if (toolbarAction == "IDM_TOGGLE_AUTOMATICRECALCULATE") {
- return this.tm1Toolbar.ToolbarInfo.AutoRecalcButton != null && this.tm1Toolbar.ToolbarInfo.AutoRecalcButton.IsAdded;
- } else if (toolbarAction == "IDM_SUPPRESS_ZEROS_ROWS_COLUMNS") {
- return this.tm1Toolbar.ToolbarInfo.SuppressZerosButton != null && this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZeros != null && this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZeros.IsAdded;
- } else if (toolbarAction == "IDM_SUPPRESS_ZEROS_ROWS") {
- return this.tm1Toolbar.ToolbarInfo.SuppressZerosButton != null && this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZerosOnRows != null && this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZerosOnRows.IsAdded;
- } else if (toolbarAction == "IDM_SUPPRESS_ZEROS_COLUMNS") {
- return this.tm1Toolbar.ToolbarInfo.SuppressZerosButton != null && this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZerosOnColumns != null && this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZerosOnColumns.IsAdded;
- } else if (toolbarAction == "IDM_CHART") {
- return this.tm1Toolbar.ToolbarInfo.ViewChartButton != null && this.tm1Toolbar.ToolbarInfo.ViewChartButton.IsAdded;
- } else if (toolbarAction == "IDM_CHARTANDGRID") {
- return this.tm1Toolbar.ToolbarInfo.ViewChartGridButton != null && this.tm1Toolbar.ToolbarInfo.ViewChartGridButton.IsAdded;
- } else if (toolbarAction == "IDM_GRID") {
- return this.tm1Toolbar.ToolbarInfo.ViewGridButton != null && this.tm1Toolbar.ToolbarInfo.ViewGridButton.IsAdded;
- } else if (toolbarAction == "IDM_CHART-SELECT") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.IsAdded;
- } else if (toolbarAction == "IDM_CHARTTYPE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_POINT") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_BUBBLE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_LINE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_SPLINE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_STEPLINE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_FASTLINE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_BAR") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_STACKEDBAR") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_STACKEDBAR100") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_COLUMN") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_STACKEDCOLUMN") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_STACKEDCOLUMN100") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_AREA") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_SPLINEAREA") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_STACKEDAREA") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_STACKEDAREA100") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_PIE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_DOUGHNUT") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_STOCK") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_CANDLESTICK") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_RANGE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_SPLINERANGE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_GANTT") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_RANGECOLUMN") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_RADAR") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_POLAR") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_BOXPLOT") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_FUNNEL") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHART_PYRAMID") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsAdded;
- } else if (toolbarAction == "IDM_CHARTPALETTE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsAdded;
- } else if (toolbarAction == "IDM_PALETTE_DEFAULT") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsAdded;
- } else if (toolbarAction == "IDM_PALETTE_STEEL") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsAdded;
- } else if (toolbarAction == "IDM_PALETTE_EARTH") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsAdded;
- } else if (toolbarAction == "IDM_PALETTE_GRAYS") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsAdded;
- } else if (toolbarAction == "IDM_PALETTE_TRANSPARENT") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsAdded;
- } else if (toolbarAction == "IDM_PALETTE_EXCEL") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsAdded;
- } else if (toolbarAction == "IDM_PALETTE_BEIGE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsAdded;
- } else if (toolbarAction == "IDM_PALETTE_BERRY") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsAdded;
- } else if (toolbarAction == "IDM_PALETTE_CHOCOLATE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsAdded;
- } else if (toolbarAction == "IDM_PALETTE_FIRE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsAdded;
- } else if (toolbarAction == "IDM_PALETTE_GREEN") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsAdded;
- } else if (toolbarAction == "IDM_SHOWLEGEND") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemToggleChartLegend.IsAdded;
- } else if (toolbarAction == "IDM_3DVIEW") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemToggle3DView.IsAdded;
- } else if (toolbarAction == "IDM_CHART_PROPERTIES") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton != null && this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.ChartPropertiesMenuItemChartProperties.IsAdded;
- } else if (toolbarAction == "IDM_RESET_DATA") {
- return this.tm1Toolbar.ToolbarInfo.ResetSandboxButton != null && this.tm1Toolbar.ToolbarInfo.ResetSandboxButton.IsAdded;
- } else if (toolbarAction == "IDM_SANDBOX_UNDO") {
- return this.tm1Toolbar.ToolbarInfo.UndoButton != null && this.tm1Toolbar.ToolbarInfo.UndoButton.IsAdded;
- } else if (toolbarAction == "IDM_SANDBOX_REDO") {
- return this.tm1Toolbar.ToolbarInfo.RedoButton != null && this.tm1Toolbar.ToolbarInfo.RedoButton.IsAdded;
- } else if (toolbarAction == "IDM_SANDBOX") {
- return this.tm1Toolbar.ToolbarInfo.SandboxButton != null && this.tm1Toolbar.ToolbarInfo.SandboxButton.IsAdded;
- } else if (toolbarAction == "IDM_CREATE_SANDBOX") {
- return this.tm1Toolbar.ToolbarInfo.SandboxButton != null && this.tm1Toolbar.ToolbarInfo.SandboxButton.MenuItemCreateSandbox != null && this.tm1Toolbar.ToolbarInfo.SandboxButton.MenuItemCreateSandbox.IsAdded;
- } else if (toolbarAction == "IDM_DELETE_SANDBOX") {
- return this.tm1Toolbar.ToolbarInfo.SandboxButton != null && this.tm1Toolbar.ToolbarInfo.SandboxButton.MenuItemDeleteSandbox != null && this.tm1Toolbar.ToolbarInfo.SandboxButton.MenuItemDeleteSandbox.IsAdded;
- } else if (toolbarAction == "IDM_SANDBOXITEMS") {
- return this.tm1Toolbar.ToolbarInfo.SandboxButton != null && this.tm1Toolbar.ToolbarInfo.SandboxButton.IsAdded;
- }
-
- return false;
-
- },
- isToolbuttonDisabled: function(toolbarAction) {
- if (toolbarAction == "IDM_SUPPRESS_ZEROS") {
- return (this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_COMMIT") {
- return (this.tm1Toolbar.ToolbarInfo.CommitSandboxButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_SAVEVIEW") {
- return (this.tm1Toolbar.ToolbarInfo.SaveViewButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_SAVEAS") {
- return (this.tm1Toolbar.ToolbarInfo.SaveAsViewButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_EXPORT") {
- return (this.tm1Toolbar.ToolbarInfo.ExportButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_SLICE_TO_EXCEL") {
- return (this.tm1Toolbar.ToolbarInfo.ExportButton.MenuItemSlice.IsEnabled == false);
- } else if (toolbarAction == "IDM_SNAPSHOT_TO_EXCEL") {
- return (this.tm1Toolbar.ToolbarInfo.ExportButton.MenuItemSnapshot.IsEnabled == false);
- } else if (toolbarAction == "IDM_EXPORT_TO_PDF") {
- return (this.tm1Toolbar.ToolbarInfo.ExportButton.MenuItemExportPDF.IsEnabled == false);
- } else if (toolbarAction == "IDM_SAVEDATACHANGES") {
- return (this.tm1Toolbar.ToolbarInfo.SaveDataChangesButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_REVIEWDATACHANGES") {
- return (this.tm1Toolbar.ToolbarInfo.ReviewDataChangesButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_RECALCULATE") {
- return (this.tm1Toolbar.ToolbarInfo.RecalcButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_TOGGLE_AUTOMATICRECALCULATE") {
- return (this.tm1Toolbar.ToolbarInfo.AutoRecalcButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_SUPPRESS_ZEROS_ROWS_COLUMNS") {
- return ( this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZeros.IsEnabled == false);
- } else if (toolbarAction == "IDM_SUPPRESS_ZEROS_ROWS") {
- return (this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZerosOnRows.IsEnabled == false);
- } else if (toolbarAction == "IDM_SUPPRESS_ZEROS_COLUMNS") {
- return (this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZerosOnColumns.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART") {
- return (this.tm1Toolbar.ToolbarInfo.ViewChartButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHARTANDGRID") {
- return (this.tm1Toolbar.ToolbarInfo.ViewChartGridButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_GRID") {
- return (this.tm1Toolbar.ToolbarInfo.ViewGridButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART-SELECT") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHARTTYPE") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_POINT") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_BUBBLE") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_LINE") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_SPLINE") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_STEPLINE") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_FASTLINE") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_BAR") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_STACKEDBAR") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_STACKEDBAR100") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_COLUMN") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_STACKEDCOLUMN") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_STACKEDCOLUMN100") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_AREA") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_SPLINEAREA") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_STACKEDAREA") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_STACKEDAREA100") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_PIE") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_DOUGHNUT") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_STOCK") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_CANDLESTICK") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_RANGE") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_SPLINERANGE") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_GANTT") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_RANGECOLUMN") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_RADAR") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_POLAR") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_BOXPLOT") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_FUNNEL") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_PYRAMID") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHARTPALETTE") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsEnabled == false);
- } else if (toolbarAction == "IDM_PALETTE_DEFAULT") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsEnabled == false);
- } else if (toolbarAction == "IDM_PALETTE_STEEL") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsEnabled == false);
- } else if (toolbarAction == "IDM_PALETTE_EARTH") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsEnabled == false);
- } else if (toolbarAction == "IDM_PALETTE_GRAYS") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsEnabled == false);
- } else if (toolbarAction == "IDM_PALETTE_TRANSPARENT") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsEnabled == false);
- } else if (toolbarAction == "IDM_PALETTE_EXCEL") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsEnabled == false);
- } else if (toolbarAction == "IDM_PALETTE_BEIGE") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsEnabled == false);
- } else if (toolbarAction == "IDM_PALETTE_BERRY") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsEnabled == false);
- } else if (toolbarAction == "IDM_PALETTE_CHOCOLATE") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsEnabled == false);
- } else if (toolbarAction == "IDM_PALETTE_FIRE") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsEnabled == false);
- } else if (toolbarAction == "IDM_PALETTE_GREEN") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.IsEnabled == false);
- } else if (toolbarAction == "IDM_SHOWLEGEND") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemToggleChartLegend.IsEnabled == false);
- } else if (toolbarAction == "IDM_3DVIEW") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemToggle3DView.IsEnabled == false);
- } else if (toolbarAction == "IDM_CHART_PROPERTIES") {
- return (this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.ChartPropertiesMenuItemChartProperties.IsEnabled == false);
- } else if (toolbarAction == "IDM_RESET_DATA") {
- return (this.tm1Toolbar.ToolbarInfo.ResetSandboxButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_SANDBOX_UNDO") {
- return (this.tm1Toolbar.ToolbarInfo.UndoButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_SANDBOX_REDO") {
- return (this.tm1Toolbar.ToolbarInfo.RedoButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_SANDBOX") {
- return (this.tm1Toolbar.ToolbarInfo.SandboxButton.IsEnabled == false);
- } else if (toolbarAction == "IDM_CREATE_SANDBOX") {
- return (this.tm1Toolbar.ToolbarInfo.SandboxButton.MenuItemCreateSandbox.IsEnabled == false);
- } else if (toolbarAction == "IDM_DELETE_SANDBOX") {
- return (this.tm1Toolbar.ToolbarInfo.SandboxButton.MenuItemDeleteSandbox.IsEnabled == false);
- } else if (toolbarAction == "IDM_SANDBOXITEMS") {
- return (this.tm1Toolbar.ToolbarInfo.SandboxButton.IsEnabled == false);
- }
-
- return "tm1-toolbar-empty";
-
- },
-
- getToolbuttonTooltip: function(toolbarAction) {
- if (toolbarAction == "IDM_SUPPRESS_ZEROS") {
- return this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.CurrentSuppressZerosStateTooltip;
- } else if (toolbarAction == "IDM_COMMIT") {
- return this.tm1Toolbar.ToolbarInfo.CommitSandboxButton.Tooltip;
- } else if (toolbarAction == "IDM_SAVEVIEW") {
- return this.tm1Toolbar.ToolbarInfo.SaveViewButton.Tooltip;
- } else if (toolbarAction == "IDM_SAVEAS") {
- return this.tm1Toolbar.ToolbarInfo.SaveAsViewButton.Tooltip;
- } else if (toolbarAction == "IDM_EXPORT") {
- return this.tm1Toolbar.ToolbarInfo.ExportButton.Tooltip;
- } else if (toolbarAction == "IDM_SLICE_TO_EXCEL") {
- return this.tm1Toolbar.ToolbarInfo.ExportButton.MenuItemSlice.Tooltip;
- } else if (toolbarAction == "IDM_SNAPSHOT_TO_EXCEL") {
- return this.tm1Toolbar.ToolbarInfo.ExportButton.MenuItemSnapshot.Tooltip;
- } else if (toolbarAction == "IDM_EXPORT_TO_PDF") {
- return this.tm1Toolbar.ToolbarInfo.ExportButton.MenuItemExportPDF.Tooltip;
- } else if (toolbarAction == "IDM_SAVEDATACHANGES") {
- return this.tm1Toolbar.ToolbarInfo.SaveDataChangesButton.Tooltip;
- } else if (toolbarAction == "IDM_REVIEWDATACHANGES") {
- return this.tm1Toolbar.ToolbarInfo.ReviewDataChangesButton.Tooltip;
- } else if (toolbarAction == "IDM_RECALCULATE") {
- return this.tm1Toolbar.ToolbarInfo.RecalcButton.Tooltip;
- } else if (toolbarAction == "IDM_TOGGLE_AUTOMATICRECALCULATE") {
- return this.tm1Toolbar.ToolbarInfo.AutoRecalcButton.Tooltip;
- } else if (toolbarAction == "IDM_SUPPRESS_ZEROS_ROWS_COLUMNS") {
- return this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZeros.Tooltip;
- } else if (toolbarAction == "IDM_SUPPRESS_ZEROS_ROWS") {
- return this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZerosOnRows.Tooltip;
- } else if (toolbarAction == "IDM_SUPPRESS_ZEROS_COLUMNS") {
- return this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZerosOnColumns.Tooltip;
- } else if (toolbarAction == "IDM_CHART") {
- return this.tm1Toolbar.ToolbarInfo.ViewChartButton.Tooltip;
- } else if (toolbarAction == "IDM_CHARTANDGRID") {
- return this.tm1Toolbar.ToolbarInfo.ViewChartGridButton.Tooltip;
- } else if (toolbarAction == "IDM_GRID") {
- return this.tm1Toolbar.ToolbarInfo.ViewGridButton.Tooltip;
- } else if (toolbarAction == "IDM_CHART-SELECT") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.Tooltip;
- } else if (toolbarAction == "IDM_CHARTTYPE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.Tooltip;
- } else if (toolbarAction == "IDM_CHART_POINT") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[0];
- } else if (toolbarAction == "IDM_CHART_BUBBLE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[1];
- } else if (toolbarAction == "IDM_CHART_LINE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[2];
- } else if (toolbarAction == "IDM_CHART_SPLINE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[3];
- } else if (toolbarAction == "IDM_CHART_STEPLINE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[4];
- } else if (toolbarAction == "IDM_CHART_FASTLINE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[5];
- } else if (toolbarAction == "IDM_CHART_BAR") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[6];
- } else if (toolbarAction == "IDM_CHART_STACKEDBAR") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[7];
- } else if (toolbarAction == "IDM_CHART_STACKEDBAR100") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[8];
- } else if (toolbarAction == "IDM_CHART_COLUMN") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[9];
- } else if (toolbarAction == "IDM_CHART_STACKEDCOLUMN") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[10];
- } else if (toolbarAction == "IDM_CHART_STACKEDCOLUMN100") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[11];
- } else if (toolbarAction == "IDM_CHART_AREA") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[12];
- } else if (toolbarAction == "IDM_CHART_SPLINEAREA") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[13];
- } else if (toolbarAction == "IDM_CHART_STACKEDAREA") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[14];
- } else if (toolbarAction == "IDM_CHART_STACKEDAREA100") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[15];
- } else if (toolbarAction == "IDM_CHART_PIE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[16];
- } else if (toolbarAction == "IDM_CHART_DOUGHNUT") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[17];
- } else if (toolbarAction == "IDM_CHART_STOCK") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[18];
- } else if (toolbarAction == "IDM_CHART_CANDLESTICK") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[19];
- } else if (toolbarAction == "IDM_CHART_RANGE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[20];
- } else if (toolbarAction == "IDM_CHART_SPLINERANGE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[21];
- } else if (toolbarAction == "IDM_CHART_GANTT") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[22];
- } else if (toolbarAction == "IDM_CHART_RANGECOLUMN") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[23];
- } else if (toolbarAction == "IDM_CHART_RADAR") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[24];
- } else if (toolbarAction == "IDM_CHART_POLAR") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[25];
- } else if (toolbarAction == "IDM_CHART_BOXPLOT") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[26];
- } else if (toolbarAction == "IDM_CHART_FUNNEL") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[27];
- } else if (toolbarAction == "IDM_CHART_PYRAMID") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemType.TypeNames[28];
- } else if (toolbarAction == "IDM_CHARTPALETTE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.Tooltip;
- } else if (toolbarAction == "IDM_PALETTE_DEFAULT") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.ColorPaletteNames[0];
- } else if (toolbarAction == "IDM_PALETTE_STEEL") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.ColorPaletteNames[1];
- } else if (toolbarAction == "IDM_PALETTE_EARTH") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.ColorPaletteNames[2];
- } else if (toolbarAction == "IDM_PALETTE_GRAYS") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.ColorPaletteNames[3];
- } else if (toolbarAction == "IDM_PALETTE_TRANSPARENT") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.ColorPaletteNames[4];
- } else if (toolbarAction == "IDM_PALETTE_EXCEL") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.ColorPaletteNames[5];
- } else if (toolbarAction == "IDM_PALETTE_BEIGE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.ColorPaletteNames[6];
- } else if (toolbarAction == "IDM_PALETTE_BERRY") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.ColorPaletteNames[7];
- } else if (toolbarAction == "IDM_PALETTE_CHOCOLATE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.ColorPaletteNames[8];
- } else if (toolbarAction == "IDM_PALETTE_FIRE") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.ColorPaletteNames[9];
- } else if (toolbarAction == "IDM_PALETTE_GREEN") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemColorPalette.ColorPaletteNames[10];
- } else if (toolbarAction == "IDM_SHOWLEGEND") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemToggleChartLegend.Tooltip;
- } else if (toolbarAction == "IDM_3DVIEW") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.MenuItemToggle3DView.Tooltip;
- } else if (toolbarAction == "IDM_CHART_PROPERTIES") {
- return this.tm1Toolbar.ToolbarInfo.ChartPropertiesButton.ChartPropertiesMenuItemChartProperties.Tooltip;
- } else if (toolbarAction == "IDM_SANDBOX") {
- return this.tm1Toolbar.ToolbarInfo.SandboxButton.Tooltip;
- } else if (toolbarAction == "IDM_SANDBOX_UNDO") {
- return this.tm1Toolbar.ToolbarInfo.UndoButton.Tooltip;
- } else if (toolbarAction == "IDM_SANDBOX_REDO") {
- return this.tm1Toolbar.ToolbarInfo.RedoButton.Tooltip;
- } else if (toolbarAction == "IDM_RESET_DATA") {
- return this.tm1Toolbar.ToolbarInfo.ResetSandboxButton.Tooltip;
- } else if (toolbarAction == "IDM_CREATE_SANDBOX") {
- return this.tm1Toolbar.ToolbarInfo.SandboxButton.MenuItemCreateSandbox.Tooltip;
- } else if (toolbarAction == "IDM_DELETE_SANDBOX") {
- return this.tm1Toolbar.ToolbarInfo.SandboxButton.MenuItemDeleteSandbox.Tooltip;
- } else if (toolbarAction == "IDM_SANDBOXITEMS") {
- if (this.tm1Toolbar.ToolbarInfo.Sandbox.ActiveSandbox == null || this.tm1Toolbar.ToolbarInfo.Sandbox.ActiveSandbox == "") {
- return this.tm1Toolbar.ToolbarInfo.SandboxButton.Tooltip;
- } else {
- return this.tm1Toolbar.ToolbarInfo.Sandbox.ActiveSandbox;
- }
- }
-
- return "";
-
- },
-
- getToolbuttonImage: function(toolbarAction) {
- if (toolbarAction == "IDM_SUPPRESS_ZEROS") {
- if (this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.SuppressZeros)
- return "tm1-toolbar-suppress-zeros dijitToggleButtonChecked";
- else if (this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.SuppressZerosOnRows)
- return "tm1-toolbar-suppress-zeros-on-rows dijitToggleButtonChecked";
- else if (this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.SuppressZerosOnColumns)
- return "tm1-toolbar-suppress-zeros-on-columns dijitToggleButtonChecked";
- else {
- return "tm1-toolbar-suppress-zeros";
- }
- } else if (toolbarAction == "IDM_COMMIT") {
- if (this.tm1Toolbar.ToolbarInfo.CommitSandboxButton.IsEnabled) {
- return "tm1-toolbar-apply";
- } else {
- return "tm1-toolbar-apply disabled-toolbutton";
- }
- } else if (toolbarAction == "IDM_SAVEVIEW") {
- if (this.tm1Toolbar.ToolbarInfo.SaveViewButton.IsEnabled) {
- return "tm1-toolbar-save-view";
- } else {
- return "tm1-toolbar-save-view disabled-toolbutton";
- }
- } else if (toolbarAction == "IDM_SAVEAS") {
- if (this.tm1Toolbar.ToolbarInfo.SaveAsViewButton.IsEnabled) {
- return "tm1-toolbar-save-view-as";
- } else {
- return "tm1-toolbar-save-view-as disabled-toolbutton";
- }
- } else if (toolbarAction == "IDM_EXPORT") {
- if (this.tm1Toolbar.ToolbarInfo.ExportButton.IsEnabled) {
- return "tm1-toolbar-export";
- } else {
- return "tm1-toolbar-export disabled-toolbutton";
- }
- } else if (toolbarAction == "IDM_SLICE_TO_EXCEL") {
- return "tm1-toolbar-slice-excel2";
- } else if (toolbarAction == "IDM_SNAPSHOT_TO_EXCEL") {
- return "tm1-toolbar-slice-snapshot";
- } else if (toolbarAction == "IDM_EXPORT_TO_PDF") {
- return "tm1-toolbar-slice-pdf";
- } else if (toolbarAction == "IDM_SAVEDATACHANGES") {
- if (this.tm1Toolbar.ToolbarInfo.SaveDataChangesButton.IsEnabled) {
- return "tm1-toolbar-save_data_changes";
- } else {
- return "tm1-toolbar-save_data_changes disabled-toolbutton";
- }
- } else if (toolbarAction == "IDM_REVIEWDATACHANGES") {
- if (this.tm1Toolbar.ToolbarInfo.ReviewDataChangesButton.IsEnabled) {
- return "tm1-toolbar-review_data_changes";
- } else {
- return "tm1-toolbar-review_data_changes disabled-toolbutton";
- }
- } else if (toolbarAction == "IDM_RECALCULATE") {
- if (this.tm1Toolbar.ToolbarInfo.RecalcButton.IsEnabled) {
- return "tm1-toolbar-recalculate";
- } else {
- return "tm1-toolbar-recalculate disabled-toolbutton";
- }
- } else if (toolbarAction == "IDM_TOGGLE_AUTOMATICRECALCULATE") {
- if (this.tm1Toolbar.ToolbarInfo.AutoRecalcButton.IsEnabled) {
- if (this.tm1Toolbar.ToolbarInfo.AutoRecalc) {
- return "tm1-toolbar-recalculation dijitToggleButtonChecked";
- } else {
- return "tm1-toolbar-recalculation";
- }
- } else {
- if (this.tm1Toolbar.ToolbarInfo.AutoRecalc) {
- return "tm1-toolbar-recalculation disabled-toolbutton dijitToggleButtonChecked";
- } else {
- return "tm1-toolbar-recalculation disabled-toolbutton";
- }
- }
- } else if (toolbarAction == "IDM_SUPPRESS_ZEROS_ROWS_COLUMNS") {
- if (this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZeros.IsChecked) {
- return "tm1-menu-radioselection";
- }
- } else if (toolbarAction == "IDM_SUPPRESS_ZEROS_ROWS") {
- if (this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZerosOnRows.IsChecked ||
- this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZeros.IsChecked) {
- return "tm1-menu-radioselection";
- }
- } else if (toolbarAction == "IDM_SUPPRESS_ZEROS_COLUMNS") {
- if (this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZerosOnColumns.IsChecked ||
- this.tm1Toolbar.ToolbarInfo.SuppressZerosButton.MenuItemSuppressZeros.IsChecked) {
- return "tm1-menu-radioselection";
- }
- } else if (toolbarAction == "IDM_CHART") {
- if (this.tm1Toolbar.ToolbarInfo.DisplayMode == 1) {
- return "tm1-toolbar-chart_only dijitToggleButtonChecked";
- } else {
- return "tm1-toolbar-chart_only";
- }
- } else if (toolbarAction == "IDM_CHARTANDGRID") {
- if (this.tm1Toolbar.ToolbarInfo.DisplayMode == 2) {
- return "tm1-toolbar-chart-grid dijitToggleButtonChecked";
- } else {
- return "tm1-toolbar-chart-grid";
- }
- } else if (toolbarAction == "IDM_GRID") {
- if (this.tm1Toolbar.ToolbarInfo.DisplayMode == 0) {
- return "tm1-toolbar-grid_only dijitToggleButtonChecked";
- } else {
- return "tm1-toolbar-grid_only";
- }
- } else if (toolbarAction == "IDM_CHART-SELECT") {
- if (this.tm1Toolbar.ToolbarInfo.DisplayMode == 0) {
- return "tm1-toolbar-chart-select_type disabled-toolbutton";
- } else {
- return "tm1-toolbar-chart-select_type";
- }
- } else if (toolbarAction == "IDM_CHARTTYPE") {
- return "tm1-toolbar-chart-select";
- } else if (toolbarAction == "IDM_CHART_POINT") {
- return "tm1-toolbar-chart-point";
- } else if (toolbarAction == "IDM_CHART_BUBBLE") {
- return "tm1-toolbar-chart-bubble";
- } else if (toolbarAction == "IDM_CHART_LINE") {
- return "tm1-toolbar-chart-line";
- } else if (toolbarAction == "IDM_CHART_SPLINE") {
- return "tm1-toolbar-chart-spline";
- } else if (toolbarAction == "IDM_CHART_STEPLINE") {
- return "tm1-toolbar-chart-stepline";
- } else if (toolbarAction == "IDM_CHART_FASTLINE") {
- return "tm1-toolbar-chart-fastline";
- } else if (toolbarAction == "IDM_CHART_BAR") {
- return "tm1-toolbar-chart-bar";
- } else if (toolbarAction == "IDM_CHART_STACKEDBAR") {
- return "tm1-toolbar-chart-stackedbar";
- } else if (toolbarAction == "IDM_CHART_STACKEDBAR100") {
- return "tm1-toolbar-chart-stackedbar100";
- } else if (toolbarAction == "IDM_CHART_COLUMN") {
- return "tm1-toolbar-chart-column";
- } else if (toolbarAction == "IDM_CHART_STACKEDCOLUMN") {
- return "tm1-toolbar-chart-stackedcolumn";
- } else if (toolbarAction == "IDM_CHART_STACKEDCOLUMN100") {
- return "tm1-toolbar-chart-stackedcolumn100";
- } else if (toolbarAction == "IDM_CHART_AREA") {
- return "tm1-toolbar-chart-area";
- } else if (toolbarAction == "IDM_CHART_SPLINEAREA") {
- return "tm1-toolbar-chart-splinearea";
- } else if (toolbarAction == "IDM_CHART_STACKEDAREA") {
- return "tm1-toolbar-chart-stackedarea";
- } else if (toolbarAction == "IDM_CHART_STACKEDAREA100") {
- return "tm1-toolbar-chart-stackedarea100";
- } else if (toolbarAction == "IDM_CHART_PIE") {
- return "tm1-toolbar-chart-pie";
- } else if (toolbarAction == "IDM_CHART_DOUGHNUT") {
- return "tm1-toolbar-chart-doughnut";
- } else if (toolbarAction == "IDM_CHART_STOCK") {
- return "tm1-toolbar-chart-stock";
- } else if (toolbarAction == "IDM_CHART_CANDLESTICK") {
- return "tm1-toolbar-chart-candlestick";
- } else if (toolbarAction == "IDM_CHART_RANGE") {
- return "tm1-toolbar-chart-range";
- } else if (toolbarAction == "IDM_CHART_SPLINERANGE") {
- return "tm1-toolbar-chart-splinerange";
- } else if (toolbarAction == "IDM_CHART_GANTT") {
- return "tm1-toolbar-chart-gantt";
- } else if (toolbarAction == "IDM_CHART_RANGECOLUMN") {
- return "tm1-toolbar-chart-rangecolumn";
- } else if (toolbarAction == "IDM_CHART_RADAR") {
- return "tm1-toolbar-chart-radar";
- } else if (toolbarAction == "IDM_CHART_POLAR") {
- return "tm1-toolbar-chart-polar";
- } else if (toolbarAction == "IDM_CHART_BOXPLOT") {
- return "tm1-toolbar-chart-boxplot";
- } else if (toolbarAction == "IDM_CHART_FUNNEL") {
- return "tm1-toolbar-chart-funnel";
- } else if (toolbarAction == "IDM_CHART_PYRAMID") {
- return "tm1-toolbar-chart-pyramid";
- } else if (toolbarAction == "IDM_CHARTPALETTE") {
- return "tm1-toolbar-chart-color_scheme";
- } else if (toolbarAction == "IDM_PALETTE_DEFAULT") {
- return "tm1-toolbar-color_scheme-default";
- } else if (toolbarAction == "IDM_PALETTE_STEEL") {
- return "tm1-toolbar-color_scheme-light_steel_blue";
- } else if (toolbarAction == "IDM_PALETTE_EARTH") {
- return "tm1-toolbar-color_scheme-earth_tones";
- } else if (toolbarAction == "IDM_PALETTE_GRAYS") {
- return "tm1-toolbar-color_scheme--grays";
- } else if (toolbarAction == "IDM_PALETTE_TRANSPARENT") {
- return "tm1-toolbar-color_scheme-semi_trans";
- } else if (toolbarAction == "IDM_PALETTE_EXCEL") {
- return "tm1-toolbar-color_scheme-excel_like";
- } else if (toolbarAction == "IDM_PALETTE_BEIGE") {
- return "tm1-toolbar-color_scheme-light-beige";
- } else if (toolbarAction == "IDM_PALETTE_BERRY") {
- return "tm1-toolbar-color_scheme-berry";
- } else if (toolbarAction == "IDM_PALETTE_CHOCOLATE") {
- return "tm1-toolbar-color_scheme-chocolate";
- } else if (toolbarAction == "IDM_PALETTE_FIRE") {
- return "tm1-toolbar-color_scheme-fire";
- } else if (toolbarAction == "IDM_PALETTE_GREEN") {
- return "tm1-toolbar-color_scheme-green_blue";
- } else if (toolbarAction == "IDM_SHOWLEGEND") {
- return "tm1-toolbar-chart-legend";
- } else if (toolbarAction == "IDM_3DVIEW") {
- return "tm1-toolbar-chart-3D";
- } else if (toolbarAction == "IDM_CHART_PROPERTIES") {
- return "tm1-toolbar-chart-properties";
- } else if (toolbarAction == "IDM_SANDBOX_UNDO") {
- if (this.tm1Toolbar.ToolbarInfo.UndoButton.IsEnabled) {
- return "tm1-toolbar-sandbox-undo";
- } else {
- return "tm1-toolbar-sandbox-undo disabled-toolbutton";
- }
- } else if (toolbarAction == "IDM_RESET_DATA") {
- if (this.tm1Toolbar.ToolbarInfo.ResetSandboxButton.IsEnabled) {
- return "tm1-toolbar-sandbox-reset";
- } else {
- return "tm1-toolbar-sandbox-reset disabled-toolbutton";
- }
- } else if (toolbarAction == "IDM_SANDBOX") {
- if (this.tm1Toolbar.ToolbarInfo.SandboxButton.IsEnabled) {
- return "tm1-toolbar-sandbox-select";
- } else {
- return "tm1-toolbar-sandbox-select disabled-toolbutton";
- }
- } else if (toolbarAction == "IDM_CREATE_SANDBOX") {
- return "tm1-toolbar-sandbox-new";
- } else if (toolbarAction == "IDM_DELETE_SANDBOX") {
- return "tm1-toolbar-sandbox-delete";
- } else if (toolbarAction == "IDM_SANDBOX_REDO") {
- if (this.tm1Toolbar.ToolbarInfo.RedoButton.IsEnabled) {
- return "tm1-toolbar-sandbox-redo";
- } else {
- return "tm1-toolbar-sandbox-redo disabled-toolbutton";
- }
- } else if (toolbarAction == "IDM_SANDBOXITEMS") {
- return null;
- }
-
- return "tm1-toolbar-empty";
-
- },
-
- onToolbarAction: function(evt) {
- if (evt.payload == "IDM_RECALCULATE") {
- if (this.tm1InternalToolbar == 1) {
- this.recalcCubeViewer();
- } else if (this.tm1Toolbar != null) {
- this.tm1Toolbar.Recalc();
- }
- } else if (evt.payload == "IDM_TOGGLE_AUTOMATICRECALCULATE") {
- this.tm1Toolbar.ToggleRecalc();
- } else if (evt.payload == "IDM_COMMIT") {
- this.tm1Toolbar.CommitSandbox();
- } else if (evt.payload == "IDM_SAVEVIEW") {
- this.tm1Toolbar.SaveView();
- } else if (evt.payload == "IDM_SAVEAS") {
- this.tm1Toolbar.SaveAsView();
- } else if (evt.payload == "IDM_SLICE_TO_EXCEL") {
- this.tm1Toolbar.ExportSlice();
- } else if (evt.payload == "IDM_SNAPSHOT_TO_EXCEL") {
- this.tm1Toolbar.ExportSnapshot();
- } else if (evt.payload == "IDM_EXPORT_TO_PDF") {
- this.tm1Toolbar.ExportPrintToPDF();
- } else if (evt.payload == "IDM_CREATE_SANDBOX") {
- this.tm1Toolbar.CreateSandbox();
- } else if (evt.payload == "IDM_DELETE_SANDBOX") {
- this.tm1Toolbar.DeleteSandbox();
- } else if (evt.payload == "IDM_SUPPRESS_ZEROS_ROWS_COLUMNS") {
- this.tm1Toolbar.SuppressZero(0);
- } else if (evt.payload == "IDM_SUPPRESS_ZEROS_ROWS") {
- this.tm1Toolbar.SuppressZero(1);
- } else if (evt.payload == "IDM_SUPPRESS_ZEROS_COLUMNS") {
- this.tm1Toolbar.SuppressZero(2);
- } else if (evt.payload == "IDM_RESET") {
- if (this.tm1InternalToolbar == 1) {
- this.restartSession ();
- } else if (this.tm1Toolbar != null) {
- this.tm1Toolbar.ReloadView ();
- }
- } else if (evt.payload == "IDM_RESTART") {
- document.cookie="ASP.NET_SessionId=;path=/";
- this.refreshView();
- } else if (evt.payload == "IDM_SAVEDATACHANGES") {
- this.tm1Toolbar.SaveDataChanges();
- } else if (evt.payload == "IDM_REVIEWDATACHANGES") {
- this.tm1Toolbar.ReviewDataChanges();
- } else if (evt.payload == "IDM_CHART") {
- this.tm1Toolbar.ToggleViewChart(1);
- } else if (evt.payload == "IDM_CHARTANDGRID") {
- this.tm1Toolbar.ToggleViewChart(2);
- } else if (evt.payload == "IDM_GRID") {
- this.tm1Toolbar.ToggleViewChart(0);
- } else if (evt.payload == "IDM_CHART_PROPERTIES") {
- this.tm1Toolbar.SetToolbarChartProperties();
- } else if (evt.payload == "IDM_3DVIEW") {
- this.tm1Toolbar.ToggleToolbar3DChart();
- } else if (evt.payload == "IDM_SHOWLEGEND") {
- this.tm1Toolbar.ToggleToolbarChartLegend();
- } else if (evt.payload == "IDM_CHART_POINT") {
- this.tm1Toolbar.SetToolbarChartType(0);
- } else if (evt.payload == "IDM_CHART_BUBBLE") {
- this.tm1Toolbar.SetToolbarChartType(1);
- } else if (evt.payload == "IDM_CHART_LINE") {
- this.tm1Toolbar.SetToolbarChartType(2);
- } else if (evt.payload == "IDM_CHART_SPLINE") {
- this.tm1Toolbar.SetToolbarChartType(3);
- } else if (evt.payload == "IDM_CHART_STEPLINE") {
- this.tm1Toolbar.SetToolbarChartType(4);
- } else if (evt.payload == "IDM_CHART_FASTLINE") {
- this.tm1Toolbar.SetToolbarChartType(5);
- } else if (evt.payload == "IDM_CHART_BAR") {
- this.tm1Toolbar.SetToolbarChartType(6);
- } else if (evt.payload == "IDM_CHART_STACKEDBAR") {
- this.tm1Toolbar.SetToolbarChartType(7);
- } else if (evt.payload == "IDM_CHART_STACKEDBAR100") {
- this.tm1Toolbar.SetToolbarChartType(8);
- } else if (evt.payload == "IDM_CHART_COLUMN") {
- this.tm1Toolbar.SetToolbarChartType(9);
- } else if (evt.payload == "IDM_CHART_STACKEDCOLUMN") {
- this.tm1Toolbar.SetToolbarChartType(10);
- } else if (evt.payload == "IDM_CHART_STACKEDCOLUMN100") {
- this.tm1Toolbar.SetToolbarChartType(11);
- } else if (evt.payload == "IDM_CHART_AREA") {
- this.tm1Toolbar.SetToolbarChartType(12);
- } else if (evt.payload == "IDM_CHART_SPLINEAREA") {
- this.tm1Toolbar.SetToolbarChartType(13);
- } else if (evt.payload == "IDM_CHART_STACKEDAREA") {
- this.tm1Toolbar.SetToolbarChartType(14);
- } else if (evt.payload == "IDM_CHART_STACKEDAREA100") {
- this.tm1Toolbar.SetToolbarChartType(15);
- } else if (evt.payload == "IDM_CHART_PIE") {
- this.tm1Toolbar.SetToolbarChartType(16);
- } else if (evt.payload == "IDM_CHART_DOUGHNUT") {
- this.tm1Toolbar.SetToolbarChartType(17);
- } else if (evt.payload == "IDM_CHART_STOCK") {
- this.tm1Toolbar.SetToolbarChartType(18);
- } else if (evt.payload == "IDM_CHART_CANDLESTICK") {
- this.tm1Toolbar.SetToolbarChartType(19);
- } else if (evt.payload == "IDM_CHART_RANGE") {
- this.tm1Toolbar.SetToolbarChartType(20);
- } else if (evt.payload == "IDM_CHART_SPLINERANGE") {
- this.tm1Toolbar.SetToolbarChartType(21);
- } else if (evt.payload == "IDM_CHART_GANTT") {
- this.tm1Toolbar.SetToolbarChartType(22);
- } else if (evt.payload == "IDM_CHART_RANGECOLUMN") {
- this.tm1Toolbar.SetToolbarChartType(23);
- } else if (evt.payload == "IDM_CHART_RADAR") {
- this.tm1Toolbar.SetToolbarChartType(24);
- } else if (evt.payload == "IDM_CHART_POLAR") {
- this.tm1Toolbar.SetToolbarChartType(25);
- } else if (evt.payload == "IDM_CHART_BOXPLOT") {
- this.tm1Toolbar.SetToolbarChartType(26);
- } else if (evt.payload == "IDM_CHART_FUNNEL") {
- this.tm1Toolbar.SetToolbarChartType(27);
- } else if (evt.payload == "IDM_CHART_PYRAMID") {
- this.tm1Toolbar.SetToolbarChartType(28);
- } else if (evt.payload == "IDM_PALETTE_DEFAULT") {
- this.tm1Toolbar.SetToolbarChartColorPalette(1);
- } else if (evt.payload == "IDM_PALETTE_STEEL") {
- this.tm1Toolbar.SetToolbarChartColorPalette(2);
- } else if (evt.payload == "IDM_PALETTE_EARTH") {
- this.tm1Toolbar.SetToolbarChartColorPalette(3);
- } else if (evt.payload == "IDM_PALETTE_GRAYS") {
- this.tm1Toolbar.SetToolbarChartColorPalette(4);
- } else if (evt.payload == "IDM_PALETTE_TRANSPARENT") {
- this.tm1Toolbar.SetToolbarChartColorPalette(5);
- } else if (evt.payload == "IDM_PALETTE_EXCEL") {
- this.tm1Toolbar.SetToolbarChartColorPalette(6);
- } else if (evt.payload == "IDM_PALETTE_BEIGE") {
- this.tm1Toolbar.SetToolbarChartColorPalette(7);
- } else if (evt.payload == "IDM_PALETTE_BERRY") {
- this.tm1Toolbar.SetToolbarChartColorPalette(8);
- } else if (evt.payload == "IDM_PALETTE_CHOCOLATE") {
- this.tm1Toolbar.SetToolbarChartColorPalette(9);
- } else if (evt.payload == "IDM_PALETTE_FIRE") {
- this.tm1Toolbar.SetToolbarChartColorPalette(10);
- } else if (evt.payload == "IDM_PALETTE_GREEN") {
- this.tm1Toolbar.SetToolbarChartColorPalette(11);
- } else if (evt.payload == "IDM_RESET_DATA") {
- this.tm1Toolbar.ResetData();
- } else if (evt.payload == "IDM_SANDBOX_UNDO") {
- this.tm1Toolbar.Undo();
- } else if (evt.payload == "IDM_SANDBOX_REDO") {
- this.tm1Toolbar.Redo();
- } else if (evt.payload.substring(0, 13) == "SANDBOXCHOICE") {
- var sandBoxId = evt.payload.substring(13, evt.payload.length);
- if (sandBoxId == 0) {
- this.tm1Toolbar.SetActiveSandbox("[Base]");
- } else {
- this.tm1Toolbar.SetActiveSandbox(this.tm1Toolbar.ToolbarInfo.Sandbox.SandboxList[sandBoxId - 1]);
- }
- }
-
-
- return;
- },
- handleTM1DimensionUpdate: function(iEvent) {
- var filter = iEvent.payload;
- this.dimensionChangeCubeViewer(filter);
- return;
- },
- areTM1ParametersValid: function () {
- var bParametersAreValid = true;
- if (this.tm1ServerCubeView != "") {
- var searchString = this.tm1ServerCubeView;
- var separatorIndex = searchString.indexOf('$$');
- this.tm1Server = searchString.substring(0, separatorIndex);
- searchString = searchString.substring(separatorIndex + 2, searchString.length);
- separatorIndex = searchString.indexOf('$$');
- this.tm1Cube = searchString.substring(0, separatorIndex);
- searchString = searchString.substring(separatorIndex + 2, searchString.length);
- separatorIndex = searchString.indexOf('$$');
- this.tm1CubeView = searchString;
- }
- if (this.tm1Cube == "") {
- bParametersAreValid = false;
- } else if (this.tm1Host == "") {
- bParametersAreValid = false;
- } else if (this.tm1Server == "") {
- bParametersAreValid = false;
- } else if (this.tm1CubeView == "") {
- bParametersAreValid = false;
- }
- return bParametersAreValid == true;
- },
- onUnload: function(evt) { //5htp, seratonin
- if (this.iframeCtrl != null) {
- this.tm1Close();
- this.iframeCtrl.destroy();
- }
- },
- onWidgetSave: function(evt) {
- this.iContext.iEvents.fireEvent("com.ibm.bux.widget.save.done", null, "");
- if (this.tm1Toolbar != null) {
- this.tm1Toolbar.SaveView();
- }
- },
- onWidgetResize: function(evt) {
- if(!this._firstVisible && this.iContext._mm.widget.widgetInstance.itemSets.buxdelayedload.widgetVisible.value == "false") {
- setTimeout(dojo.hitch(this, this.onWidgetResize, evt), 10);
- return;
- }
- if(!this.iframeCtrl) {
- setTimeout(dojo.hitch(this, this.onWidgetResize, evt), 10);
- return;
- }
- var resize = evt.payload.resize;
- if (resize) {
- if(resize.h < 0) {
- return;
- }
-
- this.iframeCtrl.resize({
- w: resize.w,
- h: resize.h
- });
- }
- if (this.iframeCtrl.resizeZone != null) {
- this.tm1Height = resize.h;
- this.saveTM1CubeViewerParams(this.iContext);
- return;
- }
- },
- onGetProperties : function (){
- // this.getWidgetProperties();
- },
- getWidgetAttributes : function (){
- this.tm1ServerCubeView = this.iContext.getiWidgetAttributes().getItemValue("tm1ServerCubeView");
- this.tm1WebURL = this.iContext.getiWidgetAttributes().getItemValue("tm1WebURL");
- this.tm1Host = this.iContext.getiWidgetAttributes().getItemValue("tm1Host");
- this.tm1Server = this.iContext.getiWidgetAttributes().getItemValue("tm1Server");
- this.tm1Cube = this.iContext.getiWidgetAttributes().getItemValue("tm1Cube");
- this.tm1CubeView = this.iContext.getiWidgetAttributes().getItemValue("tm1CubeView");
- this.tm1UserName = this.iContext.getiWidgetAttributes().getItemValue("tm1UserName");
- this.tm1Password = this.iContext.getiWidgetAttributes().getItemValue("tm1Password");
- this.tm1InternalToolbar = this.iContext.getiWidgetAttributes().getItemValue("TM1Toolbar");
- this.tm1Height = this.iContext.getiWidgetAttributes().getItemValue("tHeight");
- if (this.tm1Height == "") {
- this.tm1Height = this.initialHeight;
- }
- },
- _onCancelProperties: function() {
- alert ("inOnGetProperties");
- console.log ("in onGetProperties");
- },
- onSetProperties: function() {
- alert ("inOnSetProperties2");
- console.log ("in onSetProperties2");
- },
- onSetProperties: function(evt) {
- if (evt.payload.properties) {
- this.refreshView();
- return;
- }
- },
- saveTM1CubeViewerParams: function (inIContext) {
- inIContext.getiWidgetAttributes().setItemValue("tm1Host", this.tm1Host);
- inIContext.getiWidgetAttributes().setItemValue("tm1Server", this.tm1Server);
- inIContext.getiWidgetAttributes().setItemValue("tm1Cube", this.tm1Cube);
- inIContext.getiWidgetAttributes().setItemValue("tm1CubeView", this.tm1CubeView);
- inIContext.getiWidgetAttributes().setItemValue("tHeight", this.tm1Height);
- inIContext.getiWidgetAttributes().setItemValue("TM1Toolbar", this.tm1InternalToolbar);
- return;
- },
-
- initializeiframe : function (url) {
- this.iframeCtrl = new cubeViewerIFrame({
- url: url,
- iWidget: this
- }, this.iContext.getElementById("_" + this.iContext.widgetId + "_" + "tm1CubeViewerWidgetDiv"));
- this.iframeCtrl.startup(this.tm1Height);
- // find out our working space
- var chromeObjectId = bux.Helper.widgetIdToChromeId(this.iContext.widgetId);
- var chromeObject = bux.Helper.getChromeById(chromeObjectId);
- var currentSize = chromeObject.getClientBox();
- this.iframeCtrl.resize(currentSize);
- },
- onWidgetRefresh: function(evt) // Invoked when User preferences get modified (Including locales)
- {
- if (this.tm1Toolbar != null) {
- this.tm1Toolbar.Recalc();
- }
- return;
- },
-
- recalcCubeViewer : function () {
- var url = this.iframeCtrl.getObjectIDURL();
- var url2 = url.replace("TM1WebCubeViewer","TM1WebMain");
- url2 += "&Action=Recalc";
- this.iframeCtrl.setUrl(url2);
- return;
- },
- restartSession : function () {
- var url = this.iframeCtrl.getObjectIDURL();
- var url2 = url.replace("TM1WebCubeViewer","TM1WebMain");
- url2 += "&Action=Reload";
- this.iframeCtrl.setUrl(url2);
- return;
- },
-
- dimensionChangeCubeViewer : function (titleParams) {
- var url = this.iframeCtrl.getObjectIDURL();
- var url2 = url.replace("TM1WebCubeViewer","TM1WebMain");
- url2 += "&";
- url2 += titleParams;
- this.iframeCtrl.setUrl(url2);
- return;
- },
-
- tm1Close : function () {
- if (!this.bTurnOffCallbacks) {
- var url = this.iframeCtrl.getObjectIDURL();
- if (url != null) {
- var url2 = url.replace("TM1WebCubeViewer","TM1WebMain");
- url2 += "&Action=Close";
- this.iframeCtrl.setUrl(url2);
- }
- }
- // remove callback functions to prevent memory leaks
- if (COGNOS_TM1_cubeWgtToolbarFuncs != null) {
- COGNOS_TM1_cubeWgtToolbarFuncs["_"+this.iContext.widgetId+"_"] = null;
- delete COGNOS_TM1_cubeWgtToolbarFuncs["_"+this.iContext.widgetId+"_"];
- }
-
- if (COGNOS_TM1_cubeWgtFilterFuncs != null) {
- COGNOS_TM1_cubeWgtFilterFuncs["_"+this.iContext.widgetId+"_"] = null;
- delete COGNOS_TM1_cubeWgtFilterFuncs["_"+this.iContext.widgetId+"_"];
- }
- return;
- },
-
- determineCommonDomain: function () {
- if (this.commonDomain == null) {
- this.commonDomain = "";
- var buxURL = document.URL;
- var buxDomain = bux.Helper.extractDomain(buxURL);
- var tm1WebDomain = bux.Helper.extractDomain(this.tm1WebURL);
- if (buxDomain.toLowerCase() == tm1WebDomain.toLowerCase()) {
- return;
- } else {
- this.bTurnOffCallbacks = true;
- /*var buxColonIndex = buxDomain.indexOf(":");
- if (buxColonIndex >= 0) {
- buxDomain = buxDomain.substring(0, buxColonIndex);
- }
- var tm1WebColonIndex = tm1WebDomain.indexOf(":");
- if (tm1WebColonIndex >= 0) {
- tm1WebDomain = tm1WebDomain.substring(0, tm1WebColonIndex);
- }
- var buxDotIndex = buxDomain.indexOf(".");
- var tm1WebDotIndex = tm1WebDomain.indexOf(".");
- if (buxDotIndex >= 0 && tm1WebDotIndex >= 0) {
- var buxDomainSuffix = buxDomain.substring(buxDotIndex + 1);
- var tm1DomainSuffix = tm1WebDomain.substring(tm1WebDotIndex + 1);
-
- if (buxDomainSuffix.toLowerCase() == tm1DomainSuffix.toLowerCase()) {
- this.commonDomain = buxDomainSuffix;
- return;
- }
- } */
- }
- }
- return;
- },
-
- refreshView : function () {
- // initialize javascript callback functions
- // callback functions are stored in an array where the array index
- // is the context widgetId
- if (COGNOS_TM1_cubeWgtToolbarFuncs == null)
- COGNOS_TM1_cubeWgtToolbarFuncs = new Array();
- if (COGNOS_TM1_cubeWgtFilterFuncs == null)
- COGNOS_TM1_cubeWgtFilterFuncs = new Array();
- if (COGNOS_TM1_cubeWgtToolbarFuncs["_"+this.iContext.widgetId+"_"] == null) {
- COGNOS_TM1_cubeWgtToolbarFuncs["_"+this.iContext.widgetId+"_"] = dojo.hitch(this, "createWidgetToolbar");
- }
- if (COGNOS_TM1_cubeWgtFilterFuncs["_"+this.iContext.widgetId+"_"] == null) {
- COGNOS_TM1_cubeWgtFilterFuncs["_"+this.iContext.widgetId+"_"] = dojo.hitch(this, "fireFilterChanged");
- }
- var url = this.tm1WebURL;
- url += "/TM1WebMain.aspx?action=OpenObject&type=Cubeviewer";
- url += "&HideTabs=1&AdminHost=" + encodeURIComponent(this.tm1Host) + "&TM1server=" + encodeURIComponent(this.tm1Server) + "&value=" + encodeURIComponent(this.tm1Cube) + "$$" + encodeURIComponent(this.tm1CubeView);
- this.determineCommonDomain();
- if (this.bTurnOffCallbacks /*this.commonDomain != null && this.commonDomain.length > 0*/) {
- this.tm1InternalToolbar = 1;
- this.createBasicWidgetToolbar();
- // document.domain = this.commonDomain;
- // url += "&CommonDomain=";
- // url += encodeURIComponent(this.commonDomain);
- } else {
- if (this.tm1InternalToolbar != 1) {
- url += "&HideToolbar=1";
- }
- url += "&toolbarCallbackFunc=COGNOS_TM1_cubeWgtToolbarFuncs._"+encodeURIComponent(this.iContext.widgetId)+"_&TitleChangeCallback=COGNOS_TM1_cubeWgtFilterFuncs._"+encodeURIComponent(this.iContext.widgetId)+"_($dimName$, $subsetName$, $elemName$)";
- }
- if ((this.tm1UserName != null) && (this.tm1UserName != "")) {
- url += "&username=";
- url += encodeURIComponent(this.tm1UserName);
- url += "&password=";
- if ((this.tm1Password != null) && (this.tm1Password != "")) {
- url += encodeURIComponent(this.tm1Password);
- }
- }
- if (this.iframeCtrl == null) {
- this.initializeiframe (url);
- } else {
- this.iframeCtrl.setUrl(url);
- }
- }
- });
- dojo.provide("cubeViewerIFrame");
- dojo.declare("cubeViewerIFrame", dijit._Widget, {
- url: null,
- iWidget: null,
- resizeZone: null,
- iframe: null,
- recalcURL: null,
- constructor: function(params) {
- //
- },
- getObjectIDURL: function () {
- this.recalcURL = null;
- if (this.iframe.contentDocument) {
- if (this.iframe.contentDocument.URL == "about:blank") {
- } else {
- this.recalcURL = this.iframe.contentDocument.URL;
- }
- } else if (this.iframe.contentWindow) {
- this.recalcURL = this.iframe.contentWindow.location.href;
- }
- return this.recalcURL;
- },
-
- setUrl: function(url) {
- this.url = url;
- if (this.iframe) {
- this.iframe.src = url;
- }
- },
- assignReturnURL: function () {
- },
- startup: function(inHght) {
- var ref = this;
- this.inherited(arguments);
- this.resizeZone = this.domNode.ownerDocument.createElement("div");
- this.domNode.appendChild(this.resizeZone);
- var dn = (this.iframe = dojo.doc.createElement('iframe'));
- var url = this.url;
- var widgetParent = this.iWidget;
- dn.id = this.id + "_iframe";
- dn.style.border = "none";
- dn.style.width = "100%";
- dn.style.height = inHght + "px";
- dn.frameBorder = 0;
- dn.tabIndex = 0;
- dn.setAttribute('src', url);
- dn.setAttribute('scrolling', "no");
- this.resizeZone.appendChild(dn);
- if (dojo.isWebKit) { // Safari seems to always append iframe with src=about:blank
- setTimeout(function() {
- dn.setAttribute('src', url)
- }, 0);
- }
- },
- resize: function(size) {
- dijit.layout._LayoutWidget.prototype.resize.apply(this, arguments);
- },
- layout: function() {
- if (this.iframe.parentNode != null) {
- if (this.iframe.clientHeight > 0) {
- this.iframe.style.height = this.iframe.parentNode.parentNode.clientHeight + "px";
- }
- }
- }
- });
|