[Zope-CMF] [dev] add view traversal

yuppie y.2008 at wcm-solutions.de
Mon Sep 15 07:05:49 EDT 2008


Charlie Clark wrote:
> Am 14.09.2008 um 12:26 schrieb yuppie:
>> 2.) Which hook should be used for custom traversal?
>> ---------------------------------------------------
>>
>> a) for URLs like http://www.example.org/guestbook/+Message
>>
>> In this case we use a special prefix '+' followed by the portal type
>> name. CMF containers don't implement IPublishTraverse, so we can
>> register an IPublishTraverse adapter. If we don't find an add view, we
>> can fall back to DefaultPublishTraverse behavior.
>>
>> Unfortunately the IPublishTraverse hook only works with one adapter.  
>> If
>> other packages like plone.app.imaging[2] try to use the same hook, we
>> get a problem.
>>
>>
>> b) for URLs like http://www.example.org/guestbook/+/Message
>>
>> The '+' view already implements IPublishTraverse, so we can't change
>> traversal using an adapter. The only solution I can see is to replace
>> the '+' view by a customized version.
>>
>>
>> c) for URLs like http://www.example.org/guestbook/add/Message
>>
>> If we use our own adding view, we can implement IPublishTraverse  
>> inside
>> the view or as adapter.
> 
> I could live with either b) or c). I guess we need to weigh up the  
> desirability of being as close to Zope 3 style without unwanted side  
> effects. c) would to be the cleanest implementation. Would it be  
> possible to implement b) as a sort of alias for this if desired?

Could you live with a) as well if we use a different hook than 
IPublishTraverse?

Cheers, Yuppie



More information about the Zope-CMF mailing list