<!-- $Id$ -->

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

  <zope:adapter
        factory="loops.organize.stateful.base.StatefulResourceIndexInfo"
        trusted="True" />
  <zope:class class="loops.organize.stateful.base.StatefulResourceIndexInfo">
    <allow interface="cybertools.stateful.interfaces.IStatefulIndexInfo" />
  </zope:class>

  <zope:adapter
        factory="loops.organize.stateful.base.StatefulConceptIndexInfo"
        trusted="True" />
  <zope:class class="loops.organize.stateful.base.StatefulConceptIndexInfo">
    <allow interface="cybertools.stateful.interfaces.IStatefulIndexInfo" />
  </zope:class>

  <!-- stateful definitions and corresponding adapters -->

  <zope:utility
        factory="cybertools.stateful.publishing.simplePublishing"
        name="simple_publishing" />

  <zope:adapter
        factory="loops.organize.stateful.base.SimplePublishable"
        name="simple_publishing" />
  <zope:class class="loops.organize.stateful.base.SimplePublishable">
    <require permission="zope.View"
             interface="cybertools.stateful.interfaces.IStateful" />
    <require permission="zope.ManageContent"
             set_schema="cybertools.stateful.interfaces.IStateful" />
  </zope:class>

  <zope:utility
        factory="loops.organize.stateful.person.personStates"
        name="person_states" />

  <zope:adapter
        factory="loops.organize.stateful.person.StatefulPerson"
        name="person_states" />
  <zope:class class="loops.organize.stateful.person.StatefulPerson">
    <require permission="zope.View"
             interface="cybertools.stateful.interfaces.IStateful" />
    <require permission="zope.ManageContent"
             set_schema="cybertools.stateful.interfaces.IStateful" />
  </zope:class>

  <zope:utility
        factory="loops.organize.stateful.task.taskStates"
        name="task_states" />

  <zope:adapter
        factory="loops.organize.stateful.task.StatefulTask"
        name="task_states" />
  <zope:class class="loops.organize.stateful.task.StatefulTask">
    <require permission="zope.View"
             interface="cybertools.stateful.interfaces.IStateful" />
    <require permission="zope.ManageContent"
             set_schema="cybertools.stateful.interfaces.IStateful" />
  </zope:class>

  <zope:utility
        factory="loops.organize.stateful.task.publishableTask"
        name="publishable_task" />

  <zope:adapter
        factory="loops.organize.stateful.task.PublishableTask"
        name="publishable_task" />
  <zope:class class="loops.organize.stateful.task.PublishableTask">
    <require permission="zope.View"
             interface="cybertools.stateful.interfaces.IStateful" />
    <require permission="zope.ManageContent"
             set_schema="cybertools.stateful.interfaces.IStateful" />
  </zope:class>

  <zope:utility
        factory="loops.organize.stateful.quality.classificationQuality"
        name="classification_quality" />

  <zope:adapter
        factory="loops.organize.stateful.quality.ClassificationQualityCheckable"
        name="classification_quality" />
  <zope:class class="loops.organize.stateful.quality.ClassificationQualityCheckable">
    <require permission="zope.View"
             interface="cybertools.stateful.interfaces.IStateful" />
    <require permission="zope.ManageContent"
             set_schema="cybertools.stateful.interfaces.IStateful" />
  </zope:class>

  <zope:utility
        factory="loops.organize.stateful.contact.contactStates"
        name="contact_states" />

  <zope:adapter
        factory="loops.organize.stateful.contact.StatefulContact"
        name="contact_states" />
  <zope:class class="loops.organize.stateful.contact.StatefulContact">
    <require permission="zope.View"
             interface="cybertools.stateful.interfaces.IStateful" />
    <require permission="zope.ManageContent"
             set_schema="cybertools.stateful.interfaces.IStateful" />
  </zope:class>

  <!-- views and form controllers -->

  <browser:page
        for="loops.interfaces.IConcept"
        name="select_state.html"
        class="loops.organize.stateful.browser.StateQuery"
        permission="zope.View" />

  <browser:page
        for="loops.interfaces.IConcept"
        name="filter_input.allstates"
        class="loops.organize.stateful.browser.FilterAllStates"
        permission="zope.View" />

  <browser:page
      name="change_state.html"
      for="loops.interfaces.INode"
      class="loops.organize.stateful.browser.ChangeStateForm"
      permission="zope.ManageContent" />

  <zope:adapter
      name="change_state"
      for="loops.browser.node.NodeView
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory="loops.organize.stateful.browser.ChangeState"
      permission="zope.ManageContent" />

  <!-- event handlers -->

  <zope:subscriber handler="loops.organize.stateful.base.handleTransition" />
  <zope:subscriber handler="loops.organize.stateful.quality.assign" />
  <zope:subscriber handler="loops.organize.stateful.quality.deassign" />

</configure>
