How to extend Notes 8: capture group LiveText recognizers with a Java action

I get so many question on how to extend Notes 8 that I finally decided to create a series of blog posts on how to do it. All the posts in the series may be found under the extending_notes8 tag. In all of the examples I assume a working knowledge of Eclipse and Java programming and how to work with extension points.

For this post I’ll build on the “How to extend Notes 8: coupling LiveText to a Java action” and “How to extend Notes 8: using LiveText with capture groups” posts and show how to act on your own custom recognizer from a Java action when you have multiple capture groups.

Please note: I’ll assume that you read the “How to extend Notes 8: using LiveText with capture groups” post and have it working as we’ll build on that example in this post. Unfortunately as we act on the content type id you need to find the id of the content type on your system. I’ll show you how.

Enough with preparations – now on to the code!

So far we have our custom recognizer and our custom content type but instead of a web widget we really want to use our Java action as the recipient of the LiveText selection. We couple the Java action to the content type using an extension point in plugin.xml based on the content type id. Let me show you how to find the content type id.

  1. Start by opening the management UI for widgets, content types and recognizers. You do this by choosing “Manage Widgets, Content and Recognizers” from the part menu in the My Widgets sidebar panel as show below.
  2. Now switch to the “Content Types” panel and make a note of the ID for the “Demo Product Number” content type. Here the id is “DemoProductNumber.1410710777” as highlighted below.
  3. Now comes the trick. Notes adds “DCCT.” in front of the id shown so the real id is “DCCT.DemoProductNumber.1410710777”. Make a note of your own id and read on…

As previously the first piece of the puzzle is the extension point. Add an org.eclipse.ui.popupMenus extension as previous and specify the id you noted above as the content type id. Mine is shown below – notice how I use the id prefixed with “DCCT.”.

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension  point="org.eclipse.ui.popupMenus">
      <objectContribution id="com.lekkimworld.livetxt.objectContr1"
         objectClass="com.ibm.rcp.content.IDocumentContent">
         <visibility>
            <and>
               <objectState name="content.type"
               value="DCCT.DemoProductNumber.1410710777"/>
               <objectState name="contents" value="" />
            </and>
         </visibility>
         <action class="com.lekkimworld.livetext.MyAction"
            enablesFor="*"
            id="com.lekkimworld.livetxt.action1"
            label="Do stuff!" />
      </objectContribution>
   </extension>
</plugin>

Now create your Java action class – again implemening org.eclipse.ui.IObjectActionDelegate – and specify the correct class name in the extension point.

Again when it comes to grabbing the contents of the recognized LiveText it comes down to you selectionChanged-method of your Java action. As our recognizer uses capture groups we have a few choices for the properties we can grasp from the document. As always the entire recognized product number will be in the “contents” property but we also have “pf” and a “pn” property available that holds the product family and the part number. The example code below shows how to get at these.

public void selectionChanged(IAction action, ISelection selection) {
   IDocumentContent doc = null;

   // cast/adapt selection
   if (selection instanceof StructuredSelection) {
      Object sel = ((StructuredSelection)selection).getFirstElement();
      if (sel instanceof IDocumentContent) {
         doc = (IDocumentContent)sel;
      }
   } else if (selection instanceof IDocumentContent) {
      doc = (IDocumentContent)selection;
   } else {
      // try and adapt
      IAdapterManager amgr = Platform.getAdapterManager();
      doc = (IDocumentContent)amgr.getAdapter(selection,
          IDocumentContent.class);
   }
   if (null == doc) {
      this.selection = null;
      return;
   }

   // get all recognized content
   this.prodNumber = doc.getProperties().getProperty("contents");
   this.prodFamily = doc.getProperties().getProperty("pf");
   this.partNumber = doc.getProperties().getProperty("pn");
}

Now when you install the extension and hence put the pieces together you should see two actions for the product number LiveText recognition as shown below. The top one is our Java action and the bottom one is our web widget from previously.

