Using MIME-Based HTML Tables in Notes Client
I remember back when I first started with Notes development having to create tables on Notes Forms to display data held in fields in the same document. Maybe you did something similar whereby you'd use one multi-value field for each column of data and add a table to your form with one field in each column. Then you'd hope there was no wrapping. All very messy.
Having not done any real Notes development for 10+ years it's not something I've thought much about since. Until last week when I needed to display a table in the Notes client.
If I was in any doubt that my career is on a circular path then the fact I've just been developing for the Notes client can only confirm this.
Anyway, it turns out there was a better way of doing it, which worked quite well and I feel compelled to share, as it's not something I'd thought possible until I tried it.
The requirement I had was for tracking parcels using a courier's Web Services. Each "shipment" document in the Notes database has a tracking number in it. My job was to write a scheduled agent to regularly update the tracking data and mark documents as delivered or raise alerts for any issues.
I also needed to produce a visual way of displaying progress for each shipment, which ended up looking like this:
What you see above is just a standard Notes document opened in the Notes client. The table itself is standard HTML stored in a MIME-based field. All that my Java needed to do was build the table and stick it in a field. The fact I managed to make it look nice at the same time with a little CSS is an added bonus.
The data is purely for visual reference, so the fact the field can't be interrogated in any way isn't an issue. And, also, because the courier always returns all tracking data with each call to the service I can just delete and re-create the field and the table from scratch each time.
Job done. Remember, MIME is your friend.
Nice work, Jake.
It's not a circular path, it's demonstration of mastery.
Reply
Good stuff ... I embarked on something similar recently but ran into a snag when needing to display icons in some columns. Since the table was being included in an email, the gifs needed to be attached to the message in the event the message was viewed offline.
Reply
Did you overcome the snag Mike? It's easy enough to include inline images in MIME emails.
Reply
Show the rest of this thread
Xpages developers : How easy is this in Xpages ? I can imagine its pretty easy.
Reply
The process is the same for XPages, but it's overkill to use MIME when the browser already supports HTML. Also, repeat controls are normally more efficient (performance & memory) than generating, encoding, and displaying a long HTML string.
Reply