14d4382ca6
- 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.
61 lines
1.6 KiB
XML
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>
|