[Zope-CMF] CMF add views and <browser:page />

Martin Aspeli optilude at gmx.net
Mon Dec 8 10:00:07 EST 2008


Hi,

Thanks to yuppie, trunk now allows us to use the ++add++<type> 
traverser, which will look up an add view as an adapter on (context, 
request, fti) with name equal to fti.factory.

This is good, but it does mean that those add views cannot be registered 
with a <browser:page /> directive. Unfortunately, Five's browser:page 
does quite a lot of stuff, from allowing a template to be specified, to 
setting up class and attribute level security, to supplying a docstring 
if required to allow publication.

In CMFDefault, we have some base classes (tied to formlib) and we do 
manual security with a ClassSecurityInfo and InitializeClass(). This 
feels like a step backwards to me, at least in Plone, where we encourage 
people to use browser views with declarative (ZCML) security. It's 
difficult to explain that add forms are "special" so that they need to 
have manual security, explicit docstrings (for better or for worse), and 
be registered as an <adapter />, not a <browser:page />.

Did we envisage a solution to this? How about a new <cmf:addview /> 
directive that mimics <browser:page />, but registers the 
(context,request,fti) adapter? I could probably put that together if 
people think it's a good idea.

Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book



More information about the Zope-CMF mailing list