C_ReportRequestRest.js 4.7 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_ReportRequestRest(_cCB1, _cQQ1, _cFH1){this._cSQ1=_cQQ1;this._cRE=null;this._cC91="";var _c041;var _c4Z;if(_cFH1){_c041="v1/reports/"+_cFH1;var _cSI=window["G_UserDataSettings"]?G_UserDataSettings.F_GetValue("UseReportService"):C_BusRequest.M_bUseReportServiceSoapRelay;if(G_BusServer.M_bUseReportServiceConsumerMode&&_cSI){_c041+= "/stubbed";}}else{_c041="v1/reports/properties";_c4Z="path="+encodeURIComponent(this._cSQ1);}this.F_ConstructBaseClass(_cCB1, "GET", _c041, _c4Z);}C_ReportRequestRest.F_Extends(C_RestRequest);C_ReportRequestRest.prototype.F_GetRequestedReportPath=function(){return this._cSQ1;};C_ReportRequestRest.prototype.F_GetCmReportProperties=function(){return this._cRE;};C_ReportRequestRest.prototype.F_GetObjectURL=function(){return this._cC91;};C_ReportRequestRest.prototype.F_GetSpecificationValue=function(){return this._cRE.specification;};C_ReportRequestRest.prototype.F_GetDefaultNameValue=function(){return this._cRE.defaultName;};C_ReportRequestRest.prototype.F_GetSearchPathValue=function(){return this._cRE.searchPath;};C_ReportRequestRest.prototype.F_GetModificationTimeValue=function(){return this._cRE.modificationTime;};C_ReportRequestRest.prototype.F_GetStoreIDValue=function(){return this._cRE.id;};C_ReportRequestRest.prototype.F_GetDescriptionValue=function(){return this._cRE.defaultDescription;};C_ReportRequestRest.prototype.F_GetRoutingServerGroupValue=function(){return this._cC8;};C_ReportRequestRest.prototype.F_IsReportStudioReport=function(){if(this._cRE&&this._cRE.objectClass){var _c8P1=this._cRE.objectClass;return Boolean(_c8P1=='report'||_c8P1 =='reportTemplate'||_c8P1 =='interactiveReport'||_c8P1=='dataSet2');}return false;};C_ReportRequestRest.prototype.F_IsParentSession=function(){if(this._cRE&&this._cRE.parent&&this._cRE.parent.objectClass){return Boolean(this._cRE.parent.objectClass =='session');}return false;};C_ReportRequestRest.prototype.F_GetParentPath=function(){if(this._cRE&&this._cRE.parent&&this._cRE.parent.length){return this._cRE.parent[0].searchPath;}return null;};C_ReportRequestRest.prototype.F_GetPackageSearchPath=function(){if(this._cRE&&this._cRE.metadataModelPackage.length){return this._cRE.metadataModelPackage[0].searchPath;}return null;};C_ReportRequestRest.prototype.F_GetModelSearchPath=function(){if(this._cRE&&this._cRE.metadataModel.length){return this._cRE.metadataModel[0].searchPath;}return null;};C_ReportRequestRest.prototype.F_GetModuleSearchPath=function(){var _cSE=null;if(this._cRE&&this._cRE.module&&this._cRE.module.length){_cSE=this._cRE.module[0].searchPath;}return _cSE; };C_ReportRequestRest.prototype.F_GetModuleStoreID=function(){var _c4P=null;if(this._cRE&&this._cRE.module&&this._cRE.module.length){_c4P=this._cRE.module[0].id;}return _c4P;};C_ReportRequestRest.prototype.F_GetRunInAdvancedViewerValue=function(){return !!this._cRE.runInAdvancedViewer;};C_ReportRequestRest.prototype._cZT=function(_cCS){var _c5P=false;if(_cCS&&_cCS.data&&typeof _cCS.data[0].report=='object'){_c5P=true;}return _c5P;};C_ReportRequestRest.prototype.F_ProcessResponse=function(){C_ReportRequestRest.superClass.F_ProcessResponse.call(this);var _cPN1=this.F_GetError();if(_cPN1){return;}var _cCS=this._cDS;if(!_cCS){this.F_SetNewError(G_ResManager.F_GetString("IDS_CCHL_BAD_REPORT_RESPONSE", this._cSQ1));return;}var _c6P=_cCS.messages;if(_c6P){var i=_c6P[0].indexOf(" ");var _c0U=(i>0)?_c6P[0].substring(i+1):_c6P[0];var _cR51=(i>0)?_c6P[0].substring(0, i):"";var _c0H1=[];for(var i=1;i<_c6P.length;i++){if(_c6P[i].length){_c0H1.push(_c6P[i]);}}this.F_SetNewError(_c0U, _c0H1.join("\r\n"), _cR51);return;}var _c5P=false;if(_cCS.data&&typeof _cCS.data[0].report=='object'){_c5P=true;}var _cTE=this._cRE=_cCS.data[0].report;if(_c5P&&_cTE &&_cTE.hasOwnProperty('metadataModel')&&_cTE.hasOwnProperty('metadataModelPackage')){if(_cTE.metadataModelPackage.length){if(!G_BusServer.M_bUseReportServiceConsumerMode&&!G_CCHL.M_bIsDataset&&_cTE.metadataModelPackage[0].effectiveUserCapabilities){var _c1U=_cTE.metadataModelPackage[0].effectiveUserCapabilities;if(_c1U.indexOf("canUseReportStudio")==-1){this._cZP1=new C_Error(G_ResManager.F_GetString("IDS_TITLE_CAPABILITIES_ERROR"), G_ResManager.F_GetString("IDS_NO_RS_CAPABILITY_REPORT"));return;}}}this._cC91=_cTE._meta&&_cTE._meta.links.self.url||"";this._cC8=this._cEU1.getResponseHeader("routingServerGroup");G_BusServer.F_SetRoutingServerGroup(this._cC8);}else{this.F_SetNewError(G_ResManager.F_GetString("IDS_CCHL_BAD_REPORT_RESPONSE", this._cSQ1), JSON.stringify(_cCS));}};