This document provides a way to get the universe revision number using Business Intelligence platform Java SDK.
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
Note:
•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 BO XI 3.1 version of SAP BusinessObjects Platform
Get Universe Revision Number |
---|
<%@ page import = "com.crystaldecisions.sdk.framework.*, com.crystaldecisions.sdk.occa.infostore.IInfoStore, com.crystaldecisions.sdk.occa.infostore.IInfoObject, com.crystaldecisions.sdk.occa.infostore.IInfoObjects, com.businessobjects.sdk.plugin.desktop.universe.*, com.crystaldecisions.sdk.exception.SDKException, com.crystaldecisions.sdk.properties.*, com.crystaldecisions.sdk.plugin.desktop.common.*, java.util.*" %> <% String userName="administrator-user"; //administrator user String password="administrator-password"; // administrator password String CMSName="localhost:6400"; //CMS name String AuthType="secEnterprise"; //Authentication try { IEnterpriseSession boeSession = CrystalEnterprise.getSessionMgr().logon(userName, password, CMSName,AuthType); IInfoStore iStore = (IInfoStore)boeSession.getService("InfoStore"); IInfoObjects oInfoObjects = iStore.query("SELECT SI_ID,SI_NAME,SI_REVISIONNUM FROM CI_APPOBJECTS WHERE SI_KIND='Universe'"); for(int i=0;i<oInfoObjects.size();i++) { IInfoObject universeInfoObject=(IInfoObject)oInfoObjects.get(i); IUniverse oInfoObject = (IUniverse)universeInfoObject; IProperties props=universeInfoObject.properties(); IProperty universeProperty=(IProperty)props.getProperty("SI_REVISIONNUM"); out.println("<b>Universe ID</b>: "+oInfoObject.getID()+"<br>"); out.println("<b>Universe Name</b>: " + oInfoObject.getTitle() + "</br>"); if(universeProperty!=null) { int universeRevisionNumber=oInfoObject.getRevisionNumber(); out.println("<b>Revision Number </b>: " +universeRevisionNumber + "</br>"); } else { out.println("<b>Revision Number </b>: SI_REVISIONNUM Not Found</br>"); } out.println("-----------------------------------------------------------------------------------------------</br>"); } boeSession.logoff(); } catch(Exception e) { out.println(e); } %> |