版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
前 Cognos8产品结构图 CognosTransformer简 引入数 映射关 生成立方 Report Reportstudio简 图表和地 钻取的设 Query QueryStudio简 QueryStuio操作界面构 ysis ysisStudio简 ysisStudio操作界面构 Cognos8SDK简 连接Cognos 登陆Cognos 运行报 查询内容库Content 报表定 权限管 例子说 Cognos8Cognos8Cognos8的功能组件分为服务器端和客户端两部分,服务器端是SOACognos8WebService的方式接受和处理8元数据的工具,它们分别是:TransFormerFrameWork。用户制端,在浏览器端,用户可以以下组件:ReportStudio、QueryStudio、ysisStudioCognosSDK开发应用直接Cognos8服务。Cognos8产品结构图CognosTransformerCognosTransformer主要功能为:设计立方题模型和按照多维模型将数据库或文件中的数据加载生成立方体。CognosTransformer建立模型之前,非常重要的一点是,首分析的类型然后用CognosTransformer构造创建数据模型;最后加载数据得到一个立方体最终用户通过直接此多CognosTransformer不需要编成,操作简单,下面章节主要围绕软件功能展开帮助用户从0开始到可以独立完成模型的设下面章节设计用例大家可以Transformer安装目录下的\samples\Power首先我们需要将外部数据引入CognosTransformer,为分析Cognos新建立方体模型,选择工具条上的File→IQD文件(默认、csv文件用其来直接数据库中的表。选择CSV文件作为数据源,在Datasourcetype中选:Delimited-fieldtextwithcolumntitles→下一步从如下路径找产品维表:..\samples\Powery\CubesandReports\prodinfo.csvRunAutoDesign再点击完成。AutoDesign一般只是根据简单的列类型机械得组合成纬度,CSV文件数据的引入过程,CognosTransformerDataSourcesprodinfo再次添加数据源我们通过图表栏上的Insertdata\samples\powery\cubesand y\CubesandIQD文件。IQDImromptuQueryIQD y\Cubesand引入IQD文件后我们还可以根据图表栏上的DataSourceVieweriqdsqlpreview数据。别。纬度Dimension:维度就是用户今后进行分析时所用来分析数Level:维度数据逻辑上的等级关系(相当于数据的定位3层产品结构:product_number为后面同事实表进行关联的字段我们依次将上述三层拖拽到CognosTransformerproduct_line→product_typepordinfo文件中直接拖拽,最product_name_enCognostransformer会自动将数据源数据抽取进Cognostransformer有两种类型的度量:拖入后,指标进入指标属性窗口Measures窗口中点击右键选择InsertMeasureType开始编辑计算对于Cognostransformer来说适度使用计算来生成计算指标不但可从而降低数据库空间开销和IO开销。根据我们以往的经验,大量复杂的计算指标不会对立方体的生成和效率带来太大的压力,Cognostransformer会认为同名的列为关据仓库的星型结构来设计的,CognosTransformer可以最高效率抽bsc_msrsod-ProdNo列按照此方法依次改 ShowScopeDataSourcesUnique属性来继续关联好地区和维度,最后我们得到的关联图形应如下图CognosTransformerPowerCubesInsert生成立方体:选择上的CreatePowerCubes.然后Cognos并、计算、插入生成立方体。生成结束后,我们可以直接在系统双击开始这个立方体文件,至此您的第一个分析立方体就已经生成好了。大家慢慢会发现CognosTransformer本身的使用难度不大,分析中真正的设计 Framework是元数据模型工具。元数据模型是对数据源的业务CognosFrameWorkDataSourceNewWindowsWindows路径上输入WindowsCubeFrameWork所在机器WindowsFrameWorkCube路径,UnixUnix服务器下得路径,完成发布完成后,你就可以通过浏览器用ReportStudio、QueryStudio或者 ysisStudio这个Package作报表和分析CognosFrameWorkDataSourceMetadataWizard界面选择你需要的表、视图等对象,下一Useprimaryandforeignkeys取消,import发布完成后,你就可以通过浏览器用ReportStudio、QueryStudio或者 ysisStudio这个Package作报表和分析IQDCognosTransFormerCube的。MethodIQDPackageGeneratethefilesforexternalizedquerysubjectsIQD的保存路径ReportReportstudioReportStudio创建业务智能报表来ReportStudioReportStudio时,数据是不可见的。Reportstudio示:[订单号],把它修改为,[订单号]=’1000’,当然也可以是[订单显示值,对应于的id,编号,号码等数据相应的,label,名称等,则参数过滤的表达式必须用in等可以传参数的时候传多个值得表达在弹出选项配置中,选择编辑,把默认的删除为查询对象,改为不选中状态,如果选中该,则把页面上的数据项目删除的同2006年份和两个月份。这是一个典cognos8制作非平衡表是很简单的。2006年到左边为行,拖动经销商类型到右边为列。拖动活动到cube做数据源,还是直接从数据库取数据做(一) 2,设置。measure中。 其他图表和柱状图的做法基本原理都是一致的,measure代表(二)gstcognos8。下面以制作一个 2,拖动数据到地图中。location,此处用省的名称,注意省份的名称必须color。设置该3,设置属性。 在市上点右键,就可以看到drilldown和dillup了,默认用左键,的某个参数带过去。这个时候我们使用钻取。 drillthough属性。method为传递数据项,value份;value下的省份指的是源报表中的数据项省份。4,运行报表。(三) 设置钻取如下图所示,进入户外数据包后,打开工具菜单,选择dirll-though3,新建一个钻 量的钻取就一件建立了。6,可以钻取了。datadrillgotorelatedQueryQueryQueryStudioQueryStudio是基于关键用户对自身业务查询需求,通过式查询。QueryStudio,DB2、Oracle、SQLServerCognosPowerCubeQueryStuio两呆”字段(总共只包含4种情况。另一种是键入值,这种方法比计算3种操作类值、四舍五入、取整、1000(可以在新项目名称中为这个计算字如果余额大于1800则属于红组,如果余额小于等于1800则属于绿A组。 ysisysisStudioysisStudio是业界领先的业务智能工具,用于对企业数(OTP够设想的任何方式探查企业数据,无论是每季度按销售人员的销图形化高速导入的信息能帮助客户更快地找到线索和分析ysisStudio ysisStudio的易用性使得用户仅需ysisStudio以提供零客户端的纯Web方式具有易用性ysisStudio ysisStudio中确需要分析的内容在模型中具置的时候。Excel2002 Cognos8SDKCognos8提供的服务和组件。几乎所Cognos8SDK来完成,能够根Congos8服务是基于Webservices的,通过URL:webservername/cognos8/cgi-bin/cognos.cgi?wsdlWSDL文 INF/classes中找到。你可以使用IDE开发工具直接使用WSDLfile,或者安装Cognos提供的SDK,效果是一样的。 找到installation_location/sdk/java/lib: BIBusAPICognos8进行通信。Cognos8过BIBusAPI对这些服务进行。例如一个运行报表的请求会发ReportServiceContentManagerService内容管理服务。相应的服务执行它们自己的操作。BIBusAPI服务,都有两种接口定义:<service>_Service接口和<service>_Port接口。JavaJava息Cognos在IE浏览器中是通过如下网关来Cognoshttp[shost:port/cognos8/cgi-bin/cognos.cgi。但因为Cognos应用防火墙的原因,SDK不能通过这个网关来Cognos8,必须通过以下URI来CognosDispatcher:http[s]:privateAgentService_ServiceLocator=privateAgentService_PortagentService=publicstaticStringAS_URL= //创建Cognos8服务的agentServiceLocator=newAgentService_ServiceLocator();...{.URLserverURL=new//agentService=}//当建立起连接之后,就有了和Cognos8进行通信的介质,可以处理Cognos登陆或注销之间,必须先连接上Cognos8,如上述。用BIBusAPI方法logon(credentials,roles)进行用户的验证。on,你是谁(rolesStringBuffercredentialXML=newStringBuffer();//// //转换为XmlEncodedXMLcredentialXEX=newXmlEncodedXML();//connection.getCMService().logon(credentialXEX,此例子中,logon方法被contentmanagerservice调用,包含名称空除。以下是一个完整的类,此例子包含连接和登陆Cognos8,并且得到两个最常用的service,ContentManagerService和R.MalformedURLException;importjava.rmi.RemoteException;importorg.apache.axis.AxisFault;importorg.apache.axis. importcom.cognos.developer.schemas.bibus._3.ContentManagerServiceStub;importimportcom.cognos.developer.schemas.bibus._3.ReportServiceStub;importcom.cognos.developer.schemas.bibus._3.ReportService_ServiceLocator;importcom.cognos.developer.schemas.bibus._3.SearchPathSingleObject;importcom.cognos.developer.schemas.bibus._3.XmlEncodedXML;publicclassCRNConnectImplimplementsCRNConnect //创建连接Cognos8服务的对象 //ContentManagerService内容库管理服务Locator privateContentManagerService_ServiceLocatorcmServiceLocator= //ReportService报表服务Locator privateReportService_ServiceLocatorreportServiceLocator= //ContentManagerService privateContentManagerServiceStubcmService= //ReportService Cognos8ContentManager Cognos8ContentManager privateStringCM_URL= // privateStringusername= privateStringpwd= //// privateString//连接登陆//Cognos publicCRNConnectImpl(Configurationconfiguration)throws{ this.CM_URL= this.username= this.pwd= pwd= space= ***@返回 publicContentManagerServiceStubconnectToCognosServer()throwsRemoteException{ //BI BiBusHeaderbibus= while(bibus==null) //创建Cognos8服务的service //contentmangerservicelocator内容管理服务 cmServiceLocator=new //reportservicelocator报表服务 reportServiceLocator=new try .URLserverURL=new //得到Cognos8的服务,通过stub // cmService=new // repService=new //设置超时时间,单位为秒,0 catch(MalformedURLExceptione) System.out.println("MalformedURL:\n"+ return }catch(AxisFaulte) try // }catch(RemoteExceptionex) //Ifauthenticationisrequired,thiswillgenerate // //Atthispoint,thisexceptioncansafelybe throw //biBusHeaderSOAP:包含登陆信息的 bibus=(BiBusHeader)((Stub) if(bibus!=null) return return //得到contentmanagerservice publicContentManagerServiceStubgetCMService() return //得到reportservice publicReportServiceStubgetReportService() BiBusHeaderbibus= //从reportservice得到 bibus=(BiBusHeader)( //如果reportservice的bibus不可用,就从contentmanagerservice得到 if(bibus==null) BiBusHeaderCMbibus= //得到contentmanagerservice的 CMbibus=(BiBusHeader)( (repService).setHeader("","biBusHeader", return //登陆Cognos privatevoidquickLogon()throwsRemoteException // StringBuffercredentialXML=new // credentialXML.append(namespace==null?"": // credentialXML.append(username==null?"": credentialXML.append(pwd==null?"": StringencodedCredentials= //调用contentmanagerservice的logon方法,此方法为stub getCMService().logon(new newSearchPathSingleObject[] // }连接上Cognos8并成功认证之后,就可以创建或者运行一张报表了。运行一张报表首先得制定这张报表的搜索路径searchpath,报表此例我们用run(objectPath,parameterValuesoptions)方法reportParameterValues=emptyParameterValues;//ParameterValuereportParameters[]=newParameterValue[1];reportParameters[0]=newParameterValue();////ParmValueItempvi[]=newParmValueItem[1];SimpleParmValueItemitem1=newSimpleParmValueItem();//pvi[0]=item1;//为optionOptionrunOptions[]=new//RunOptionBooleansaveOutput=newRunOptionBoolean();runOptions[0]=//RunOptionStringArrayoutputFormat=newRunOptionStringArray();//格式还可以为CSVHTMLFragmentMHTPDFsingleXLSXHTMLoutputFormat.setValue(newString[]{"HTML"});runOptions[1]=outputFormat;RunOptionOutputEncapsulationoutputEncapsulation= new runOptions[2]=outputEncapsulation;//AsynchOptionIntprimaryWait=newrunOptions[3]=//AsynchOptionIntsecondaryWait=newrunOptions[4]=AsynchReplyres repService.run(newSearchPathSingleObject(reportPath),parameters,**Copyright2005CognosIncorporated.All *CognosandtheCognoslogoaretrademarksofCognos*Description:ThiscodesamplemakescallstoCognos8SDKimport.MalformedURLException;import.URL;importjavax.xml.rpc.ServiceException;importorg.apache.axis.AxisFault;importorg.apache.axis. importcom.cognos.developer.schemas.bibus._3.AsynchOptionEnum;importcom.cognos.developer.schemas.bibus._3.AsynchOptionInt;importimportcom.cognos.developer.schemas.bibus._3.BiBusHeader;importimportcom.cognos.developer.schemas.bibus._3.FormatEnum;importcom.cognos.developer.schemas.bibus._3.HdrSession;importcom.cognos.developer.schemas.bibus._3.OutputEncapsulationEnum;importcom.cognos.developer.schemas.bibus._3.ParameterValue;importimportimportcom.cognos.developer.schemas.bibus._3.ReportService_ServiceLocator;importcom.cognos.developer.schemas.bibus._3.RunOptionBoolean;importimportcom.cognos.developer.schemas.bibus._3.RunOptionStringArray;importcom.cognos.developer.schemas.bibus._3.CAMPassport;import*运行报表并保存为*Notethatthisapplicationdoesnoerrorhandling;errorswill*uglyexceptionstacktracestoappearontheconsole,and*applicationwillexitpublicclass{ *此函数准备 *@paramrepService一个初始化的reportservice报表服务对象 *@param 用户 *@param *@param 名称空间 staticvoid ReportService_Port String String String //净化头部移 //净化头部移 上下文 BiBusHeaderbibus (BiBusHeader)if(bibus!={if(bibus.getTracking()!={(bibus.getTracking().getConversationContext()!=null){}} //为登陆设置一个新的 bibus=newbibus.setCAM(new //设置登陆方式为 //设置 bibus.getCAM().setCAMPassport(new //bibus.getCAM().getCAMPassport().setId(new bibus.setHdrSession(new // FormFieldVarffs[]=new////ffs[0]=newFormFieldVar(); ffs[1]=new ffs[2]ffs[2]=new // //Stringpassport= //bibus.getCAM().setCAMPassport(new //bibus.getCAM().getCAMPassport().setId(new //得到 Stringpassport= ((Stub)repService).setHeader("","biBusHeader", * cealloccurrencesof"pattern"in"str"with * *@param Thesourcestring. *@param Thepatterntosearchfor. *@param The cementforpattern. * Identicaltotheoriginalstringwithall of"pattern" cedby publicstaticStringpublicstaticString StringString Stringre intstrLen= intpatternLen= intstart=0,end= StringBufferresult=new char[]chars=new while((end=str.indexOf(pattern,start))>=0) str.getChars(start,end,chars,result.append(chars,0,endresult.append(chars,0,end- start=end+ str.getChars(start,str.getChars(start,strLen,chars,result.append(chars,0,strLen- return *Themainentrypointforthe publicstaticvoidmain(String[] //ChangethisURLifyourserverisinanotherlocationor //different // // StringserverHost= // StringserverPort= //Changethissearchpathifyouwanttorunadifferent // StringreportPath "/content/package[@name='GOSalesand+ ation+"report[@name='AddStringoutputPathStringoutputPath=Outputfilename //Specifyausertologinas.登陆的用户 和名称空 StringuserName= StringuserPassword= StringuserNamespace=Parsethecommand-linearguments.for(intidx=0;idx<args.length;{if(args[idx].compareTo("-host")=={serverHost=args[idx+}elseif(args[idx].compareTo("-port")=={serverPort=args[idx+}elseif(args[idx].compareTo("-report")=={reportPath=args[idx+}elseif(args[idx].compareTo("-output")=={outputPath=args[idx+;}elseif(args[idx].compareTo("-user")=={userName=args[idx+}elseif(args[idx].compareTo("-password")=={userPassword=args[idx+}elseif(args[idx].compareTo("-namespace")=={userNamespace=args[idx+}{System.out.println("Unknownargument:"}}Createaconnectiontoareportserver.//StringCognos_URL++++ "CreatingCognos8connectionto++++System.out.println("ServerURL:"+//创建ReportService_ServiceLocatorreportServiceLocatornew//ReportService_PortrepService={//repService}catch(MalformedURLException{"CaughtaMalformedURLException:\n"System.out.println("Cognos8serverURLwas:"System.exit(-}catch(ServiceException{System.out.println("CaughtaServiceException:"System.exit(-} System.out.println("...SetupthebiBusHeaderforalogon.用biBusHeaderif((userName.length()>&&(userPassword.length()>&&(userNamespace.length()>{"Loggingonas++"inthe++"setUpHeader(repService,userName,}//Set//Setupthereportparameters. ParameterValueparameters[]=newParameterValue[]////为optionOptionrunOptions[]=new//RunOptionBooleansaveOutput=newRunOptionBoolean();runOptions[0]=//RunOptionStringArrayoutputFormat=newRunOptionStringArray();//格式还可以为CSVHTMLFragmentMHTPDFsingleXLSXHTMLoutputFormat.setValue(newString[]{"HTML"});runOptions[1]=outputFormat;RunOptionOutputEncapsulationoutputEncapsulation new runOptions[2]=outputEncapsulation;//AsynchOptionIntprimaryWait=newrunOptions[3]=//AsynchOptionIntsecondaryWait=newrunOptions[4]=Nowrunthereport.{System.out.println("Runningthereport...");System.out.println("Reportsearchpathis:");////AsynchReplyresSearchPathSingleObject(reportPath),parameters,runOptions);//.SocketTimeoutException:Readtimed System.out.println("...////Thereportisfinished,let'sfetchtheresultsandthemafile.if(res.getStatus() AsynchDetailReportOutputreportOutput=for(inti=0;i<res.getDetails().length;{if{reportOutput} String[]data="Writingreportoutputto"outputPath+FileOutputStreamfs=//URIsintheoutputarerelativeonserver;weneed//makethemabsolutesotheyreferenceserverStringuriFix//"http://"+serverHost+":"serverPort+"http://"+serverHost ;//for(intidx=0;idx<data.length;{Stringfixed_hunkceSubstring(data[idx],"../",;}System.out.println("...}}catch(AxisFault{//Stringex_str}catch(Exception{System.out.println("UnhandledSystem.out.println("Message:\n"+System.out.println("Stack}}}}运行选项指定报表生成的格式,包括XML,HTML,CSC,XLS,调用run(objectPath,parameterValues,options)方法,传入报表的搜索Content内容库contentstore是存放BIBusAPI对象的数据库,可以通过BIBusAPI的方法来对contentstore中的对象进行操作。此例通过对象的搜索路径查找出contentstore中相应的对象。通过如下方法:query(searchPath,properties,sortBy,options)。指内容库contentstore中的对象都由一个单一的根对象开始组织为一个层。根对象以/开始,包含了contentstore中的所有对象。Contentpath,并表示了其在contentstore所处的位置。例如以下的/content/package[@name='GOSalesandReportSamples']/report[@name='CreateaList意思为GOSalesandRetailers数据包下的ationReportSamples文件夹中的CreateaListReport报表。 Copyright2005 Copyright2005CognosIncorporated.All CognosandtheCognoslogoaretrademarksofCognos//SimpleContentManagerquery.MalformedURLException;import.URL;importimportimportimportimport importcom.cognos.developer.schemas.bibus._3.BaseClass;importcom.cognos.developer.schemas.bibus._3.CAM;importimportimportcom.cognos.developer.schemas.bibus._3.FormFieldVar;importcom.cognos.developer.schemas.bibus._3.FormatEnum;importcom.cognos.developer.schemas.bibus._3.HdrSession;importcom.cognos.developer.schemas.bibus._3.OrderEnum;importcom.cognos.developer.schemas.bibus._3.PropEnum;importcom.cognos.developer.schemas.bibus._3.QueryOptions;importcom.cognos.developer.schemas.bibus._3.Sort;importcom.cognos.developer.schemas.bibus._3.StringProp;importpublicclass{ publicstaticvoidmain(String[] //AttemptasimpleCM StringsearchPath=new // StringuserName= StringuserPassword= // StringuserNamespace= //Processcommand-line //cmQueryacceptsthese //-- //-- //-- //-- // for(inti=0;i<args.length; String[]command args[i].substring(0, args[i].substring(args[i].indexOf('=')+if(command[0].compareTo("--search")=={searchPath=}elseif(command[0].compareTo("--uid")=={userName=}elseif(command[0].compareTo("--pwd")=={userPassword=}elseif(command[0].compareTo("--namespace")=={userNamespace=}{thrownewException("Unknownargument:"+}}} catch(Exception System.exit(- //ConcatenatethereadfiltertothesearchPaththisway //askCMtoonlyreturntheobjectswehavereadacces //searchPath+= CreatetheconnectiontoContentManagerService. // URLendPointUrl new //初始化contentmanagerservicelocator ContentManagerService_ServiceLocatorservice newContentManagerService //初始化contentmanagerportContentManagerService_PortContentManagerService_Portcms //Searchproperties:weneedthedefaultNameandthe // //PropEnum PropEnum[]properties {PropEnum.defaultName,PropEnum.searchPath //Sortoptions:ascendingsortonthedefaultName //ThecmQuery.plsampledoesn'tdothis,itreturnsthedefaultunsorted // Sort[]sortBy={new //Queryoptions;usethe // QueryOptionsoptions=new //Addtheauthenticationinformation,if //Anotheroptionwouldbetousethelogon()andlogonAs() CAMcam=new HdrSessionheader=new if(userName!= FormFieldVar[]vars=new // vars[0]=new // vars[1]=new // // vars[2]=new }{} //设置用认证信息 BiBusHeaderbibus=new ((Stub)cms).setHeader("","biBusHeader",//Makethe//Makethe{//BaseClass[]results=newSearchPathMultipleObject(searchPath), // ythe for(inti=0;i<results.length; // TokenProptheDefaultName= // StringProptheSearchPath= catch(AxisFault //Faultdetailscanbefoundvia //whichreturnsanElement System.out.println("SOAP catch(RemoteException{BiBusHeadertheException(BiBusHeader) //YoucannowusetheExceptiontofindoutmore //aboutthe System.out.println("Cognos8threwanRMI System.out.println("Stack catch(MalformedURLException System.out.println("MalformedURL System.out.println("Stack catch(ServiceException System.out.println("Remoteservice System.out.println("Stack }每张Cognos8报表都有一个XML格式的报表定义,描述了报表的当在ReportStudio中修改一张报表的时候,就是在修改此报表的报表而不保存,则用runSpecification(specification,parameterValues,{StringreportPath=////是否 表定Option[]qOpts//是否 表定ReportServiceQueryOptionBooleanupgradeSpecFlag=new//ReportServiceQueryOptionSpecificationFormatspecFormat=new//qOpts[0]=upgradeSpecFlag;qOpts[1]=specFormat;//AsynchReplyqResult=newSearchPathSingleObject(reportPath),newParameterValue[]{},//if((qResult.getStatus()==||(qResult.getStatus()==){while((qResult.getStatus()==||(qResult.getStatus()==){qResult=newParameterValue[]{},newOption[]}}//if(qResult.getDetails()!={for(inti=0;i<qResult.getDetails().length;{if(qResult.getDetails()[i]instanceof{reportSpec=(}}}} SAXReaderxmlReader=newSAXReader();ByteArrayInputStreambais=new////装 对 =publicvoidaddQuery(Stringp_sName){//Elementn=(Element)o if(n==null){n=(Element) }ElementeElementee.addAttribute("namep_sName);}4:把报表定义写回内容库contentbc[]=new//Reportrpt=new//AddOptionsaddOpts=new//TokenProprptDefaultName=newTokenProp();AnyTypePropap=newAnyTypeProp();//得到报表定义StringreportXML=intiStartReport=reportXML.indexOf("<report");StringreportOut=reportXML.substring(iStartReport);// //StringparentPath=parent.getSearchPath().getValue();{rpt,addOpts);}//handleuncaught首先从内容库contentstore中得到报表定义,然后报表定义被解析contentstore。用query(objectPath,parameterValues,options)方法得到报表的定用validateSpecification(specification,parameterValuesoptions)方法保存报表可以用update(object,options)方法覆盖原有报表,用add(parentPath,object,options)方法在内容库contentstore中新增一**Copyright2005CognosIncorporated.All *CognosandtheCognoslogoaretrademarksofCognos*EditReportSpecclasscontainsmethodsformodifyingasimple*reportusingtheCognos8importcom.cognos.developer.schemas.bibus._3.AsynchReply;importcom.cognos.developer.schemas.bibus._3.Option;importimportcom.cognos.developer.schemas.bibus._3.ReportServiceQueryOptionBoolean;importcom.cognos.developer.schemas.bibus._3.ReportServiceQueryOptionEnum;importimportcom.cognos.developer.schemas.bibus._3.SearchPathSingleObject;importcom.cognos.developer.schemas.bibus._3.SpecificationFormatEnum;publicclass{ //gettheReport**@paramconnectCognos8*@paramreport publicStringgetReportSpec(CRNConnectconnect,BaseClassWrapper{{ StringreportSpec= if((connect.getReportService()!= &&(report!= &&(connect.getDefaultSavePath()!= // StringreportPath= // //是否 表定 Option[]qOpts //是否 表定 ReportServiceQueryOptionBooleanupgradeSpecFlag=new // ReportServiceQueryOptionSpecificationFormatspecFormat=new // qOpts[0]= qOpts[1]= // // AsynchReplyqResult new newParameterValue[] // // if((qResult.getStatus()== ||(qResult.getStatus()==AsynchReplyStatusEnum.stillWorking)) while((qResult.getStatus()==||(qResult.getStatus()==AsynchReplyStatusEnum.stillWorking)){qResult=Option[]{});}}
////extractthereportif(qResult.getDetails{for(inti=0;i<qResult.getDetails().length;{if(qResult.getDetails()[i]instanceof{reportSpec((AsynchDetailReportObject)qResult.getDetails()[i]).getReport().getSpecification().g}}}//}catch(java.rmi.RemoteException{}}return}}应用程序或者设备。可以控制用户是否有系统中特定数据或者可以控制内容库contentstore中对象的权限,例如文件夹,报 用户,用户组和角色,也可以使用Cognos8中创建的用户组和角色。但不能在Cognos8中创建用户。可以通过BIBusAPI来创建删除Cognos用户组和角色,添加删除**Copyright2005CognosIncorporated.All *CognosandtheCognoslogoaretrademarksofCognos*Description:Thisfilecontainsmethodsforhandlinggroupsand usingtheCognos8importimportcom.cognos.developer.schemas.bibus._3.Group;importimportcom.cognos.developer.schemas.bibus._3.MultilingualToken;importcom.cognos.developer.schemas.bibus._3.PropEnum;importcom.cognos.developer.schemas.bibus._3.Role;importcom.cognos.developer.schemas.bibus._3.Sort;importpublicclass{ //内容库contentstore CSHandlerscsHandler=new *CreateanewCognosgroup.创建一个新的Cognos *@param Cognos8 *@param *@param * publicStringcreateGroup(CRNConnectconnection,StringgroupName,String throws Createanewgroup.BaseClass BaseClassgroup=new // Stringpath= // //NotethatthedefaultNameofthenewobjectwillbeset //thefirst(inthiscase,only)name MultilingualToken[]names=new names[0]=new Locale[]locales= group.setName(new //往内容库contentstore中添加新用户组 return "Successfullycreatedgroup + +"intheCognos *CreateanewCognosrole.新增一个Cognos *@param Cognos8 * 返回添加成功的信息 publicStringcreateRole(CRNConnectconnection,StringroleName,String throws ////新角色,BaseClass类 BaseClassrole=new // Stringpath= // //NotethatthedefaultNameofthenewobjectwillbeset //thefirst(inthiscase,only)name MultilingualToken[]names=new names[0]=new Locale[]locales= role.setName(new //往内容库contentstore中添加新角色 returnreturn"Successfullycreatedrole++"intheCognos} *将用户添加到指定用户组下 *@param Cognos8 * * * publicString CRNConnect String String throws // BaseClassuser[]=csHandler.queryObjectInCS(connection,**publicString*{{addToGroup(connection,addToGroup(connection,pathOfGroup,}}catchcatch(java.rmi.RemoteException{{returnreturn"Exceptioncaught:"+}}returnreturn"Successfullyadded"+++"to"+}}*将用户添加到指定的角色下*被添加的用户对象的搜索路径* Cognos8*@param*返回添加成功的信息角色对象的搜索路径* CRNConnectCRNConnectStringStringStringStringthrowsthrows{{////BaseClassBaseClassuser[]=csHandler.queryObjectInCS(connection,{{addToRole(connection,addToRole(connection,pathOfRole,}}catchcatch(java.rmi.RemoteException{{returnreturn"Exceptioncaught:"+}}returnreturn "Successfullyadded"+pathOfUser+"to"+ *将用户或者用户组添加到用户组下 *@param Cognos8 * * publicvoid CRNConnect String BaseClass[] throws //得到当前组的成员 PropEnum[]props {PropEnum.defaultName,PropEnum.searchPath,PropEnum.members}; Groupgroup (Group)csHandler.queryObjectInCS(connection,pathOfGroup, // if(group.getMembers().getValue()== group.setMembers(new csHandler.updateObjectInCS(connection,newBaseClass[]{group // //Preservealltheexisting BaseClass[]newMembers newBaseClass[group.getMembers().getValue().length+ intindex= BaseClassobj= for(inti=0;i<group.getMembers().getValue().length; obj=//BaseClass[]memberProps newMembers[index]= newMembers[index]=group.setMembers(new //Updatethe csHandler.updateObjectInCS(connection,newBaseClass[]{group *给指定角色添加成员 *@param Cognos8 * 角色的搜索路径 * 用户,组或角色 publicvoid CRNConnect String BaseClass[] throws //得到当前角色下的成员 PropEnum[]props {PropEnum.defaultName,PropEnum.searchPath,PropEnum.members}; Rolerole=(Role)csHandler.queryObjectInCS(connection,pathOfRole, //如果没有成员则直接 if(role.getMembers().getValue()== role.setMembers(new csHandler.updateObjectInCS(connection,newBaseClass[]{role // //Preservealltheexisting BaseClass[]newMembers newBaseClass[role.getMembers().getValue().length+ intindex= BaseClassobj= for(inti=0;i<role.getMembers().getValue().length; obj= newMembers[index]= newMembers[index]=role.setMembers(new //Updatethe csHandler.updateObjectInCS(connection,newBaseClass[]{role *从组中删除用户 *@param Cognos8 * 组的搜索路径 * 用户的搜索路径 * 返回成功添加的信息 publicString CRNConnect String String throws // return"Successfullydeleted++"from+} *从角色中删除用户对象 *@param Cognos8 * 角色的搜索路径 * * publicString CRNConnect String String throws // returnreturn"Successfullydeleted++"from+} *从指定的组中删除指定的成员 *@param Cognos8 * * 组成员 publicvoid CRNConnect String BaseClass throws //得到当前组中的成员 PropEnum[]props {PropEnum.defaultName,PropEnum.searchPath,PropEnum.members}; BaseClass[]objects csHandler.queryObjectInCS(connection,pathOfGroup, Groupgroup= //保留除待删除成员外的所有成员 BaseClass[]newMembers newBaseClass[group.getMembers().getValue().length- intindex= BaseClassobj= for(inti=0;i<group.getMembers().getValue().length; obj= BaseClass[]memberProps csHandler.queryObjectInCS(connection,ifif != && != newMembers[index]= group.setMembers(new //更新成员 *从指定角色中删除指定成员 *@param Cognos8 * 角色的搜索路径 * 成员对象 publicvoid CRNConnect String BaseClass throws //得到当前角色下的成员 PropEnum[]props {PropEnum.defaultName,PropEnum.searchPath,PropEnum.members}; BaseClass[]objects csHandler.queryObjectInCS(connection,pathOfRole, Rolerole= //保留除待删除成员外的所有成员 BaseClass[]newMembers newBaseClass[role.getMembers().getValue().length- intindex= String String BaseClassobj= for(inti=0;i<role.getMembers().getValue().length; obj= BaseClass[]memberProps csHandler.queryObjectInCS(connection, csMember= csMemberPath= if != newMembers[inde
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年二建法规安全生产责任划分真题题库(含答案及解析)
- 2026年哈密地区哈密市中小学编制教师招聘笔试参考题库及答案详解
- 2026年承德市双滦区中小学编制教师招聘考试备考题库及答案详解
- 2026年蚌埠市蚌山区中小学编制教师招聘笔试参考题库及答案详解
- 2026年贵港市覃塘区中小学编制教师招聘笔试参考试题及答案详解
- 2026年湖北省中小学编制教师招聘考试参考试题及答案详解
- 2026年天水市麦积区中小学编制教师招聘笔试备考试题及答案详解
- 2026年徐州市泉山区中小学编制教师招聘笔试参考试题及答案详解
- 2026年山东省青岛市中小学编制教师招聘笔试模拟试题及答案详解
- 2026年怀化市鹤城区中小学编制教师招聘笔试备考试题及答案详解
- 《铁路技术管理规程》(普速铁路部分)
- 控制错装和漏装配件-副本
- 都兰县创盛矿业有限责任公司直沟铅锌矿矿山地质环境保护与土地复垦方案
- DB43-T 2891-2024 中医特色护理技术规范 灸法类
- 23秋国家开放大学《液压气动技术》形考任务1-3参考答案
- 标准化厂房施工进度计划
- 武钢体育中心初步设计说明
- 血液净化中心应急预案及处置流程
- 林业地形图使用基础
- 高压防护架搭设方案
- 钻镗专用机床液压系统设计
评论
0/150
提交评论