<!-- $Id$ -->

<configure
   xmlns="http://namespaces.zope.org/zope"
   xmlns:browser="http://namespaces.zope.org/browser"
   i18n_domain="zope">

  <class class=".registry.RelationRegistry">
    <require
        permission="zope.View"
        interface=".interfaces.IRelationRegistryQuery"
        />
    <require
        permission="zope.ManageContent"
        interface=".interfaces.IRelationRegistryUpdate"
        />
    <require
        interface="zope.app.catalog.interfaces.ICatalogQuery"
        permission="zope.View"
        />
    <require
        interface="zope.app.catalog.interfaces.ICatalogEdit"
        permission="zope.ManageServices"
        />
    <require
        interface="zope.app.container.interfaces.IContainer"
        permission="zope.ManageServices"
        />
    <factory id="cybertools.relation.registry.RelationRegistry" />
  </class>

  <adapter
        for=".interfaces.IRelation"
        provides=".registry.IIndexableRelation"
        factory=".registry.IndexableRelationAdapter"
        trusted="true"
        />

  <subscriber
        for=".interfaces.IRelationRegistry
             zope.app.container.interfaces.IObjectAddedEvent"
        handler=".registry.setupIndexes"
        />

  <subscriber
        for="zope.interface.Interface
             zope.app.container.interfaces.IObjectRemovedEvent"
        handler=".registry.invalidateRelations"
        />

  <subscriber
        for="cybertools.relation.interfaces.IRelation
             cybertools.relation.interfaces.IRelationInvalidatedEvent"
        handler=".registry.removeRelation"
        />

  <!-- browser settings -->

  <!--<browser:tool
      interface=".interfaces.IRelationRegistry"
      title="Relation Registry"
      description="Registry for relation objects."
      />-->

  <browser:addMenuItem
      title="Relation Registry"
      description="A utility that allows the registration of and query for relations"
      class=".registry.RelationRegistry"
      permission="zope.ManageSite"
    />

</configure>
