As I mentioned on This Week in Lotus last week, I’ve been working on a submission to OpenNTF. In fact I’ve had it pretty much ready to go for months now, I just never got round to submitting it and the topic of OpenNTF on This Week in Lotus gave me the opportunity I needed to back myself into a corner so that I could procrastinate no longer.

The project is called Audit Comments Custom Control, although the custom control is so configurable that it can capture comments from the user in a dialog and store them back to any field, not just an audit field. The custom control uses a Dojo dialog (dijit.Dialog) and gets around the well-documented problems with using Dojo dialogs. The custom control has a number of properties that allow the developer to force presentation of the dialog onLoad, prevent cancelling of the dialog, define which DominoDocument datasource and which field the comments should be bound to, define an error message, and define which element should be partially refreshed after the comments have been entered. In addition to being triggered onLoad of the XPage, the dialog can alternatively be triggered programmatically through client-side javascript. QuerySaveDocument SSJS is required to save the comments back to the underlying DominoDocument datasource.

Initially I developed the custom control for an application late last year, but recognised that I might again have the need to prompt for comments when editing a document. I also recognised the benefits of being able to prompt for comments at any other point during the document editing process. Consequently I extended the custom control by adding a number of properties to make it configurable enough to be used for a variety of purposes. Ironically, during UAT the customer requested that I remove the audit comments functionality!

The custom control is designed to work with 8.5.1 or higher, but may work with 8.5.0. (If anyone is on that version and tries it, I’d be interested to hear if it does or not). Although dojo dialogs are available as an extension in the XPages Extension Library, the configurable nature of this means I believe it is still of use. Once I understand the XPages Extension Library better I would like to provision this project as a extension in its own right. But that may take me some time. Without modifications, I believe you can only use one instance per XPage, something I’d also like to address. If anyone has any feature requests, spots any defects, or would like to contribute any additional functionality please contact me either in the project or by other means.

I am also looking to contribute the custom control to the Apache catalog, and I’m not sure if that needs to happen before it will show up when using the Import and Export for Designer plugin contributed by Yi BJ Guo and Stefan Wissel also to OpenNTF. If my project is already available with that plugin, it should install only the resources required into your ntf or nsf. If not, the instructions in the ReadMe file are clear about which resources need copying across to your application.

One comment I would like to add is that this is the first full project I’ve contributed to OpenNTF. I read all the documentation and filled in the form to become a contributor several months ago, but thought it would be time-consuming to set up the project and upload everything. How wrong I was. Within half an hour I had created the project, uploaded all the files and set up the project as required. Using the Import and Export for Designer plugin to create the zip file to upload was also extremely easy and is very slick. Extending my initial audit comments custom control with the properties to make it configurable and creating the Apache-style ReadMe file was also very straightforward. I would strongly recommend any developer who has a custom control they feel is worth contributing to take the necessary steps and do it. It’s relatively quick, very easy, and rewarding.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.