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

  <class class=".person.Person">
    <implements interface="schooltool.app.interfaces.IHaveCalendar" />
    <implements interface="schooltool.person.interfaces.IHavePreferences" />
    <require
        permission="schooltool.view"
        interface="schooltool.person.interfaces.IReadPerson"
        attributes="__cmp__" />
    <require
        permission="schooltool.edit"
        interface="schooltool.person.interfaces.IWritePerson"
        set_schema="schooltool.person.interfaces.IPerson" />
    <require
        permission="schooltool.view"
        attributes="nameinfo demographics schooldata parent1 parent2 emergency1 emergency2 emergency3 modified" />
    <require
        permission="schooltool.edit"
        set_attributes="modified" />
  </class>

  <subscriber
    for="schooltool.person.interfaces.IPerson
         zope.lifecycleevent.interfaces.IObjectModifiedEvent"
    handler=".person.personModifiedSubscriber"
   />

  <subscriber
    for="schooltool.demographics.interfaces.IDemographics
         zope.lifecycleevent.interfaces.IObjectModifiedEvent"
    handler=".person.personDemographicsModifiedSubscriber"
   />

  <subscriber
    for="schooltool.demographics.interfaces.INameInfo
         zope.lifecycleevent.interfaces.IObjectModifiedEvent"
    handler=".person.personDemographicsModifiedSubscriber"
   />

  <subscriber
    for="schooltool.demographics.interfaces.ISchoolData
         zope.lifecycleevent.interfaces.IObjectModifiedEvent"
    handler=".person.personDemographicsModifiedSubscriber"
   />

  <subscriber
    for="schooltool.demographics.interfaces.IContactInfo
         zope.lifecycleevent.interfaces.IObjectModifiedEvent"
    handler=".person.personDemographicsModifiedSubscriber"
   />

  <class class=".person.NameInfo">
    <require
       permission="schooltool.view"
       interface=".interfaces.INameInfo"
       />
    <require
       permission="schooltool.edit"
       set_schema=".interfaces.INameInfo"
       />
  </class>

  <class class=".person.Demographics">
    <require
       permission="schooltool.view"
       interface=".interfaces.IDemographics"
       />
    <require
       permission="schooltool.edit"
       set_schema=".interfaces.IDemographics"
       />
  </class>

  <class class=".person.SchoolData">
    <require
       permission="schooltool.view"
       interface=".interfaces.ISchoolData"
       />
    <require
       permission="schooltool.edit"
       set_schema=".interfaces.ISchoolData"
       />
  </class>

  <class class=".person.ContactInfo">
    <require
       permission="schooltool.view"
       interface=".interfaces.IContactInfo"
       />
    <require
       permission="schooltool.edit"
       set_schema=".interfaces.IContactInfo"
       />
  </class>

  <!-- sample data -->
  <configure
      xmlns:zcml="http://namespaces.zope.org/zcml"
      zcml:condition="have devmode">

    <utility
        factory=".sampledata.SamplePersonalEvents"
        provides="schooltool.sampledata.interfaces.ISampleDataPlugin"
        name="personal_events"
        />
  </configure>

  <include package=".browser" />

</configure>
