OpenSocial (iGoogle) gadgets in Eclipse

I’ve been reading some blog posts about the upcoming Eclipse v.4 (or e4) and which features are planned for this release. One of the posts (OpenSocial (iGoogle) gadgets in Eclipse) discusses how Google Gadgets might make their way to Eclipse as views (ViewParts). Being a Notes user this is what we’ve had for a couple of years as MyWidgets but it’s always interesting to speculate who influences who… 🙂

It is becoming very clear to me that Notes as a platform is a good citizen in the Eclipse community by drawing from the community but also giving back to it.

New pet project: LiveTextr

Part of my job, interest and efforts goes towards illustrating just how extensible the Notes 8 platform is. Part of this is playing around with the platform and trying to do stuff to illustrate how the platform may be extended. One of the very cool ways to extend Notes 8 is using widgets and LiveText but debugging it can be a hazzle due to the way widgets are created and installed into the platform. The goal of my latest pet project was to alleviate some of these pains and make it easier to work with LiveText.

So I’m happy to show of LiveTextr!

LiveTextr is a sidebar plugin for Notes 8 that allows you to test LiveText regular expressions against the Notes documents you have open in Notes without creating a widget first. This means that I can open a document that contains some text I would like to test against and start writing regular expressions and have them debugged in the Notes client before doing the actual widget. Installing and testing the pattern is done by clicking a button and the pattern is dynamically added to the LiveText engine.

The first screenshot shows me debugging a pattern right there in my Notes 8.5.1 client.



Click image for larger version

LiveTextr also provides you with instant feedback on the syntax of your regular expression as you write it. This is also a problem with the built-in model as there’s no way to test your regular expression as you write the widget. The second screen shot shows the current feedback (shown in red text) when the regular expression contains errors.



Click image for larger version

Further improvements I’m planning is to allow users to build regular expressions visually (or at least without having to know the syntax of regular expressions) and to handle capture groups. I also plan to open source the project on OpenNTF.org.

Generating unique id’s for Notes widgets

If you write code to automatically generate widget descriptors (aka extension.xml) for users you have to ensure that the widget id is unique. A nice exxample of this can be found here. One caveat is that the widget id is used to distinguish the widgets hence has to be unique. To easiest way to generate a unique id in Java is to use the java.util.UUID class. Generating a unique, random, id with this class is easy.

String id = java.util.UUID.randomUUID().toString();

On plug-ins, features, update sites and extension.xml files…

I’m receiving quite a few e-mails asking questions about features, plug-ins, update sites and extension.xml files and how they relate so I thought I would try and clarify things.

Term Description
Plug-in The smallest unit of code you use to create functionality for an Eclipse based client. This is where the actual Java code is.
Feature Used to package and bundle plug-ins together. Features are thin wrappers for plug-ins and is basically a single file called feature.xml. You can bundle multiple plug-ins into a single feature. When installing code into Notes you actually install the features which in turn point to the plug-ins to copy to the client. You can only manage features through the Notes “code UI” (File/Application/Application Management) though you can install code into the platform by simply copying the plug-ins into the appropriate directories in the file system. This is not recommended… 🙂
Update site Update sites are used to deploy features to clients. An update site is simply a directory containing a

  • “plugins”-directory containing a jar-file per plug-in
  • “features”-directory containing jar-file per feature
  • site.xml file describing which features and plug-ins (and in what versions) are available on that particular update site

When an Eclipse based client contacts an update site it reads and parses the site.xml file to discover what’s available there.

Update Sites may be remote or local. A local update site is a directory on a local hard drive or LAN drive with the above structure or a zip-file with the above structure. An update site may also be remote and may be read using HTTP (any server will do) or it may be read using NRPC if you’re using a Notes 8+ client. When using NRPC you use the Update Site Notes database template.

extension.xml These files are used when installing code using the MyWidgets sidebar plug-in and is a shorthand for manually installing code. There is no magic at work here. When you drop an extension.xml file onto the sidebar panel the following steps are performed:

  1. The extension.xml file is parsed and verified to be a valid XML file
  2. The features to be installed are located and a dependency graph is assembled so any required features are identified
  3. The update site address specified in the extension.xml file is contacted and each missing feature in the dependency grapg is attempted installed “bottom up”
  4. The client is restarted

If you’re wondering why your widget catalog deployment doesn’t work…

