Running O4W offline.

I got caught out the other day whilst running through my O4W presentation for a client. The PowerPoint side of things was fine, but I got caught out when trying to run the O4W demo for real without an internet connection.

Running O4W offline seems a strange thing to want to do.  After all, it’s a web based solution and therefore it should be hooked up to the internet – Right??

Well not always.

Everything had been running fine and I’d really been cracking on with the O4W proof of concept application.  It was now less than 12 hours before I’d be heading off to Ireland and time for one last run through the demo.  However, being a Thursday night it was archery day and, with a competition looming and new arrows to content with, Lauren was anxious to go practice.  So I found myself on the archery field, laptop in hand and no internet connection.

The PowerPoint side of things was naturally a breeze.  The animations needed a little fine tuning, but otherwise all was good.  However, when I came to run the O4W demo for real things took a downwards turn.

In short, O4W out of the box requires access to the internet for the jQuery libraries.  No internet connection = no access to those libraries and (in my case) = no menu to run the application.  Caught, hook line and sinker.

As usual though, the guys at Revelation have thought about this and it is easy to reconfigure O4W to run offline.  You just need to know where and how.  Herein, follows the where and how.

Firstly, you’ll need to make sure that you do this ‘with’ an internet connection.  Without one and things get a little difficult.  Once on the web, run up O4W in developer mode and navigate to the ‘Scripts’ tab on the O4W Configuration page.  This is the page where your templates and scripts are defined.  We are interested in setting the following prompts on this tab:

  1. Source for jQuery needs to be changed to ‘Provided O4W Files (without Internet connection)
  2. The URL for jQuery from O4W prompt should be changed to ‘../jquery/’.  This might be slightly different depending on your virtual drive, etc.
  3. If, like me, you have used one of the various themes available online (I was using Sunny), you’ll need to select one of the themes that ships with O4W.  I would suggest Smoothness as a good starting point as it’s clean, fresh and it looks nice.

Once the above changes have been made, save the form, close the browser and restart your engine server.  Depending on your browser settings you might also need to clear out your cache to avoid any problems.  I use Firefox without saving the history, so I’m pretty much good to go.

This time, if you switch off your internet connection and run up O4W (or your application) you should get the new theme, but running offline.

So what about your nice fancy theme?

Getting your preferred theme is almost as easy, but it needs a couple more steps.  Firstly you’ll need to download your jQuery theme (or acquire your own css theme) and save the files into the appropriate CSS folder.  Choose the one that matches the version that you are using.  In my current version of O4W I chose the 1.4.4 folder, making my path C:\\MyOIDirectory\O4W\jquery\1.4.4\css\sunny.  In that folder, I placed the downloaded theme’s images folder and the jquery-ui-1.8.14.custom file.  The number did not correspond to the jQuery version defined in O4W, so I changed that filename to be jquery-ui-1.8.6.custom.

Now that we have our theme in place we can launch O4W in design mode and navigate back to the Scripts tab.  This time, change the jQuery Theme to ‘Other (Custom)’ and type ‘sunny’ in to the ‘or Other Theme’ prompt.  (I should mention that you should not include the quotes marks (‘ ’) when making these changes in the O4W form.

Finally, check the details in the form, save it and close the browser, clear the cache, restart the engine server and rerun the application in offline

If you are running this in Firefox, then all should be well.  However, at the time of writing IE is not picking up the theme properly and you’ll have to stick with one of the O4W supplied themes.  This has been reported, so watch for a fix in a future release of O4W (OI 9.3 or later).

If this blog posting sounds a little long and confusing, don’t worry.  Watch my YouTube Channel and, with any luck, I’ll have a video walking you through this over the next couple of days.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s