<?xml version="1.0"?>

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

  <include file="security.zcml" />

  <adapter
      for=".interfaces.IHaveRequirement"
      provides=".interfaces.IRequirement"
      factory=".requirement.getRequirement"
      trusted="true"
      />

  <adapter
      for=".interfaces.IHaveEvaluations"
      provides=".interfaces.IEvaluations"
      factory=".evaluation.getEvaluations"
      trusted="true"
      />

  <view
      name="requirement" type="*"
      provides="zope.traversing.interfaces.ITraversable"
      for="schooltool.requirement.interfaces.IHaveRequirement"
      factory=".requirement.requirementNamespace"
      />
  <adapter
      name="requirement"
      provides="zope.traversing.interfaces.ITraversable"
      for="schooltool.requirement.interfaces.IHaveRequirement"
      factory=".requirement.requirementNamespace"
      />

  <!-- Requirement Content -->

  <class class=".requirement.Requirement">
    <allow interface="zope.app.container.interfaces.ISimpleReadContainer" />
    <require
        permission="schooltool.view"
        attributes="keys __iter__ values items __len__ addBase removeBase title"
        />
    <require
        permission="schooltool.edit"
        set_schema=".interfaces.IRequirement"
        />
    <require
        permission="schooltool.edit"
        interface="zope.app.container.interfaces.IWriteContainer"
        />
  </class>

  <!-- Scoresystem Content -->

  <class class=".scoresystem.DiscreteValuesScoreSystem">
    <require
        permission="zope.View"
        interface=".interfaces.IDiscreteValuesScoreSystem"
        />
    <require
        permission="schooltool.edit"
        set_schema=".interfaces.IScoreSystem"
        />
  </class>

  <class class=".scoresystem.GlobalDiscreteValuesScoreSystem">
    <require
        permission="zope.View"
        interface=".interfaces.IDiscreteValuesScoreSystem"
        />
    <require
        permission="schooltool.edit"
        set_schema=".interfaces.IScoreSystem"
        />
  </class>

  <class class=".scoresystem.RangedValuesScoreSystem">
    <require
        permission="zope.View"
        interface=".interfaces.IRangedValuesScoreSystem"
        />
    <require
        permission="schooltool.edit"
        set_schema=".interfaces.IScoreSystem"
        />
  </class>

  <class class=".scoresystem.GlobalRangedValuesScoreSystem">
    <require
        permission="zope.View"
        interface=".interfaces.IRangedValuesScoreSystem"
        />
    <require
        permission="schooltool.edit"
        set_schema=".interfaces.IScoreSystem"
        />
  </class>

  <!-- Score System registrations -->

  <utility
      provides="zope.schema.interfaces.IVocabularyFactory"
      component="schooltool.requirement.scoresystem.ScoreSystemsVocabulary"
      name="schooltool.requirement.scoresystems"
      />

  <utility
      provides="schooltool.requirement.interfaces.IScoreSystem"
      component="schooltool.requirement.scoresystem.PassFail"
      name="Pass/Fail"
      />

  <utility
      provides="schooltool.requirement.interfaces.IScoreSystem"
      component="schooltool.requirement.scoresystem.AmericanLetterScoreSystem"
      name="Letter Grade"
      />

  <utility
      provides="schooltool.requirement.interfaces.IScoreSystem"
      component="
          schooltool.requirement.scoresystem.ExtendedAmericanLetterScoreSystem"
      name="Extended Letter Grade"
      />

  <utility
      provides="schooltool.requirement.interfaces.IScoreSystem"
      component="schooltool.requirement.scoresystem.PercentScoreSystem"
      name="Percent"
      />

  <utility
      provides="schooltool.requirement.interfaces.IScoreSystem"
      component="schooltool.requirement.scoresystem.HundredPointsScoreSystem"
      name="100 Points"
      />

  <!-- Evaluations Content -->

  <class class=".evaluation.Evaluations">
    <require
        permission="schooltool.edit"
        interface=".interfaces.IEvaluations"
        />
  </class>

  <class class=".evaluation.Evaluation">
    <require
	permission="schooltool.view"
	interface=".interfaces.IEvaluation"
	/>
    <require
        permission="schooltool.edit"
        set_schema=".interfaces.IEvaluation"
        />
  </class>

  <!-- These declarations should go somewhere else eventually -->

  <class class="schooltool.app.app.SchoolToolApplication">
    <implements
        interface="schooltool.requirement.interfaces.IHaveRequirement" />
  </class>

  <class class="schooltool.course.course.Course">
    <implements interface=".interfaces.IHaveRequirement" />
  </class>

  <class class="schooltool.course.section.Section">
    <implements interface=".interfaces.IHaveRequirement" />
  </class>

  <class class="schooltool.person.person.Person">
    <implements interface=".interfaces.IHaveEvaluations" />
  </class>

  <include package=".browser" />

</configure>
