Complete guide to manually uninstalling “plugins” from Lotus Notes

As you probably know installing and uninstalling Java extensions (“plugins”) into the Lotus Notes client is easy using either File >> Application >> Install, File >> Application >> Application Management or the widget catalog. Sometimes however this doesn’t work and you’ll have to resort to a manual uninstall. This blog post outlines the way to perform a manual uninstall.

We have to start with some basics though. A Java extension in Lotus Notes (also known as a “plugin”) consists of two things:

  1. Eclipse plugin(s)
    The plugin is where the actual code and functionality is stored together with additional resources such as images, string translation etc.
  2. Eclipse feature
    The feature is what’s actually installed from a Lotus Notes perspective. The feature points to the Eclipse plugins that provides the actual functionality. It’s almso important to note that a single feature may reference multiple plugins.

Both an Eclipse plugin and an Eclipse feature are represented in the file system as JAR-files (files with an extension of “JAR”) and both of them are kept in the file system. A JAR-file is just a fancy ZIP-file with a predefined folder structure. Eclipse Features and plugins are stored in two directories beneath your Notes data directory (<Notes data dir.>/workspace/applications/eclipse/features for the features and <Notes data dir.>/workspace/applications/eclipse/plugins for the plugins).

From the above it may seem obvious that simply deleting these files will uninstall a Java extension – unfortunately there’s a final piece to the puzzle. Lotus Notes also keeps a record of what’s installed in a file called platform.xml (stored in <Notes data dir>workspace.configorg.eclipse.update). Simply deleting the feature(s) and plugin(s) may seem to work but will misbehave for instance when activating the File >> Application >> Application Management interface. The solution is to edit this file as well.

The complete steps to manually uninstalling a Java extension is therefore as follows:

  1. Close Lotus Notes
  2. Open the “features”-directory (<Notes data dir>workspaceapplicationseclipsefeatures)
  3. Locate the Eclipse features to uninstall.
  4. For each Eclipse feature you need to open it and edit the feature.xml file. Locate the <plugin>-tags and fine the names of the referenced plugins. Note that there might be more than one. Combining the plugin id and the plugin version will give the full filename of the plugin (<plugin id>_<plugin version>.jar).
  5. Delete the Eclipse features you’re uninstalling.
  6. Open the “plugins”-directory (<Notes data dir>workspaceapplicationseclipseplugins).
  7. Delete the plugin JAR-file(s) you recorded in the step above.
  8. Open the directory containing the platform.xml file (<Notes data dir>workspace.configorg.eclipse.update).
  9. Edit platform.xml and go to the end of the file.
  10. Remove each entry you see for the features you deleted in the step above.
  11. Save and close the file.
  12. Since Lotus Notes also keeps a record of which Java extensions to load it’s best to start Notes with some parameters to make it recompute the Java extension registry: notes.exe -RPARAMS -clean

Let me know if the above doesn’t work for you.

Please note: Manually uninstalling a Java extension installed via a widget descriptor via a widget catalog/policy will probably just make it reinstall once uninstalled.

Doing Java plugins? Then you need to checkout this OpenNTF.org project

Props goes out to the Java UI Team (Ryan Baxter, Adam Geheb, Stanton Sievers) for publishing the Java UI API Exerciser plugin showing how to use the Java UI API for the Notes client. If you’re doing Java plugins for the Notes client you definitely want to check it out. Installation is also very easy because it’s signed and as such also serves as a showcase on how plugin deployment works when it’s fully transparent.

More info can be found on the catalog entry.

Actually showing the password prompt when developing Java for Notes

If you’re developing console applications in Java that access Notes resources and you’re testing them in Eclipse you have experienced the following. You run your application to test it from Eclipse. It accesses a Notes resource and you haven’t granted 3rd party applications access in the Security settings so it causes Notes to ask you for the password – only the Console view doesn’t accept input… Bummer! πŸ™

Fortunately there’s a solution to this which I’ll show below.

Disclaimer: I can in no way take credit for this tip as I didn’t discover it. The credit goes to Karsten Lehmann who posted it in the Design Partner forum.

The solution is not to make the password prompt go to the Console view but pop up a password entry dialog instead. The way to do this is to initialize the Swing UI framework before running your application as I do below (see code in bold).

import javax.swing.SwingUtilities;
import lotus.domino.Session;
import lotus.domino.Database;
import lotus.domino.DocumentCollection;
import lotus.domino.NotesFactory;
import lotus.domino.NotesThread;

public class Main {

  public static void main(String[] args) {
    try {
      SwingUtilities.invokeLater(new Runnable() {
        public void run() {}
      });

      NotesThread.sinitThread();
      s s = NotesFactory.creates();
      System.out.println("Name: " + s.getUserName());
      Database db = s.getDatabase("server1/Example", "names.nsf");
      DocumentCollection dc = db.getAllDocuments();
      System.out.println("Docs: " + dc.getCount());

    } catch (Throwable t) {
      t.printStackTrace();
    } finally {
      NotesThread.stermThread();
    }
  }
}

