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

  <include package="zope.app.zcmlfiles" />
  <include package="zope.login" />
  <include package="zope.password" />
  <include package="zope.viewlet" file="meta.zcml" />
  <include package="zope.mimetype" file="meta.zcml"/>
  <include package="zc.resourcelibrary" file="meta.zcml"/>
  <include package="schooltool.securitypolicy" file="meta.zcml" />
  <include package="schooltool.skin" file="meta.zcml" />
  <include package="z3c.form" file="meta.zcml" />
  <include package="z3c.macro" file="meta.zcml" />
  <include package="z3c.template" file="meta.zcml" />
  <include package="schooltool.traverser" file="meta.zcml" />

  <include package="zope.session" />
  <include package="zope.app.server" />
  <include package="zope.contentprovider" />
  <include package="zope.viewlet" />
  <include package="zope.formlib" />
  <include package="zope.keyreference" />
  <include package="zope.intid" />
  <include package="zope.catalog" />
  <include package="zope.mimetype" />
  <include package="zope.html" />
  <include package="z3c.form" />
  <include package="z3c.formui" />
  <include package="z3c.macro"/>

  <include package="zope.location" />

  <!-- set up an adapter from zope.i18n locale to a zope.ucol collator -->

  <adapter
      for="zope.i18n.interfaces.locales.ILocale"
      provides="zope.i18n.interfaces.locales.ICollator "
      factory="zope.ucol.localeadapter.LocaleCollator"
      />

  <!-- pull in some configuration needed by schooltool. -->
  <include package="zc.resourcelibrary" file="configure.zcml" />
  <include package="zc.table" file="configure.zcml" />
  <include package="zc.catalog" file="configure.zcml" />
  <include package="hurry.query" file="configure.zcml" />
  <include package="zc.datetimewidget" file="configure.zcml" />
  <includeOverrides package="zc.datetimewidget" file="overrides.zcml" />

  <!-- set up zope3 security -->
  <unauthenticatedPrincipal id="zope.anybody" title="Unauthenticated User" />
  <unauthenticatedGroup id="zope.Anybody" title="Unauthenticated Users" />
  <authenticatedGroup id="zope.Authenticated" title="Authenticated Users" />
  <everybodyGroup id="zope.Everybody" title="All Users" />

  <!-- set up custom security policy -->
  <include package="schooltool.securitypolicy"/>

  <!-- Support Online Help -->

  <include package="zope.app.renderer" />
  <include package="zope.app.file" />
  <include package="zope.app.onlinehelp" file="meta.zcml" />
  <include package="zope.app.onlinehelp" />

  <!-- Load devmode-specific Zope and SchoolTool packages -->

  <configure
      xmlns:zcml="http://namespaces.zope.org/zcml"
      zcml:condition="have devmode">
    <include package="zope.app.apidoc" file="meta.zcml" />
    <include package="zope.app.preference" file="meta.zcml" />
    <include package="zope.app.apidoc" />
    <include package="zope.app.preference" />
    <include package="zope.app.renderer" />
    <include package="zope.app.tree" />
    <include package="schooltool.sampledata" />
    <include package="schooltool.setupdata" />
  </configure>

  <!-- Translations -->

  <i18n:registerTranslations directory="../locales" />

  <!-- Permissions -->

  <permission id="schooltool.view" title="View" />
  <permission id="schooltool.edit" title="Edit Info" />
  <permission id="schooltool.add" title="Add Info" />
  <permission id="schooltool.editCalendarOverlays" title="Edit Calendar Overlays" />

  <!-- Utilities -->

  <utility
      name="schooltool"
      provides="zope.app.generations.interfaces.ISchemaManager"
      component="schooltool.generations.schemaManager"
      />

  <!-- *Core* sub-packages -->

  <include package="schooltool.skin" />
  <include package="schooltool.relationship" />
  <include package="schooltool.app" />
  <include package="schooltool.course" />
  <include package="schooltool.person" />
  <include package="schooltool.contact" />
  <include package="schooltool.demographics" />
  <include package="schooltool.group" />
  <include package="schooltool.resource" />
  <include package="schooltool.term" />
  <include package="schooltool.schoolyear" />
  <include package="schooltool.securitypolicy.browser" />
  <include package="schooltool.export" />
  <include package="schooltool.table" />
  <include package="schooltool.email" />
  <include package="schooltool.level" />

  <adapter
      for="zope.interface.Interface
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory="schooltool.table.table.NullTableFormatter " />

</configure>