That’s what is required to act on custom recognizers. As you can probably gather from the above it doesn’t work letting users do their own recognizers and then wanting to act on them from Java due to two reasons – 1) never trust a user to give it the right name as instructed 🙂 and 2) the id of the content type will change from machine as it is generated when the user creates the content type. It is possible however if you create the content type and the recognizer for users and install then using an extension.xml file as the extension.xml sets the id’s. That’s probably also the way you’d want it.

There is however an even better solution… Dynamically add the content type and recognizer to the client from Java for a single, combined solution. Stay tuned…

How to extend Notes 8: using LiveText with capture groups

I get so many question on how to extend Notes 8 that I finally decided to create a series of blog posts on how to do it. All the posts in the series may be found under the extending_notes8 tag. In this post you’ll need familiarity with how MyWidgets and LiveText works. A basic understanding of regular expressions would be beneficial as well.

This post will set the stage for the next post on how to add Java actions that use LiveText recognizers that contain capture groups. No Java code or Eclipse extension point stuff in this post.

Let me start by explaining what capture groups are. As you probably know you use regular expressions to search for text occurrences when using LiveText. In short a regular expression is a text pattern to search for in a block of text. Regular expressions can be hard to grasp at first but once you “have it” they will become an invaluable tool in your arsenal.

A regular expression can range from the simple to the extremely complex. A simple regular expression to find a product number like OTGC-5431 could look like this one:

[A-Z]{4}-d{4}

This regular expression tells the regular expression engine to search for 4 consecutive, uppercase, letters ([A-Z]{4}) followed by a hyphen (-) followed by 4 digits (d{4}).

Now that’s great but what if this isn’t just a product number but it’s actually a compound data format and that the product number is made up of a product family (OTGC) and a part number (5431) and I needed the two pieces of information separately? Well that’s where capture groups become important.

In regular expressions there is a syntax to signal that the text that you find actually consists of multiple, separate, discrete, pieces of information. As in the example with a product number such as OTGC-5431. This product number consists of two parts – 1) the product family (OTGC) and 2) the part number (5431). If you need access to the product family and part number separately you can use capture groups to split up the product number in the regular expression itself instead of relying on parsing after recognition.

So instead of simply getting a match of “OTGC-5431” you also get information that the product family is “OTGC” and the part number is “5431”.

So how does one use capture groups?

Well you start with the regular expression above and then you add capture groups by simply changing it to be

([A-Z]{4})-(d{4})

Notice how I only added two sets of parentheses. That all. That tells the regular expression engine that the result is made of of two parts. So instead of getting just one result (OTGC-5431) I get three: OTGC-5431, OTGC, 5431 (the match in it’s entirety and the two capture groups).

So how do I use these results in MyWidgets / LiveText? Well let me walk you through an example.

Lets imagine that you have a web service that allows you to search for product numbers but need the product family and part number separately. The syntax is something like http://www.example.com/prodquery?pf=<product family>&pn=<part number> (http://www.example.com/prodquery?pf=OTGC&pn=5431). Let me show you, end to end, how to do this using MyWidgets and LiveText.

  1. Start by creating a new widget. Choose to create a web widget and click Next.
  2. Now specify the URL as being “http://www.example.com/prodquery?pf=OTGC&pn=5431&#8221; (Please note: The address doesn’t point to anything but it proves the point we need). Now click Next.
  3. A GET request is fine – just click Next.
  4. Now the web page is fetched. As we know the URL we specified doesn’t work just click Next.
  5. In the “Configure a Widget” dialog name the widget “Demo Product Search” and choose “Wire as an action” at the bottom. Then click the “Advanced” tab at the top.
  6. Put a checkmark in both boxes in the “Configure” column as we need to map both URL parameters to our recognized LiveText. Then click Next.
  7. We need a new recognizer to recognize our product number. To do this click the “New Recognizer…” button.
  8. Name the recognizer “Demo Product Number” in the top text box. Now since our recognizer uses two capture groups we need to tell Notes how to map these to our widget (as widget properties) so we need a new Content Type. To do this click the “New Type…” button.
  9. In the “Configure a Content Type” dialog box you name the parts of the text you recognize. We have two parts so we click the “Add”-button twice and fill the text fields like specified below. We do this to indicate we have two properties called “pf” and “pn”. Then click OK.
  10. Back in the “Configure a Recognizer” dialog our new Content Type (“Demo Product Number”) has been chosen for us. Now we specify our regular expression with the two capture groups. Then we click the “Add”-button twice and map capture group 1 (the “product family”) to content property “pf” and capture group 2 (the “part number”) to content property “pn” as shown below. Then click OK.
  11. Back in the “Wire an action to configure a widget” dialog our newly created recognizer has been chosen for us. Now we need to map the widget properties (the parts of the recognizer) to the URL parameters. We do this on the “Advanced” tab so click on that near the top.
  12. On the “Advanced” tab add a second parameter box by clicking the “Add”-button and map the URL parameters to our widget properties as shown below. Then click Finish.

