Monday, May 31, 2010

Thankful for freedom

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.

Tuesday, May 18, 2010

HTML 5 Cache Manifest and dynamic data (Xpages)

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.


Tuesday, May 4, 2010

Domino 8.5.2 & Cache Manifest, not just for offline use

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?

Speed!

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.

CACHE MANIFEST

#version: 0.0.15

tasks4.css
tasks4.js
trashcan.png
uinext.js
ajax-loader.gif
runbuild2.png
attach.png
spinningwheel.js
spinningwheel.css
sw-alpha.png
sw-button-cancel.png
sw-button-done.png
sw-header.png
sw-slot-border.png
tasks.js
iscroll.js
home.png
wood.png
zengarden.jpg
checkbox.png
newwindow.png
cal.png
category.png

#local dojo resources
/domjs/dojo-1.4.1/dojo/dojo.js
/domjava/xsp/theme/webstandard/xsp.css
/domjava/xsp/theme/webstandard/xspLTR.css
/domjava/xsp/theme/webstandard/xspSF.css
/xsp/.ibmxspres/domino/ckeditor/contents.css
/xsp/.ibmxspres/domino/ckeditor/skins/lotus/icons.png
/xsp/.ibmxspres/domino/ckeditor/skins/lotus/images/arrowdown.gif
/xsp/.ibmxspres/domino/ckeditor/skins/lotus/images/toolbar_start.gif
/xsp/.ibmxspres/domino/ckeditor/skins/lotus/images/toolbarSprite3.png
/xsp/.ibmxspres/domino/ckeditor/skins/lotus/images/toolbarSprite.png
/domjs/dojo-1.4.1/dijit/themes/dijit.css
/domjs/dojo-1.4.1/dijit/themes/tundra/Common.css
/domjs/dojo-1.4.1/dijit/themes/tundra/layout/ContentPane.css
/domjs/dojo-1.4.1/dijit/themes/tundra/layout/TabContainer.css
/domjs/dojo-1.4.1/dijit/themes/tundra/layout/AccordionContainer.css
/domjs/dojo-1.4.1/dijit/themes/tundra/layout/SplitContainer.css
/domjs/dojo-1.4.1/dijit/themes/tundra/layout/BorderContainer.css
/domjs/dojo-1.4.1/dijit/themes/tundra/form/Common.css
/domjs/dojo-1.4.1/dijit/themes/tundra/form/Button.css
/domjs/dojo-1.4.1/dijit/themes/tundra/form/CheckBox.css
/domjs/dojo-1.4.1/dijit/themes/tundra/form/RadioButton.css
/domjs/dojo-1.4.1/dijit/themes/tundra/form/Slider.css
/domjs/dojo-1.4.1/dijit/themes/tundra/Tree.css
/domjs/dojo-1.4.1/dijit/themes/tundra/ProgressBar.css
/domjs/dojo-1.4.1/dijit/themes/tundra/TitlePane.css
/domjs/dojo-1.4.1/dijit/themes/tundra/Calendar.css
/domjs/dojo-1.4.1/dijit/themes/tundra/TimePicker.css
/domjs/dojo-1.4.1/dijit/themes/tundra/Editor.css
/domjs/dojo-1.4.1/dijit/themes/tundra/Dialog.css
/domjs/dojo-1.4.1/dijit/themes/tundra/images/titleBar.png
/domjs/dojo-1.4.1/dijit/themes/tundra/images/spriteArrows.png
/domjava/xsp/theme/webstandard/xspFF.css
/domjava/xsp/theme/webstandard/xsp.css
/domjs/dojo-1.4.1/dijit/themes/tundra/tundra.css
/domjs/dojo-1.4.1/dijit/themes/tundra/images/accordionItemHover.gif
/domjs/dojo-1.4.1/dojo/io/iframe.js
/domjs/dojo-1.4.1/ibm/domino/widget/layout/DominoRichText.js
/domjs/dojo-1.4.1/ibm/xsp/widget/layout/RichText.js
/domjs/dojo-1.4.1/ibm/xsp/widget/layout/nls/RichText_en-us.js
/domjs/dojo-1.4.1/ibm/domino/widget/layout/nls/DominoRichText_en-us.js
/domjs/dojo-1.4.1/ibm/xsp/widget/layout/xspClientDojo.js
/domjs/dojo-1.4.1/ibm/domino/widget/layout/css/domino-default.css
/domjs/dojo-1.4.1/ibm/xsp/widget/layout/nls/xspClientDojo_en-us.js

NETWORK:
#a whitelist of paths request can be made to for more dojo and other resources not listed above
/xsp/.ibmxspres/
/domjs/dojo-1.4.1/
/domjava/xsp/