…then make sure your widget catalog is in the root of the server. This will be fixed in Notes 8.5.1 and a SPR has been generated (SPR #DMDD7Q4MWT) for Notes 8.5 FP1 so open an PMR and vote for it if this is important enough for you. For the record the way that this works is by the Notes client having a replication event listener for the widget catalog database.

How to deploy widgets and/or plugins in your organization

Deploying widgets and/or plug-ins in your organization is very easy and there’s a number of options for doing it.

  1. Desktop policies
  2. Widget catalog via MyWidgets
  3. Drag’n’drop of widgets to the MyWidgets sidebar plug-in

Using a desktop policy is just a administration shorthand for using the widget catalog via MyWidgets.

The first thing you really should do, if not simply using publishing widgets created through the MyWidgets functionality, is to read up on and understand the Lotus Expeditor provisioning manifest syntax. The manifest is used to specify where the update site server is and which features and in which version to install. The manifest looks weird at first but it’s actaully easy enough. Unfortunately there isn’t a nice UI for creating these provisioning manifests but I head rumors in the Meet the Developers lab at Lotusphere that a UI is coming. Soon… 🙂

And now for the time and frustration saver…

Absolutely make sure that you put the widget catalog in the root of the Domino server to make sure it ends up in the root of the Notes client. If you do not do this and you specify a widget catalog in the preferences the Notes client wont apply updates to the widgets when new versions are available. This is a bug at least in Notes 8.5 GOLD.

Resources:

TwitNotes – v. 1.0.7 is out

Just uploaded TwitNotes v. 1.0.7 to the update site. It’s just a small bug fix release that fixes some minor things:

  • Easier searching by responding to pressing the Enter key on the Search tab
  • Make sure all profile images are scaled to 48x48px to handle too large images (looking at you @marybethraven)
  • Attempt to fix wordwrap issue on Ubuntu – still working on that

Thanks to Brian Leonard from IBM for providing a widget descriptor to make installation a lot easier. Simply drag the link to your MyWidgets sidebar plug-in to install.

My take on the LotusLive Contacts Sync plug-in and how to install it more easily

I read Chris Tooheys post on the LotusLive contact sync plug-in for Notes 8 (LotusLive Notes Contacts Sync on Lotus Notes 8.5… and why you should care!) with great interest and was very happy to see they didn’t choose to make it a sidebar plug-in. Instead they chose a Tools-action which makes much more sense and which doesn’t take up space in the sidebar. Now it just needs a hook (extension point) into the replication API to sync when I replication with my servers – that would be very nice.

I haven’t really tested the plug-in thoroughly yet but I found it funny that I had to issue a cross certificate to a LotusLive certificate during the install (“CN=www.lotuslive.com/OU=Terms of use at http://www.verisign.com/rpa (c)05/OU=Lotus/O=INTERNATIONAL BUSINESS MACHINES CORPORATION/L=Phoenix/ST=Arizona/C=US/SerialNumber=DOC:19110616/XX=V1.0, Clause 5.(b)/XX=New York/XX=US”). This is the SSL certificate of the LotusLive.com site. I can actually install without cross-certifying but cannot restart the client until I create the cross-certificate. Maybe Lotus should choose a SSL certificate that is trusted by the Notes client by default.

To make it easier to install I created a LotusLive Contacts Sync widget descriptor which you can use to install the plug-in much more easily than doing the File/Application/Install dance.

To install from this either save the xml-file to your computer and drag it to the MyWidgets sidebar (or use a widget catalog) or drag the link directly to the sidebar.

The stuff you need to test plug-in deployment in Notes 8

While testing the plug-in deployment features of Lotus Notes 8.x I needed some plug-ins to actually install. They needed to be small, not to have any dependencies on the platform as such as well as having a manageable, and known, dependency graph. Also I needed multiple versions to test installing different versions, upgrading and uninstalling. For this specific purpose I wrote a couple of very, very, very simple sidebar plug-ins (very simple – they just display the version of the plug-in) to play around with.

I now have two plug-ins packaged into two features – Feature 1 and Feature 2. Feature 1 depends on (a specific version of) Feature 2 which in turn doesn’t depend on anything else than the platform (Eclipse core). This means that I can test installing different versions of Feature 1 and verify that Feature 2 is also updated accordingly.

I have made these features publicly available so if you need something similar read on.

Feature dependencies

The below table shows the dependencies between the two test features provided. The table should be read so that Feature 1 v. 1.0.1 depends on Feature 2 v. 2.0.0 and Feature 1 v. 1.1.1 depends on Feature 2 v. 2.0.2.

Feature 2 version
Feature 1 version 2.0.0 2.0.1 2.0.2
1.0.0 X    
1.0.1 X    
1.0.2   X  
1.1.0   X  
1.1.1     X

Installing the features

You can test installation of the features in one of two ways. Either use an update site I provide or use the widget descriptors to install using a widget catalog or the My Widgets sidebar plug-in.

To use the update site point your Update Manager at http://update.lekkimworld.com/testplugins/site.xml and make sure that, when you install, untick the “Only show the latest version of a feature per update site” when selecting features.

Failure to do so will result in your only being able to see Feature 1 v. 1.1.1 and Feature 2 v. 2.0.2. Unticking the box will allow you to select any combination of features you would want to test.

To use the widget descriptors right-click and save the below widget descriptors to your system and use them directly by dragging them onto the My Widgets sidebar plug-in or import them into a widget catalog.