Now take a deeeeeeeeeeeeeeeeep breath… 🙂

That’s what’s required to create a new widget with a new recognizer and new content type. It may seem like much, and I think it is, but remember that you may now add a second web widget that uses the same recognizer by following the same steps but ignoring step 7-10. Also when you’ve done it a few times it becomes second nature and you use it all the time. I do.

Now we need some text to test on. Create a new e-mail message, add a subject, some text to the body field including a couple of product numbers and e-mail the message to yourself. To make it easier you may copy/paste the below text:

Ullamcorper veniam aliquip duis, vel vero dolore in dolor
aliquam dolore lobortis delenit vel duis, magna. Eros
iusto, consequat iriure eu enim nulla exerci minim nulla
facilisis, ex te ut nulla volutpat qui: OTGC-5431,
OTMM-6615. Odio nulla amet ea quis volutpat suscipit exerci
eros et dolore feugiat, ea dolor ad, vulputate, delenit
enim sed autem tation enim zzril blandit iusto. Dolor
facilisi vero feugait iriure, et consequat ut, et euismod
ipsum praesent quis duis zzril in hendrerit, at et, dolor
hendrerit dignissim. Ut commodo odio consequat, onsectetuer
augue dignissim nulla dolore velit.

Now when you open the message from your inbox you should see something like this:

As you can see the Notes client recognized two text strings as shown by the blue dotted lines. If you hover over the text and click the down arrow (will appear to the right of the text) you’ll see a small menu as shown below. From that menu select “Display Demo Product Number Properties”. That will show a dialog box explaining exactly what Notes found and what text goes into which capture groups and hence into which widget properties.

In the next post in the series I’ll show how to use these widget properties from a Java action. Stay tuned…

How to extend Notes 8: coupling custom LiveText recognisers to a Java action

I get so many question on how to extend Notes 8 that I finally decided to create a series of blog posts on how to do it. All the posts in the series may be found under the extending_notes8 tag. In all of the examples I assume a working knowledge of Eclipse and Java programming and how to work with extension points.

For this post I’ll build on the “How to extend Notes 8: coupling LiveText to a Java action“-post and show how to act on your own custom recognizer.

Most of the work is actually the same than for using the built-in recognizers but now you need to utilize your custom recognizer. So you need a recognizer – there are of cause ways to do this programmatically but that’s the focus for another post. For now lets focus on using existing recognizers. Do that by adding your recognizer to Notes – either using MyWidgets or simply importing a recognizer using an extension.xml file such as this one. Remember you need both the recognizer AND the content type it produces (the file has both).

For this example I’ll use the extension.xml I link to above – to install simply drag the link to your MyWidgets sidebar panel. That file gives you a new recognizer with an id of “DCR.Toddlerdemo.885487295” and a content type with an id of “DCCT.demonotes85inspirationproductno.1361861595”. As in previous posts you link your Java action to the content type so make a note of the id.

