[z3-five] handler not getting called
yary
not.com at gmail.com
Wed Oct 11 22:59:35 CEST 2006
On 11/10/06, Philipp von Weitershausen <philipp at weitershausen.de> wrote:
> yary wrote:
> > I'm trying to add a handler, but it doesn't get called. ZCML:
> >
> > <five:traversable class=".portal.QSite" />
> > <five:traversable class="OFS.Folder.Folder" />
> > <five:implements class=".portal.QSite"
> > interface=".portal.IQSite"
> > />
> > <subscriber
> > for=".portal.IQSite zope.app.container.interfaces.IObjectEvent"
> > handler=".portal.addedQSite"
> > />
> >
> > currently addedQSite prints a debug message and then throws an
> > exception- trying to make it hard to miss... but I can create a QSite
> > and not see the debug message or exception. My first attempt I used
> > IObjectAddedEvent, and switched to IObjectEvent to try and catch any
> > event, still nothing calls my addedQSite on add or delete. Any ideas
> > on how to fix?
>
> How are you creating a QSite object? Most of Zope 2 or the CMF doesn't
> send events yet, unfortunately. It would be a nice sprint topic or task
> to add such events to Zope 2, though.
QSite is a subclass of CMFSite- in its entirety:
class QSite(CMFSite):
meta_type='Q Site'
My product initializes it with initializeBases... & registerClass. I
add a 'Q Site' to my Zope root through the management interface, and
that's where I was hoping to get the event notification.
I suspected that the event methods were more intended for content
objects written from scratch, still, was hoping the "magic" worked
"outside the box" as well! Thanks for alerting me that I can't expect
events to work on Zope2-ish objects yet. Hope you don't mind me cc'ing
to the five list on this response, so others can see that it is
closed.
What I'm trying to do in the big picture, is write a product that
comes with an optional skin, which it installs on instantiation. Will
post a more detailed request for help to the zope users list.
More information about the z3-five
mailing list