[Zope-dev] post publishing hook
Florent Guillaume
fg at nuxeo.com
Fri Apr 1 11:03:08 EST 2005
I didn't know about that hook, but from reading the code it seems it
takes place before publishing, not after.
There's the recent post_traverse hook too, but that's not what I want.
Florent
Chris McDonough wrote:
> When do you think it should be called? I just had to override
> zpublisher_validated_hook to do some stuff that would have been a bit
> easier if a different hook existed, but that might be a different use
> case...
>
>
> On Fri, 2005-04-01 at 10:48, Florent Guillaume wrote:
>
>>I really could use a post publishing hook.
>>Standard use case: delay indexing at the end of the request to only do
>>it once per object even if the object has been modified 4 times.
>>
>>Today there's the REQUEST._hold() hack with an instance having a
>>__del__, but this gets executed outside the main transaction, and
>>REQUEST is already dying.
>>
>>I'd like a post-publishing hook that's called in the initial REQUEST and
>>transaction.
>>
>>Open issues are:
>>1. what if there's an exception in the hook? I'd say log it but that's all.
>>2. what if there's a Conflicterror? That's tougher to deal with... The
>>transaction has to be retried, without the user being aware of it, so it
>>means the hook should probably be called *before* things are sent to the
>>browser.
>>
>>What do you think?
>>
>>Florent
>
>
--
Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D
+33 1 40 33 71 59 http://nuxeo.com fg at nuxeo.com
More information about the Zope-Dev
mailing list