This document provides a way get universe name(.UNV universes) and their associated connection names using the BusinessObjects Enterprise Platform Java SDKs.
For more scripts and information on how to run these scripts refer to the blog avaiable here:
shawn.penner/blog/2013/06/04/scripts-and-samples
Below is the Java Server Pages (JSP) sample
Notes:
•You would need to change the userName, password, cmsName to the values specific to your enterprise server in the provided sample code.
• The sample code is tested with BI 4.0 and 4.1 version of SAP BusinessObjects Platform.
Universe And Connection Details |
---|
<%@ page import = "com.crystaldecisions.sdk.framework.*" %> <%@ page import = "com.crystaldecisions.sdk.occa.infostore.*" %> <%@ page import = "java.util.*" %> <%@ page import = "java.io.*" %> <%@ page import = "com.crystaldecisions.sdk.properties.IProperties"%> <%@ page import = "com.crystaldecisions.sdk.properties.IProperty"%> <html> <head></head> <body> <table border="2" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1"> <tr> <th width="30%"> Universe Name</th> <th width="30%"> Connection Name</th> </tr>
<% IInfoStore iStore=null; String connectionTotalValue=null; String connectionName=null; String user = "Administrator"; //administrator username String password = "Password1"; //administrator password String cmsName = "localhost:6400"; //cms name String apsAuthType = "secEnterprise"; try { IEnterpriseSession es = CrystalEnterprise.getSessionMgr().logon(user, password, cmsName, apsAuthType); iStore = (IInfoStore)es.getService("","InfoStore"); String query="select si_id,si_name,si_dataconnection from ci_appobjects where si_kind='universe'"; IInfoObjects universeObjects = (IInfoObjects)iStore.query(query); for(int i=0;i<universeObjects.size(); i++) { IInfoObject universeObject = (IInfoObject)universeObjects.get(i); out.print("<tr><td>"+ universeObject.getTitle() + "</td>"); IProperties universeProperties=(IProperties)universeObject.properties(); IProperties connectionProperties=(IProperties)universeProperties.getProperties("SI_DATACONNECTION"); if(connectionProperties != null) { IProperty connectionTotal=(IProperty)connectionProperties.getProperty("SI_TOTAL"); if(connectionTotal != null) { connectionTotalValue=connectionTotal.getValue().toString(); Integer outputFile=new Integer(connectionTotalValue); for(int j=1 ; j<=outputFile.intValue() ; j++) { String connectionID=connectionProperties.getProperty(""+j).getValue().toString(); IInfoObjects connectionObjects=iStore.query("Select si_id,si_name from ci_appobjects where si_id="+connectionID); IInfoObject connectionObject=(IInfoObject)connectionObjects.get(0); connectionName=connectionObject.getTitle(); out.print("<td>"+connectionName+ "</td></tr>"); } } } } } catch(Exception e) { out.println(e); } %> |