Webobjects Theming: XML to HTML + WOD


Woohoo! I just got an XSLT prototype working that will let me re-implement theming in our repository application!

My goal was to produce a solution that would allow (some of) our users to completely customize the interface of our WebObjects application, in a way that simply mucking about with the .html part of a WOComponent simply couldn't support. They need to be able to add/remove/move/modify functionality that may not be predetermined in a .wod file.

So, what I did was to produce an XML-based format to store combined data from what would have conventionally been stored in separate .html and .wod files (I know, breaking MVC, but so what - it does what we need). This XML file can be edited in anything that can edit XHTML - like, say, Dreamweaver...

The cool thing about this "theming engine" is that it allows a form of inheritance on the customized components. If a theme of our application only needs 1 or 2 modified components, then you only have to add new database records for those modified components, edit a couple of XML strings, and you're done. The rest of the theme will be automatically inherited from the default theme (I'm also wanting to allow users to specify WHICH theme they inherit from. That could be REALLY powerful).

If you want to completely change the look of the app, you're free to do it. All you need is 1 XML string/file/record per WOComponent being customized.

Basically, I take the XML string, feed it into my XSLT translations and pump out the conventional .html and .wod strings, which will be cached in the database so it doesn't suck performance-wise.

When the XML source strings are updated, they're run through the XSLT translation again and the cache is updated. The cool part about the way this will be cached is that it is persistent across applications and instances - the cache is stored right next to the XML source in the repository application database.

I'm actually quite hopeful that this will work out, since it will let our partners hack away on the interface without having to learn WebObjects (or how to compile an application), or the structure of a PLIST file, or whatever... They should be able to happily pump stuff out of Dreamweaver (or BBEdit, or JEdit, or whatever), and feed it into the theming engine. All we have to do is document the WOComponent library that is available to them (classes, attributes, what it does, etc...)

Now, to prototype it actually working in a WebObjects app...


comments powered by Disqus