I am proud of DominoToGo. It. Just. Works.

(If you see a video about what I’m writing about, just scroll down…)

I’m just back from a customer in Zurich, Switzerland where we kickstarted a DominoToGo project.

A quite interesting project from my perspective: it’s about coroners that want to write reports about dead people on an iPad mini while they are on site.

So far they had a Notes application in the office, so that they needed to make notes somewhere, for example on a sheet of paper, and enter the information when they’re back in the office.

Since the Notes application should continue to be master of the data, the iPad app needs to push new reports to the Notes application. Furthermore, to create a report, several lists are needed from Notes, for example Notes user names and selection lists for fields like “cause of death”.

Does everyone die in places with good network coverage?

Unfortunately, people do not always die in places with good network coverage, so offline functionality is essential. Therefore a web based app is out of the question, just as in so many other projects I recently worked on.

About the app

So basically the app needs to:

– get a list of all Notes users from the Domino Directory
– get several selection lists from one NSF
– get a list of customer records from another NSF
– offer a form to enter the data
– offer several selection dialogs in the form, something like a view pick list in Notes
– save the data to a new document
– upload the document to a third NSF in Domino, when the device is online
– if the device is offline, the data needs to be queued locally and uploaded sometime later

What we did

In Appcelerator Titanium we started with a template that is delivered with the DominoToGo package. This template contains an app with basic functionality like

– layout for iPad, iPhone and Android
– a configuration dialog for entering the Domino username and password
– an HTML based “about” page
– basic navigation
– a skeleton for synchronization functionality

This template app already has the DominoToGo libraries included so we could start immediately with the business logic.
Futhermore, this template app already uses Titanium’s Alloy framework, which is a system where layout, logic and data is organized separately and the app code is very well structured. The layout is defined with simple XML tags while the logic is written with JavaScript.

First step: synchronization

We started with the synchronization logic. As written above, several Notes views needed to be synchronized to the app. With DominoToGo, this was a no-brainer, here is a piece of the code:

function sync_personen(success, e) {
if (!success) {
DTG.log("Sync von names fehlgeschlagen: "+e.error);
return;
}
var view = Alloy.Globals.notesdb_adressen.getView("(iLotus_Personen)");
view.update(sync_adressen, false, 'Synchronisation fehlgeschlagen: %s');
}

function sync_names(success, e) {
if (!success) {
DTG.log("Sync von fehlgeschlagen: "+e.error);
return;
}
var view = Alloy.Globals.notesdb_names.getView("(iLotus_People)");
view.update(sync_personen, false, 'Synchronisation fehlgeschlagen: %s');
}

Regarding the amount of data, we counted some hundred Notes users from the Domino Directory, some 500 customer records and about one hundred keywords used in selection lists.

The synchronization took about one second to complete. It is so fast, that we simply let the synchronization run everytime the app starts, the user doesn’t notice it at all.

Second step: designing the form

The basic form was done very quick thanks to the great Titanium Alloy framework. For example, have a look at this code:


and now look what this kind of tag produces in the app:

It’s a generalized view picker dialog which displays the content of a Notes view in a picker dialog in the app (of course, even when the iPad is offline). I wrote code for various generalized picker dialogs, like a date picker, a view picker and a selection list picker. My customer now only needs one line of XML code like the one above to use such dialogs. Not that bad, isn’t it?

Third step: uploading data to Notes

Data entered in the form in the app should be uploaded to a Notes application in Domino. Nothing simpler than that, look here (no, that’s not LotusScript! It’s JavaScript in Titanium);

var notesdb = Alloy.Globals.notesdb_ereignisse;
var doc = notesdb.createDocument();
doc.replaceItemValue("form", "FM-LN");
doc.replaceItemValue("Name", $.fields1.c_getValue1());
doc.replaceItemValue("Vorname", $.fields1.c_getValue2());
doc.save(true);

But there was one additional requirement: the documents need to get a number based on special numbering rules. This numbering could only be done on the Domino side. A problem? Hell no!

In DominoToGo there is a SSJS library on the Domino side that provides extension points, for example when a new document has been uploaded from the app to Notes,

So we simply needed to write some server side JavaScript code in this library which computes a new number and stores it in the new document that just has been uploaded by the app. Simple and clean.

My job was done and I am proud

After developing and explaining all this functionality my job was done. Now the customer has all the functionality and pieces needed to finish the app by himself.

I’m proud of DominoToGo. All the synchronization functionality needed in this project was implemented in minutes and just worked. Reliable and fast.

Yes, since I developed the DominoToGo framework by myself such a statement seems to be selfish. Nevertheless, I’m still proud of my work 🙂

If you want to read more about DominoToGo, have a look here.


2 thoughts on “I am proud of DominoToGo. It. Just. Works.