[Zope3-dev] Re: Object Hub does not receive important events
Jim Fulton
jim@zope.com
Tue, 08 Jul 2003 17:23:31 -0400
Stephan Richter wrote:
> Hi Gary,
>
> I was just trying to test the text index by having it filled using the
> ObjectHub and a Registration subscriber. After I figured out that the service
> name "EventSubscription" changed to "Subscription" (see checkins), I got the
> Registration subscriber to work and was able to add new objects to the hub
> and therefore to the index.
>
> Then however, I tried to modify and delete objects, but the
> ObjectModifiedEvent and ObjectRemovedEvent are not being forwarded to the
> Object Hub, so nothing happens.
>
> As far as I can tell, there are two possible ways of fixing this:
>
> 1. Subscribe the object hub directly to the two events.
>
> 2. Have the Registration subscriber handle the two events.
>
> If I visualize the design correctly in my head, I think option 2 would be the
> correct one, since it seems to me that the "Registration subscriber" is
> responsible for automatically managing the hub based on events.
I don't think that that's correct. I'm 99% sure that the hub is supposed
to be subscribed to modification and removal events.
See zope/app/interfaces/services/hub.py.
Ah, and see zope/app/services/hubcollaborations.txt.
Clearly, the hub is supposed to handler adds and removes.
There seems to be a special case for objects moved into or out
of the hubs place, but, frankly, copying and moving are a mess right
now and I would ignore them for this discussion.
I'm puzzed that the hub isn't registered for modified and removed
events. I guess this is partly the result that we aren't using it. :(
Jim
--
Jim Fulton mailto:jim@zope.com Python Powered!
CTO (703) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org