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

  <page
      name="index.html"
      for="schooltool.basicperson.interfaces.IBasicPerson"
      class=".person.PersonView"
      permission="schooltool.view"
      menu="schooltool_actions"
      title="View"
      />

  <page
      name="edit.html"
      for="schooltool.basicperson.interfaces.IBasicPerson"
      class=".person.PersonEditView"
      permission="schooltool.edit"
      menu="schooltool_actions"
      title="Edit"
      />

  <page
      name="person_export.xml"
      for="schooltool.person.interfaces.IPersonContainer"
      class=".xml.PersonContainerXMLExportView"
      permission="schooltool.edit"
      menu="schooltool_actions"
      title="Export Persons as XML"
      />

  <page
      name="person_export.xml"
      for="schooltool.person.interfaces.IPerson"
      class=".xml.PersonXMLExportView"
      permission="schooltool.edit"
      menu="schooltool_actions"
      title="Export"
      />

  <page
      name="advisors.html"
      for="schooltool.basicperson.interfaces.IBasicPerson"
      class=".person.PersonAdvisorView"
      permission="schooltool.edit"
      menu="schooltool_actions"
      title="Advisors"
      />

  <page
      name="advisees.html"
      for="schooltool.basicperson.interfaces.IBasicPerson"
      class=".person.PersonAdviseeView"
      permission="schooltool.edit"
      menu="schooltool_actions"
      title="Advisees"
      />

  <!-- list of persons -->
  <zope:adapter
      for="schooltool.basicperson.interfaces.IBasicPersonSource
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory=".person.PersonTerms"
      />

  <!-- list of groups -->
  <zope:adapter
      for="schooltool.basicperson.interfaces.IGroupSource
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory=".person.GroupTerms"
      />

  <!-- person add form adapter -->
  <zope:adapter factory=".person.PersonAddFormAdapter" />

  <!-- Person xml export plugins -->
  <zope:adapter
      for="zope.interface.Interface
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory=".xml.PersonGroupDataExporterPlugin"
      name="person_group_relationships"
      provides=".interfaces.IPersonDataExporterPlugin"/>

  <zope:adapter
      for="zope.interface.Interface
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory=".xml.GroupDataExporterPlugin"
      name="group_list"
      provides=".interfaces.IExtraDataExporterPlugin"/>

  <page
     name="add.html"
     for="schooltool.person.interfaces.IPersonContainer"
     class=".person.PersonAddView"
     permission="schooltool.edit"
     menu="schooltool_actions" title="New Person"
     layer=".skin.IBasicPersonLayer" />
  <page
     name="person-csvimport.html"
     for="schooltool.person.interfaces.IPersonContainer"
     class=".csvimport.BasicPersonCSVImportView"
     template="templates/person-csvimport.pt"
     permission="schooltool.edit"
     layer=".skin.IBasicPersonLayer" />

  <zope:adapter
     factory=".person.UsernameValidator" />

  <!-- DEMOGRAPHICS -->
  <configure package="schooltool.skin">

    <navigationViewlet
      name="demographics"
      for="*"
      manager="schooltool.app.browser.interfaces.IManageMenuViewletManager"
      template="templates/navigationViewlet.pt"
      class="schooltool.skin.skin.NavigationViewlet"
      permission="schooltool.edit"
      link="demographics"
      title="Demographics"
      order="15"
      />

  </configure>

  <zope:adapterTraverserPlugin
     for="schooltool.app.interfaces.ISchoolToolApplication"
     layer="zope.publisher.interfaces.http.IHTTPRequest"
     name="demographics"
     adapter="schooltool.basicperson.demographics.IDemographicsFields"
     permission="zope.Public"
     />

  <page
     name="index.html"
     for="schooltool.basicperson.interfaces.IDemographicsFields"
     class=".demographics.DemographicsView"
     template="templates/demographics-view.pt"
     permission="schooltool.edit"
     />

  <page
     name="addText.html"
     for="schooltool.basicperson.interfaces.IDemographicsFields"
     class=".demographics.TextFieldDescriptionAddView"
     permission="schooltool.edit"
     menu="schooltool_actions" title="New Text Field" />

  <page
     name="addDate.html"
     for="schooltool.basicperson.interfaces.IDemographicsFields"
     class=".demographics.DateFieldDescriptionAddView"
     permission="schooltool.edit"
     menu="schooltool_actions" title="New Date Field" />

  <page
     name="addEnum.html"
     for="schooltool.basicperson.interfaces.IDemographicsFields"
     class=".demographics.EnumFieldDescriptionAddView"
     permission="schooltool.edit"
     menu="schooltool_actions" title="New Selection List Field" />

  <page
     name="edit.html"
     for="schooltool.basicperson.demographics.TextFieldDescription"
     class=".demographics.FieldDescriptionEditView"
     permission="schooltool.edit"
     menu="schooltool_actions" title="Edit" />

  <page
     name="edit.html"
     for="schooltool.basicperson.demographics.DateFieldDescription"
     class=".demographics.FieldDescriptionEditView"
     permission="schooltool.edit"
     menu="schooltool_actions" title="Edit" />

  <page
     name="edit.html"
     for="schooltool.basicperson.demographics.EnumFieldDescription"
     class=".demographics.EnumFieldDescriptionEditView"
     permission="schooltool.edit"
     menu="schooltool_actions" title="Edit" />

  <page
     name="index.html"
     for="schooltool.basicperson.demographics.TextFieldDescription"
     class=".demographics.TextFieldDescriptionView"
     permission="schooltool.view"
     menu="schooltool_actions" title="View" />

  <page
     name="index.html"
     for="schooltool.basicperson.demographics.DateFieldDescription"
     class=".demographics.DateFieldDescriptionView"
     permission="schooltool.view"
     menu="schooltool_actions" title="View" />

  <page
     name="index.html"
     for="schooltool.basicperson.demographics.EnumFieldDescription"
     class=".demographics.EnumFieldDescriptionView"
     permission="schooltool.view"
     menu="schooltool_actions" title="View" />

  <zope:adapter
      factory=".demographics.DemographicsFieldsAbsoluteURLAdapter"
      provides="zope.traversing.browser.interfaces.IAbsoluteURL" />

  <zope:adapter
      factory=".demographics.DemographicsFieldsAbsoluteURLAdapter"
      provides="zope.interface.Interface"
      name="absolute_url"/>

  <zope:adapter
      factory=".demographics.CustomEnumDataConverter" />

  <resourceDirectory
      name="jstree"
      directory="resources/jstree"
      layer=".skin.IBasicPersonLayer" />

  <resource
      name="jquery.js"
      file="resources/jstree/jquery.min.js"
      layer=".skin.IBasicPersonLayer" />

</configure>
