Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

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:

  • Stops web intelligence Processing servers
  • Deletes Cache files from web intelligence server cache directory
  • Starts web Intelligence processing Servers

Note: This utility must be run during BO system downtime as it requires WIPS to restart.


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 delete shared web intelligence server cache in a BusinessObjects environment

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());
  }
}
}
  • Copy the above code into a text file and save it as ClearCache.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 eclipse 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:

               http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_boejava_dg_en.zip

    • For XI 3.1

               http://help.sap.com/businessobject/product_guides/boexir31/en/boesdk_java_dg_12_en.zip

  • 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:

  1. 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
  2. Select the folder "Objects" and click on Manage | Add | Program File
  3. Choose as Program Type Java and add DeleteCacheWebi.jar
  4. Right Click on DeleteCacheWebi within your Objects folder and choose Properties | Default Settings | Program Parameters
  5. Specify as "Class to run:" ClearCache.
  6. In the Arguments section, pass the below mentioned parameters:
    1. Path to web intelligence server cache directory. Following two scenarios are applicable here:
      1. WIPS Cache directory is hosted on the server box where Program Job Server is running:

                       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

1 Comment
Labels in this area