C_ModelRootRequestRest.js 2.9 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_ModelRootRequestRest(_c221, _cCB1, _cP71){this._cV8=[];this._cF71="";this._cRW="";this._cNC1=null; this._cJH1=null;this._c621=_c221;this._cF71=this._c621.F_GetModelPath();this._cRW=this._c621.F_GetModelLocale();if(_cP71===undefined){this.F_ConstructBaseClass(_cCB1, "GET", "v1/metadata/fmmodels", "path=" + encodeURIComponent(this._cF71) + "&locale=" + encodeURIComponent(this._cRW));}else{this.F_ConstructBaseClass(_cCB1, "GET", "v1/metadata/fmmodels", "path=" + encodeURIComponent(_cP71._cF71) + "&locale=" + encodeURIComponent(_cP71._cRW));}};C_ModelRootRequestRest.F_Extends(C_RestRequest);C_ModelRootRequestRest.prototype.F_ProcessResponse=function(){C_ModelRootRequestRest.superClass.F_ProcessResponse.call(this);var _cCS=this._cDS;if(_cCS&&_cCS.data&&_cCS.data.length>0){var _cQA=[];for(var i=0;i<_cCS.data.length;i++){if(_cCS.data[i]&&_cCS.data[i].metadata){var d=U_XML.F_LoadString(null, _cCS.data[i].metadata);if(!d){this.F_SetNewErrorRes("IDS_CCHL_BAD_MA_RESPONSE", _cCS.data[i].metadata);return; }_cQA.push(d.documentElement);}}this._cV8=_cQA;var _cW8=this._cV8[C_ModelRootRequestRest.K_eResponse_MemberTreeMetadata];if(_cW8){var d=_cW8.ownerDocument;var _c6X=_cW8.selectNodes(".//dimension");var _cID=_c6X.length;this._c621._c9N=true;for(var _cTT1=0;_cTT1<_cID;_cTT1++){var _cL71=_c6X.item(_cTT1);var _cUT1=_cL71.getAttribute("_ref");var nl=_cL71.selectNodes( ".//hierarchy[@multiRoot='0' and @rootCaption and @rootCaption!='' and @rootMUN and @rootMUN!='']" );var _cFK1=nl.length;for(var i=0;i<_cFK1;i++){var _cJ71=nl.item(i);var _c7X=_cJ71.getAttribute("rootCaption");var _cGH1=_cJ71.getAttribute("rootMUN");var _cDL1=_cJ71.appendChild(d.createElement("member"));_cDL1.setAttribute("memberCaption", _c7X);_cDL1.setAttribute("memberUniqueName", _cGH1);_cDL1.setAttribute("_path", _cGH1);_cDL1.setAttribute("_ref", _cGH1);_cDL1.setAttribute("dimensionUniqueName", _cUT1);_cDL1.setAttribute( "hierarchyUniqueName", _cJ71.getAttribute( "_ref" ) );var _cM71=_cJ71.selectSingleNode("level");if(_cM71){_cDL1.setAttribute( "levelUniqueName", _cM71.getAttribute( "_ref" ) );}this._c621.F_CacheMembersResponse(_cJ71, Number.POSITIVE_INFINITY); } }this._c621._c9N=false;this._c621._cE2(); }this._c621.F_CacheModelRootResponse(this._cV8);}};C_ModelRootRequestRest.prototype.F_GetModelRootResponses=function(){return this._cV8;};C_ModelRootRequestRest.K_eResponse_MemberTreeMetadata=0;C_ModelRootRequestRest.K_eResponse_Operations=1;C_ModelRootRequestRest.K_eResponse_MetadataRoot=2;C_ModelRootRequestRest.K_eResponse_QueryFunctions=3;C_ModelRootRequestRest.K_eResponse_ReportFunctions=4;C_ModelRootRequestRest.K_eResponse_MacroFunctions=5;C_ModelRootRequestRest.K_eResponse_MetadataParameterMap=6;