<?xml version="1.0"?>
<configure
    xmlns="http://namespaces.zope.org/zope"
    i18n_domain="schooltool">

  <include file="security.zcml" />

  <class class=".schoolyear.SchoolYearContainer">
    <allow interface="zope.app.container.interfaces.ISimpleReadContainer" />
    <require permission="schooltool.view"
             attributes="keys values __iter__ __len__ getActiveSchoolYear validateForOverlap active_id" />
    <require permission="schooltool.edit"
             interface="zope.app.container.interfaces.IWriteContainer" />
    <require permission="schooltool.edit"
             attributes="activateNextSchoolYear" />
  </class>

  <interface
      interface=".interfaces.ISchoolYear"
      type="zope.app.content.interfaces.IContentType"
      />

  <class class=".schoolyear.SchoolYear">
    <allow interface="schooltool.schoolyear.interfaces.IReadSchoolYear" />
    <require permission="schooltool.edit"
             interface="schooltool.schoolyear.interfaces.IWriteSchoolYear"
             set_schema="schooltool.schoolyear.interfaces.IReadSchoolYear" />
  </class>

  <adapter
      factory=".schoolyear.getSchoolYearContainer" />

  <adapter
      factory=".schoolyear.SchoolYearInit"
      name="schooltool.schoolyear" />

  <adapter
      factory=".schoolyear.SchoolYearDateRangeAdapter" />

  <subscriber handler=".subscriber.subscriberAdapterDispatcher" />

  <adapter factory=".schoolyear.SchoolYearOverlapValidationSubscriber"
           name="validate_overlap"/>
  <adapter factory=".schoolyear.SchoolYearTermOverflowValidationSubscriber"
           name="validate_overflow"/>

  <adapter factory=".subscriber.ObjectEventAdapterSubscriberDispatcher" />

  <include package=".browser" />

</configure>
