TwitNotes – Notes 8.5 beta is not supported

So the public beta of Notes 8.5 is out and I’m sorry to say that it doesn’t play nice with TwitNotes. I have been in contact with IBM Lotus about it (funny that they contacted me) and we’re working on finding out why.

I’ll post more as I find out why but for now it seems to be due to conflicting Java libraries in the TwitNotes plugin and the Notes 8.5 client as such. I thought they were in separate class loaders by it doesn’t appear that way.

Possibly a fantastic tool for Notes 8 education

Last night I stumbled over an amazing article on the developerWorks site and it’s just fantastic. Not that the articles normally aren’t good but this article introduce a Lotus Expeditor tool that could prove invaluable for many Notes 8 shops for use in Notes 8 training or for use in Notes 8 plug-in development. Although the tool was written for Lotus Expeditor it installs just fine under Notes 8.0.1 without any problems at all.

The tool is called the Personal Wizard plug-in and is, from what I can see, developed by Vittorio Castelli from IBM. The tool allows you to record user interface interactions in the Lotus Expeditor/Notes 8 client and play the interactions back. Either by you or by another person you send the procedure. You can also save/load procedures to/from the filesystem.

In this way the tool can be used to automate test procedures and as a way to create end-user education. The tool allows you to step through a procedure (useful for education) or run it as a macro which is useful for development/testing. The tool is a little rough around the edges but it is definitely worth a look.

Using the Personal Wizards plug-in in IBM Lotus Expeditor

How to get started with Java

I regularly receive e-mails from Notes/Domino developers asking how to get started with Java. In general people are intimidated by the language itself and turned away by the absence of good resources for novice Java programmers so they ask my advise on how to get started. Normally the focus is to use Java for web development (J2EE) and Notes 8 development.

Although evidence to contrary Java is actually quite a simple language at its core and it’s mainly about syntax and a few (dozen) rules. I recommend starting with the language itself and focusing on that before diving into Java for Notes, J2EE and Notes 8 development.

Although not the easiest of routes I suggest the following:

  1. Start with a good Java book and learn the language itself without focusing on Notes/Domino. I can recommend the Thinking In Java book. Skip stuff on threading, GUI development and other advanced topics. Make sure to read up on the java.io framework (e.g. how to read/write to/from files) as that concept is used a lot. All in all – read chapter 1 through 12.
  2. Be sure you read the book and did the hands-on labs… 🙂
  3. Start doing some simple Notes agents in Java instead of LotusScript. Maybe even convert a few existing agents into Java. Here my posts called “Java explained” might help.
  4. Do step 3 again and again until you’re confident with the language.
  5. Start looking into more complex areas such as J2EE development and Notes 8 development.

If you have questions feel free to ask them here.

Portable broadband

We’re testing a portable broadband solution (Telia mobilt bredbånd (link in Danish)) at work these days and I must say it’s much nicer than having to connect through some customers network with the limitations that normally entails. Especially when you get a solid connection like today – 495 kbps downstream and 397 upstream. Nice…

Part 2 of the blackbox article published

The second and final article in my series on Sametime blackboxes (Configuring the Sametime business card system, Part 2: Reach more data with custom blackboxes) has been published at the THE VIEW website and will be out in the May/June issue.

Where as the first article primarily focused on configuration and setup of the blackbox system the second article describes how to develop your own custom blackbox implementations. One of the blackboxes I describe is the one I developed for the bleedyellow.com Sametime server. This implementation retrieves business card data from Lotus Connections.

SWT@Notes 8: Logging from SWT components

As you probably know using System.out.println for logging in Java is a no-no and this is also the case when developing plugins for Notes 8 and Lotus Expeditor. This post outlines how to use the logging framework supplied with Lotus Expeditor, how to manage the logging and where the logs go.

You have probably been using log4j or similar logging framework for years. Avoiding writing to System.out is even more important when writing SWT components and plug-ins for Notes 8 a.k.a. Eclipse since the output goes to a log tucked away under the covers. Luckily there’s an approach which is so much better and more flexible.

Logging basics

Luckily logging has been built into the language (since Java 1.4) and into the Lotus Expeditor platform. Actually there is 5 different frameworks built into the Lotus Expeditor platform. Based on advise from the Lotus and personal experience I really recommend you use the java.util.logging framework built into the core Java language. This is also known as JSR47 loggers. The below graphics shows the logging sub-system of Lotus Expeditor.



Page 8 from the
IBM Lotus Expeditor 6.1 Client for Desktop Serviceability – Logging and IBM Support Assistant (PDF).

As you can see from the above you can use the following logging frameworks in Lotus Expeditor:

  • Eclipse Logging
  • OSGi Logging
  • IBM Commons Logging
  • Apache Jakarta Commons Logging
  • java.util.logging a.k.a. JSR47

I haven’t got experience with all of the these frameworks and luckily I don’t have to. I just have to know about java.util.logging and there’s an abundance of info on that on Google. The Sun tutorial might be the best place to start if you’ve never used java.util.logging. All this being equal the frameworks work the same with the only difference being how you obtain loggers and what the different logging levels are called. Log levels are called something different in the different frameworks but slide 7 in the Lotus Expeditor documentation on logging shows the mapping between the different frameworks.

Using loggers in code

Using java.util.logging in code is really easy and consists of 3 steps:

  1. Obtain the logger to use (normally in a static final variable).
  2. Write info to the logger.

The below is an example of using loggers.

package com.example.logging;

import java.util.logging.Logger;

public class MyLoggingClass {
   // logger
   private final Logger log = Logger.getLogger(
      this.getClass().getPackage().getName());

   public MyLoggingClass() {
      log.finest("Finest...");
      log.finer("Finer...");
      log.fine("Fine...");
      log.info("Info...");
      log.warning("Warning...");
      log.severe("Severe...");
   }
}

The above code creates a logger in a variable called “log” as a private variable. The logger itself is called com.example.logging which is the name used to control the log level (see below). I find it best to name the logger after the package name that contains the class. Sometimes it is however beneficial to also have a logger with more specialized names to log info on specific events.

Configuring the logger log levels

The log level for a single logger or multiple loggers can be controlled using the LogManager using the <Notes data directory>/workspace/.config/rcpinstall.properties file. To change the log level for the com.example.logging logger to FINEST add the following line to the file and restart the client:

com.example.logging.level=FINEST

To change the level dynamically use the OSGi console commands as described below.

Interacting with loggers from the OSGi console

If you start the Notes 8 client with the OSGi console visible you can interact directly with the loggers using the console command called setlogrlev. To set the log level for the com.example.logging logger to FINEST use the following command:

setlogrlev com.example.logging FINEST

Please note that the logger levels are case sensitive so you have to write “FINEST” and not “finest”.

Where the logging goes

All log messages are written to log files in the <Notes data directory>/workspace/logs directory. Opening the directory will reveal a number of files. The two most important are error-log-X.xml and trace-log-X.xml. The file names are quite explanatory and are, as the extension implies, XML-files. When you open them they’ll be rendered using a XSLT stylesheet to be displayed nicely. You can either read them using a browser or using the “Help/Support/View Log” and “Help/Support/View Trace” menu item in the Notes 8 client.

While the log files are usable I personally find it much easier and better to use the OSGi console when developing as I can adjust the log levels on the fly.

Further reading