Tuesday, September 22, 2009

Ockham's razor - Joomla - CakePHP - Jake -jQuery

As explained earlier, I am trying to integrate a small app built with jQuery and CakePHP in Joomla.

My first idea was to use Jake - http://dev.sypad.com/projects/jake/. This is a generic Joomla component capable of calling a CakePHP application. I remember to have tried it more than a year ago.
Probably something changed in my settinggs (in fact the config - os /PH¨P/ Joomla is entirely different....) all I get is:

"Fatal error: session_start() [function.session-start]: Failed to initialize storage module: user (path: C:\xampp\tmp) in C:\xampp\htdocs\www\DiagTools\cake\libs\session.php on line 553"

I tried tweaking PHP sesson config, checked permissions (actually sessions files are created there). On the net, I found a few posts seeking for support about the same concern but no answer.

I remarked that Jake is still in beta since 2007. I think that's indication of at least future troubles...

A second option was not to integrate them, but to make them similar enough. I found a few posts proposing to recycle Joomla thems into a CakePHP theme so the two components would work side by side. I think this is a poor man integration, my customer will not be able to use the Joomla admin to administer the site or change security settings etc The worst being that I will have to rechange it if we go for another design.

Considering that CakePHP is used only for structuring the application, validating a single basic form and calling a web service (a feature that sits there but that nobody uses), why not getting it out and keep just the jQuery stuff?

So I started this third solution which is creating a fresh Joomla component.

One more time the Joomla community amazed me by its vitality and by the high number of good quality components and plugins available. SC jQuery is a plugin that makes installing jQuery a single click operation. In the confiiguration you may choose the themes for the user interface widget - really cool : http://extensions.joomla.org/extensions/core-enhancements/scripts/7230.

I have not done serious things with jQuery since a while, this theme concept is great and you can see it in action here : http://jqueryui.com/themeroller/.

So at the end of the day I got the kernel of the app running in Joomla. The layout still requires adaptation and I have to simulate the screens built with CakePHP...

Yet I am sure to have done the right choice, removing one technology, avoiding a bridge. This will  provide the best integration for the users and the most flexible options for the administrators of the web site.

No comments: