![]() |
vendredi 16 septembre 2005 |
EuroOSCON tutorial on AjaxI wrapped up the slides today for my EuroOSCON tutorial next month. The tutorial is on "Model-driven Ajax", which is a thin veneer over my long-abused meme on browser-side XML, XSLT, and changing the way consulting projects run.In this case, though, I hope to back it up with more than the demo at PloneCon 1 in New Orleans. At OSCOM 3 in Harvard a few years back, I gave a tutorial on writing a Mozilla-based front end for a CMS using WebDAV. Stephan Richter helped me, and we had over 40 people typing on their computers. At the end, most of them had a Mozilla extension that talked to a WebDAV server. I learned a lot from this. First, I prepared...a LOT. I had cut-and-paste material pre-tested and arranged things into multiple segments. Each segment had code where, if you got lost on the last segment, you could be teleported to a safe spot. This time I want to add demonstrations of each segment. Not just demos, be screen-recorded demos, so if people get lost during the segment, they can play the movie and see the right way to do things. So yeh, this is a bigger investment in preparation. But if I was at a tutorial, I'd want to leave actually doing something. Doing this on a large scale is a challenge, without losing people. Thus, I think it counts as good preparation.
On a side note, Faassen is talking about lxml! That's good news. On the down side,
I didn't see any speakers from the EU directorates. I was hoping for a little
cross-pollination. |
ZPT outside ZopeToday Damien Baty from Pilot Systems dropped by to help me on a project for the Plone Foundation. He was writing a Python method to grab data from the catalog and organize it for use in a ZPT template. Basically, moving logic out of presentation, yada yada yada.The session went extremely well and was very productive. Damien handled the part where Python interacts with all the components, I wrote some HTML to format things. For my part, rather than redo a bunch of HTML as I iterated with layouts, I typed up some quick XML and used very simple XSLT to make a large page of stuff. This let me play around with structure, layout, etc. in a very efficient way, using the goodness of a very nice XML authoring environment (oXygen). However, this broke down when handing it over to Damien. Clearly the XSLT had to be translated to ZPT. In the process, lots of little tags didn't get closed, little errors in TALES expressions, etc. Sure, it would have been better if I had done it in ZPT from the beginning, but then I would have been a lot less productive, using a CMS when all I was doing was semi-static mockups. It made me think of what Alan at Enfold said about their gig with Oxfam America. Last year they did a Plone system that shipped with Zope 3 views. In fact, they taught the customer how to write view classes and templates that used them. The customer only had to learn Python, not the Zope APIs. Their methods returned simple Python data (lists of dictionaries, etc.) Later, the consultants (Enfold) converted these methods into real CMS method calls. Alan said this worked really well. I then applied this to working with Damien. I could have used the Zope 3 standalone ZPT package which Shane described on his weblog. With this, I could work from the command line, no long-running process, just edit/run/refresh (edit the template, run a single sub-second command, refresh output in browser.) Damien would then have nothing extra to do with my ZPT. He would only need to convert my static Python data to calls into the CMS for real content. On the Trac list last week I noticed someone claim that using ZPT as a template language meant using all of Zope, then saw someone else agree. At least with the Zope 3 version, ZPT is much easier to use in isolation.
Thanks Damien for all the help today, and thanks Shane for the writeup. |