Change to LDAP Directory Assistance (in Domino 7)

Or at least I think the change was in Domino 7… I never noticed it before since we have been using a custom DSAPI authentication module to work around the shortcoming in previous Domino releases.

The change is that the @Username function now returns the distinguished name of the authenticated user separated with slashes (/) even though it is a LDAP name and hence really separated by commas. This is über nice since it means we can scrap the custom DSAPI module and move the application from a Domino 5.x server to a Domino 7 server (we are having big issues deploying the DSAPI filter on Domino 7).

Sweet!

(For the record – my custom DSAPI filter does more than convert LDAP names separated by commas to names separated by slashes. It also handles dynamic LDAP groups composed on the groupOfUrls objectClass. If you need something like that let me know.)

Got bitten by Skype

It appears that Skype, in its default setup, listens on port 80 and port 443 (HTTP and HTTPS) when loaded (alternative ports for incoming calls). This is bad when running a web server for testing or trying to use the web preview from Domino Desinger. So mental note to self – no Skype while working!! 🙂

Helping out on “Domino application hosting best practices?”

Anyone out there who can help Scott out?

“Is anyone out there willing to talk about running Domino as an applications hosting platform for other organizations but not using the xSP install? There are a few companies out there that sell Domino but there’s only so much I can figure out about how they manage the back end from digging around with a free account ID.”

ScottandMargo.net: Domino application hosting best practices?

THE VIEW article: Extend the power of LotusScript with DXL and OOP

The second part of my articles on LotusScript.doc titled “Extend the power of LotusScript with DXL and OOP” will be out in the May/June issue of THE VIEW. The article is a great deal more technical and explains in-depth how the application is built using object-oriented LotusScript, design patterns, DXL and XSLT.

The article will supposedly be posted online today (Friday) and should be available at a newsstand near you soon!! 🙂

Java in Notes/Domino Explained: Test agents in Eclipse by extending AgentBase (part 4)


By now (I assume you read part 1, part 2 and part 3) we have a working AgentBase extension called EclipseAgentBase which is capable of detecting whether the code is running inside Notes/Domino (and hence use the AgentBase functionality supplied by IBM) or outside Notes/Domino. If running outside Notes/Domino we use some custom functionality to “bootstrap” the runtime environment.

In part 3 I showed how to return a Session object from the getSession() method and a PrintWriter from the getAgentOutput() method. The problem with the getSession() method is that the returned Session is unaware of the runtime environment and a call to getAgentContext() will return null which isn’t what we want. Since lotus.domino.Session is an interface we can simply create our own implementation to wrap the returned Session.

To do this we simply create a wrapper for our Session and return the wrapper. Having the wrapper implement the lotus.domino.Session interface makes the caller oblivious to the change (change from part 3 in bold):

public Session getSession() {
   try {
      if (this.pIsNotes) {
         return super.getSession();
      } else {
         if (null == this.pSession) {
            this.pSession = new SessionWrapper(NotesFactory.createSession());
         }
         return this.pSession;
      }
   } catch (NotesException e) {
      throw new RuntimeException("Unable to create session", e);
   }
}

The declaration of the SessionWrapper class is as follows:

private class SessionWrapper implements Session {
   // declarations
   private Session pSession = null;

   public SessionWrapper(Session session) {
      this.pSession = session;
   }
   ...
   ...
}


The only caveat is that we have to implement all the methods of the lotus.domino.Session interface (all 62 of them) which is quite tedious. But here Eclipse comes to the rescue. Once the class and the pSession member variable has been defined you can simply right click and select “Generate Delegate Methods” from the Source-submenu. This will make Eclipse generate stubs for all methods and make the actual call go to the pSession member variable.

In this way we only need to override the methods we atually need to. This is a big time saver.

Once we return a SessionWrapper object instead of the Session from NotesFactory.createSession() we can do what we need to in relation to the AgentContext. The only method I choose to override from the lotus.domino.Session interface is the getAgentContext() method. Again we are in luck since AgentContext is an interface so we can do this using an anonymous inner class (in bold):

public AgentContext getAgentContext() throws NotesException {
   return new AgentContext() {
      ...
   };
}

We have to implement the 16 methods of the AgentContext interface but we can simply use the “Override/Implement Methods” functionality to generate the stubs to save some time and typing. Once we have done this all the methods return either null or 0 which isn’t what we want. Instead delegate all method calls to callback-methods (starting with “callback”) in the top EclipseAgentBase class as shown below for the getCurrentAgent() method which delegates to the callbackGetCurrentAgent() method:

public abstract class EclipseAgentBase extends AgentBase {
   ...
   ...

   protected Agent callbackGetCurrentAgent() throws NotesException {
      return null;
   }

   private class SessionWrapper implements Session {
      // declarations
      private Session pSession = null;

      public SessionWrapper(Session session) {
         this.pSession = session;
      }

      public AgentContext getAgentContext() throws NotesException {
         return new AgentContext() {

            public Agent getCurrentAgent() throws NotesException {
               return callbackGetCurrentAgent();
            }
         };
      }
      ...
      ...
   }
}

The result of using the callback and just returning null is presently the same but using the callback gives us a lot of functionality as you’ll see in the next and final part of the series.

Webcast: First Look Web conference: IBM Lotus Sametime 7.5

From IBM PartnerWorld News: ISV edition 6 June 15, 2006:

“First Look Web conference: IBM Lotus Sametime 7.5
IBM Lotus Sametime 7.5 is more than an innovative real-time collaboration tool. It’s also a development platform that offers significant opportunity for customer value and services opportunities. To learn more, join us 23 June at 10 a.m. (EST) for a first look at Sametime 7.5.”

Direct link to registration