Houcem Berrayana
Houcem Berrayana

Reputation: 3080

Worklight - Updatable static content

I have this requirement : My WL application have a set of static pages that might be updated any time. Originally the source of all static content is a desktop page that will be transformed by xsl to a mobile friendly content. The problem that I don't want to do that on each request (HA requirement).

I want to get some inspiration on how to architect that without using direct update mechanism (don't want the end user to get notified of these updates).

I should note that pages will change rarely every few month maybe.

I'm thinking about 2 ways of doing that :

1- Making the transformation on adapter side and rely on WL caching so that transformation is not made each time (does that exist ?). But how the adapter will get notified of page change and flush the cache ? Should I program some advanced java based adapter ? (Storing in the cache and having a kind of a job that scans every day for content changes ?)

2- Doing it mobile side but I don't know how to get notified of changes !

Upvotes: 0

Views: 104

Answers (1)

Idan Adar
Idan Adar

Reputation: 44516

Is your only problem with Worklight's Direct Update that the user is being notified and is required to explicitly approve the transfer?

In this case why not use the option of Silent Direct Update?

The property you're looking for is updateSliently set to true in initOptions.js.
For this to work it is required, obviously, that connectOnStartup will be set to true as well.


perhaps what is doable is to use an adapter to fetch the HTML (or whatever it is) and save it to the device's local storage and then have the app display this content, this way you do not alter the app's web resources and not trigger Direct Update.

Upvotes: 1

Related Questions