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

  <!-- Skills and skillsets -->

  <flourish:activeViewlet
      name="manage_school"
      manager="schooltool.skin.flourish.page.IHeaderNavigationManager"
      for="schooltool.cando.interfaces.ISkillSetContainer"
      />

  <flourish:activeViewlet
      name="manage_school"
      manager="schooltool.skin.flourish.page.IHeaderNavigationManager"
      for="schooltool.cando.interfaces.ILayerContainer"
      />

  <flourish:activeViewlet
      name="manage_school"
      manager="schooltool.skin.flourish.page.IHeaderNavigationManager"
      for="schooltool.cando.interfaces.INodeContainer"
      />

  <flourish:activeViewlet
      name="manage_school"
      manager="schooltool.skin.flourish.page.IHeaderNavigationManager"
      view=".model.LayersView"
      />

  <flourish:activeViewlet
      name="manage_school"
      manager="schooltool.skin.flourish.page.IHeaderNavigationManager"
      view=".model.NodesView"
      />

  <flourish:page
      name="index.html"
      for="schooltool.cando.interfaces.ISkillSetContainer"
      class=".skill.SkillSetContainerView"
      permission="schooltool.view"
      title="Skill Sets"
      />

  <flourish:viewlet
      name="table"
      class=".skill.SkillSetTable"
      for="schooltool.cando.interfaces.ISkillSetContainer"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="filter"
      manager=".skill.SkillSetTable"
      class=".skill.SkillSetTableFilter"
      render="template"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="table"
      class=".skill.SkillSetSkillTable"
      for="schooltool.cando.interfaces.ISkillSet"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="filter"
      before="batch table"
      class="schooltool.table.table.DoNotFilter"
      manager=".skill.SkillSetSkillTable"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="done"
      before="table batch"
      after="filter"
      manager=".skill.SkillSetTable"
      view=".skill.SkillSetContainerView"
      class="schooltool.app.browser.app.ManageItemDoneLink"
      render="template"
      permission="schooltool.view"
      />

  <zope:adapterTraverserPlugin
      for="schooltool.app.interfaces.ISchoolToolApplication"
      layer="zope.publisher.interfaces.browser.IBrowserRequest"
      name="skills"
      adapter="schooltool.cando.interfaces.ISkillSetContainer"
      />

  <zope:adapter
      factory=".skill.SkillSetContainerAbsoluteURLAdapter"
      provides="zope.traversing.browser.interfaces.IAbsoluteURL" />

  <zope:adapter
      factory=".skill.SkillSetContainerAbsoluteURLAdapter"
      provides="zope.interface.Interface"
      name="absolute_url"/>

  <flourish:viewlet
      name="skillset_container"
      manager="schooltool.skin.flourish.page.IPageRefineManager"
      class=".skill.SkillSetContainerLinks"
      for="schooltool.cando.interfaces.ISkillSetContainer"
      title="Add"
      permission="schooltool.edit"
      view=".skill.SkillSetContainerView"
      />

  <flourish:viewlet
      name="skillset_container_actions"
      manager="schooltool.skin.flourish.page.IPageRefineManager"
      class=".skill.SkillSetContainerActionLinks"
      for="schooltool.cando.interfaces.ISkillSetContainer"
      title="Actions"
      permission="schooltool.edit"
      view=".skill.SkillSetContainerView"
      />

  <flourish:viewlet
      name="add.html"
      title="Skill Set"
      class="schooltool.skin.flourish.page.LinkViewlet"
      manager=".skill.SkillSetContainerLinks"
      permission="schooltool.edit"
      />

  <flourish:page
      name="add.html"
      for="schooltool.cando.interfaces.ISkillSetContainer"
      class=".skill.SkillSetAddView"
      title="Skills"
      subtitle="New Skill Set"
      content_template="templates/form.pt"
      permission="schooltool.edit"
      />

  <flourish:page
      name="edit.html"
      for="schooltool.cando.interfaces.ISkillSet"
      class=".skill.SkillSetEditView"
      subtitle="Edit"
      content_template="templates/form.pt"
      permission="schooltool.edit"
      />

  <flourish:page
      name="index.html"
      for="schooltool.cando.interfaces.ISkillSet"
      class=".skill.SkillSetView"
      content_template="templates/skillset.pt"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="skillset_links"
      manager="schooltool.skin.flourish.page.IPageRefineManager"
      class=".skill.SkillSetLinks"
      for="schooltool.cando.interfaces.ISkillSet"
      title="Add"
      permission="schooltool.edit"
      />

  <flourish:viewlet
      name="add.html"
      title="Skill"
      class="schooltool.skin.flourish.page.LinkViewlet"
      manager=".skill.SkillSetLinks"
      view=".skill.SkillSetView"
      permission="schooltool.edit"
      />


  <flourish:page
      name="add.html"
      for="schooltool.cando.interfaces.ISkillSet"
      class=".skill.SkillAddView"
      subtitle="New Skill"
      content_template="templates/form.pt"
      permission="schooltool.edit"
      />

  <flourish:page
      name="index.html"
      for="schooltool.cando.interfaces.ISkill"
      class=".skill.SkillView"
      subtitle="View Skill"
      content_template="templates/skill.pt"
      permission="schooltool.view"
      />

  <flourish:page
      name="edit.html"
      for="schooltool.cando.interfaces.ISkill"
      class=".skill.SkillEditView"
      subtitle="Edit"
      content_template="templates/form.pt"
      permission="schooltool.edit"
      />

  <!-- Course skills -->

  <flourish:viewlet
      name="manage-course-skills"
      after="manage-course-worksheets"
      for="schooltool.course.interfaces.ICourse"
      view="schooltool.course.browser.course.FlourishCourseView"
      permission="schooltool.edit"
      manager="schooltool.skin.flourish.page.IPageContentManager"
      class=".course.CourseSkillsOverview"
      />

  <zope:adapterTraverserPlugin
      for="schooltool.course.interfaces.ICourse"
      layer="schooltool.skin.flourish.IFlourishLayer"
      name="skills"
      adapter="schooltool.cando.interfaces.ICourseSkills"
      permission="schooltool.view"
      />

  <flourish:page
      name="index.html"
      for="schooltool.cando.interfaces.ICourseSkills"
      class=".course.CourseSkillsView"
      permission="schooltool.view"
      subtitle="Assigned Skills"
      />

  <flourish:viewlet
      name="cando-resources"
      view=".course.CourseSkillsView"
      manager="schooltool.skin.flourish.page.IPageContentManager"
      template="templates/cando_resources.pt"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="table"
      class=".course.CourseSkillsTable"
      for="schooltool.cando.interfaces.ICourseSkills"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="filter"
      before="batch table"
      class="schooltool.table.table.DoNotFilter"
      manager=".course.CourseSkillsTable"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="course_skills"
      manager="schooltool.skin.flourish.page.IPageRefineManager"
      class=".course.CourseSkillsLinks"
      for="schooltool.cando.interfaces.ICourseSkills"
      title="Actions"
      permission="schooltool.edit"
      view=".course.CourseSkillsView"
      />

  <flourish:viewlet
      name="assign-skills.html"
      title="Assign Skills"
      class="schooltool.skin.flourish.page.LinkViewlet"
      manager=".course.CourseSkillsLinks"
      permission="schooltool.edit"
      />

  <flourish:viewlet
      name="remove-skills.html"
      after="assign-skills.html"
      title="Remove Skills"
      class=".course.RemoveSkillsLinkViewlet"
      manager=".course.CourseSkillsLinks"
      permission="schooltool.edit"
      />

  <flourish:viewlet
      name="edit-skills.html"
      after="remove-skills.html"
      title="Set Required/Visible"
      class=".course.EditSkillsLinkViewlet"
      manager=".course.CourseSkillsLinks"
      permission="schooltool.edit"
      />

  <flourish:viewlet
      name="cando-resources"
      view=".course.CourseRemoveSkillsView"
      manager="schooltool.skin.flourish.page.IPageContentManager"
      template="templates/cando_resources.pt"
      permission="schooltool.view"
      />

  <flourish:page
      name="edit-skills.html"
      subtitle="Set Required/Visible"
      for="schooltool.cando.interfaces.ICourseSkills"
      class=".course.EditCourseSkillsView"
      permission="schooltool.edit"
      />

  <flourish:viewlet
      name="cando-resources"
      view=".course.EditCourseSkillsView"
      manager="schooltool.skin.flourish.page.IPageContentManager"
      template="templates/cando_resources.pt"
      permission="schooltool.view"
      />

  <flourish:page
      name="assign-skillsets.html"
      for="schooltool.cando.interfaces.ICourseSkills"
      class=".course.CourseAssignSkillSetsDialog"
      template="templates/course_assign_skillsets_dialog.pt"
      permission="schooltool.edit"
      />

  <flourish:viewlet
      name="available_table"
      class=".course.AvailableSkillSetTable"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      view=".course.CourseAssignSkillSetView"
      permission="schooltool.view"
      />

  <flourish:page
      name="assign.html"
      for="schooltool.cando.interfaces.ICourseSkills"
      class=".course.CourseAssignSkillSetView"
      title="Skills"
      subtitle="Assign Skill Set"
      permission="schooltool.edit"
      />

  <flourish:page
      name="assign-skills.html"
      for="schooltool.cando.interfaces.ICourseSkills"
      class=".course.CourseAssignSkillsView"
      subtitle="Assign Skills"
      permission="schooltool.edit"
      />

  <flourish:page
      name="remove-skills.html"
      for="schooltool.cando.interfaces.ICourseSkills"
      class=".course.CourseRemoveSkillsView"
      subtitle="Remove Skills"
      permission="schooltool.edit"
      />

  <flourish:viewlet
      name="nodes_table"
      class=".course.SkillsetNodesTable"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      view=".course.CourseAssignSkillsView"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="filter"
      before="batch table"
      class=".course.SkillsetNodesTableFilter"
      manager=".course.SkillsetNodesTable"
      render="template"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="cando-resources"
      view=".course.CourseAssignSkillsView"
      manager="schooltool.skin.flourish.page.IPageContentManager"
      template="templates/cando_resources.pt"
      permission="schooltool.view"
      />

  <flourish:page
      name="index.html"
      for="schooltool.cando.interfaces.ICourseSkillSet"
      class=".course.CourseSkillSetView"
      subtitle="Assigned Skills"
      content_template="templates/course_skillset.pt"
      permission="schooltool.view"
      />

  <flourish:page
      name="edit.html"
      for="schooltool.cando.interfaces.ICourseSkillSet"
      class=".course.CourseSkillSetEditView"
      subtitle="Edit Skills"
      content_template="templates/course_skills_edit.pt"
      permission="schooltool.edit"
      />

  <flourish:viewlet
      name="cando-resources"
      view=".course.CourseSkillSetEditView"
      manager="schooltool.skin.flourish.page.IPageContentManager"
      template="templates/cando_resources.pt"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="table"
      class=".course.CourseSkillSetSkillTable"
      for="schooltool.cando.interfaces.ICourseSkillSet"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="filter"
      before="batch table"
      class="schooltool.table.table.DoNotFilter"
      manager=".course.CourseSkillSetSkillTable"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="table_edit"
      class=".course.CourseEditSkillSetSkillsTable"
      for="schooltool.cando.interfaces.ICourseSkillSet"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      permission="schooltool.edit"
      />

  <flourish:viewlet
      name="filter"
      before="batch table"
      class="schooltool.table.table.DoNotFilter"
      manager=".course.CourseEditSkillSetSkillsTable"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="buttons"
      after="table"
      manager=".course.CourseEditSkillSetSkillsTable"
      template="templates/course_skills_edit_table_buttons.pt"
      permission="schooltool.edit"
      />

  <flourish:page
      name="index.html"
      for="schooltool.cando.interfaces.ICourseSkill"
      class=".course.CourseSkillView"
      subtitle="View Skill"
      content_template="templates/skill.pt"
      permission="schooltool.view"
      />

  <!-- Layers -->

  <zope:adapter
      factory=".model.LayerContainerAbsoluteURLAdapter"
      provides="zope.traversing.browser.interfaces.IAbsoluteURL" />

  <zope:adapter
      factory=".model.LayerContainerAbsoluteURLAdapter"
      provides="zope.interface.Interface"
      name="absolute_url"/>

  <zope:adapterTraverserPlugin
      for="schooltool.app.interfaces.ISchoolToolApplication"
      layer="zope.publisher.interfaces.browser.IBrowserRequest"
      name="layers"
      adapter="schooltool.cando.interfaces.ILayerContainer"
      />

  <flourish:page
      name="index.html"
      for="schooltool.cando.interfaces.ILayerContainer"
      title="Layers Container"
      class=".model.LayersView"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="table"
      class=".model.LayersTable"
      for="schooltool.cando.interfaces.ILayerContainer"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="done"
      before="table batch"
      after="filter"
      manager=".model.LayersTable"
      view=".model.LayersView"
      class="schooltool.app.browser.app.ManageItemDoneLink"
      render="template"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="layers-add-links"
      manager="schooltool.skin.flourish.page.IPageRefineManager"
      class=".model.LayersAddLinks"
      title="Add"
      permission="schooltool.edit"
      view=".model.LayersView"
      />

  <flourish:viewlet
      name="add.html"
      title="Layer"
      view=".model.LayersView"
      class="schooltool.skin.flourish.page.LinkViewlet"
      manager=".model.LayersAddLinks"
      permission="schooltool.edit"
      />

  <flourish:page
      name="add.html"
      for="schooltool.cando.interfaces.ILayerContainer"
      class="schooltool.cando.browser.model.FlourishLayerAddView"
      content_template="templates/form.pt"
      permission="schooltool.edit"
      title="Layers Container"
      subtitle="Add Layer"
      />

  <flourish:page
      name="index.html"
      for="schooltool.cando.interfaces.ILayer"
      class=".model.LayerView"
      subtitle="View Layer"
      content_template="templates/layer.pt"
      permission="schooltool.view"
      />

  <flourish:page
      name="edit.html"
      for="schooltool.cando.interfaces.ILayer"
      class=".model.LayerEditView"
      subtitle="Edit"
      content_template="templates/form.pt"
      permission="schooltool.edit"
      />

  <flourish:page
      name="edit_children.html"
      for="schooltool.cando.interfaces.ILayer"
      class=".model.EditChildLayersView"
      subtitle="Edit Children"
      permission="schooltool.edit"
      />

  <flourish:viewlet
      name="available_table"
      class=".model.AvailableChildLayersTable"
      for="schooltool.cando.interfaces.ILayer"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      view=".model.EditChildLayersView"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="current_table"
      class=".model.RemoveChildLayersTable"
      for="schooltool.cando.interfaces.ILayer"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      view=".model.EditChildLayersView"
      permission="schooltool.view"
      />

  <!-- Nodes -->

  <zope:adapter
      factory=".model.NodeContainerAbsoluteURLAdapter"
      provides="zope.traversing.browser.interfaces.IAbsoluteURL" />

  <zope:adapter
      factory=".model.NodeContainerAbsoluteURLAdapter"
      provides="zope.interface.Interface"
      name="absolute_url"/>

  <zope:adapterTraverserPlugin
      for="schooltool.app.interfaces.ISchoolToolApplication"
      layer="zope.publisher.interfaces.browser.IBrowserRequest"
      name="nodes"
      adapter="schooltool.cando.interfaces.INodeContainer"
      />

  <flourish:page
      name="index.html"
      for="schooltool.cando.interfaces.INodeContainer"
      title="Nodes Container"
      subtitle="Search"
      class=".model.NodesView"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="table"
      class=".model.NodesTable"
      for="schooltool.cando.interfaces.INodeContainer"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="filter"
      before="batch table"
      class=".model.NodesTableFilter"
      manager=".model.NodesTable"
      render="template"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="done"
      before="table batch"
      after="filter"
      manager=".model.NodesTable"
      view=".model.NodesView"
      class="schooltool.app.browser.app.ManageItemDoneLink"
      render="template"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="nodes-add-links"
      manager="schooltool.skin.flourish.page.IPageRefineManager"
      class=".model.NodesAddLinks"
      title="Add"
      permission="schooltool.edit"
      view=".model.NodesView"
      />

  <flourish:viewlet
      name="add.html"
      title="Node"
      view=".model.NodesView"
      class="schooltool.skin.flourish.page.LinkViewlet"
      manager=".model.NodesAddLinks"
      permission="schooltool.edit"
      />

  <flourish:page
      name="add.html"
      for="schooltool.cando.interfaces.INodeContainer"
      class="schooltool.cando.browser.model.FlourishNodeAddView"
      content_template="templates/form.pt"
      permission="schooltool.edit"
      title="Nodes Container"
      subtitle="Add Node"
      />

  <flourish:page
      name="index.html"
      for="schooltool.cando.interfaces.INode"
      class=".model.NodeView"
      subtitle="View Node"
      content_template="templates/node.pt"
      permission="schooltool.view"
      />

  <flourish:page
      name="edit.html"
      for="schooltool.cando.interfaces.INode"
      class=".model.NodeEditView"
      subtitle="Edit"
      content_template="templates/form.pt"
      permission="schooltool.edit"
      />

  <flourish:page
      name="edit_children.html"
      for="schooltool.cando.interfaces.INode"
      class=".model.EditChildNodesView"
      subtitle="Edit Children"
      permission="schooltool.edit"
      />

  <flourish:viewlet
      name="available_table"
      class=".model.AvailableChildNodesTable"
      for="schooltool.cando.interfaces.INode"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      view=".model.EditChildNodesView"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="current_table"
      class=".model.RemoveChildNodesTable"
      for="schooltool.cando.interfaces.INode"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      view=".model.EditChildNodesView"
      permission="schooltool.view"
      />

  <flourish:page
      name="edit_layers.html"
      for="schooltool.cando.interfaces.INode"
      class=".model.EditNodeLayersView"
      subtitle="Edit Layers"
      permission="schooltool.edit"
      />

  <flourish:viewlet
      name="available_table"
      class=".model.AvailableNodeLayersTable"
      for="schooltool.cando.interfaces.INode"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      view=".model.EditNodeLayersView"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="current_table"
      class=".model.RemoveNodeLayersTable"
      for="schooltool.cando.interfaces.INode"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      view=".model.EditNodeLayersView"
      permission="schooltool.view"
      />

  <flourish:page
      name="edit_skillsets.html"
      for="schooltool.cando.interfaces.INode"
      class=".model.EditNodeSkillSetsView"
      subtitle="Edit SkillSets"
      permission="schooltool.edit"
      />

  <flourish:viewlet
      name="available_table"
      class=".model.AvailableNodeSkillSetsTable"
      for="schooltool.cando.interfaces.INode"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      view=".model.EditNodeSkillSetsView"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="current_table"
      class=".model.RemoveNodeSkillSetsTable"
      for="schooltool.cando.interfaces.INode"
      manager="schooltool.skin.flourish.interfaces.IAJAXParts"
      view=".model.EditNodeSkillSetsView"
      permission="schooltool.view"
      />

  <!-- All objects imported using global importer -->

  <configure package="schooltool.export">

    <flourish:viewlet
        name="import-skills.html"
        after="import.html"
        title="Import Skill Data"
        class="schooltool.skin.flourish.page.LinkViewlet"
        manager="schooltool.app.browser.app.SchoolActionsLinks"
        permission="schooltool.edit"
        />

    <flourish:page
       name="import-skills.html"
       title="Skills"
       subtitle="Import Skill Data"
       for="schooltool.app.interfaces.ISchoolToolApplication"
       content_template="templates/f_import.pt"
       class="schooltool.cando.browser.importer.GlobalSkillsMegaImporter"
       permission="schooltool.edit" />

  </configure>

  <include file="document.zcml" />
  <include file="report.zcml" />
  <include file="gradebook.zcml" />
  <include file="breadcrumbs.zcml" />

  <flourish:viewlet
      name="courses-actions-links"
      after="courses-add-links"
      before="course-import-links"
      manager="schooltool.skin.flourish.page.IPageRefineManager"
      class=".course.CanDoCoursesActionsLinks"
      view="schooltool.course.browser.course.FlourishCoursesView"
      title="Actions"
      permission="schooltool.edit"
      />

  <flourish:viewlet
      name="assign-courses-skills.html"
      title="Batch Assign Skills"
      class=".course.BatchAssignSkillsLinkViewlet"
      manager=".course.CanDoCoursesActionsLinks"
      permission="schooltool.edit"
      />

  <flourish:page
      name="assign-courses-skills.html"
      subtitle="Assign Courses Skills"
      for="schooltool.course.interfaces.ICourseContainer"
      class="schooltool.cando.browser.course.CoursesSkillsAssignmentView"
      permission="schooltool.edit"
      />

</configure>
