[Zope-CMF] Five's local sitemanager, CMF, etc

Martin Aspeli optilude at gmx.net
Mon Feb 26 11:03:13 EST 2007




Philipp von Weitershausen wrote:
> 
> Rocky wrote:
>> On Feb 23, 3:50 pm, Martin Aspeli <optil... at gmx.net> wrote:
>>> yuppie wrote:
>>>> Maybe I'm missing something. But wasn't a major goal of
>>>> five.localsitemanager to return acquisition wrapped tools?
>>> That was my understanding, too. I thought this would just mean
>>> aq_base'ing the utility and aq-wrapping it back into the context (the
>>> portal root). Without this, we start requiring users of the interface to
>>> know when aq wrapping is needed and do it explicitly with __of__() which
>>> I think we agreed was unacceptably detailed and ugly. :)
>> 
>> Alright, I've gone ahead and put code in place for this (albeit a bit
>> naively) with r72810.  The next question is whether we should be doing
>> the same with adapters and subscribers as well (even though this
>> doesn't affect the whole tools-getting-acquired-properly issue).
> 
> One more thing: This acquisition wrapping should clearly be marked (with 
> comments) as something that's done to for BBB because some tools happen 
> to want acquisition. I think in the future, it should be discouraged to 
> expect acquisition in CMF tools.
> 
> To get to the portal root / CMF site, I suggest a pattern that is 
> sometimes used in Zope3: We register the CMF site object as a utility 
> providing ICMFSite (or whatever). Then whichever code that's executed 
> below the portal (and that includes CMF tools) can do 
> getUtility(ICMFSite) to get to the site.
> 

+1 - in fact, we already have Products.CMFCore.interfaces.ISiteRoot. I use
it all the time. :)

Martin

-- 
View this message in context: http://www.nabble.com/Five%27s-local-sitemanager%2C-CMF%2C-etc-tf3219557.html#a9161398
Sent from the Zope - CMF list2 mailing list archive at Nabble.com.



More information about the Zope-CMF mailing list