dominoGuru.com

Your Development & Design Resource

WML-enabling a Personal Address Book - It's in the cards....

You'll get that bad pun at the end of this...

Welcome to the first post of the Domino + BES mini-project. Today we'll give you an beginner-level introduction to WML specific to something that you can use right now: the mobilization of a Group Personal Address Book.

If you're company is anything like my one customer, you have your main Domino Directory as well as several "other" directories containing things like IT contact information (such as home and mobile numbers) that you really don't want to get out to anyone that shouldn't have access. I know I wouldn't want to get calls at my house from someone who can't figure out how to print a calendar in a "planner" layout! So, the typical solution here is to create a new NotesDatabase based on the Personal Address Book Template and use that new NotesDatabase to store your shared contacts.

That's exactly what my one customer did... and then complained that each time they needed to access the contact information, they needed to boot up their laptops, VPN into their secured environment, launch Lotus Notes, and look up the information. Absolute pain for the user, and a situation that could be easily addressed with their existing technology investments: they have IBM Lotus Notes/Domino and RIM Blackberry Enterprise Server.

So, let's outline first what we're going to do, and then review the step-by-step build:

We'll create a very simple WML-based functional-build of the Personal Address Book. And don't worry - you don't need to know anything about WML... we're go step-by-step, and it's really simple stuff here.

Now, to outline our build:

  1. Create a NotesView named "mobile".
  2. Create a Form named "$$ViewTemplate for mobile".

Yeah - that's about it really. Two Design Elements, and you'll have your WML-based secondary "Mobile Directory", which you'll be able to access even when you're offline... but let's not get ahead of ourselves here.

As I'm a visual person - here's a pretty picture!

WML Mobile 
Directory Diagram

So, here's the basics of what we're going to do. The "mobile" NotesView - via the "$$ViewTemplate for mobile" - will load a single WML page that contains "cards" - the first being a radiobutton list of all entries in the "mobile directory". When an option/name is selected, you simply go to the card that's ID matches the UniversalID of the given entry.

And this is where the beauty comes in: since you're loading all of this into a single WML page, you can "navigate" any number of entries within the WML page, and the user experience mirrors that of the current Blackberry Mobile Device Address Book (with Select Name = Contact Page). The email and number "live-text" recognition on the device creates the hotspots/links as they would in an email body. The result is a fully functional, offline-accessible secondary Mobile Directory!

Now let's build it!

First, check out this WML Example from W3CSchools.com. We're going to modify this example to better fit our needs, as well as do away with the do event trigger for card1, and instead define an onpick event for the individual entry on card1. That make any sense? Don't worry - we're going for results first, complete grasp of this later...

So, we'll basically have the following WML markup:

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>
 <card id="card1" title="IT Contact Information">
  <p>
   <select name="name">
    <option value="HTML">
     <onevent tpe="onpick">
      <go href="#013725AFF8D1811952117E30731E49FC" />
     </onevent>
     Chris Toohey
    </option>
   </select>
  </p>
 </card>

 <card id="013725AFF8D1811952117E30731E49FC" title="Contact Info">
  <p>
   <b>Chris Toohey</b><br />
   ctoohey@dominoguru.com<br />
   Mobile: 610.417.1700
  </p>
 </card>

</wml>

So, from this, we get the idea that all I'll need to do is 1) create a list in card1 of all contacts in the Address Book and specify the onpick event for each to go to the anchor named after their UniversalID.

The "mobile" NotesView contains two columns. The first - which is hidden - builds our options list for card1. The second - which is visible - contains the specific card markup for the individual contact - following the above schema (using the UniversalID, etc.). Just set the NotesView attribute to "Treat contents as HTML" (which is a misnomer here...) and you're done. Quick Note: The above sample markup only includes the name, email address, and mobile number - go nuts with what you want to include in the specific user's card.

Now that we have our "mobile" NotesView, we'll create our "$$ViewTemplate for mobile" Form.

WML Mobile 
Directory Form markup

Shouldn't be too hard from here to get - cfd_lookup returns an @DBColumn of the first (hidden) column, thus populating the card1 options list, and the $$ViewBody displays the visible contents of the mobile view (2nd column).

Last thing to do here is change the content type of the Form to text/vnd.wap.wml and you're finished! Just fire up your Blackberry Browser and point it to your "mobile" NotesView to get a fully-functional WML-based "Mobile Directory" which - once cached - will allow for complete offline access!

You can alternately - to deploy your new "Mobile Directory" as an actual Blackberry Application - use the BES Channel Push, which will push out a defined icon to the recipient device's Home Page and pre-cache the contents of the (in this case) "Mobile Directory". For that, you can either download the .Net-based examples, or wait for Showtime - which will allow you to do all of that Channel and Message Push to defined recipients from within your Lotus Notes client!


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.