Posted Dec 22, 2008
Valor and icy drinks at the Faculty/Staff Directory sprint
FSD 3.0 will harness viewlets and other Zope 3 technologies.
’Twas a tale of valor and icy drinks at the Faculty/Staff Directory sprint.
Viewlets—we loveses them
We converted our presentation layer to views and viewlets. As foretold by prophecy, this lets extender authors do absolutely anything they want. It also lets site managers hide and move things around on our pages using the @@manage-viewlets UI. This branch is almost done now, and it only took us three sprints to get here! :-) Of course, Plone’s built-in framework didn’t quite have everything we needed; we had to do our own multiview lookups, which involved reading all the way down the bottom of Zope’s component resolution code.
Nesting Classifications (and everything else)
Nestability has come to Classifications, Committees, and Departments. In fact, we decided to go right over the cliff and, for 3.0, completely remove the distinctions between them. You’ll be able to make as many kinds of "grouping" objects as you wish. Every grouping object parked at the root of an FSD will simply become its own heading on a Person page, for example. Though we anticipated fear and panic at this decision, the users we consulted all asked why we hadn’t done it sooner! The nestability, along with tons of upfactoring, is on the trunk as we speak.
Utilities are the new tools
We turned the Faculty/Staff Directory tool into a utility. In doing so, we converted it from an Archetypes object to one based on Zope 3 schemas. This is the first Z3 schemas work I’ve done, and I like what I see. There’s less boilerplate to write, and general knowledge of Python leads you right instead of wrong. For example, I needed a field to contain (and validate) a regular expression. In Archetypes, I would have had to go digging through my old code to remember what to name the magical validate_myRegexField method. With schema fields, explicitness prevails: a TextLine that also has other constraints is no longer a TextLine but a subclass thereof. Make a subclass, call it RegexLine, stick a constraint() method on it, and you have something more reusable and lexically localized than an Archetypes validator.
Just converting the tool to a utility wholesale is a first step; the next is to break it into several smaller ones which can be individually overridden. This will let people replace our email obfuscation with their own—a common request—without having to monkeypatch.
Finally, I see this as a Zope-3-schemas spike for the whole project; if it continues to go well, we might eventually convert the core content types. I’m within a day or three of merging this branch.
Curricula vitae
Representation of publications has been on the drawing board for some time now. Since we’ve taken so long to deliver something “official”, everyone’s gone off and rolled their own as extenders: so far, there are Andreas Jung’s fsd.cmfbibliographyat, a lighter-weight version at Universidad Nacional Autónoma de México, and a nebula of specs coalescing at the University of Washington. Gathering most of the players in the same room, it became clear that some people want lightweight, some people want to go all-out, and no one size fits all. Thus, we made plans for an abstraction layer (maybe a collection of interfaces?) to let site managers plug in whatever representations of publications (with whatever complexities) they wish. This itself might manifest as an extender; we shall see.
Microformats
Rob Porter added microformat support to our Person pages. Now cool Firefox plugins can automatically scrape contact info and throw it in your address book.
An unusual sprint
It was kind of an strange sprint, in that everybody worked on almost everything. I think 3 things contributed to this:
- One group would get stuck, and somebody would run over to help, often staying after the problem was solved.
- Most people were interested in more than one thing, which fueled the above.
- We primarily worked in pairs, but we had an odd number of sprinters, which created some helpful instability.
At any rate, it was tremendously healthy. Since the task groups were so fluid, we had better communication between them than I’ve seen at a sprint, and we’re already reaping the fruits in easier merges: there’s hardly any Conway-style fragmentation.
Credits
These people rock:- Gildardo “The open wireless from the restaurant a block away works better” Bautista
- Federico “It’s snowing outside. Why is there ice in my drink?” Cazarez
- Cris “Is there a reason you can’t nest these?” Ewing
- Mike “Go ahead, make my sprint” Halm
- Vladimir “CV Master” Melendez
- Craig “That’ll break the table headers” Haynal
- Rebecca “Don’t you plan on buying the tickets before you fly out?” McCloskey
- Rob “Eviscerate IE 6 with a spoon” Porter
- Eric “Is it lunchtime yet?” Steele
- Christian “Network savior” Vinten-Johansen
Thanks also to our FSD power users for their consultation as well as to everyone else who poked their heads in during the week. If you rock and I forgot you, whack me, and I’ll make it right. Great job, everyone! The 3.0 release is going to be an amazing piece of kit!

Multiviews
GenericSetup prevents us from registering multiple viewlet managers for different contexts that share the same name. Our solution was to create managers of different names and do that crazy lookup to see which one should be included in the template.