C_ReportRequest.js 3.5 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_ReportRequest(_cCB1, _cQQ1, _cFH1){this.F_ConstructBaseClass(_cCB1);if(_cFH1){_cQQ1='storeID("' + _cFH1 + '")';}this._cQE=window["G_UserDataSettings"]?G_UserDataSettings.F_GetValue("UseReportService"):C_BusRequest.M_bUseReportServiceSoapRelay;var _cYT=this._cQE?C_ReportRequestRest:C_ReportRequestSOAP;this._cLH1=new _cYT({F_Request_OnComplete:this._cV.bind(this, this),F_Request_OnAborted:this._cEC1.bind(this, "F_Request_OnAborted")},_cQQ1,_cFH1);this._cXK(this._cLH1, ["F_GetCmReportProperties","F_GetDefaultNameValue","F_GetDescriptionValue","F_GetModelSearchPath","F_GetModuleStoreID","F_GetModificationTimeValue","F_GetModuleSearchPath","F_GetPackageSearchPath","F_GetParentPath","F_GetRoutingServerGroupValue","F_GetRunInAdvancedViewerValue","F_GetSpecificationValue","F_IsParentSession","F_IsReportStudioReport"]);}C_ReportRequest.F_Extends(C_RequestBase);C_ReportRequest.prototype.F_Send=function(){this._c0P=this._cLH1; this._cLH1.F_Send();};C_ReportRequest.prototype.F_Abort=function(){if(this._c0P){this._c0P.F_Abort(); }};C_ReportRequest.prototype.F_GetError=function(){return this._cZP1||(this._c0P&&this._c0P.F_GetError());};C_ReportRequest.prototype.F_ProcessResponse=function(){};C_ReportRequest.prototype._cV=function(_cFG1){if(_cFG1.F_GetError()){this._cC6();return;}this._c0P=null;if(this._cQE){var _cFE1=this._cLH1.F_GetObjectURL();var _c041=_cFE1+'?fields=searchPath,base.id,base.type,base.searchPath';this._c1P=new C_RestRequest({ F_Request_OnComplete:this._cB3.bind(this),F_Request_OnAborted:this._cEC1.bind(this, "F_Request_OnAborted")},'GET',_c041);this._c0P=this._c1P;this._c1P.F_Send();}else{this._cC6();}};C_ReportRequest.prototype._cB3=function(_c2P){console.log('C_ReportRequest.F_CMInfoRequest_OnComplete');if(_c2P.F_GetError()){this._cC6();return;}var _c3P=_c2P._cDS&&_c2P._cDS.data&&_c2P._cDS.data.length>0&&_c2P._cDS.data[0];if(! _c3P){this._c2P.F_SetNewError('Missing JSON data');this._cC6();return;}var _cYK=_c3P.base&&_c3P.base.length>0&&_c3P.base[0]; this._cPM1={objectURL: _c3P._meta.links.self.url,objectType: _c3P.type,cmSearchPath: _cYK&&_cYK.searchPath||_c3P.searchPath,storeID: _cYK&&_cYK.id||_c3P.id,reportViewCmSearchPath: _cYK?_c3P.searchPath:"",reportViewStoreID: _cYK?_c3P.id:"",reportViewObjectType: _cYK&&_cYK.type||""}; this._c0P=null;this._cC6();};C_ReportRequest.prototype._cC6=function(){this.F_ProcessResponse();this._cEC1("F_Request_OnComplete");};C_ReportRequest.prototype._cEC1=function(_cOO1){if(this._cDB1&&this._cDB1[_cOO1]){this._cDB1[_cOO1](this);}};C_ReportRequest.prototype._cXK=function(_c3Z,_cXI1){for(var i=0; i<_cXI1.length;++i){var _cRK1=_cXI1[i];this[_cRK1]=_c3Z[_cRK1].bind(_c3Z);}};C_ReportRequest.prototype.F_GetObjectURL=function(){if(this._cQE){return this._cPM1.objectURL;}else{return this._cLH1.F_GetObjectURL();}};C_ReportRequest.prototype.F_GetSearchPathValue=function(){if(this._cQE){return this._cPM1.cmSearchPath;}else{return this._cLH1.F_GetSearchPathValue();} };C_ReportRequest.prototype.F_GetRequestedReportPath=function(){if(this._cQE){return(this._cPM1&&this._cPM1.cmSearchPath)||this._cLH1.F_GetRequestedReportPath();}else{return this._cLH1.F_GetRequestedReportPath();}};C_ReportRequest.prototype.F_GetStoreIDValue=function(){if(this._cQE){return this._cPM1.storeID;}else{return this._cLH1.F_GetStoreIDValue();}};C_ReportRequest.prototype.F_GetCMInfo=function(){return this._cPM1;};