C_RowStoreAccessor.js 4.1 KB

123456
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: cchl
  3. // (C) Copyright IBM Corp. 2003, 2016.
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. function C_RowStoreAccessor(_cIS1){this._cJS1=_cIS1;this._c9P="columns";this._cVE="name";this._c3U="values";};C_RowStoreAccessor.prototype.F_GetRowNumbersArray=function(){if(!this._c441){var _cFK1=this._cJS1.rows.length;this._c441=new Array(_cFK1);for(var i=0;i<_cFK1;i++){this._c441[i]=i;}}return this._c441;};C_RowStoreAccessor.prototype.F_GetCellCallback=function(_c541){var i=this.F_GetColumnIdx(_c541);var _cTM1=this._cJS1[this._c9P][i];var fn=_cTM1.formattedValues?this.F_GetColumnCategoricalFormattedValueByIndex:(_cTM1[this._c3U]?this.F_GetColumnCategoricalValueByIndex:this.F_GetColumnValueByIndex);return fn.bind(this, i, _cTM1);};C_RowStoreAccessor.prototype.F_GetColumnCategoricalFormattedValueByIndex=function(i,_cTM1,_cIU1){_cIU1=this._c441?this._cJS1.rows[_cIU1]:_cIU1;return _cTM1.formattedValues[_cIU1[i]];};C_RowStoreAccessor.prototype.F_GetColumnCategoricalValueByIndex=function(i,_cTM1,_cIU1){_cIU1=this._c441?this._cJS1.rows[_cIU1]:_cIU1;return _cTM1[this._c3U][_cIU1[i]];};C_RowStoreAccessor.prototype.F_GetColumnValueByIndex=function(i,_cTM1,_cIU1){return(this._c441?this._cJS1.rows[_cIU1]:_cIU1)[i];};C_RowStoreAccessor.prototype.F_GetColumnIdxLookup=function(){if(!this._cGH){this._cGH=U_JsUtils.F_CreateReverseLookupByProperty(this._cJS1[this._c9P], this._cVE);}return this._cGH;};C_RowStoreAccessor.prototype._cGE1=function(_c541){return this._cJS1[this._c9P][this.F_GetColumnIdx(_c541)];};C_RowStoreAccessor.prototype.F_GetColumnIdx=function(_c541){return this.F_GetColumnIdxLookup()[_c541];};C_RowStoreAccessor.prototype.F_GetColumnDataType=function(_c541){return this._cJS1[this._c9P][this.F_GetColumnIdx(_c541)].dataType||"";};function C_VizRowStoreAccessor(_cIS1, _cJU1){this._cMB={};this._cNB={};var nl=_cJU1.selectNodes(".//vizValue");var _cFK1=nl.length;for(var i=0;i<_cFK1;i++){var n=nl.item(i);var _c3J1=n.getAttribute("idField");var _cHE1=n.getAttribute("refDataItem");this._cMB[_c3J1]=_cHE1;this._cNB[_cHE1]=_c3J1;}var nl=_cJU1.selectNodes( ".//vizCategoryField[count(vizCategoryDataItems/vizCategoryDataItem) = 1]/vizCategoryDataItems/vizCategoryDataItem" );var _cFK1=nl.length;for(var i=0;i<_cFK1;i++){var n=nl.item(i);var _c3J1=n.parentNode.parentNode.getAttribute("idField");var _cHE1=n.getAttribute("refDataItem");this._cMB[_c3J1]=_cHE1;this._cNB[_cHE1]=_c3J1;}var nl=_cJU1.selectNodes( ".//vizCategoryField[count(vizCategoryDataItems/vizCategoryDataItem) > 1]/vizCategoryDataItems/vizCategoryDataItem" );var _cFK1=nl.length;this._c0L=_cFK1>0;if(this._c0L){this._c02={};for(var i=0;i<_cFK1;i++){var n=nl.item(i);var _c3J1=n.parentNode.parentNode.getAttribute("idField");var _cHE1=n.getAttribute("refDataItem");if(!this._c02[_c3J1]){this._c02[_c3J1]=[];}this._c02[_c3J1].push(_cHE1);this._cNB[_cHE1]=_c3J1;}}C_VizRowStoreAccessor.baseConstructor.call(this, _cIS1);};C_VizRowStoreAccessor.F_Extends(C_RowStoreAccessor);C_VizRowStoreAccessor.prototype.F_GetCellCallback=function(_c3J1){if(this._c0L){var _cE91=this._c02[_c3J1];if(_cE91){var _c4J1=[];var _c641=[];for(var i=0;i<_cE91.length;i++){var _cBO1=this.F_GetColumnIdx(_cE91[i]);_c641.push(_cBO1);_c4J1.push(this._cJS1[this._c9P][_cBO1]);}return this._cG.bind(this, _c641, _c4J1);}}return C_VizRowStoreAccessor.superClass.F_GetCellCallback.call(this, this._cMB[_c3J1]);};C_VizRowStoreAccessor.prototype._cG=function(_c641,_c4J1,_cIU1){var _cFK1=_c4J1.length;for(var i=0;i<_cFK1;i++){var _cTM1=_c4J1[i];var _cBO1=_c641[i];var _cGN1=_cTM1.formattedValues?_cTM1.formattedValues[_cIU1[_cBO1]]:_cTM1[this._c3U][_cIU1[_cBO1]];if(_cGN1!==null){return _cGN1;}}};function C_Rave1DataAccessor(_cIS1){C_Rave1DataAccessor.baseConstructor.call(this, _cIS1);this._c9P="fields";this._cVE="id";this._c3U="categories";};C_Rave1DataAccessor.F_Extends(C_RowStoreAccessor);C_Rave1DataAccessor.prototype.F_GetFieldMin=function(_c3J1){return this._cGE1(_c3J1).min;};C_Rave1DataAccessor.prototype.F_GetFieldMax=function(_c3J1){return this._cGE1(_c3J1).max;};