Description

The Desktop Client is a standalone Java application, providing Smart Client functionality (with the exception of functions that rely on browser infrastructure, such as Javascript) and in addition offline functionality, giving the ability to be operable when not connected to the Internet.

This is useful when the users of your application are mobile and cannot access the Internet all the time, for example, if they are using laptops. There may be some operations, such as entering a lot of text, which do not need to be performed online (in this case only sending the data to the server needs to be done online), and even users of regular browsers may select this option.

How it works

The Desktop Client can be installed using Java WebStart, or by an administrator manually copying the appropriate files and creating shortcuts.

Any interaction performed on a Desktop Client configured for Offline operation will be stored in a cache on the client.

When offline, the Desktop Client acts like its own Presentation Server. Only a subset of the features of the Presentation Server are available. No collaborative features are available, and data updates are simulated (according to the guidelines given by the developer).

When the user goes offline, a popup window will optionally inform them of the change.

The Desktop Client can handle multiple applications and multiple user logins while offline.

When reconnected to the Presentation Server, the Desktop Client will forward all changes to the back-end application.

Data transfer

Service Functions can be given an offline option. This determines what response is given by the Service Function when the application is online.

The main options are to either resend any data previously sent by the Service Function, or to send a simulated data result set.

In the simulated data you should include elements or attributes to designate that the data transfer is offline. This can then be used the application View to show to an offline user that changes they have made have not been committed to the back-end application.

If the Service Function has not been invoked before, a better option might be to simulate the returned data.

User preference information is also stored by the Desktop Client, and will be restored to the Presentation Server when reconnected.

Notes and caveats

Dynamic properties such as ${http.server.*}, ${aps.context} and all other dynamic property values should not be changed to hard-coded values in your login handler or template files. The Desktop Client requires these to operate in offline mode.

Note that there is a potential for data synchronization conflict, if, for example, multiple users are working on the same application, and have edited the same data. The issue could be further complicated by an online user changing data, and an offline user reconnecting and submitting changes to what is now old data. All changes will be processed by the Presentation Server, therefore, you must handle this on your back-end application by returning error status from Service Functions. When an error occurs during synchronization of offline changes, the synchronization will stop and alert the user to the problem. Synchronization cannot continue until the offending service call is cancelled by the user, or some other action taken to make it succeed.

An application must have been accessed online before it can be used offline. Applications cannot be used offline without having previously connected to the Presentation Server. This is because the Smart Client needs some data to work with, which must be accessed from the back-end application. When working offline, there is no data available to use.

When starting up while offline, the login process is the same as online; the requirement to specify a user name, password and application ID is no different.