[Product-Developers] Re: Limiting schema extenders to one Plone site?

Martin Aspeli optilude at gmx.net
Fri Jun 13 11:02:37 UTC 2008




Raphael Ritz wrote:
> 
> 
>>> Alternatively, you might be interested in looking at
>>>
>>>    http://pypi.python.org/pypi/plone.behavior
>>>
>> 
>> I don't think plone.behavior would help here ... at least not
>> immediately.
> 
> Which is why I said "you might be interested in looking at"
> and knowing it's Andreas who I responded to ;-)
> 
> But while we are at this: I haven't used plone.behavior yet
> but it seems to me like it's laying the ground for a number
> of TTW configurable things that depend on interfaces being
> assigned (or not) to make e.g., certain adapters available
> (or not).
> 

Yup. That's the idea, anyway.



> It is my current understanding that if Andreas were to implement
> his schema extender as a behavior he could then control the
> availability of this extender using a custom  IBehaviorAssignable
> adapter in which he could implement any logic he wants to decide
> about availability (including being in a certain site, or the
> current site being configured somehow, having a certain product
> installed etc...)
> 
> Please correct me if I'm wrong,
> 

I think that's right. However, it may be overkill - a local adapter is
probably easier.

In fact, Alec Mitchell points out that the "pure zope 3" part of
plone.behavior is probably overkill - it pretty much just degenerates to
local adapters. This came from a desire to be generaliseable and to show off
how behavior assignment could be done. However, I think it may be better to
move the interface-based behavior assignment stuff out of the module and
into the test case as an example, as per the XXX comments in those modules.

For Dexterity, the idea is that we'll use plone.behavior to 

 a) make it easy for third party authors to signal the availability of a new
behavior (using the plone:behavior ZCML directive)

 b) build a UI to add/remove behaviours for a type

 c) store enabled behaviours in the FTI (for easy GS export/import among
other things)

Again, though, behaviors are at least intended to be used mainly for general
aspects of types that a third party author may want to provide for
integrators to pick and choose from. If you are only going to use a
behaviour once, then it's probably easier to just use local adapters.

Martin
-- 
View this message in context: http://www.nabble.com/-Product-Developers--Limiting-schema-extenders-to-one-Plone-site--tp17808996s20094p17821015.html
Sent from the Product Developers mailing list archive at Nabble.com.





More information about the Product-Developers mailing list