I’m so Notes Traveler ready…

Got my new cell phone yesterday… It’s a Samsung i600 running Windows Mobile 6 so it’s Notes Traveler ready when it ships with Notes/Domino 8.0.1 i 1Q2008. First impressions of the phone are very favorable and I think it’s going to fit me just fine. A nice feature is that the package includes two batteries and an external charger to charge the second battery outside the phone. Whether that means that the phone consumes at LOT of battery power remains to be seen.

So far only one small thing. How do you find the MAC address of the built in Wifi? Well you simply dial *#1546792*# (or invoke WindowsAdminSettings.exe) and find in under “Version”. Strange but it works. Wifi from bed… πŸ™‚

Eclipse Version Qualifiers

When developing plug-ins and features in Eclipse you need to change the version number to force Notes 8 to redownload and install the feature/plug-in. To make this easier you can use version qualifiers – this will make your life much easier. For more info see Using Version Qualifiers. Thanks to Pierre Carlson from IBM.

Sick of java.awt type ahead suggestions in Eclipse?

Then you need this little handy tip. There are many classes with identical or similar names in the java.awt and the SWT widget libraries. Having to distinguish between the package names in the type ahead dropdown is a pain and lead to wrongful imports so do yourself this favor:

  • Open Eclipse
  • Select Window/Preferences from the menu
  • Expand Java/Appearance/Type Filters from the menu on the left
  • Click the “Add package” button, enter “java.awt” (without the quotes) and click OK
  • OK your way out

This will make Eclipse remove any matching classes from the java.awt package from your type ahead list. Very nice…

And while you’re there you might want to add lotus.domino.cso, lotus.domino.local and lotus.notes to the list as well as all Domino programming is done through the lotus.domino package.

Dragons…

Normally I wouldn’t post stuff like this on this blog but I’m so excited that I have to do just that. I have been a long time fan of the Dragonlance novels and now that an animated feature of the first novel is in the works I’m just plain excited. The first movie will be Dragons of Autumn Twilight and will be released directly to DVD. See here for more info on the movie.

[youtube https://www.youtube.com/watch?v=UHrOfJ8_D0o&rel=1&border=0]

T61p

Yesterday I picked up my new laptop – a Lenovo Thinkpad T61p. It’s a worthy replacement for my 3 year old IBM Thinkpad T41p. I know it’s very nerdy but boy it’s nice! πŸ™‚

It’s shipping with Windows Vista Ultimate so now I have to determine whether to go with Vista or install Windows XP which was my intent initially.

Discovering Notes 8: Showing dialogboxes from SWT in Notes 8


One of the big changes in Notes 8 is the move to a Java threading model which means that showing a messagebox is not something you can *just* do. This has implications for you if you’re developing (or thinking of developing) UI components in Java for Notes 8. These UI components (e.g. sidebar contributions) are developed in SWT and hence follow the SWT way of doing it.

Please note: Although the following may seem (overly) complex nothing of it is new when discussion UI development. The only difference between Notes 7.x and earlier and Notes 8 is that some of these aspects now rears their ugly head.

Now lets get to it…

Since only one thread can access the display and hence draw on the screen at any one time, requests to the display needs to be serialized. In Notes 8 and SWT this is done using the Eclipse Job API. This is done by encapsulating a piece of functionality and asking the platform (the “scheduler”) to execute it. The scheduler adds the job to a queue and and execute it once it is its turn. This may not happen right away though it mostly will.

To display stuff in the UI you use an UIJob instance as shown below. This example simply shows a messagebox with some static content.

new UIJob("Rectangle") {
   public IStatus runInUIThread(IProgressMonitor arg0) {
      MessageDialog.openInformation(
         this.getDisplay().getActiveShell(),
         "HelloWorld", "Hello SWT Job API World");
      return Status.OK_STATUS;
   }
}.schedule();

The second example will show you how to display some Notes data. Since access to the Notes API must be run in a specially initialized thread (remember NotesThread.sinitThread?) you have two options:

  • Manually initialize a thread using NotesThread / extend NotesThread.
  • Take the easy route and use NotesJob.

Using NotesJob is by far the easiest and will handle all the dirty details for you. When you do this you can also use the NotesPlatform class which is an (undocumented) way of getting a lotus.domino.Session instance inside Notes 8.

Using NotesJob will take care of getting at the data – to display it in the UI you still need an UIJob which is why I use two job instances in the example below. Since you can only access final variables from within inner classes I mark the name variable as final.

new NotesJob("Show messagebox") {
   protected IStatus runInNotesThread(IProgressMonitor arg0) throws NotesException {
      Session session = NotesPlatform.getInstance().getSession();
      Name n = session.createName(session.getUserName());
      final String name = n.getAbbreviated();
      new UIJob("My UI job") {
         public IStatus runInUIThread(IProgressMonitor arg0) {
            MessageDialog.openInformation(
               this.getDisplay().getActiveShell(),
               "Username", "Username: " + name);
            return Status.OK_STATUS;
         }
      }.schedule();
      return Status.OK_STATUS;
   }
}.schedule();

I hope this helps you.

Caveat with code from developerWorks tutorial on composite applications

If you’re planning to follow the “Building composite applications for IBM Lotus Notes V8” tutorial on Composite Applications from developerWorks (and you really should) and you have Domino Designer set to automatically insert Option Declare for you (and you really should) you need to declare a variable in Lesson 3. You need to declare the cName as a String for the code to compile. Or remove Option Declare of cause… πŸ™‚