How to register a marker interface so that it displays in Plones ZMI?

I would like to register a marker interface in order to add it to objects in ZMI. My product configure.zcmlcontains:

<interface interface=".interfaces.IMarkerInterface" />

and after reinstalling the interface is displayed in the list of available interfaces. But if I try to add it to an object in ZMI, I get a ComponentLookupError. What is missing?

+3
source share
2 answers

It worked well for me.

I tested it in Plone 4.0.3

Created a package with pasteur:

paster create -t plone bogus.interface

With this interface.py file:

from zope.interface import Interface

class IBogusInterface(Interface):
    """ Marker bogus interface
    """

And this configure.zcml file:

<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>

Are you sure nothing is missing?

+4
source

, , -, . - , ZMI.

+3

Source: https://habr.com/ru/post/1746243/


All Articles