Article draft of to THE VIEW

Just shot of an e-mail with a draft of my next article for THE VIEW. The working title is “Into the blackbox – a tour of the Sametime Business Card system” and will discuss and describe the business card system, a.k.a. UserInfo, of Sametime and how to configure, mix and match blackboxes and how to write your own blackbox implementations. The article is a little less development focused than I’m used to but I still managed to sneak in some Java code… 😉

No word yet on when it’s gonna be out but I’m guessing the March/April 2008 issue.

More on Sametime blackboxes

I was at a customer site today and among other things I was asked to take a look on a Sametime business card issue they were having with a custom blackbox. The issue was that the picture was not showing up in Sametime. They did already have a PMR open with Lotus Support but they had been unable to solve the issue.

The customer is using the “custom” blackbox implementation (com.ibm.sametime.userinfo.userinfobb.UserInfoNotesCustomBB) provided by IBM Lotus as part of Sametime 7.5.1 where you can specify a database path, a view and some field names in the UserInfoConfig.xml and the rest is taken care of for you. While this is well and good it still didn’t work. The problem was trivial to solve but it was difficult to explain why it simply didn’t work.

The issue was that the attributes used to specify the database path and view name are case sensitive!! The customer had simply followed the XML convention of using lowercase attribute names which turned out to be wrong. When you use this implementation the database attribute *has* to be called “DbName” and the view attribute *has* to be called “View”. If you get the casing wrong it wont work!

New PMR coming up – change the implementation of the class to make the attribute names case insensitive. Or read the article in THE VIEW 2008 Technical Supplement to see how to easily write your own blackbox… 🙂

Sametime blackboxes (update)

Just a short update on my Sametime blackboxes post from earlier today.

As noted by Julian Robichaux and Urs Meli in comments I had a typo in the previously posted code as I had managed to insert the wrong looping code twice… 😦 The correct, correct looping should be:

public static void main(String[] args) {
   LinkedList l = new LinkedList();
   for (int i=0; i<10; i++) {
      l.addLast(new Simple(i));
   }
   while (l.size() > 0) {
      System.out.println("" + ((Simple)l.removeFirst()).getI());
   }
}

Sametime blackboxes

This week I have been writing an article on writing custom Sametime blackboxes for THE VIEW 2008 Technical Supplement and during my research I have stumbled across of number of interesting things. One of them is quite serious so I thought I ought to share.


You might not know this but when you hover your mouse over a contact in Sametime Connect 7.5 the data from the business card is actually retrieved using a servlet on the Sametime server. This servlet in turn uses a number of so-called blackboxes to fetch the actual information. You can write your own blackbox implementation using an API provided by IBM Lotus to fetch the business card data from another data source than the Sametime directory (whether that be Domino or LDAP).

First of all let me say that I like the idea of the blackbox API and that it makes total sense that I can extend the Sametime Connect business card system.

There is just two caveats I would like to point your attention to:

  1. The configuration file you edit is IBM Confidential
  2. The lifecycle methods are not called consistently

Configuration file

Blackbox configuration is done in a file called UserInfoConfig.xml in the Domino binary directory. On the top of this file there is a header saying that the file is IBM Confidential which to me is crazy since it’s for configuration and is publicly available.

Anyway this is just funny – the second part is worse.

Lifecycle methods

The interface you extend to write a blackbox has an init() method which is called once the blackbox pool is constructed and a terminate() method which is supposedly called upon blackbox termination. And here lies the problem – the terminate() method is only called for half the blackboxes. This is found out using a simple blackbox that writes to the Domino console once the different methods are called.

This effectively means that the whole lifecycle management cannot be used at all. The methods are there, I gather, to allow you to acquire long-lived resources in the init() method and assure their termination in the terminate() method. If the terminate() method isn’t called this can lead to resource leaks which isn’t very nice. What’s worse is that they can be very hard to diagnose.

I have found the problem in the blackbox pool code and it is a typical novice programmer mistake. Consider the following code:

import java.util.LinkedList;

public class RookieLooping {

   public static void main(String[] args) {
      LinkedList l = new LinkedList();
      for (int i=0; i<10; i++) {
         l.addLast(new Simple(i));
      }
      for (int i=0; i<l.size(); i++) {
         System.out.println("" + ((Simple)l.remove(i)).getI());
      }
   }

   public static final class Simple {
      private int i = 0;
      public Simple(int i) {
         this.i = i;
      }
      public int getI() {
         return i;
      }
   }
}

This code will result in the following output:

0
2
4
6
8

This isn’t what the programmer expected. He/she probably expected something like this:

0
1
2
3
4
5
6
7
8
9