Now create your Java action class – again implemening org.eclipse.ui.IObjectActionDelegate – and add the org.eclipse.ui.popupMenus extension point to your plugin.xml file using the content type id as below.

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension  point="org.eclipse.ui.popupMenus">
      <objectContribution id="com.lekkimworld.livetxt.objectContr1"
         objectClass="com.ibm.rcp.content.IDocumentContent">
         <visibility>
            <and>
               <objectState name="content.type"
               value="DCCT.demonotes85inspirationproductno.1361861595"/>
               <objectState name="contents" value="" />
            </and>
         </visibility>
         <action class="com.lekkimworld.livetext.MyAction"
            enablesFor="*"
            id="com.lekkimworld.livetxt.action1"
            label="Do stuff!" />
      </objectContribution>
   </extension>
</plugin>

Again when it comes to grabbing the contents of the recognized LiveText it comes down to you selectionChanged-method of your Java action. If your custom recognizer doesn’t use capture groups your contents will be in the “contents” property as previously. If you DO use capture groups you need to use the names you specified for the capture groups when you mapped it to the widget – we’ll look at that another time. The example code below simply assumes a single group.

public void selectionChanged(IAction action, ISelection selection) {
   IDocumentContent doc = null;

   // cast/adapt selection
   if (selection instanceof StructuredSelection) {
      Object sel = ((StructuredSelection)selection).getFirstElement();
      if (sel instanceof IDocumentContent) {
         doc = (IDocumentContent)sel;
      }
   } else if (selection instanceof IDocumentContent) {
      doc = (IDocumentContent)selection;
   } else {
      // try and adapt
      IAdapterManager amgr = Platform.getAdapterManager();
      doc = (IDocumentContent)amgr.getAdapter(selection,
          IDocumentContent.class);
   }
   if (null == doc) {
      this.selection = null;
      return;
   }

   // get number from document property
   this.selection = doc.getProperties().getProperty("contents");
}

That’s all. Again the main post is knowing how but again 95% of the plugin.xml file and the Java action is the same. In a future post in this series I’ll show how to act upon custom recognizers using capture groups. Stay tuned…

How to extend Notes 8: using the other built in LiveText recognisers with Java actions

I get so many question on how to extend Notes 8 that I finally decided to create a series of blog posts on how to do it. All the posts in the series may be found under the extending_notes8 tag. In all of the examples I assume a working knowledge of Eclipse and Java programming and how to work with extension points.

This second post builds upon the “How to extend Notes 8: coupling LiveText to a Java action“-post posted earlier. Most of the post is the same but you’ll need to change the content type to act on. Read on.

My Notes 8.5 client comes with the follow built in recognizers:

Recognizer Content type
Phone number content.phone
Address content.address
Organization content.org
Person content.person
Web site content.web

The trick is to couple our definitions in plugin.xml to the right content type. So to attach to a recognized web address you need to specify content.web as the content type as shown below:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
  <extension point="org.eclipse.ui.popupMenus">
    <objectContribution
          id="com.lekkimworld.livetext.objectContribution2"
          objectClass="com.ibm.rcp.content.IDocumentContent">
       <action
             class="com.lekkimworld.livetext.Action1"
             id="com.lekkimworld.livetext.action2"
             label="Do stuff with web address!">
       </action>
       <visibility>
          <and>
             <objectState name="content.type" value="content.web" />
             <objectState name="contents" value="*" />
          </and>
       </visibility>
    </objectContribution>
  </extension>
</plugin>

Now also change your action to extract the right property from the document. All the IBM recognizers stick the recognized text in the “contents” property so simply grab that. Some of the recognizers (person and address) also have some sub-parts you could extract but I find the recognizers so flaky that I haven’t invested much time in using them. I find the web and phone recognizers the only useful ones. Below is some sample code for the selectionChanged method.

