Using z3 style events
Based on my previous entry on at_post_create_script, I was curios on how to achieve something like that using z3 style events. Now, I know that it's not the same and the following events are meant only to replace manage_afterAdd and so on, but I'm pretty sure that there are (or will be) events fired that would replace the at_post_* scripts.
So, easy as it gets:
Create a new python package inside the zope Products folder, add the following method inside __init__.py :
def addedATDoc(ob, event):
print "called"
print ob
print event
Now add a configure.zcml file with the following content:
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five">
<subscriber
for="Products.ATContentTypes.interface.IATDocument
zope.app.container.interfaces.IObjectAddedEvent"
handler="Products.specialevent.addedATDoc"
/>
Start zope in debug mode (with zopectl fg) and watch the terminal when a Plone Page is created. Only problem with this method is that it's zope-wise, instead of being site-wise. localevent is a product that should help with that.
Previous: My favorite development environment