ZMI のオブジェクトに追加できるように、マーカー インターフェイスを登録したいと思います。私の製品configure.zcml
には以下が含まれています:
<interface interface=".interfaces.IMarkerInterface" />
再インストール後、使用可能なインターフェイスのリストにインターフェイスが表示されます。しかし、それを ZMI のオブジェクトに追加しようとすると、ComponentLookupError
. 何が欠けていますか?
それは私にとってはうまくいきました。
Plone 4.0.3でテストしました
ペーストでパッケージを作成しました:
paster create -t plone bogus.interface
この interfaces.py ファイルを使用すると、次のようになります。
from zope.interface import Interface
class IBogusInterface(Interface):
""" Marker bogus interface
"""
そして、この configure.zcml ファイル:
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
xmlns:i18n="http://namespaces.zope.org/i18n"
i18n_domain="bogus.interface">
<five:registerPackage package="." initialize=".initialize" />
<!-- -*- extra stuff goes here -*- -->
<interface interface=".interfaces.IBogusInterface" />
</configure>
何も見逃していなかったと確信していますか?
また、明らかに、マーカー インターフェイスは空でなければならないことに注意してください。属性やメソッドを含めることはできません。含まれている場合、ZMI には表示されません。