My contribution to the Notes & Domino community

UI

Bob Balfe asked some time ago who is using JQuery for their Domino development projects. I hoped it was gonna rain with examples of implementation of JQuery plugins in Lotus Notes but so far it remains a bit quiet. So why not describe an example myself?

Figure: Screenshot from the website.

xBreadcrumbs is a nice plugin to JQuery to provide horizontal navigation. It uses an unordered list (UL) as source so when you provide that data dynamically with Notes data it becomes interesting.

In my case the customer wanted to have breadcrumbs on top of documents that are stored in a Notes view. Documents are categorized in a parent-response hierarchy so for each document I have to calculate the complete path from the opened document to its uber-parent (some points on that u) aka as ‘Home’.

Figure: Document location in Notes view.

Figure: Document location in breadcrumb.

Implementation

Download the zip file, extract it and upload the files in your Notes application.

Create a subform that you will embed on the form of your document. Add the following code to the subform:

The agent will use the Notes view ‘$v-treeview’, find the document by its document UNID and navigates via each parent all the way up in the Notes view. While doing so the required information to build the unordered list is collected.

By the way, the code for this agent was co-written by my collegue Tomas Ekström.

Reflection

In theory the breadcrumbs were displayed without any problem on the fly. However when moving into production with a database with more than 10.000 documents performance became a problem. It took about 3 seconds to collect the information and thereafter the complete document would be displayed.

Since the customer did not find such a load time acceptable BUT could no longer live without the breadcrumbs any longer I decided to place the subform instead of on top of the form to the bottom of the form and place it via CSS back on top of the document via absolute positioning.

The result is that the content of the document is displayed instantly and the breadcrumbs will follow a few seconds later. Not the nicest solution if you would ask me.

But for small websites (tested with 400 documents) the function works like a charm.

To end this post I will include the code for the agent + some script library.

Bildr is a prototype application that never received enough funding to become a full blown (internal) Notes template. The idea is to offer a place where teams can share high resolution images.

Bild is the Swedish word for photo and Bildr refers ofcourse to Flickr.

Another reason why I stopped prototyping the database is that I started looking at XPages and the limitations I experience with pre-XPages development. To shorten it: it takes just too many design elements to build it in the old-fashioned way to be able to offer a Web 2.5 experience. Maybe after a long break I will move the idea behind the application into an XPages based solution.

For now you can download the application and use it as a start for your development project.

What’s in it?

1. Easy import and thumbnailing of images (Notes client)

Open any of the Picture views and select the New Upload button.

The idea is that you can upload multiple images at once in a new or an existing category. You can add tags and a description to the to be created document(s). New uploads you may want to appear in the ImageFlow gallery in the startpage and you can enable commenting and read restrictions.

When you select the Upload Images action button you can select the pictures you want to upload. The code behind this function is taken from the NSFTools site (I guess). After uploading you can select to include more images or just leave it as it is.

Behind the scenes each picture is included in a Notes document with also a mid-size image and a thumbnail:

For the Notes client that is just it. Nothing more exciting here except some gaps in the completeness of the functionality (hey, I was talking about a prototype).

2. Presentation (Browser)

For the way of presenting different elements I guess I was so bold to use Jake Howlet’s DomBlog Template (for search, calendar, commenting, RSS etc.) which was for a long time a learning application for many Domino developer. I guess if you compare the layout with that of LinkedIn you will see some comparison.

I guess Lightbox alike functions are almost unthinkable when looking at high resolution images so this I also included when clicking on a mid-size or thumbnail image:

What is it not?

You can not call this app a production ready application. Some things are not in place (like cleaning up categories and corresponding image documents). However it can be a nice starting point for a mature application. Untill now I experienced little or none errors so please give it a try and send me the end result of you modification.

Even though Notes 8.5.1 can be expected soon reality learns us however that a lot of users are still on versions 7 or even 6. Ofcourse you could use the limitations in the UI as an argument to force them to upgrade to newer versions of Notes, but then still a lot would run the basic client, not the standard one, so nice looking Java Views are still a long way to go.

I wrote before something about UI’s in Lotus Notes but now I was thinking about adding an example so those who are interested can test it and give feedback or use it for their projects. Whatever.

A problem with Notes Views is that when they contain a lot of documents scrolling becomes inevitable. Even when you apply categorized columns it will become necessary that users click through the Views. An option would be that you just start typing and hopefully Notes will lead you to the nearest corresponding document.

When you apply categorized views the categories are displayed vertically below each other so for travelling users with smaller screens it will become tasly to open and close the categories just to see thse categories and corresponding documents displayed in a properly in the overview.

Maybe XPages in the Notes client will bring us some relief, but we are not there yet.

So how do we cope with the issue for the time being?

On the web it is common practice to have some sort of pagination on top / below lists of documents so you can navigate through the list without the need to scroll up and down or move you mouse across the screen. The pagination can be based on number of available pages or just available short cuts (example: the first letter of an available lastname). I myself have written some articles about pagination on this blog which you may check out yourself.

So this is all about the web, I adress this article to pagination in the Notes client.

The simplest way I found is to create a list of similar shortcuts, containing javascript, and render pass thru HTML in Notes. In this example I explain how I added pagination to a list (a Notes View) of persons. The thought is to show a list of persons form which their lastname start with a certain letter. What I needed to accomplish this:

A Form with an Embedded View. This View should be categorized by the first letter of the lastname @LowerCase(@Trim(Tx_LastName);1). SaveOptions are set to zero ofcourse.

The Embedded View has the ‘Show single category option’ in use. As formula write the name of the Field that will acts as a temporary container (Tmp_LastName).

Add a Field named TmpLastName on top of the Embedded View. Make it editable. As default value give it the value “a” (you could check if this value is really available or not).

Here we make a call to first column in the same Embedded View. Around each found category we wrap a JavaScript call which will put the value in the temporary field and finally we call the button to update the UI.

Here is a screendump that shows how it could look like:

A problem discovered

Well everything looked shiny untill I tried to load the Form in a Frameset. When pressing on one of the links I got the message:

For my ‘photogallery’ application I got a bit tired of the Smoothgallery implementation. Basically I was looking for sometime more attractive and less ‘busy’. That is when I bumped into ImageFlow a JS image gallery in a iTunes alike way (and probably more Apple software which I do not use).

Here is what it looks like in my app:

this is how it looks in my app

Some rules for implementing ImageFlow in your Domino app:

ImageFlow is written for PHP applications, so for each image you include the reference gets rewritten in a following format:

Nothing ‘spectaculair’ but going to the guidelines document and applying the rules in an application brings a lot of ‘logic’ and consistence among other applicatons to the end-user.

One guideline had my special attention:

Put actions in the Actions menu and action bar. Do not put actions in the outline unless the action is directly related to one of the views or folders.

Normally I use an outline for actions that are so general that I want to have it everywhere available (like opening a configuration profile). Therefor I added a header with tabs. One is called ‘Menu options’ where I provide a dialogs with actions that are related to certain userroles (admin, editor, reader).

I also added a ‘Using’ and ‘About’ tab in the header to push our developers to provide instructions and general information about the application. Something that is often lacking.

For the ‘menu’ or ‘outline’ I would like to use collapsible tables like in the OpenTV project on OpenNTF but that is still bugging me.