使用 portal_tool 将旧插件从 Plone 2.1(原型)更新到 4.3(敏捷)

Updating old add-on with portal_tool from Plone 2.1 (Archetypes) to 4.3 (Dexterity)

我正在尝试将具有 2 种内容类型(原型)的 plone 2.1 附加组件更新为 Plone 4(敏捷)。

其中一个内容类型 (foo) 的作用类似于 portal_tool,这是一个独特的 'container',其中必须添加具有某些字段的另一种内容类型 (bar)(并且仅在此之上'container').

我不确定是否有办法在 Dexterity 上执行此操作,就像之前在 Archetypes 上一样。此外,在这种情况下,自定义 portal_tool 是 Plone 4.x+ 中的一种可行方法还是已弃用?

这里有一些摘录(来自 AT):

foo.py:

class foo(UniqueObject, BaseFolder):
    ...
    __implements__ = (getattr(UniqueObject,'__implements__',()),) + (getattr(BaseFolder,'__implements__',()),)
    ...
    allowed_content_types = ['bar']
    ...
    def __init__(self, id=None):
        BaseFolder.__init__(self,'portal_foo')
        self.setTitle('Foo')
    ...

bar.py:

class bar(BaseContent):
    ...

不确定创建扩展 UniqueObject 的自定义 Dexterity 内容类型是否可行(可能不行),但是使用 Plone 内容类型进行单点配置是一种非常古老且不推荐使用的方法.

我的建议是将您的配置移动到 Plone registry