是否有可能“覆盖”只是产品的工作流程?
我有 mynamespace.myproduct
和 mynamespace.myproduct2
。
mynamespace.myproduct2
被定义为 mynamespace.myproduct
的 metadata.xml
中的依赖项。 mynamespace.myproduct2
有一些我想覆盖的工作流程,而无需整体自定义 mynamespace.myproduct2
。
我知道我可以使用 ZMI 的 portal_workflow
更改它,但在 mynamespace.myproduct
和 mynamespace.myproduct2
两种情况下,我都需要保留这些更改code> 重新安装在 portal_quickinstaller
中。
工作流程将具有相同的名称,但我的自定义工作流程将具有不同的状态,并且我需要 mynamespace.myproduct
来覆盖 mynamespace.myproduct2
的工作流程。总结:我只需要更改产品的工作流程(保留内容类型等),但不想自定义整个包。
我对 overrides.zcml (示例),但这完全覆盖了配置文件,我只想覆盖工作流程(甚至不知道这种方法是否有效。添加此文件将进行始终使用而不是原始配置文件?我如何正确测试它?)。根据 plone 社区指南:
注意 ZCML 和 GenericSetup 之间的差异 ZCML 更改会影响 在 Zope 内的所有站点中加载 Python 代码,而 GenericSetup XML 文件仅影响一个 Plone 站点及其数据库。通用设置 XML 文件始终是数据库更改。 ZCML与之间的关系 特定于站点的行为通常是使用层来完成的。 ZCML 指令, 像视图和视图一样,被注册为在某个特定的活动上活动 图层仅使用图层属性。导入 GenericSetup XML 时 通过 Portal_setup,或者运行产品附加安装程序 Plone 站点,该层仅针对特定站点激活, 启用为此层注册的所有视图。
我不希望这影响所有 Plone 站点,只影响一个。
那么,这是可能/可行的,还是我必须从原始工作流程中进行分叉并编辑 xml 文件才能工作?
I have mynamespace.myproduct
and mynamespace.myproduct2
.
mynamespace.myproduct2
is defined as a dependency in mynamespace.myproduct
's metadata.xml
. mynamespace.myproduct2
has some workflows that I would like to override, without having to customize mynamespace.myproduct2
as a whole.
I know I can change it using the portal_workflow
at ZMI, but I need to keep these changes, in both situations when mynamespace.myproduct
and mynamespace.myproduct2
are reinstalled in portal_quickinstaller
.
The workflows would have the same name, but my customized one will have different states, and I need mynamespace.myproduct
to override mynamespace.myproduct2
's workflows. Summarizing: I need to just change a workflow from a product, (keeping the content-types, etc) but don't want to customize the whole package.
I tought about overrides.zcml (an example), but this overrides the profile completely, and I just want to override the workflow (and dont even know if this approach works. adding this file is going to be always used instead of the original profile? How do I properly test it?). And according to plone community guide:
Note Difference between ZCML and GenericSetup ZCML changes affect
loaded Python code in all sites inside Zope whereas GenericSetup XML
files affect only one Plone site and its database. GenericSetup XML
files are always database changes. Relationship between ZCML and
site-specific behavior is usually done using layers. ZCML directives,
like viewlets and views, are registered to be active on a certain
layer only using layer attribute. When GenericSetup XML is imported
through portal_setup, or the product add-on installer is run for a
Plone site, the layer is activated for the particular site only,
enabling all views registered for this layer.
I don't want this to affect all Plone sites, just one.
So, is this possible/feasible, or will I have to do a fork and edit the xml files from the original workflow to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要覆盖
mynamespace.myproduct2
中定义的任何工作流程,您必须在mynamespace.myproduct
中添加新的工作流程定义,并将其绑定到您所需的内容类型。因此,您必须添加此结构:
并且在
workflows.xml
中您将具有:这只会影响安装您的产品的站点。
最后记得重新启动 zope 并重新安装您的产品以应用新的 genericsetup 配置。
to override any workflow defined in
mynamespace.myproduct2
you have to add a new workflow definition inmynamespace.myproduct
and bind it to your desired content type.So you have to add this structure:
and in
workflows.xml
you will have:This will affect only the site where your product is installed.
In the end remember to restart zope and to re-install your product to apply the new genericsetup configuration.