Friday, January 15, 2010

How to upgrade YUI libraries in Orbeon

Orbeon uses YUI as a javascript framework/library for XForm components. As of this writing it bundles YUI 2.6 with some bug fixes, YUI is now out with 2.8 as RC and 3.0 beta.

There are a few critical bugs in YUI 2.6 that was preventing us to implement couple of components which prompted to look into upgrading YUI within Orbeon. Its not exactly a rocket science, but the process could have been better if Orbeon supported (had thought about easier ways of) upgrading YUI.

Here are the steps

  1. Download the latest source code from Orbeon git-hub
  2. Replace src\resources-packaged\ops\yui with the latest version of YUI
  3. Find this file has hard coded YUI library names!! To the very least look for all the *beta* js files and make sure either they exist in the new YUI version or replace the filenames (in java file or .js file itself) so they are found and loaded during run time
  4. Orbeon build does come with an additional subdirectory under yui called examples. Seems like they are bundling couple of examples (resize and treeview). You will need to move these from new version of YUI/examples directory.
  5. Rebuild and deploy orbeon (ant orbeon-war or ant orbeon-dist-war)!!
Note you can find your javascript files under orbeon-resources-public.jar and orbeon-resources-private.jar in case you want to double check which files made it into Orbeon build.