我在我的包中创建了一个自定义Plone内容类型,即my.product
。
我需要集成工作副本支持:以便“正在发布”的文档(在我的情况下,已发布的内容类型)在编辑时保持在线状态。基本上,我想利用plone.app.iterate提供的“工作副本支持(迭代)”来实现what is explained here。这将使我能够check-in
/ check-out
我的更改。
Plone 4中是否可以使用Archetypes自定义内容类型?如果是的话怎么会这样呢?
答案 0 :(得分:2)
我在my.product/my/product/profiles/default
文件夹中添加了以下两个文件,它似乎可以正常工作:
diff_tool.xml
<?xml version="1.0"?>
<object>
<difftypes>
<type portal_type="MyCustomType">
<field name="any" difftype="Compound Diff for AT types"/>
</type>
</difftypes>
</object>
repositorytool.xml
<?xml version="1.0"?>
<repositorytool>
<policymap>
<type name="MyCustomType">
<policy name="at_edit_autoversion"/>
<policy name="version_on_revert"/>
</type>
</policymap>
</repositorytool>
答案 1 :(得分:1)
我从未使用过plone.app.iterate,但这是如何解决问题的通用方法。
操作由 plone.app.iterate GenericSetup配置文件安装。您可以在此处查看操作:
向行* pay_expr *付款,告知何时显示操作。它指向具有条件的帮助者视图。
视图在这里定义
如果内容项可归档,则执行的检查
很可能失败来自if not interfaces.IIterateAware.providedBy
条件。您的自定义contennt必须声明此接口。但是,您可以确认这会在checkin_allowed(self)
中放置一个pdb断点并逐行执行,看看您的内容类型会发生什么。