public void selectionChanged(IAction action, ISelection selection) {
   IDocumentContent doc = null;

   // cast/adapt selection
   if (selection instanceof StructuredSelection) {
      Object sel = ((StructuredSelection)selection).getFirstElement();
      if (sel instanceof IDocumentContent) {
         doc = (IDocumentContent)sel;
      }
   } else if (selection instanceof IDocumentContent) {
      doc = (IDocumentContent)selection;
   } else {
      // try and adapt
      IAdapterManager amgr = Platform.getAdapterManager();
      doc = (IDocumentContent)amgr.getAdapter(selection,
          IDocumentContent.class);
   }
   if (null == doc) {
      this.selection = null;
      return;
   }

   // get text from document property
   this.selection = doc.getProperties().getProperty("contents");
}

How to extend Notes 8: coupling LiveText to a Java action

I get so many question on how to extend Notes 8 that I finally decided to create a series of blog posts on how to do it. All the posts in the series may be found under the extending_notes8 tag. In all of the examples I assume a working knowledge of Eclipse and Java programming and how to work with extension points.

For this second post I’ll touch on one of my favorite features of Notes 8 that is MyWidgets and LiveText. From the user interface you may create a number of widget types (web, Notes etc.) that act on text which is automatically recognized and highlighted by Lotus Notes using the LiveText feature. But what if you wanted to perform an action that didn’t lend itself to one of these widget types? What if you wanted to couple the text recognized by LiveText to a Java action? Well look no further. In this post I’ll show you how to combine the org.eclipse.ui.popupMenus extension point with a com.ibm.rcp.content.IDocumentContent object contribution to do what is transparently done using MyWidgets.

Let me preface this by saying that it’s still far easier to do this using MyWidgets but still this isn’t rocket science.

To accomplish this task you’ll need two pieces. First of you need the code to execute. This is done using an action class that implements org.eclipse.ui.IObjectActionDelegate which means that you need to implement three methods:

  • public void setActivePart(IAction action, IWorkbenchPart part)
    Called when what’s called the part is changed in Eclipse. You can leave this method blank.
  • public void selectionChanged(IAction action, ISelection selection)
    Called when you run an action on some text that the client highlighted using LiveText. The purpose of this method is to extract the text and make it available to the run method (see below).
  • public void run(IAction action)
    This is the workhorse of the class and it’s called whenever the action is selected from the context menu. The action will act on the text you extracted in the selectionChanged method.

The run-method isn’t as interesting as it just performs the action. The method is called in the UI thread. The selectionChanged-method is more fun as this is where you extract the highlighted text. The example here acts on a recognized phone number but it could just as well have been another of the built in recognizers. Below is a snippet of code on how to get the highlighted text.

public void selectionChanged(IAction action, ISelection selection) {
   IDocumentContent doc = null;

   // cast/adapt selection
   if (selection instanceof StructuredSelection) {
      Object sel = ((StructuredSelection)selection).getFirstElement();
      if (sel instanceof IDocumentContent) {
         doc = (IDocumentContent)sel;
      }
   } else if (selection instanceof IDocumentContent) {
      doc = (IDocumentContent)selection;
   } else {
      // try and adapt
      IAdapterManager amgr = Platform.getAdapterManager();
      doc = (IDocumentContent)amgr.getAdapter(selection,
          IDocumentContent.class);
   }
   if (null == doc) {
      this.selection = null;
      return;
   }

   // get number from document property
   this.selection = doc.getProperties().getProperty("phone");
}

The second piece to the puzzle is the plugin.xml snippet that couples our action to the LiveText feature of Lotus Notes. It’s again a org.eclipse.ui.popupMenus extension point coupled to an object contribution but this time also a visibility modifier to only show the action when text matching a recognizer is shown. You will want to pay attention to the italic text. Again you will need to change the class name for the action as well.

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
  <extension point="org.eclipse.ui.popupMenus">
    <objectContribution
          id="com.lekkimworld.livetext.objectContribution2"
          objectClass="com.ibm.rcp.content.IDocumentContent">
       <action
             class="com.lekkimworld.livetext.Action1"
             id="com.lekkimworld.livetext.action2"
             label="Call it!">
       </action>
       <visibility>
          <and>
             <objectState name="content.type" value="content.phone" />
             <objectState name="contents" value="*" />
          </and>
       </visibility>
    </objectContribution>
  </extension>
