How to override the Plone event subscriber

I need to expand the Plone product (Products.Poi) with a second product. In the extension product, I need to override the original subscriber event. I tried to subscribe to the override.zcml event with the same name, but the second event does not override the first, but all two are executed.

Here http://plone.org/products/dexterity/documentation/manual/five.grok/core-components/events seems like this is not possible:

Unlike adapters, you cannot override the event subscriber using a more specific interface. Each activated event subscriber will be executed when the event is triggered.

Does anyone have a trick?

Thanks Alex

+5
source share
2 answers

overrides.zcml, zcml buildout? : http://developer.plone.org/components/zcml.html?highlight=zcml#overrides - : zcml = my.package-overrides

, z3c.unconfigure: http://pypi.python.org/pypi/z3c.unconfigure

+3

: z3c.unconfigure.

zcml.

, Poi:

  • "z3c.unconfigure" install_requires setup.py
  • event.py update_tracker_watchers
  • overrides.zcml , unconfigure Products.Poi.events.update_tracker_watchers .

<include package="z3c.unconfigure" file="meta.zcml" />
<unconfigure>
    <subscriber
        for="Products.Poi.interfaces.ITracker
                  Products.Archetypes.interfaces.IObjectEditedEvent"
        handler="Products.Poi.events.update_tracker_watchers"
    />
    </unconfigure>
<subscriber
    for="Products.Poi.interfaces.ITracker
              Products.Archetypes.interfaces.IObjectEditedEvent"
    handler=".events.update_tracker_watchers"
/>

+5

All Articles