// Licensed Materials - Property of IBM // // IBM Cognos Products: pps // // (C) Copyright IBM Corp. 2005, 2017 // // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. //all user inputs for accessing arrays are 1 based var ppwebInfo; function DimensionFilters() { function DimFilterRecord(Label,Code,IsTimeDim,IsMeasureDim,TopCode,TopLabel) { this.label = Label; this.code = Code; this.topCode = TopCode; this.topLabel = TopLabel; this.isTimeDim = IsTimeDim; this.isMeasureDim = IsMeasureDim; } dimRecordArray = new Array(); this.AddDim = function(Label,Code,IsTimeDim,isMeasureDim,TopCode,TopLabel,dimIdx) { dimRecordArray[parseInt(dimIdx)] = new DimFilterRecord(Label,Code,IsTimeDim,isMeasureDim,TopCode,TopLabel); } this.GetDimLabel = function(dimIdx) { return (dimRecordArray[parseInt(dimIdx)].label); } this.GetDimCode = function(dimIdx) { return (dimRecordArray[parseInt(dimIdx)].code); } this.GetDimTopLabel = function(dimIdx) { return (dimRecordArray[parseInt(dimIdx)].topLabel); } this.GetDimTopCode = function(dimIdx) { return (dimRecordArray[parseInt(dimIdx)].topCode); } this.IsDimFiltered = function(dimIdx) { return (dimRecordArray[parseInt(dimIdx)].code != dimRecordArray[parseInt(dimIdx)].topCode); } this.IsTimeDim = function(dimIdx) { return (dimRecordArray[parseInt(dimIdx)].isTimeDim); } this.IsMeasureDim = function(dimIdx) { return (dimRecordArray[parseInt(dimIdx)].isMeasureDim); } this.GetNumDimensions = function() { return dimRecordArray.length; } } function AxisInfo() { function NestGroup(Code,DimIdx,Group) { this.code = Code; this.dimIdx = DimIdx; this.group = Group; } var nestGroups = new Array(); this.AddLevel = function(Level,Code,DimIdx,Group) { nestGroups[parseInt(Level)] = new NestGroup(Code,DimIdx,Group); } this.GetCatCode = function(Level) { return nestGroups[parseInt(Level)].code; } this.GetDim = function(Level) { return nestGroups[parseInt(Level)].dimIdx; } this.GetNestGroupInDim = function(Level) { return nestGroups[parseInt(Level)].group; } this.GetNestingDepth = function() { return nestGroups.length; } } function XtabInfo() { var rowInfo = new AxisInfo(); var colInfo = new AxisInfo(); this.GetRowInfo = function() { return rowInfo; } this.GetColumnInfo = function() { return colInfo; } this.GetZeroSuppressionIdx = function() { if (typeof document.fhidden.ZS != "undefined") return parseInt(document.fhidden.ZS.value); else return 0; } this.Is8020Suppressed = function() { if (typeof document.fhidden.ETS != "undefined") return (parseInt(document.fhidden.ETS.value) == 1); else return false; } this.GetCurrency = function() { if (typeof document.fhidden.D != "undefined") return parseInt(document.fhidden.D.value); else return 0; } // we won't interpret each of the codes as there are too many and cube specific.. this.GetMaxNumberOfRows = function() { return parseInt(document.fhidden.G.value); } this.GetMaxNumberOfColumns = function() { return parseInt(document.fhidden.H.value); } this.GetRowPage = function() { if (typeof document.fhidden.J != "undefined") return parseInt(document.fhidden.J.value); else return 0; } this.GetColumnPage = function() { if (typeof document.fhidden.K != "undefined") return parseInt(document.fhidden.K.value); else return 0; } this.IsGetDataLaterOn = function() { return (document.fhidden.GD.value != "1"); } } function PPWebInfo() { var filters = new DimensionFilters(); var xtabInfo = new XtabInfo(); this.GetDimensionInfo = function() { return filters; } this.GetXtabInfo = function() { return xtabInfo; } this.getCubeName = function() { return document.fhidden.E.value; } this.GetCurrentMeasure = function() { if (typeof document.fhidden.V != "undefined") return parseInt(document.fhidden.V.value); else return 0; } this.GetCurrentMeasureString = function() { var type = 0; if (typeof document.fhidden.V != "undefined") type = parseInt(document.fhidden.V.value); return topparent.getGlobal("renderAs")[type]._label; } this.GetBackURL = function() { return document.fhidden.PP_BACK.value; } this.GetResetURL = function() { return document.fhidden.HOME.value; } this.GetLanguage = function() { return document.fhidden.LA.value; } this.GetLocale = function() { return document.fhidden.LO.value; } this.IsSplitViewOn = function() { if (document.fhidden.YS) return true; else return false; } this.GetDisplayType = function() { if (typeof document.fhidden.Y != "undefined") return parseInt(document.fhidden.Y.value); else return 0; } this.GetSplitViewDisplayType = function() { if (typeof document.fhidden.YS != "undefined") return parseInt(document.fhidden.YS.value); else return 0; } this.isActionPaneOpen = function() { return (parseInt(document.fhidden.ACTPANE.value) != 0); } } function initialize_ppwbInfo() { ppwebInfo = new PPWebInfo(); //Store the dimensions var dimCache = topparent.getGlobal("dimCache"); var dimbarcontent = document.getElementById("dimbar-content"); if (!dimbarcontent) dimbarcontent = topparent.getChartFrame().document.getElementById("dimbar-content"); var dim = dimbarcontent.firstChild; while (dim.tagName == "A") { var dimIdx = parseInt(dim.getAttribute("number")) - 1; var dimtopnode = dimCache.getDimTopNode(dimIdx); ppwebInfo.GetDimensionInfo().AddDim(dim.getAttribute("category"),dim.getAttribute("code"),topparent.getGlobal("gDimensionInfo[" + dimIdx + "]").isTimeDimension,topparent.getGlobal("gDimensionInfo[" + dimIdx + "]").isMeasureDimension,dimtopnode.getCode(),dimtopnode.getLabel(),dimIdx) dim = dim.nextSibling; } //Store the axis info //Rows var level = 0; var levelselect = xtabCache.getXtabLevelSelector("r",level); while (levelselect) { ppwebInfo.GetXtabInfo().GetRowInfo().AddLevel(level,levelselect.getAttribute("code"),levelselect.getAttribute("dimIdx"),levelselect.getAttribute("groupLevel")) level++; levelselect = xtabCache.getXtabLevelSelector("r",level); } //Columns var level = 0; var levelselect = xtabCache.getXtabLevelSelector("c",level); while (levelselect) { ppwebInfo.GetXtabInfo().GetColumnInfo().AddLevel(level,levelselect.getAttribute("code"),levelselect.getAttribute("dimIdx"),levelselect.getAttribute("groupLevel")) level++; levelselect = xtabCache.getXtabLevelSelector("c",level); } }