Home Screen
The uMobile native app home screen is rendered entirely on the native app side using JSON layout data downloaded from the portal. The app's "index.html" page can render links to modules in the user's layout in either grid or list format. Clicking any of the module icons / links will launch that module according to the logic below.
Modules
uMobile modules are displayed using an IFrame. When a module is selected, uMobile hides the home screen, unhides the module IFrame, then loads the module's target URL in that frame.
Portlet Modules
Most uMobile modules point to portlets hosted on the uMobile application server. The URL associated with portlet modules should use exclusive mode to avoid adding two portlet titlebars to the screen.
Module Registration Format
Key | Description | Default | Required |
---|---|---|---|
fname |
...
Unique key for this module. Modules included with the user layout may be overridden by specifying a module with the same key in config.js | Yes | ||
title | User-facing title for this module. The title is not capable of supporting dynamic portlet titles. | Yes | |
url | Entry URL for this module. Typically either a portlet URL with detached mode or an external (non-portal) URL. | Yes | |
description | User-facing description for the module. The description is only used when the list-based home view is selected. | No | |
newItemCount | An integer representing the number of new items currently associated with the module. If > 0, a badge number will be displayed on the app home screen. | 0 | No |
iconUrl | Local path of an icon to be used on the home screen. | No | |
doesRequireLayout | Only applies to locally-defined modules. If this property is true, the module will only be included in a user's layout if a module with an identical fname is included in the user's layout. | No | |
externalModule | Indicates that this module is an external (non-portal) module. | false | No |
Code Block | ||||
---|---|---|---|---|
| ||||
{
"fname": "news",
"title": "News",
"url": "/p/news/detatched/render.uP",
"description": "Personalized news and RSS reader",
"newItemCount": "0",
"iconUrl": "/icons/news.png"
} |
Code Block | ||||
---|---|---|---|---|
| ||||
{
"title" : "Transit",
"fname" : "transit",
"url" : "http://uchicago.transloc.com/m/",
"doesRequireLayout" : true,
"externalModule" : true
} |
Non-Portal URLs
For external sites, the uMobile app adds an extra "back" button to the header to allow for some basic navigation within that external site. In the future, uMobile might add a button allowing the user to leave uMobile and open that site in the native web browser.
Inter-Module Links
Consider the following use case: A map portlet exists in the user's browser-based layout, but uMobile's native app has a separate module used by the native app. When computing the user's home screen, the logic successfully overrides the remote portlet with the local native map module. Lets assume the user also has the dining hall portlet in her layout, and that she navigates to this portlet. The dining hall portlet displays a link intended to help her find the physical location of some dining hall, using a service URL that looks like "/s/map?id=somewhere". If the user were to click on this link in the browser version, she would be redirected to "/p/map/maximized/render.uP?location=somewhere". Instead, we want her to be able to view the location in the app's local map module.
To support this use case, uMobile needs to examine each link before visiting it to determine if it should be redirected to a local module. (Note: this logic is placed alongside the back-end logic for checking session state) It's critical that uMobile examine the link before any redirect has taken place. If the URL is to be redirected, uMobile must prevent the app from calling that link and should instead load the appropriate local module with any necessary dynamic parameters.
This feature has yet to be effectively implemented in the PhoneGap-based version of uMobile, largely because the local map module has not yet been implemented. The Titanium client supports redirecting both map and directory service URL requests to local modules.
Additional note: If a user visits a service URL that redirects to another portlet and the app does not need to replace it with a local module, the app might still want to update the title to reflect the second portlet. There is no logic currently in place to perform this step.