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 XFormsFeatures.java 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.

    3 comments:

    Alessandro Vernet said...

    Ritesh,

    Great stuff; thank you for sharing. Also, I am not sure if you have seen this page already, but we have some information on the wiki on how to update YUI in Orbeon Forms. In particular, we did a few bug fixes in YUI, which you might need to port forward when you upgrade. We often find that some of those fixes made their way into YUI, but that is not always the case.

    Alex

    Ritesh Trivedi said...

    Alex,

    Thanks for pointing it out.

    BTW, just our of curiosity, do you use any blog discovery tool? I am looking for one and could certainly use a recommendation.

    Alessandro Vernet said...

    Ritesh,

    I am just using Google Alerts, which works quite well with blogs.

    Alex