I have been working on few requirements to have a schedulable object in the enterprise system to have details about the objects from the CMS repository using the BusinessObjects Enterprise Java SDKs.
For this have used the BusinessObjects scheduler apart from having a third party scheduler by creating a Java Program Objects.
In this blog, I will be presenting one such example of getting the BusinessObjects Server Status by creating a java program object.
- BusinessObjects Enterprise System
- BusinessObjects Enterprise Java SDKs
Creation of a Java Program Object:
- For creating a java program object, you need to write a java class which has to implement the interface IProgramBase.
- Once you create the java file, you would then need to create a jar file for the java class by setting all the required jars in your classpath.
- Below is a sample java file to retrieve the server status of BusinessObjects servers and export the results to an excel file.
|Server Status Export to Excel|
public class ServerServices implements IProgramBase
System.out.println(“Connected to ” + enterprisesession.getCMSName() + “CMS”);
for(Iterator iserver = serverInfoObjects.iterator() ; iserver.hasNext() ; )
server = (IServer) iserver.next();
System.out.println(” Excel file created successfully”);
- Copy the above code into a text file and save it as ServerServices.java. Please make sure that your java class name and file name should exactly be the same(case sensitive).
- Compile the above java class by having all the jars required to run the file in the classpath. You can also use ecllipse IDE to compile and create jar file. The list of jars can be found from the developers guide available at below links
For BI 4.0
For XI 3.1
- Refer to the section ‘JAR files needed for deployment of Business Objects Software’ from the above guides to get the list of jar files.
- You would specifically need the jar files listed under ‘BusinessObjects Enterprise Java SDK’
- Once you have compiled the code, create a jar file for your compiled .class file.
Publishing the Java Program Object to the Enterprise System:
- In the CMC, go to Folders and create new folder “Objects” or navigate to an existing folder where you want to publish the program object
- Select the folder “Objects” and click on Manage | Add | Program File
- Choose as Program Type Java and add ServerServices.jar
- Right Click on ServerStatus within your Objects folder and choose Properties | Default Settings | Program Parameters
- Specify as “Class to run:” ServerServices.
- In the Arguments pass the the location along with excel file name where you want the excel file to be generated(eg. c:/serverstatus.xls).
- Test “Run Now” and schedule the Program Object.
You would then have an excel file generated at the above specified location which contains the server status details.