BusinessObjects Board

LDAP automatic refresh

Hi All.

Wanted to share something with you as I have found many people have been looking for this in some form or another.

I have an LDAP directory and have successfully linked BOXI R2 SP2 FP2.4 to this. As you will all know BOXI does not poll for changes to the LDAP directory and thus when you add/delete/modify a user the changes are not reflected in BOXI.

What you have to do is create a Program Object in BOXI that will force the refresh.

I have implemented this using Java as this can be used under both Windows and Unix (I use Unix).

This java program implements the IProgramBaseEx class meaning that you do not need to specify a logon or a CMS. Because the Java program is contained inside the CMS repo it knows your CMS. Because you will add this (and schedule this) program objects as the Administrator, it uses this account to run the object.

All the java program does is update the LDAP information in the repository. The SI_UPDATE_TS property is changed to todays date, however it is the COMMIT that forces the CMS to request a refresh from LDAP.

Note that I have supplied the .java file for you and also the .jar file. I know some people are wary of using executables provided by people uknown to them.

Instructions:

  1. Download UpdatePlugin.java
  2. Download UpdatePlugin.bat
  3. Create a folder lib_XIR2SP2
  4. Search for and copy all *.jar files from Business Objects directory to lib_XIR2SP2
  5. Run the bat from DOS
  6. Jar the file (jar cfm UpdatePlugin *.class)
  7. Add to BOXI as a Program Object using the CMC. Notice that you must update the “Class to run:” (under Process/Paramters) to UpdatePlugin.
  8. Schedule to run.

(Yes, you can create a JAR in Windows and run this inside the Program Job Server in Unix)

If you download the Jar file all you will have to do is :

  1. Add to BOXI as a Program Object using the CMC. Notice that you must update the “Class to run:” (under Process/Paramters) to UpdatePlugin.
  2. Schedule to run.

Just incase the files do not work here is the Java Code:



import java.util.Date;
import com.crystaldecisions.sdk.exception.SDKException;
import com.crystaldecisions.sdk.framework.CrystalEnterprise;
import com.crystaldecisions.sdk.framework.IEnterpriseSession;
import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
import com.crystaldecisions.sdk.occa.infostore.IInfoObject;
import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
import com.crystaldecisions.sdk.plugin.authentication.ldap.IsecLDAP;
import com.crystaldecisions.sdk.plugin.desktop.program.IProgramBaseEx;


public class UpdatePlugin implements IProgramBaseEx{

  public void run(IEnterpriseSession enterpriseSession, IInfoStore infoStore, IInfoObject infoObject, String objectId, String[] args) throws SDKException {
		
    try {
      System.out.println("Scheduled Java App for Update LDAP");
      System.out.println("CMS is " + enterpriseSession.getCMSName());
      System.out.println("Querying for the plugin");

      //Query for any object in the CMS.
      String lQuery = "SELECT TOP 1 * " 
                    + "FROM CI_SYSTEMOBJECTS "
                    + "WHERE SI_NAME='secLDAP'";
		
      IInfoObjects lInfoObjects = (IInfoObjects) infoStore.query(lQuery);
			
      if (lInfoObjects.size() > 0) {
        System.out.println("A plugin was found");
        IsecLDAP lPlugin = (IsecLDAP) lInfoObjects.get(0);
			
        System.out.println("Old value: " + lPlugin.properties().getProperty("SI_UPDATE_TS").getValue());
			
        lPlugin.properties().getProperty("SI_UPDATE_TS").setValue(new Date());
			
        System.out.println("Commiting the value");
        infoStore.commit(lInfoObjects);
			
        }//if
      
      else{
        System.out.println("no plugin was found using SQL [" + lQuery + "]");
        }//else	

      }//try 
		
      catch (SDKException lException) {
        lException.printStackTrace();
        }//catch
	
    }//run

  }//class

Compile_Class_R2SP2_bat.zip (0.0 KB)
UpdatePlugin_java.zip (1.0 KB)
UpdatePlugin_jar.zip (1.0 KB)


stephenEclectic (BOB member since 2004-12-07)

Thanks for the post. We were having this problem as well and your program appears to have worked as advertised.

That said, a couple of observations.

  1. The .bat file has each of the lib entries in it twice.

  2. We’re at SP1 on BOXI and not all of the libs were present on our system.
    Specifically (and I renamed the directory from what it is in the original bat file only because of the mnemonic difference to our system):

“.\lib_XIR2\commons-codec.jar”;
“.\lib_XIR2\jsr173_1.0_api.jar”;
“.\lib_XIR2\ojdbc14.jar”;
“.\lib_XIR2\softwareInventory.jar”;
“.\lib_XIR2\sqljdbc.jar”;
“.\lib_XIR2\swt.jar”;
“.\lib_XIR2\xpp3-1.1.3_8.jar”;
“.\lib_XIR2\xstream-1.2.jar”

None of those entries seem to be referenced anyway. It compiled without them just fine and ran ok as well.

  1. Out of the box, you may not have java set up properly on your server. If not you will get an error to the effect that the java executable cannot be found when you try to schedule/run UpdatePlugin. What I had to do to resolve this was to add the java directory to the path statement in the system environment variable (Windows control panel). I also had to create a JAVA_HOME and JAVA_SDK environment variable. I may not have needed the JAVA_SDK environment variable, but I went ahead and added it anyway.

You will also have to go into the CCM and restart the Program Job Server to pick up the changes to your environment variables.

All of this can be done on the fly without having to reboot or restart anything else.

Jim Wagner
NC State University


jrwagner (BOB member since 2007-05-16)

Hi,

Many Thanks for the post, I am new to Business Objects. We are also facing the same issue in BOXIR2SP2.

Can you please help us for the below queries;

Instructions:

  1. Download UpdatePlugin.java
  • Downloaded Successfully
  1. Download UpdatePlugin.bat
  • Downloaded Successfully
  1. Create a folder lib_XIR2SP2
  • Is there any specific location do we need to create this folder? (eg: under Business Objects folder like that)
  1. Search for and copy all *.jar files from Business Objects directory to lib_XIR2SP2
  • Done
  1. Run the bat from DOS
  • Is there any specific location to copy the bat file and run from that folder?
  1. Jar the file (jar cfm UpdatePlugin *.class)
  • Done
  1. Add to BOXI as a Program Object using the CMC. Notice that you must update the “Class to run:” (under Process/Parameters) to UpdatePlugin.
  • Can you please give me more details on how to update the ‘Class to run’ under Process/Parameters
  1. Schedule to run.
  • Done

Regards,
Siva.


Sivanesan (BOB member since 2010-08-24)

Is it possible to customize LDAP plugin, if yes , could you please guide me


navkalp (BOB member since 2011-11-04)

hello , can i find how can i map group in LDAP with java sdk ?
i search and i dont found how can i map a group …
thanx a lot


nada (BOB member since 2020-04-08)