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

  <!-- layers -->

  <class class=".skill.Skill">
    <implements
        interface="zope.annotation.interfaces.IAttributeAnnotatable" />
    <require
        permission="schooltool.edit"
        set_schema=".interfaces.ISkill" />
    <require
        permission="schooltool.view"
        interface=".interfaces.ISkill" />
    <!-- XXX: hack to bypass GradebookOverview checks -->
    <require
        permission="schooltool.view"
        attributes="scoresystem" />
  </class>

  <class class=".skill.SkillSet">
    <require
        permission="schooltool.view"
        interface="zope.interface.common.mapping.IEnumerableMapping" />
    <require
        permission="schooltool.view"
        attributes="title label description"
        />
    <require
        permission="schooltool.edit"
        interface="zope.interface.common.mapping.IWriteMapping"
        set_schema=".interfaces.ISkillSet"
        />
  </class>

  <class class=".skill.SkillSetContainer">
    <allow interface="zope.container.interfaces.ISimpleReadContainer" />
    <require permission="schooltool.view"
             attributes="keys values items __iter__ __len__ has_key" />
    <require permission="schooltool.edit"
             interface="zope.container.interfaces.IWriteContainer" />
  </class>

  <adapter
      for="schooltool.app.interfaces.ISchoolToolApplication"
      factory=".skill.SkillInit"
      name="schooltool.cando.skill" />

  <adapter
      factory=".skill.SkillAppStartup"
      name="schooltool.cando.skill" />

  <adapter
      for="schooltool.app.interfaces.ISchoolToolApplication"
      factory=".skill.getSkillSetContainer" />

  <adapter
      factory=".skill.ScoreSystemAppStartup"
      name="schooltool.cando.skill.scoresystem" />

  <adapterTraverserPlugin
      for="schooltool.course.interfaces.ISection"
      layer="zope.publisher.interfaces.http.IHTTPRequest"
      name="skills"
      adapter="schooltool.cando.interfaces.ISectionSkills"
      />

  <adapter
      factory=".skill.SkillCatalog"
      name="schooltool.cando.skill.SkillCatalog" />

  <adapter
      for=".interfaces.ISkillSetContainer"
      provides="zope.catalog.interfaces.ICatalog"
      factory=".skill.getSkillCatalog" />

  <adapter factory=".skill.SearchableTextSkill" />

</configure>
