We simply expect our devices to work, anywhere, anytime. Yet many people have discovered and been frustrated by the lack of connectivity in various locations. For some, this is simply an annoyance, but for others, connectivity issues can impact their ability to work. Oil and gas workers, building site workers, park rangers, farmers and other professionals may find themselves disconnected and unable to work effectively. Until now, there weren’t good, affordable solutions. Not everyone can invest in a satellite phone.

 

For web and mobile CA Plex applications, CM First has a new capability, CM WebClient HSync, which will make it possible for users to store data locally on the device until a signal can be re-established. Application data is stored directly on the device so that people can continue to work when the network isn’t available. This makes your applications ‘always on,’ an increasingly important and desirable capability.

 

CM WebClient HSync is based on CA Plex and the Sencha Touch framework; it generates a data entry app without an internet connection. It also provides offline validation based on any rules you have established in the CA Plex model, then saves off the data until it can be synchronized with the host database.

 

CM WebClient HSync meets all the requirements you might have for such a capability:

 

  • Runs on all popular devices
  • Performs efficiently
  • Stores persistent data on devices
  • Allows data entry consistent with CA Plex model definitions
  • Customizable for your specific needs
  • Fetches and updates data using CA Plex.

 

The four components of CM WebClient HSync operate on a Sencha Touch framework on top of a CA Plex model. The Template Generator creates template files based on CA Plex model entities or classes. Output files are then created from these template files. The JavaScript Function stores the data on the mobile device and is also responsible for synchronizing the data when the device can connect to a database. Finally, the CA Plex Service Servlet allows communication with the existing CA Plex-generated server function to validate and process the data when the device reconnects.

 

CM WebClient HSync uses REST-based web services to communicate between the device and back-end database servers.

 

Let’s get into a little more detail about CM WebClient HSync. We chose the Sencha Touch JavaScript framework for this app because it is designed for mobile applications, runs all platforms and can be integrated with Cordova/Phonegap, if needed. We decided to use templates to give you maximum flexibility and meta-code is exploited to retrieve values from the CA Plex model to populate those templates. Web Services allows us to call CA Plex functions when online.

 

The components of HSync include your CA Plex model, template files, the Eclipse workspace, SyncServices servlet and the HSync group model. The latter is composed of Hsync/OfflineApplication, Hsync/TemplateGeneratorEntity, HSync/Ability and HSync/Generator Utilities.

 

You can set up your CA Plex model with only a few changes. Create an Application Entity to inherit from the OfflineApplication entity then inherit from TemplateGeneratorEntity for each entity you want to include. The Add Application ENT comprises ENT triples and you can use the Inherit from Ability entities to control behavior.  You will need to set up the configuration to generate for a Java Client and generate a TemplateGeneration function for each entity being used. CM WebClient Hsync uses meta-code to query model details and creates a UI function to control application generation.

 

The Generator UI sets properties for generation and starts the generation process:

 

Step 1

 

Step 2

 

The application generation process reads the HSync templates which contain special tags then inserts values from the CA Plex model, including information from triples, labels and message objects. It then creates output files, typically JavaScript, which is flexible enough to generate HTML, XML, JSON, text and other types.

 

The HSync templates use tags to control how output is generated, which include attributes, loops, conditions and modifiers.

 

Here’s an example of a template:

 

Which will then result in the following output:

 

Use Abilities to control behavior. You can inherit from Ability entities and fields and add your own Abilities. Templates will conditionally generate code based on inheritance. HSync templates are designed with features to empower you to create what you want. These include: mandatory field validation, default values, referential integrity, virtual attributes, selector panels, menus, data synchronization and the ability to add custom JavaScript.

 

Sencha Touch offers JavaScript frameworks based on the Ext JS library designed to work with touch screens.   It builds panels from components using the MVC structure. The outputs can be packaged as a mobile app with Cordova/Phonegap.   The Sencha Cmd tool ‘compiles’ JavaScript to ensure better performance, it applies themes for mobile platforms. And you can use it to upgrade the Sencha Framework.

 

Once you have your HSync application, HSync provides the ability to call CA Plex functions over HTTP/HTTPS, Use AJAX to call from a JavaScript app and ensure data fits the business rules.

 

As you create more business-oriented apps, you will find the demand increasing for the ability to store data offline. Talk to CM First about how you can exploit CM WebClient HSync to empower your customers.

Did you like this article about “NO CONNECTION, NO PROBLEM” – email us future blog topics to info@cmfirstgroup.com