Thankful for freedom

On May 31, 2010, in Uncategorized, by Mark Hughes

I am truly blessed, on this day i remember all who have served our great Country in the cause of liberty and freedom. From their sacrifices we are given freedom here on Earth, so that we might have life, liberty and the pursuit of happiness.

My Lord and Savior shed his blood and gave His life, so that who ever believes in Him shall not perish but have eternal life, and that we may be free from the bondage of sin forever.

So it is up to us as free men and women, to honor these sacrifices with our lives- how we choose to live each day is our testament to what we have been given.

Let us make them proud.


HTML 5 Cache Manifest and dynamic data (Xpages)

On May 18, 2010, in mobile, xpages, by Mark Hughes

So cache manifest files are a very useful tool. With dynamic data though they are a little tough to work with.

For example:
You want to cache some images and script libraries local, as well as css, and some other files. It does this great, but it will also cache the html generated by the xpage the first time it was opened.
The problem: the view information changes, and every time you open the xpage you get the initial html and wrong view information.
The first thing you need to do is set a partial refresh on the view info after load. But that is only half the battle, as maybe you have preferences for a theme, and the preference comes from a profile document. So the theme will not change.
The solution: Update the cache-manifest file which will make the page re-cache itself.
So how do you do this for every time a page is refreshed?
Well Notes makes it easy – you make a notes page. On the page properties tell it content type = text/cache-manifest. Name it something like my.manifest. Then on the version line of the manifest you enter in computed text set to @now. You will always have a new manifest that you can use to update your local cache with.
Over on Niklas Heidlhoff’s blog is an example of how to use a cache-manifest file and how to make an offline app with X-Pages. This is great news for mobile developers.
But what if you don’t want or need the app to be offline? What advantages do you get with a cache manifest?
Lets say you have a mobile app(or any Xpages app), it has some rather large style sheets, script libraries, and images. This is all static content, simply cache this content locally then the application is local and only connects to the server when it gets or posts information to the Notes database.
I have added many images and features to ITANA for an upcoming release. Knowing that the cache manifest would be supported in version 8.5.2, i use allot more images and css than i had previously.
Before I added the cache manifest file, it would take about 20 seconds to open this Xpages app from my iPhone, now it takes less than 5, and part of that is the iPhone opening a new Safari instance!

And here is an example cache manifest to show how to leave network connectivity in place for everything but your resources that you keep local.
#version: 0.0.15
#local dojo resources
#a whitelist of paths request can be made to for more dojo and other resources not listed above