</plugin>

Easy isn’t it??

In a future post in this series I’ll show how to act upon the other built in recognizers and how to act on your own. Stay tuned…

How to extend Notes 8: coupling text selection to Java action

I get so many question on how to extend Notes 8 that I finally decided to create a series of blog posts on how to do it. All the posts in the series may be found under the extending_notes8 tag. In all of the examples I assume a working knowledge of Eclipse and Java programming and how to work with extension points.

For this first post I’ll touch on one of my favorite features of Notes 8 that is MyWidgets and LiveText. From the user interface you may create a number of widget types (web, Notes etc.) that act on selected text but what if you wanted to perform an action that didn’t lend itself to one of these widget types? What if you wanted to couple text selection to a Java action? Well look no further. In this post I’ll show you how to combine the org.eclipse.ui.popupMenus extension point with a org.eclipse.jface.text.ITextSelection object contribution to do what is transparently done using MyWidgets.

Let me preface this by saying that it’s still far easier to do this using MyWidgets but still this isn’t rocket science.

To accomplish this task you’ll need two pieces. First of you need the code to execute. This is done using an action class that implements org.eclipse.ui.IObjectActionDelegate. This means you need to implement three methods:

  • public void setActivePart(IAction action, IWorkbenchPart part)
    Called when what’s called the part is changed in Eclipse. You can leave this method blank.
  • public void selectionChanged(IAction action, ISelection selection)
    Called when you select some text in the Notes client and select your action. The purpose of this method is to extract the selected text and make it available to the run method (see below).
  • public void run(IAction action)
    This is the workhorse of the class and it’s called whenever the action is selected from the context menu. The action will act on the selected text you extracted in the selectionChanged method.

The run-method isn’t as interesting as it just performs the action. The method is called in the UI thread. The selectionChanged-method is more fun as this is where you extract the selected text. Below is a snippet of code on how to do it.

public void selectionChanged(IAction action, ISelection selection) {
   StructuredSelection sel = (StructuredSelection)selection;
   try {
      IAdapterManager amgr = Platform.getAdapterManager();
      Object obj1 = sel.getFirstElement();
      Object obj2 = amgr.getAdapter(obj1, ITextSelection.class);
      if (obj2 instanceof org.eclipse.jface.text.ITextSelection) {
         ITextSelection txtSelection = (ITextSelection)obj2;
         this.selection = txtSelection.getText();
      }
   } catch (Throwable t) {
      this.selection = null;
   }
}

The second piece to the puzzle is to tell the platform when you would like your action to be listed ie. when select is selected. This is done in the plugin.xml using the org.eclipse.ui.popupMenus extension point and by doing an object contribution as shown below. The italic text (the id’s and the action label) may be changed to your liking. The bold/italic text is the class name of your action which should be changed to match your action class.

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension point="org.eclipse.ui.popupMenus">
      <objectContribution
            id="com.lekkimworld.textsel.objectContribution1"
            objectClass="org.eclipse.jface.text.ITextSelection">
         <action
               class="com.lekkimworld.textsel.SelectionAction"
               enablesFor="*"
               id="com.lekkimworld.textsel.action1"
               label="Perform action from selected text">
         </action>
      </objectContribution>
   </extension>
</plugin>

The next post (which will be published tomorrow) will show you how to act upon LiveText that is couple your Java action to text that the Notes client recognizes and highlights for you. Stay tuned…

IBM makes Firefox the default company browser? When will IBM Lotus Notes stop depending on Internet Explorer?

In recent news IBM officially proclaimed Mozilla Firefox as the corporate browser of choice. The news was picked up by major news outlets such as CNet, readwriteweb.com and ars technica (“IBM embraces Firefox, adopts it internally“). The news even made it to small Denmark as a news item on Version 2 (“IBM gør Firefox til standardbrowser for 400.000 ansatte“; English: IBM makes Firefox the default browser for 400.000 employees).