Developing Java plugins and applications for Notes on 64 bit

I just upgraded my Thinkpad from Windows Vista 32 bit to Windows 7 64 bit and besides being amazed at the speed improvements (thanks to moving of Windows Vista) I needed to think about how I develop Java for Notes in general. When moving to 64 bits there are some things you need to consider if, and only if, you install the 64 bit version of the Java Development Kit (JDK) as I did. You need to consider stuff for two reasons which I’ll address in turn.

Please note: This blog post will focus on 64 bits Windows 7 as that’s what I’m running now but I suspect it will apply to other Notes platforms such as Windows Vista, Linux and Mac as well. I’m not using Lotus Expeditor Toolkit so I can’t confirm the following is but a wise man told me that XPD Toolkit doesn’t support 64 bit JDK’s so in that case you need this as well as my “Configure Eclipse 3.4 for Notes 8.5.1”-guide as well.

Notes is a 32 bit application

Say you install a 64 bit JDK and try to run an application that access Notes using local address (NRPC; a client or server installed on the same machine) such as the following:

import lotus.domino.Session;
import lotus.domino.Database;
import lotus.domino.DocumentCollection;
import lotus.domino.NotesFactory;
import lotus.domino.NotesThread;

public class Main {
  public static void main(String[] args) {
      NotesThread.sinitThread();
      Session s = NotesFactory.createSession();
      System.out.println("Name: " + s.getUserName());
      Database db = s.getDatabase("server1/Example", "names.nsf");
      DocumentCollection dc = db.getAllDocuments();
      System.out.println("Docs: " + dc.getCount());

    } catch (Throwable t) {
      t.printStackTrace();
    } finally {
      NotesThread.stermThread();
    }
  }
}

The code will compile fine but when you run it you’ll see a message like the following (plus a stacktrace):

java.lang.UnsatisfiedLinkError: C:Notes8nlsxbe.dll:
   Can't load IA 32-bit .dll on a AMD 64-bit platform

The problem is, as the message explains, that you cannot load a 32 bit DLL (remember Notes is a 32 bit application) into a 64 bit Java Virtual Machine (JVM). The solution is to install a 32 bit JDK instead and run the application using this JDK. Remember that it is perfectly valid and possible to install multiple JDK’s on a single machine and it fact that’s what I’m doing.

Developing plugins for Notes 8+

Developing plugins for Notes 8+ on 64 bit Windows is also somewhat different from doing it on a 32 bit Windows system. Of course you need Eclipse but here’s the first difference – you need to use a 64 bit version of Eclipse if you’re using a 64 bit JDK. The reason is that Eclipse uses SWT (Standard Widget Toolkit) for the user interface widgets. The reason SWT looks so nice on any supported platform is because it wraps the native, C-code, platform widgets. So remember that and grab a 64 bit Eclipse. Once that’s installed and working with your 64 bit JDK configure Eclipse as you normally would but with a small difference that will cause your code not to compile (my Eclipse complained about not be able to resolve org.eclipse.swt.widgets.Shell).

As you may know, you specify the bundles you depend on when developing your plugin and in turn you also specify which environment you run in. This is how Eclipse knows which versions to the bundles to put on the class path but since you’re running 64 bit Windows and Notes is 32 bits it will be a problem. The fix is however very easy to implement and only means tweaking the target platform setup to explicitly set the architecture you’re running on to “x86” and not “x86_64” which is the default if you’re on a 64 bit JVM. Where to set this differs a little between Eclipse 3.4 and Eclipse 3.5 but the concept is the same.

  1. Open the target platform setup
  2. Edit the “Environment” settings
  3. Set the architecture to “x86”

Once this is done the workspace will be rebuilt and everything should work just fine. Mine did anyway… πŸ™‚

Back to our standalone Java application

If you need to run a Java application that accesses Notes locally from within an Eclipse instance (lets face it – who writes Java code without an IDE these days?) you also need to use a 32 bit JVM although you very well may be running 64 bit Eclipse in a 64 bit JVM. The JVM used to execute an application from within Eclipse is the JVM you setup in the build path. To set it simply right-click the project, choose Build Path -< Configure Build Path… and replace/edit the JVM library used.

Conclusion

I hope the above is clear – if not let me know using the comment system. I’ll soon be blogging about using Eclipse 3.5 for your Eclipse development instead of the current version 3.4. Stay tuned.

Extending DDE – creating custom context menus

Part of my new LotusScript.doc release is of course finding ways to make it even easier to use and use the API that’s now supplied as part of LotusScript.doc. Central to all this is extending DDE to make LotusScript.doc accessible in a variety of ways. Today I’ll show you how to add context, i.e. right-click, menus to the DDE navigator on the left as you can see below.

Doing this is actually very easy and only comprises of an IViewActionDelegate (the code; implement org.eclipse.ui.IViewActionDelegate) and a entry in plugin.xml to indicate where to stick the action. In this case it’s an objectContribution to org.eclipse.ui.popupMenus:

<extension point="org.eclipse.ui.popupMenus">
   <objectContribution adaptable="true"
      id="com.lekkimworld.dde.navctxmenu.objectContribution"
      objectClass="org.eclipse.core.resources.IFile">
      <action
         class="com.lekkimworld.dde.navctxmenu.MyContextAction"
         enablesFor="2+"
         id="com.lekkimworld.dde.navctxmenu.action"
         label="DDE context stuff (select min. 2 design elements)"
         menubarPath="additions"
         style="push">
      </action>
   </objectContribution>
</extension>

The above should be pretty much self-explanatory.

The example code is available for download as an Eclipse project: com.lekkimworld.dde.navctxmenu.zip

Signed demo plugin on OpenNTF

Today Niklas Heidloff tweeted about a new demo Java extension that have been published on OpenNTF. Besides being a very nice demo example it also has another noticeable difference from all other Java extensions that have been published so far. The difference is small although very important. The difference is that it’s digitally signed!

When installing Java extensions in Notes you have probably grown used to the “Are you really, really, really, really sure you want to install this unsigned Java extension in your Notes client”-prompt. Without thinking you probably click “Yes” out of habit which is why you may not remember the prompt. If you install this Java extension you wont see this prompt because it’s signed by a certificate you trust (it’s an IBM certificate).

Using jarsigner -verify -verbose -certs on the feature will yield something like this:

[entry was signed on 01-11-09 04:05]
X.509, CN=International Business Machines Corporation,
OU=Lotus Software Group, OU=Digital ID Class 3 - Java
Object Signing, O=International Business Machines
Corporation, L=Westford, ST=Massachusetts, C=US

The difference is small but very important. You did notice it didn’t prompt you right?

Why you should get Notes/Domino 8.5.1 if you take Notes as a PLATFORM seriously

Yesterday Ed asked “Notes/Domino 8.5.1 available: So what do you think?” so I thought I would take a little time and reflect over the new release. I have to admit that I have been running 8.5.1 as my production client for so long that it’s difficult to remember what’s new but I’ll give it a try.

For me as developer and a “Java guy” the main things about 8.5.1 is of course the new DDE extensibility API and the official release of the Java UI API not to mention that we FINALLY have a decent LotusScript/Java editor in DDE. That’s great but that’s is not it.

On of my biggest pet peeves with IBM has been how they for a long time referred to Lotus Notes as a mail client. It IS a mail client but albeit much more than that. By far. Notes 8 (Standard) showed the way by giving us a PLATFORM to develop for. Part of the platform is Java extensions no matter whether they are for the sidebar, toolbar or context menus. Java extensions are of course also an integral part of the Composite Application framework. The biggest problem with the Java extensions when Notes 8 came out was that they were hard to provision to users. That was later remedied by the introduction of widget descriptors (drag’n’drop install of Java extensions to the MyWidgets sidebar or using the widget catalog) so that’s great. The approach had however one major flaw in that the Notes client prompted users when installed unsigned Java extensions. There were ways around it but it wasn’t pretty.

So….

The reason to get 8.5.1 if you take Notes as a PLATFORM seriously is a little, tiny, addition to the security policy in Domino Directory. “But you’re a developer” you might say and you’re (mostly) right. This addition is however of great importance to all developers – it may just be the one thing that gives you success with your Notes Standard client deployment.

Once you have upgraded to 8.5.1 open your Domino Directory and check out the Security Settings document for policies. Switch to the “Keys and Certificates” tab and scroll to the bottom. Look closely – you might not see it at first. Way down of the bottom there is a new section called “Administrative Trust Defaults”. In this section you can specify the internet certificates and/or internet cross certificates to deploy to your end users using policies. With this crucial piece in place you can deploy signed Java extensions to end-users and have them install them without being prompted. At all!! The wont get confused, they wont have the option of aborting the install. This is great news and it works great.

Now that we’re able to push internet cross certificates to end-users these issues goes away. So go!! Deploy away!! Break out Eclipse and get going writing these Java extensions and deploy them seamlessly and transparently…

Of course there are caveats and stuff you need to know but that’s for another day! Oh – and that’s what Lotusphere is for! πŸ™‚

Configure Eclipse 3.4 for Notes 8.5.1

With the eminent release of Notes 8.5.1 it will become important for all you plugin guys and gals to update your configuration to work with Notes 8.5.1. This post will address this.

One of the really nice things about this new release is how Lotus strive to minimize the disk footprint of the install package. Part of this involves how jar-files are stored in the installed package but also how many Java VM’s ship with Notes. Previously there were 2 JVM’s – now there’s only one. There’s no longer a JRE stored in the plugin directory way down in the directory structure. Now you simply use the JVM in <Notes install dir>/jvm – simple right?!

This is nice but it means that your Eclipse configuration needs to be a little different JVM wise. I have therefore updated my Eclipse configuration guidelines to work with Notes 8.5.1.

Happy coding…

Please note: Once Notes 8.5.1 is final and released I’ll update the guidelines with the correct install id etc.