If you look at the code you can probably see why. The for-loop used to remove elements from the LinkedList is the source of the problem. It only considers every second element of this list. A correct implementation could be (although there are numerous ways of doing it):

public static void main(String[] args) {
   LinkedList l = new LinkedList();
   for (int i=0; i<10; i++) {
      l.addLast(new Simple(i));
   }
   while (l.size() > 0) {
      System.out.println("" + ((Simple)l.removeFirst()).getI());
   }
}

I have reported this problem to IBM Lotus Support but for now, as of Sametime 7.5.1 CF1, you cannot rely on the terminate() method being called.

Just beware… (I have reported the issue to Lotus Support and is awaiting a SPR number).

What’s up with the “me too” articles on developerWorks?

After reading the last installment in an article series on Notes 8 development on developerWorks I have to wonder how many articles they (developerWorks) need to publish on creating simple plug-ins, building features and publishing them using an update site. This is already extensively covered as part of the Eclipse development articles both on developerWorks and on eclipse.org/articles.

In my mind a good example of bringing something new to the table is the article on leveraging the current context in Notes 8 (Leveraging user context in the IBM Lotus Notes V8 sidebar and toolbar). That’s new. That’s something I wanna do. It still uses the first third configuring and setting up stuff but still it’s new.

Why not try some more concrete examples that actually cover some of the things that IBM bring to the table in Notes 8 / Sametime 7.5 / Expeditor or some of the areas that is going to cause problems? Suggestions could be:

  • Using the components of Expeditor e.g. the message broker and the web services engine
  • Building Notes UI’s using SWT components
  • Making your SWT components look the ones supplied by IBM
  • Communicating with the Notes application from your features/plug-ins

The above suggestions aren’t great but I’m dying to read articles on Notes 8/Sametime 7.5 that doesn’t spend the better half explaining the same ol’ concepts as have been explained so many times before…

Patch for lost messages in Sametime 7.5.1 tabbed chat interface

As previously mentioned (Sametime 7.5.1 tabbed interface is loosing messages!) I upgraded to Sametime Connect 7.5.1 and began loosing chat messages when using the new tabbed chat interface. I was kindly informed by Hans-Peter Kuessner from Domblog.de of two IBM patches for the issue. I contacted Lotus Support and requested the hotfixes and promptly received them. I have provisioned the hotfix to my users using the automatisk provisioning built into Sametime 7.5. The automatic update of user Connect clients has worked like a charm and the patch has solved the issue. Nice!

Below is a screenshot of the dialog shown to users after the patch has been automatically installed and a screenshot of the “Manage plug-ins” dialog after the feature patch has been installed.

Only feature I could see the need for would be some way to see which users have installed the patch and who haven’t. Of cause users do not have the option of not installing the patch but still it would be nice to know how many of the users have been updated. Some might be connecting from home where they might not have access to the update site. I haven’t checked the log so strictly speaking I don’t know if it’s there but somehow I doubt it.

New THE VIEW article is out!

I’m happy to say that my newest article is online at THE VIEW website. The article is on managing and provisioning lotus.domino.Session objects to plug-ins in Sametime Connect 7.5.1 – a subject that’s a little tricky due to the native code underneath the Notes/Domino Java API and due to the way that classloaders work in Sametime Connect/Expeditor.

For the ones who’s already on Sametime 7.5.1 please see the errata (https://lekkimworld.com/theview_sametime).

Article abstract:

Take the mystery out of providing multiple Notes sessions from Sametime Connect. Plug-in developers find that running multiple Sametime plug-ins that access Notes at the same time is tricky; the reasons are due to how the Sametime 7.5 Java application-programming interface (API) differs from the one Notes uses, and how Java class-loaders load native library code on Windows. The solution provided in this article uses a bundled group of plug-ins, invisible to connect users, for managing lotus.domino.Session objects across other plug-ins. You also learn how to achieve fast plug-in deployments with automatic Connect configuration, plus easier plug-in maintenance. The solution code is available for download at THE VIEW Web site.

Deploying your plug-ins in Notes 8 and Sametime 7.5.x


This document discusses the Notes 8 "shelfViews" programming model, and explicitly explains how to contribute a shelf view to the Notes 8 sidebar. There are basically two steps:
1. Create a view and add a contribution to the org.eclipse.ui.views extension point.
2. Contribute the view to the com.ibm.rcp.ui.shelfViews extension point to have it appear in the sidebar.
Following these descriptions, we compare the Notes 8 "shelfViews" programming model to the Sametime "miniApps" programming models, such that developers will know how to migrate a plugin from the Sametime client to the Notes 8 client.

Documentation — Sidebar Contribution Design Pattern and Migrating a Sametime 7.5 plugin over to Notes 8 via the Composite Application blog.