1

Background Information: The organization where am working uses Java, Oracle ADF framework,Oracle db/weblogic server stack.

New Requirement I have this tricky requirement for a new project to make the web application that I am building on to work offline also. As per the requirements a user should be able to click on a 'Work offline' button while in the 'online' mode and be able to get a local copy of the application/or page to their device.

And once the user complete the data entry in the offline version of the application downloaded to their local device, then the user should be able to click on a 'Submit' button and upload the local details to the server (ie. to the main production server. And it is to be done when there is internet connectivity).

The solution am trying to proceed with is as follows:

  1. I build a std web application to work on the production online mode. It will use ADF or /JSF with Oracle db.
  2. I will build a simple application for offline mode which will reuse most of the pages developed for online mode. But the database use will be a lightweight one like hsqldb. And the whole application will be bundled with a lightweight server like jetty.
  3. The whole offline application and server will be bundled together as an executable jar which can be downloaded and run from any device.
  4. The local offline version of the app will have a 'submit' button. And on clicking this button when there is internet conectivity then we will make a webservice call to the production server, and submit the data collected

My Questions :

  1. Will my proposed solution work ? ...is there a better way to do this?
  2. Is hsqldb the best lightweight embedded database for offline mode?
  3. Is jetty a good lightweight embedded web server?...is there a better one ?
  4. Can an executable jar be run on any device like mac,ios,linux,android,windows etc.
user1455719
  • 1,045
  • 4
  • 15
  • 35
  • I am not sure ADF is supported by Jetty. Using Oracle products outside Oracle stack is usually a nightmare. Oracle ADF is not suitable for such requirement. See how HTML5 is handling offline mode. In your architecture you are missing the synchronization strategy. Is there a reason to have an offline mode? – Sydney Nov 21 '14 at 20:30
  • If jetty doesn't support ADF then I can try HTML5 /servlets or JSP or JSF The organization want its staffs to go with their devices to remote areas where there is no connectivity and do the work. After the user has keyed in data to the application in offline mode , then the user can try to upload the data sitting in the local database can be synced with the prodserver via SOAP webservice or REST service – user1455719 Nov 21 '14 at 21:48

2 Answers2

2

The approach I have followed is as follows:

  1. I built my web pages UI with angularjs inside a normal html5 page and hosted it on my weblogic server.
  2. I wrote a appcache.manifest file for the html page describing all the css/js/image files used by the application. So that if the page is once loaded on to a browser then the page will be cached on the browser.
  3. I created restful services for exchanging data to my html page from server. The data was passed in the json format and I was encrypting the json payload using AES encryption. At the client side I used cryptojs library to decrypt the data provided by the rest service. how does cryptojs works
  4. I used pouchdb javascript library for storing data provided by the user locally onto the in browser database(pouchdb store data to indexedDB in case of chrome and firefox, it store data to webSQLDB in case of safari and other brwosers).
Community
  • 1
  • 1
user1455719
  • 1,045
  • 4
  • 15
  • 35
0

You can use ADF Essentials that is supported on GlassFish for the offline version. (This will also reduce your license cost). You could use an Oracle XE database for the offline version. http://www.oracle.com/technetwork/developer-tools/adf/overview/adfessentials-1719844.html

Shay Shmeltzer
  • 3,693
  • 1
  • 13
  • 9