Gary Poster wrote:

> On Sep 25, 2005, at 3:58 PM, Christian Lueck wrote:
>> ...
>> seems most promising -- but what
>> to do with it?
>> Question:
>> Is it right to register a formlib-based addview with the
>> <browser:page>-directive?
> Yep.
>> How do I get the + ? ;)
> The '+' is an implementation of IAdding.  You first need to register 
> the page for the interface, a la
>   <browser:page class="" name="addWhatever.html"
>            permission="zope.Public"
>            for="" />
> and then register a menu item for the adding that points to it, a la
>   <browser:addMenuItem
>       title="Whatever"
>       factory=""
>       permission="zope.Public"
>       view="addWhatever.html"
>       />
Cool, that's working fine. Thank you!

> The factory is used to get the interface to check constraints.  You 
> might be able to do without it; check APIdoc if you are curious.

Huh, that means that the '+' is  a kind of global context, or to put it
different:  one can request the addview in arbitrary '+'-contexts, for
example by accessing the url
'/theIntendedContainerForWhatever/+/addWhatever.html' but even by
'/noPlaceForWhatever/+/addWhatever.html'.  There's no exception until a
collision with ContainerTypeConstraints when the factory is called (or
maybe when the object which is returned by the factory is passed to the
add-method (the factory itself seems to have no idea about the context)).

Zope3-dev mailing list

Reply via email to