While I really like the choice being a multi-year-long Firefox user myself it raises a question. If Microsoft Internet Explorer isn’t a good choice for a web browser and not something that IBM wants to bet their money on for internal web browser usage how come it’s still good enough as a core component in Lotus Notes 8? As you might know most (if not all) e-mail rendering in Lotus Notes is done using Internet Explorer. Also Internet Explorer is the browser of choice for web-based Composite Application components (on Windows anyway). Despite the hate for Internet Explorer that some may carry around it works and works well.

It does however raise an interesting question…

What’s to stop Microsoft from introducing a special “feature” in Internet Explorer that makes it crash when used inside Lotus Notes? Customers would blame Lotus Notes while the “feature” would in effect cripple all Lotus Notes 8 e-mail rendering on the Windows platform. The only thing that I can see stopping them from a move like this is behaving nicely – but how long will that continue?

If only there was a way to solve that problem… Well there is. Create a SWT Browser component that uses Webkit or another open source rendering engine that IBM can control and can continue to control. That would put IBM Lotus back in control of a core component of their own product. Maybe this egg is too precious to put in another vendors basket.

Comments?

Eclipse Helios (3.6) and why it’s important to Notes administrators

Notes 8 is based on Eclipse and Eclipse use OSGi for bundle lifecycle and dependency management. Part of OSGi is the OSGi console that is a console into the inner working of OSGi. The console is very useful and may be used to diagnose Eclipse and Notes 8 issues. I’ve previously blogged about the OSGi console and how to access it in Notes in my “SWT@Notes 8: -console” post back in 2008. One of the cool things about the OSGi console is that you can write administrative commands for the console that you may invoke using the text based interface.

One major shortcoming of the OSGi console was that one could only access it once the platform was invoked that is it couldn’t be accessed once Notes was started. This is a real bummer as it could be very useful in certain troubleshooting scenarios. This is about to change.

In the upcoming Eclipse 3.6 (Helios) release we’ll get even easier access to the OSGi console as you may attach to OSGi console after launching the platform. Yeah!!

On his blog Chris Aniszczyk of Redhat has a post called “Easier access to the OSGi console“:


In Eclipse 3.6 M7, it will be easier to access the OSGi
Console within the running Eclipse. The Equinox team
added a org.eclipse.osgi.framework.console.ConsoleSession
service that you can use to get the input and output to a
console session. The PDE team took advantage of this
recently by extending the org.eclipse.ui.console.consoleFactories
extension point and allowing you to bring up the OSGi
console easily...

Nice Notes 8.5.2 feature – policy control for access settings for Lotus Connections

Disclaimer: The following is from the release notes of Notes 8.5.2 so I don’t take credit for writing this. Lotus Notes 8.5.2 is in beta and there are no guarantees that the features described here will be in the final product that IBM ships.

From Notes 8.5.2 administrators can now define the Lotus Connections server to which the sidebar should connect by adding the following properties to the plugin_customization.ini file located in the <Notes>/framework/rcp directory. Modify this file within the installation package prior to distributing it to end users. If you are installing this code drop for the server as well, use the new policies to manage the accounts instead.

com.ibm.lconn.client.base/server=<server_URL>
com.ibm.lconn.client.base/authtype=<authentication_method>
com.ibm.lconn.client.base/authserver=
     <server_URL>:443/activities/j_security_check

where

  • <server_URL> is the full Web address of the Activities feature on the Lotus Connections server including the protocol. Add a backslash before each colon. For example: http://enterprise.example.com/activities
  • <authentication_method> is one of the following values:
    • J2EE-FORM: Form based authentication, default
    • TAM-FORM: Tivoli Access Manager Form authentication
    • SM-FORM: Siteminder Form authentication

    The port number might need to be changed from the default of 443 depending on your deployment.

To tell the Notes client where to read the server information from, add the following property to the plugin_customization.ini file:

com.ibm.lconn.client.base/policy-mode=<mode>

where <<mode> is one of the following values:

  • DEFAULT: Allows users to modify the server URL. This is how the client behaves by default.
  • FORCED: Prevents users from being able to edit the Server URL field in the Activities preferences page.
  • OVERWRITE: Overwrites the server URL that was specified in the preferences page with the one specified in the com.ibm.lconn.client.base/server property. Use this setting if you change deployments and want to force users to switch from accessing one server to accessing another.

If you choose to specify the server using the plugin_customization.ini file, keep these things in mind:

  • When you define the Lotus Connections server to connect to using the plugin_customization.ini file, be sure to specify the full URL of the Activities feature.
  • Tell users to access the Activities sidebar before opening the Connections preferences page when starting the Notes client for the first time. Accessing the sidebar is what triggers Notes to pull the server information from the plugin_customization.ini file.
  • If the server information displayed in the server URL field of the Connections properties page is not the information specified in the plugin_customization.ini file, click Restore Defaults, provide your log in credentials, and then click OK.

Nice Notes 8.5.2 feature – upgrading multiple local databases to a new ODS

Please note: The following is from the release notes of Notes 8.5.2 so I don’t take credit for writing this. Lotus Notes 8.5.2 is in beta and there are no guarantees that the features described here will be in the final product that IBM ships.

In the latest code drop of Notes 8.5.2, using either the Notes Client, Domino Administrator Client, or Domino Designer Client, a customer can force the client to perform ODS upgrades of all local databases. For most non-essential databases, the ODS upgrade will take place in a background process and while a database is upgraded, the end user will not be able to use the database. For essential databases that are in use at the point that an upgrade is attempted, the ODS upgrade will be done at the next first time open which will typically occur at client restart.

Configuration Options – Required

The following new NOTES.INI setting performs the upgrade:

NSF_UpdateODS=1

With this set, the client will do a one time pass to upgrade local databases using the compact task.

Configuration Options – Optional

In addition, the specific ODS level that is desired should be set (if none set, ODS51 will be forced):

To create ODS 51 databases:
Create_R85_Databases=1

To create ODS 48 databases:
Create_R8_Databases=1

User Feedback

For databases compacted in the background, there will not be any user visible indication that the database compacts are in progress. If a user attempts to use a database while the compact is in progress, they will see the error:

"Database is being Compacted; Compact must finish before use"

For databases that are in use at the time the compact is attempted (names.nsf, cache.ndk, log.nsf, and possibly user mail files), the compact will occur at the next client restart. When the database is compacted at restart, progress will be shown in the splash screen or in the status bar, depending on when the database is opened.

For each database that is compacted, a “Compacting…” and “Compacted….” will appear in the log.

11/12/2009 03:01:49 PM  Compacting dummy.nsf (dummy),  -r -C
11/12/2009 03:01:52 PM  Compacted  dummy.nsf, 0K bytes recovered (0%)

For each database that is at the desired ODS (or later), only “Compacting…” will appear in the log

11/12/2009 03:01:49 PM  Compacting dummy.nsf (dummy),  -r -C

At the end of the upgrade, the following will appear in the log:

10 databases had an older NSF ODS version. 8 of
those databases were successfully upgraded to a
later NSF ODS.

Book keeping Options

NSF_UpdatedToODS=#

After the upgrade is attempted for all local databases, this will be set to the ODS level that was requested. Deleting this setting will cause the code to attempt to perform upgrades. If upgrades are not necessary, the database will be skipped. If the client is shut down before all databases are completed and processed, then this is not set, and the next retry will attempt compacts on databases that are not at the desired ODS.

Clarifications/Not in scope

If there is an error during the compact, the database ODS will not be changed. There will not be any retry logic. If there is not enough space, which can be one of the errors, then the database ODS will not be changed. If a database takes a while to compact then the user does not have access to that Db during the compact. For always in use databases, their compact will be done on the next client restart, and will block user usage.

Limitations

Only Windows and Linux are supported. Macintosh support will be available in a later code drop.