In this blog, I will be demonstrating a program object to automate the process of deleting web intelligence cache files generated by Web Intelligence Processing Server (WIPS). This utility is developed based on the assumption that all web intelligence servers in a BO environment share a common cache pool.
Following is the brief workflow of this utility at the time of execution:
Note: This utility must be run during BO system downtime as it requires WIPS to restart.
Creation of a Java Program Object:
import java.io.*;
import com.crystaldecisions.sdk.plugin.desktop.program.*;
import com.crystaldecisions.sdk.framework.*;
import com.crystaldecisions.sdk.occa.infostore.*;
import com.crystaldecisions.sdk.exception.*;
import com.crystaldecisions.sdk.plugin.desktop.server.IServer;
import com.crystaldecisions.sdk.occa.infostore.CePropertyID;
public class ClearCache implements IProgramBase {
public void run(IEnterpriseSession enterprisesession,IInfoStore iStore,String str[]) throws SDKException
{
System.out.println("Connected to " + enterprisesession.getCMSName() + "CMS");
System.out.println("Using the credentials of " + enterprisesession.getUserInfo().getUserName() );
try
{
iStore = (IInfoStore) enterprisesession.getService("", "InfoStore");
IInfoObjects infoobjects = iStore .query("SELECT * FROM CI_SYSTEMOBJECTS WHERE SI_SERVER_DESCRIPTOR = 'webiserver'");
boolean commandSuccess;
for(int i=0;i<infoobjects.size();i++)
{
IServer boServer=(IServer)infoobjects.get(i);
int timeout = 20;
commandSuccess = boServer.manageServer(IServer.CE_SERVER_STOP,timeout,"","");
if(commandSuccess == true)
System.out.println("Server has been stopped");
else
System.out.println("Server has NOT been stopped!");
}
File file = new File(str[0]);
String[] myFiles;
if(file.isDirectory()){
myFiles = file.list();
for (int i=0; i<myFiles.length; i++) {
File myFile = new File(file, myFiles[i]);
myFile.delete();
}
System.out.println("Files are deleted successfully");
}
for(int i=0;i<infoobjects.size();i++)
{
IServer boServer1=(IServer)infoobjects.get(i);
int timeout = 20;
commandSuccess = boServer1.manageServer(IServer.CE_SERVER_START,timeout,"","");
if(commandSuccess == true)
System.out.println("Server has been started!");
else
System.out.println("Server has NOT been started!");
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}
http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_boejava_dg_en.zip
http://help.sap.com/businessobject/product_guides/boexir31/en/boesdk_java_dg_12_en.zip
Publishing the Java Program Object to the Enterprise System:
In this scenario you can specify the cache directory path in the usual format e.g. C:\ProgramFiles(x86)\BusinesObjects\Node.WebIntelligenceProcessingServer
b.WIPS Cache directory is hosted on a remote server or SAN Disk:
In this scenario you can specify the cache directory path in the UNC syntax for windows i.e. \\server\share\file_path
e.g. \\172.198.101.11\D$\webiCache
Note: The account on which BO services are running must have required access on the remote box in order to perform the read/write/delete operation
7. Test "Run Now" and schedule the Program Object.
Upon successful execution of the program object, the cache for the web intelligence server is deleted and webi services are started after deletion of cache in a Business Objects environment
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |