plone.app.discussion/plone/app/discussion/contentrules.zcml
Alin Voinea 14d4382ca6 Use commented object as context instead of comment within event trigger
- In order this to work with plone.contentrules use commented object as
  the main context within custom discussion events and add comment as the
  second parameter.
2014-04-18 16:33:12 +03:00

61 lines
1.6 KiB
XML

<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:zcml="http://namespaces.zope.org/zcml">
<!-- Content Rules events -->
<configure zcml:condition="installed plone.contentrules">
<interface
interface="plone.app.discussion.interfaces.ICommentAddedEvent"
type="plone.contentrules.rule.interfaces.IRuleEventType"
name="Comment added"
/>
<interface
interface="plone.app.discussion.interfaces.ICommentRemovedEvent"
type="plone.contentrules.rule.interfaces.IRuleEventType"
name="Comment removed"
/>
<interface
interface="plone.app.discussion.interfaces.IReplyAddedEvent"
type="plone.contentrules.rule.interfaces.IRuleEventType"
name="Comment reply added"
/>
<interface
interface="plone.app.discussion.interfaces.IReplyRemovedEvent"
type="plone.contentrules.rule.interfaces.IRuleEventType"
name="Comment reply removed"
/>
</configure>
<!-- Content rules subscribers -->
<configure zcml:condition="installed plone.app.contentrules">
<subscriber
for="plone.app.discussion.interfaces.ICommentAddedEvent"
handler=".contentrules.execute_comment"
/>
<subscriber
for="plone.app.discussion.interfaces.ICommentRemovedEvent"
handler=".contentrules.execute_comment"
/>
<subscriber
for="plone.app.discussion.interfaces.IReplyAddedEvent"
handler=".contentrules.execute_comment"
/>
<subscriber
for="plone.app.discussion.interfaces.IReplyRemovedEvent"
handler=".contentrules.execute_comment"
/>
</configure>
</configure>