dominoGuru.com

Your Development & Design Resource

IBM XPages: A game-changer for Lotus Notes Domino application developers

I reached out via on Twitter, on Facebook, on Google+, and even on LinkedIn asked "What is your favorite thing about developing with IBM XPages?"... and I got great feedback.

Some responded by picking a particular feature or functionality (the most common being the Repeat Control), while most love the freedom that the addition to the IBM Lotus Notes Domino platform brings. For me, it's something different. I'll explain.

On a recent project, I needed to create an event management feature. From a given event listing, a user might want to "Add this Event to My Events".

Typical traditional "Lotus Notes" ways to do this range from creating a copy of the event information in a new NotesDocument (MyEvent vs. Event, if you will) to [shudder] adding the user's name to an "attending" NotesItem on the Event. Even the best of techniques is tinged with a sense of hackery.

If I had to do this in traditional Lotus Notes, I would create a "pin" NotesDocument, which would be a response to the given Event NotesDocument. This "pin" would contain the following NotesItems:

NotesItem Value
$Ref UniversalID of the Event (parent/child relationship)
author @UserName() of the person creating the "pin".
user target @UserName()
status "Attending|1","Not Attending|0"

So the idea here is pretty simple. A "pin" can either be initiated by an "Event Chair" or from the actual user. When the user adds their own "Add this Event to My Events", author and user is set to @UserName() and the status is automatically set to "Attending|1". When the "Event Chair" invites people, they'll have the option to choose whether they're want to attend or not attend.

An added bonus to this technique is to allow you to track who is attending and who is not... and the "Event Chair" can follow-up with them accordingly.

The two scenarios where I'll need to display "My Events" as a user is 1) a list of events that I'm "attending", and 2) the ability to edit my "pin" and say whether I'm attending an event or not. In both scenarios, clicking on the "pin" should take me to the actual Event.

So I'd want to display these via an embedded view on, let's say, a Form that I'm using as a dashboard. Thing is, the "pin" doesn't have Event information. As a view cannot create a data join between two sources (the "pin" and the "event"), I would not go with an embedded view but opt for some Computed Text and use @DBColumns/@DBLookups.... but now I've lost the ability to click-to-launch UNLESS I throw away the Computed Text and use a Computed Field which I could highlight as pass-thru HTML, render pass-thru HTML in the Notes client, and now use a friggin HTML Anchor/link to launch the "Event" NotesDocument via a Notes Client URL (notes://killmenow/events.nsf/{UniversalID}... because if I launched the "pin" NotesDocument I'd have to throw some PostOpen LotusScript that got a handle on the parent "Event" and open it, while still keeping a handle on the "pin" NotesUIDocument so I could close it. The screen'll flicker like all hell, but it'll work...

Well. Screw. That.

My Events 'list' xc:tile_event.xsp Custom Control Example My Events 'list' xc:tile_event.xsp Custom Control Example

Using an XPages Repeat Control, I can simply rock my @DbLookup() to get a handle on all of my "pin" NotesDocuments, and pass the $Ref through to a Custom Control that I've written that handles displaying an Event. In the above example, I also pass through the "type" that I want to display. If I changed that to "miniform", you wouldn't just get an event title and timestamp, but you'd also get "Attend this Event" "Ignore this Event" buttons which directly update the given "pin" NotesDocument while displaying live data from the "Event" NotesDocument.

Alternately, I could tell it to use the type "minicard":

My Events 'minicard' xc:tile_event.xsp Custom Control Example My Events 'minicard' xc:tile_event.xsp Custom Control Example

This option, which is used on the "events" views, is really slick: it will check to see if you're already attending and suppress the "Add to My Events" button while also displaying a real-time count of all people "attending" the given event.

The point is, what I love about XPages is that I'm no longer bound by the ridiculous limitations or hacks-around-said-limitations of traditional "Lotus Notes" development. Does "traditional" Lotus Notes development have it's place? ABSOLUTELY! My Junction Lite app is the perfect example of a Lotus Notes Client utility app that would quite frankly SUCK as an XPages-based solution.

Conclusion

I quite frankly got really angry remembering how difficult it used to be writing something like the "events" facility using "traditional" methods... and I'm certain the shift in tone (which I'll keep in this article/editorial) resonates with a lot of IBM Lotus Notes Domino application developers that spend more and more time working with XPages.

Sure, there's an absolute learning curve. There are a lot of tactics and learned behaviors that almost have to be completely abandoned in order to get the most out of XPages. There are also some things that quite frankly just don't make sense.

But at the end of the day, I can now spin out a solid solution that meets business logic needs while enveloping the user experience expectations that users have today in a fraction of the time it would take me to develop the same application if I were to be bound by the platform limitations that traditional development can bring.

We have this amazing set of tools. Learn how to use them all. If you're not currently learning XPages, you'd better get started. If you need help, just let me know!


About the author: Chris Toohey

Thought Leadership, Web & Mobile Application Development, Solutions Integration, Technical Writing & Mentoring

A published developer and webmaster of dominoGuru.com, Chris Toohey specializes in platform application development, solutions integration, and evangelism of platform capabilities and best practices.



More from dominoGuru.com

dominoGuru.com is powered by IBM Notes Domino XPages & hosted by Prominic.NET

Contact Us

Use our Contact / Feedback form or one of these email addresses:

Creative Commons License

Except where otherwise noted, dominoGuru.com by Chris Toohey is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.