2024-05-21 06:08:04 发布
网友
我希望在通过“共享”选项卡更改内容的角色时触发邮件。如何做到这一点?我知道在修改对象时触发邮件,但在更改/添加权限时不会。你知道吗
内容规则框架是基于Zope事件构建的;当内容被修改时,一个事件被发送出去,内容规则订阅该事件,被通知并执行配置的操作。你知道吗
不幸的是,sharing选项卡和底层Zope访问控制框架都不会发出事件(Zope的这一部分会将事件提前好几年)。你知道吗
你必须:
自定义共享选项卡视图(plone.app.workflow.browser.sharing),以便在添加或删除角色时发出自定义事件。
plone.app.workflow.browser.sharing
使用内容规则引擎注册此事件类型;您需要使用IRuleEventType注册事件接口:
IRuleEventType
<interface interface="your.package.interfaces.IRolesChangedEvent" type="plone.contentrules.rule.interfaces.IRuleEventType" name="Roles added or removed on this object" />
创建可由新事件类型触发的条件。这个过程是documented in this Plone.org knowledgebase article。
通过自定义加载项http://collective-docs.readthedocs.org/en/latest/getstarted/index.html自定义Plone
您可能需要修补共享选项卡以触发保存共享选项卡时触发的自定义事件。你知道吗
事件http://collective-docs.readthedocs.org/en/latest/components/events.html
这种定制可以通过
重写http://collective-docs.readthedocs.org/en/latest/components/zcml.html#overrides
或者猴子修补http://collective-docs.readthedocs.org/en/latest/misc/monkeypatch.html
然后为自定义事件创建内容规则条件:
http://plone.org/documentation/kb/creating-content-rule-conditions-and-actions/adding-the-condition
内容规则框架是基于Zope事件构建的;当内容被修改时,一个事件被发送出去,内容规则订阅该事件,被通知并执行配置的操作。你知道吗
不幸的是,sharing选项卡和底层Zope访问控制框架都不会发出事件(Zope的这一部分会将事件提前好几年)。你知道吗
你必须:
自定义共享选项卡视图(
plone.app.workflow.browser.sharing
),以便在添加或删除角色时发出自定义事件。使用内容规则引擎注册此事件类型;您需要使用
IRuleEventType
注册事件接口:创建可由新事件类型触发的条件。这个过程是documented in this Plone.org knowledgebase article。
通过自定义加载项http://collective-docs.readthedocs.org/en/latest/getstarted/index.html自定义Plone
您可能需要修补共享选项卡以触发保存共享选项卡时触发的自定义事件。你知道吗
事件http://collective-docs.readthedocs.org/en/latest/components/events.html
这种定制可以通过
重写http://collective-docs.readthedocs.org/en/latest/components/zcml.html#overrides
或者猴子修补http://collective-docs.readthedocs.org/en/latest/misc/monkeypatch.html
然后为自定义事件创建内容规则条件:
http://plone.org/documentation/kb/creating-content-rule-conditions-and-actions/adding-the-condition
相关问题 更多 >
编程相关推荐