<!-- $Id$ -->

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

  <zope:class class="cybertools.tracking.btree.TrackingStorage">
    <require permission="zope.View"
             interface="zope.app.container.interfaces.IReadContainer" />
    <require permission="zope.View"
             interface="cybertools.tracking.interfaces.ITrackingStorage" />
    <require permission="zope.ManageContent"
             interface="zope.app.container.interfaces.IWriteContainer" />
    <require permission="zope.ManageContent"
             set_schema="cybertools.tracking.interfaces.ITrackingStorage" />
  </zope:class>

  <zope:class class="loops.organize.tracking.change.ChangeRecord">
    <require permission="zope.View"
             interface="loops.organize.tracking.change.IChangeRecord" />
    <require permission="zope.ManageContent"
             set_schema="loops.organize.tracking.change.IChangeRecord" />
  </zope:class>

  <zope:class class="loops.organize.tracking.access.AccessRecord">
    <require permission="zope.View"
             interface="loops.organize.tracking.access.IAccessRecord" />
    <require permission="zope.ManageContent"
             set_schema="loops.organize.tracking.access.IAccessRecord" />
  </zope:class>

  <zope:subscriber handler="cybertools.tracking.btree.unindexTrack" />

  <zope:subscriber handler="loops.organize.tracking.change.recordModification" />
  <zope:subscriber handler="loops.organize.tracking.change.recordAdding" />
  <zope:subscriber handler="loops.organize.tracking.change.recordAssignment" />
  <zope:subscriber handler="loops.organize.tracking.change.recordDeassignment" />

  <zope:subscriber handler="loops.organize.tracking.access.logAccess" />

  <zope:adapter
      factory="loops.organize.tracking.access.AccessRecordManager"
      name="load_access_records"
      trusted="True" />
  <zope:class class="loops.organize.tracking.access.AccessRecordManager">
    <allow attributes="process" />
  </zope:class>

  <!-- ZMI views -->

  <browser:page
      for="cybertools.tracking.interfaces.ITrackingStorage"
      name="contents.html"
      template="../../browser/contents.pt"
      class="cybertools.container.ordered.ContainerView"
      menu="zmi_views" title="Contents"
      permission="loops.ManageSite" />

  <browser:page
      for="cybertools.tracking.interfaces.ITrackingStorage"
      name="index.html"
      class="cybertools.tracking.browser.TrackingStorageView"
      permission="loops.ManageSite" />

  <browser:menuItem
      menu="zmi_views"
      for="cybertools.tracking.interfaces.ITrackingStorage"
      order="0"
      title="View"
      action="index.html" />

  <browser:page
      for="cybertools.tracking.interfaces.ITrack"
      name="index.html"
      class="loops.organize.tracking.browser.BaseTrackView"
      permission="loops.ManageSite" />

  <browser:page
      for="loops.organize.tracking.change.IChangeRecord"
      name="index.html"
      class="loops.organize.tracking.browser.ChangeView"
      permission="loops.ManageSite" />

  <browser:page
      name="edit.html"
      for="cybertools.tracking.interfaces.ITrack"
      class="loops.organize.tracking.browser.EditForm"
      permission="loops.ManageSite"
      menu="zmi_views" title="Edit" />

  <browser:page
      for="loops.organize.tracking.access.IAccessRecord"
      name="index.html"
      class="loops.organize.tracking.browser.AccessView"
      permission="loops.ManageSite" />

  <browser:menuItem
      menu="zmi_views"
      for="cybertools.tracking.interfaces.ITrack"
      order="0"
      title="View"
      action="index.html" />

  <!-- application views -->

  <browser:page
      name="tracking_stats.html"
      for="loops.interfaces.IConcept"
      class="loops.organize.tracking.report.TrackingStats"
      permission="zope.View" />

  <browser:page
      name="recent_changes.html"
      for="loops.interfaces.IConcept"
      class="loops.organize.tracking.report.RecentChanges"
      permission="zope.View" />

  <browser:page
      name="load_access_records"
      for="loops.interfaces.ILoops"
      class="loops.organize.tracking.access.AccessRecordManagerView"
      attribute="loadRecordsFromLog"
      permission="zope.Public" />

  <zope:adapter factory="loops.organize.tracking.setup.SetupManager"
                name="organize.tracking" />

</configure>
