« How come the journalist or the editor didn't spot this?? | Main| To go with the previous entry a little screenshot »

How to show people's telephone extensions in the buddylist

Category

So there is something very cool about Sametime (actually a lot of things), which very few administrators realize, you can write your own Java classes to customize various LDAP fields that are used by Sametime.  This feature is most useful for name mappings and manipulations for resolving and searching names, but with some out of the box thinking, you can use this feature to make Sametime more user friendly.  For this example your Sametime server will need to be using an LDAP directory, but if you're watching IBMs direction you're probably already doing that anyway.  If you want to do something for Domino Directories take a read of this document.  I don't know if this technique works with Sametime 3.1 as I haven't checked the documentation.  To do this, you're going to need a Java compiler and a few hours of Java experience to understand the code (it really isn't complex).  You'll also need to have the LDAP server capable of returning the users cn (common name) and telephoneHumber, these LDAP directory attributes can be different with different LDAP servers, so you'll need to figure out yours, but I'll refer to them as cn and telephoneNumber here.
There are basically 5 steps involved in setting up Sametime to display names this way:


1.        Configure the LDAP directory to return the correct attributes (I will not cover this step)

2.        Write the Java source code file that returns the user name.        
3.        Compile the source code file and copy the resulting Java class file to the Sametime server.

4.        Update the Sametime.ini file.

5.        Enter the Java class and method name in the Sametime Administration Tool LDAP directory settings.


"The attribute of the person entry that defines the person's name" setting in the LDAP Directory settings of the Sametime Admin tool controls the format of ther users display name, by default this is set to "cn" a users common name, something like "Carl Tyler/US/ACME" as an example.   This is the value displayed in a users Sametime Connect client after they have added a used to their buddylist.


So for what we want to do here, we now need to write a Java class that takes the cn and extension directory attributes and combines these values into a single display name in the format of common name x ext. so we'd see something like "Carl Tyler/US/ACME x707"


Step 2 - Write the Java source code file that returns the users name in the format we want.

Note
 The Java code that you write must be compatible with the Java Run-Time Environment (JRE 1.3) because of the JRE installed with Domino/Sametime
The code sample below shows the code you might use to combine the values stored in the cn and telephoneNumber LDAP directory entry attributes into a single display name in the format laid out above.

/**

* This class combines values stored in the commonname and extension LDAP directory entry
* attributes into a single display name in the format of commonName xtelephoneNumber.

* Example; Carl Tyler/US/ACME x707

* If extension is empty, it does not display the xtelephoneNumber
*/


public class  StLdapCustomizedNameDisplay

{

public static String displayName (String commonName, String telephoneNumber)  

{

            String result = "";

            if (telephoneNumber.length() == 0)
                          result = commonName;

            else
                          result = commonName + " x" + telephoneNumber;

                       

            return result;

             
    }

}

As I promised it really isn't complex code.


Step 3 - Compiling the source file and copying the Java class file to the Sametime server

To complete this step, perform these procedures:

1.        
Compile the Java source code file to produce the Java class file. (How you do this would depend on your Java SDK)
This example assumes you compile the source code file example from the previous procedure to produce a Java class file named "StLdapCustomizedNameDisplay.class."

2.        
Copy the compiled class file (StLdapCustomizedNameDisplay.class) to the "java" subdirectory of the Sametime server installation directory. In a default Sametime server installation, the correct directory path for the class file is:
c:\Lotus\Domino\java.


Note
 If this directory doesn't exist you will need to create it. You should copy the Java class file to the C:\Lotus\Domino\java location because this is the default class path specified for the Meeting Services in the Windows registry settings. Copying the class file to this location ensures that LDAP directory searches conducted from both Meeting Services clients and Community Services clients will return user names in the programmed format.

Step 4 - Update the Sametime.ini file

In this procedure, you update the ST_JAVA_CLASS_PATH and the ST_JAVA_JVM_PATH parameters in the Sametime.ini file on the Sametime server. This step ensures that the Sametime Community Services class path and JVM location settings are configured appropriately for the environment.

The ST_JAVA_CLASS_PATH parameter must specify the location of the Java class file copied in the previous step (c:\Lotus\Domino\java\StLdapCustomizedNameDisplay.class in this example).
The ST_JAVA_JVM_PATH parameter should specify the location of the jvm.dll file used by the Sametime Meeting Services. By default, the Meeting Services use the jvm.dll file located at c:\Lotus\Domino\wsc-jre\jre\bin\classic\jvm.dll.  

To update the Sametime.ini file:

1.        
Use a text editor to open the Sametime.ini file located in the C:\Lotus\Domino directory.
2.        
In the [Config] section of the Sametime.ini file, ensure that the ST_JAVA_CLASS_PATH parameter specifies the java subdirectory of the Sametime server installation directory (default C:\Lotus\Domino\java), as shown in the example below:
ST_JAVA_CLASS_PATH=C:\Lotus\Domino\StConfig.jar;C:\Lotus\Domino\StConfigXml.jar;C:\Lotus\Domino\xerces.jar;C:\Lotus\Domino\java

3.        
In the [Config] section of the Sametime.ini file, ensure that the ST_JAVA_JVM_PATH parameter specifies the directory path to the jvm.dll file on the Sametime server that is used by the Meeting Services. The recommended setting for the ST_JAVA_JVM_PATH parameter is:
ST_JAVA_JVM_PATH=C:\Lotus\Domino\wsc-jre\jre\bin\classic\jvm.dll


Note
 The ST_JAVA_JVM_PATH parameter specifies the to the JVM loaded by the Community Services. Either the Community Services or the Meeting Services can load the JVM. Specifying the same JVM for both of these services ensures consistent searching behavior for both Community Services and Meeting Services clients, regardless of which of these services loads the JVM.
4.        
Save and close the Sametime.ini file.

Step 5 - Enter the Java class and method name in the Sametime Administration Tool LDAP Directory settings

Entering the Java class and method name in the Sametime Administration Tool LDAP Directory settings is the last of four steps required to use a Java class to control the format of user names returned in LDAP directory searches.

In this procedure, you enter the Java class and method name into "The attribute of the person entry that defines the user's name" setting in the LDAP Directory settings of the Sametime Administration Tool.
Use the format "Classname.methodname()" when entering the Java class name and method name in the Sametime Administration Tool setting. Following our earlier example, you would enter the class name and method name as  "StLdapCustomizedNameDisplay.displayName(commonName, telephoneNumber)."

Follow the instructions below:        

1.        
From the Sametime server home page, click the "Administer the Server" link to open the Sametime Administration Tool.
2.        
Choose LDAP Directory - Basics.
3.        
In the "Search settings for server" drop-down list, select the LDAP server that contains the LDAP directory for which you want to modify the "The attribute of the person entry that defines the user's name" setting.
4.        
In the "The attribute of the person entry that defines the person's name" setting, type the class name and method name in the format classname.methodname(). For example:
StLdapCustomizedNameDisplay.displayName(cn, telephoneNumber)

5.        
Click Update and restart the server for the change to take effect.

Now, to see the new names, you will need to re-add people to your buddylist, but if your LDAP server is correctly serving up commonName and telephoneNumber, you should see something like "Carl Tyler/US/ACME x707" .  Now you can tweak the code yourselves to do things like remove the OUs if you wish, or put cell phone number in there, all sorts!! I suppose some of you want the compiled class file too.  
Here it is, not supported, I'm not responsible for it etc. etc.

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::rolleyes:;-)