Your Development & Design Resource
Mobile XPages: The Architecture of How
01/12/2011 12:13 PM by Chris Toohey
In this series, you will be creating a multi-platform mobile device user interface and enhanced user experience for a Domino Server-hosted NotesDatabase app using the Personal Address Book Template.
Once we have defined the Five Ws of Mobile XPages, we will need to figure out the How. The How (specific to the topic of Mobile XPages NotesDatabase app architecture) will illustrate the built-in MVC software architecture options available to IBM Lotus Notes Domino Application Developers, and afford you the ability to create extended user interfaces and user experiences for your traditional NotesDatabase applications without interrupting production environments.
And while this topic is applicable to Web Browser-based XPage application development, you will see how it is absolutely critical to the development techniques discussed further in this series.
Every XPage and Custom Control allows you to define a remote Data Source. Be it a View or a Document, the out-of-the-box functionality -- driven by a dialog-prompt (seen below) in the Domino Designer no less -- gives you the ability to interact with NotesData in other (or remote) NotesDatabases.
Here we have a simple in-NotesDatabase example of a Document Data
Here we have a simple remote NotesDatabase (other.nsf) example of a Document Data Source:
<xp:dominoDocument var="thisdoc" formName="document"
thisdoc can now be used to Create, Read, Update, and Delete a NotesDocument in a separate NotesDatabase.
Not impressed? Via the same Dialog Prompt (or, once you are familiar with the syntax via direct markup in the Source pane), you can define a target Data Source on a remote Domino server!
<xp:dominoDocument var="thisdoc" formName="document"
What this affords you is the ability to create secured mobile versions of your NotesDatabase applications via XPages easier than ever before.
Consider if you will the prototypical Mobilization of a NotesDatabase:
Illustrated above, you have the Mobile Devices accessing the target NotesDatabase [on the target Domino server] directly. This requires either HTTP traffic access to the target Domino server through your firewall or moving the Domino server to the DMZ.
Both of these options have their drawbacks. The most apparent being exposure of your Domino infrastructure to the external world, where any Black Hat or Script Kiddie can put your server and your applications through the paces while looking for an ingress point.
And while I trust Domino, who wants to temp fate and put something externally that you don't have to.
Enter the Domino HTTP Request Proxy.
A Domino HTTP Request Proxy is an architecture that relies on the placement of another Domino server in your DMZ, and your external users -- from Web Browsers to Mobile Devices -- will communicate directly with said Domino server. The external Domino server then communicates securely via NRPC to the target Domino server where your target NotesDatabase is located. Ideally, all CRUD operations will be consumed by your Domino HTTP Request Proxy app and performed against the target NotesDatabase.
Of course Traditional Domino Development could achieve this via
LotusScript, by defining the
targetDB as the remote target
NotesDatabase... but XPages allows you to do this via out-of-the-box RAD development practices.
Once you understand that you can remotely access any target NotesDatabase(s) via your Domino HTTP Request Proxy XPage-based NotesDatabase, you need to decide whether you will create your mobile UI/UX in the same NotesDatabase (direct access we'll call it) or leverage the Domino HTTP Request Proxy architecture (either via a second NotesDatabase app residing on the same Domino server or on a remote/external server).
Several benefits to using the Domino HTTP Request Proxy architecture:
No need to modify the target NotesDatabase Design
Since you are creating an external NotesDatabase to handle all CRUD operations for the target NotesDatabase, you won't need to modify the designs of those NotesDatabases and NotesTemplates.
This, of course, does not mean that you should run test UIs/UXs against production environments (your Notes Admin will most likely shoot you), but this does mean that you can create extended functionality for in-house custom, 3rd-party, and even the core Domino templates without voiding warranties by manipulating their design.
Most deep-dive XPage work is all-in...
Let's say you want to disable the rendering of the native Dojo Script Libraries [which we will...].Adding the following line to the NotesDatabase xsp.properties affects the entire NotesDatabase [every XPage, every Custom Control, etc.]:
By using an external NotesDatabase, you can create completely customized-to-the-User Agent UIs and UXs without impacting the rendering of the Web Browser and Lotus Notes Client version of the NotesDatabase application.
Extend the security model of the target NotesDatabase
Not only can you give the individual user Author access to the target NotesDatabase, but you can further restrict said user's ability to the creation of content from the Domino HTTP Request Proxy app.
You can conditionally render specific subsections of the content creation Form. Take the time to create enhanced data entry controls and elements to aid your user in populating the end-result NotesDocument.
Remember, you're not working on the NotesDocument, but rather a particular user input vector for the target NotesDatabase. You are, thus, completely separating User Interface and User Experience from the Data Source.
This is the foundation for MVC software architecture with XPages, and something that -- due to the previously hand-in-hand tethering of the Form Design Element with a given NotesDocument -- is a huge paradigm shift for the IBM Lotus Notes Domino Developer.
This is true with all Web Browser-based XPage NotesDatabase apps, but it is specifically important to Mobile XPages development. We will be delivering a user experience based on the User Agent [the Client, the Web Browser, or a specific Mobile Device]. Understanding the capabilities (and more importantly the limitations) of the given User Agent is critical to a successful cross-platform hybrid solution.
The idea behind Mobile Device development is to create as powerful a user experience as possible... while considering that your user is accessing your app on a mobile device.
For the purpose of this build project, we will create a Domino HTTP Request Proxy which will handle all CRUD operations in a target NotesDatabase that happens to reside on the same Domino server.
This app will allow you to create a Contact NotesDocument in a remote Personal Address Book Template-based NotesDatabase residing on the same Domino server.
This app will restrict the user through the user interface, allowing them only to add Person Contacts and not Company Contacts.
This app will leverage device-specific functionality and deliver a user experience completely different from that of the target NotesDatabase.
And we'll start the actual build of this app in the next post in this series!
Series permalink: Mobile XPages for Smartphones and Tablets