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

7 Messages Forum Options Options
Embed this topic
Permalink
Andreas Jung-5
[Product-Developers] Limiting schema extenders to one Plone site?
Reply Threaded MoreMore options
Print post
Permalink
Schema extender implementing ISchemaExtender or IOrderableSchemaExtender
extend the schema of a particular content-type for all Plone instances
within a Zope site. Is there a way to restrict the extender to one site
only (based on some conditions)? One possiblity would be to hack something
into getFields()..would IBrowserLayerAwareExtender do the job by using a
particular layer only available within the related sites? Or any better
ideas?

Andreas

_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers

attachment0 (201 bytes) Download Attachment
David Glick-2
Re: [Product-Developers] Limiting schema extenders to one Plone site?
Reply Threaded MoreMore options
Print post
Permalink
You can either use IBrowserLayerAwareExtender and a browser layer  
that's registered by your product, or else register the extender as a  
local adapter (e.g. using componentregistry.xml)
David

On Jun 12, 2008, at 1:22 PM, Andreas Jung wrote:

> Schema extender implementing ISchemaExtender or  
> IOrderableSchemaExtender extend the schema of a particular content-
> type for all Plone instances within a Zope site. Is there a way to  
> restrict the extender to one site only (based on some conditions)?  
> One possiblity would be to hack something into getFields()..would  
> IBrowserLayerAwareExtender do the job by using a particular layer  
> only available within the related sites? Or any better ideas?
>
> Andreas_______________________________________________
> Product-Developers mailing list
> Product-Developers@...
> http://lists.plone.org/mailman/listinfo/product-developers

David Glick
Project Associate
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment

http://www.onenw.org
davidglick@...
(206) 286-1235 x32

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup




_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Raphael Ritz
[Product-Developers] Re: Limiting schema extenders to one Plone site?
Reply Threaded MoreMore options
Print post
Permalink
David Glick wrote:
> You can either use IBrowserLayerAwareExtender and a browser layer that's
> registered by your product, or else register the extender as a local
> adapter (e.g. using componentregistry.xml)
> David
>

Alternatively, you might be interested in looking at

   http://pypi.python.org/pypi/plone.behavior

Raphael


> On Jun 12, 2008, at 1:22 PM, Andreas Jung wrote:
>
>> Schema extender implementing ISchemaExtender or
>> IOrderableSchemaExtender extend the schema of a particular
>> content-type for all Plone instances within a Zope site. Is there a
>> way to restrict the extender to one site only (based on some
>> conditions)? One possiblity would be to hack something into
>> getFields()..would IBrowserLayerAwareExtender do the job by using a
>> particular layer only available within the related sites? Or any
>> better ideas?
>>
>> Andreas_______________________________________________
>> Product-Developers mailing list
>> Product-Developers@...
>> http://lists.plone.org/mailman/listinfo/product-developers
>
> David Glick
> Project Associate
> ONE/Northwest
>
> New tools and strategies for engaging people in protecting the environment
>
> http://www.onenw.org
> davidglick@...
> (206) 286-1235 x32
>
> Subscribe to ONEList, our email newsletter!
> Practical advice for effective online engagement
> http://www.onenw.org/full_signup


_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Martin Aspeli-2
Re: [Product-Developers] Re: Limiting schema extenders to one Plone site?
Reply Threaded MoreMore options
Print post
Permalink

Raphael Ritz wrote:
David Glick wrote:
> You can either use IBrowserLayerAwareExtender and a browser layer that's
> registered by your product, or else register the extender as a local
> adapter (e.g. using componentregistry.xml)
> David
>

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.

Martin
Raphael Ritz
[Product-Developers] Re: Limiting schema extenders to one Plone site?
Reply Threaded MoreMore options
Print post
Permalink
Martin Aspeli wrote:

>
>
> Raphael Ritz wrote:
>> David Glick wrote:
>>> You can either use IBrowserLayerAwareExtender and a browser layer that's
>>> registered by your product, or else register the extender as a local
>>> adapter (e.g. using componentregistry.xml)
>>> David
>>>
>> 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).

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,

        Raphael


>
> Martin
>


_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Martin Aspeli-2
Re: [Product-Developers] Re: Limiting schema extenders to one Plone site?
Reply Threaded MoreMore options
Print post
Permalink

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
Dylan Jay-3
[Product-Developers] Re: Limiting schema extenders to one Plone site?
Reply Threaded MoreMore options
Print post
Permalink
In reply to this post by Andreas Jung-5
Andreas Jung wrote:
> Schema extender implementing ISchemaExtender or IOrderableSchemaExtender
> extend the schema of a particular content-type for all Plone instances
> within a Zope site. Is there a way to restrict the extender to one site
> only (based on some conditions)? One possiblity would be to hack
> something into getFields()..would IBrowserLayerAwareExtender do the job
> by using a particular layer only available within the related sites? Or
> any better ideas?

I used schemaextender's in built support for browserlayers very
successfully. Since most of my view customisations also need to be plone
instance specific a single browserlayer per product seemed like a clean
solution to me.



_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers