<!-- $Id$ -->

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

  <icon
      name="zmi_icon"
      for="loops.interfaces.ILoopsObject"
      file="loops_icon.gif"
      />

  <!-- resources -->

  <resource name="loops.css" file="loops.css" />
  <resource name="loops.js" file="loops.js" />

  <!-- new style pages -->

  <page for="loops.interfaces.INode"
        name="index.html"
        class="loops.browser.node.NodeView"
        permission="zope.Public"
        />

  <page for="loops.interfaces.INode"
        name="main.html"
        class="loops.browser.node.NodeView"
        permission="zope.Public"
        />

  <!-- macros -->

  <page
      for="*"
      name="loops_macros"
      permission="zope.View"
      class=".macros.Macros"
      allowed_interface="zope.interface.common.mapping.IItemMapping"
      />

  <page
      for="*"
      name="node_macros"
      template="node_macros.pt"
      permission="zope.View"
      />

  <page
      for="*"
      name="concept_macros"
      template="concept_macros.pt"
      permission="zope.View"
      />

  <page
      for="*"
      name="relation_macros"
      template="relation_macros.pt"
      permission="zope.View"
      />

  <page
      for="*"
      name="target_macros"
      template="target_macros.pt"
      permission="zope.View"
      />

  <page
      for="*"
      name="resource_macros"
      template="resource_macros.pt"
      permission="zope.View"
      />

  <!-- named templates - forms and macro templates -->

  <zope:adapter
      factory="loops.browser.util.pageform"
      for="zope.interface.Interface"
      name="loops.pageform" />

  <!--<zope:adapter
      factory="loops.browser.util.dataform"
      for="zope.interface.Interface"
      name="loops.dataform" />-->

  <zope:adapter
      factory="loops.browser.util.concept_macros"
      for="loops.browser.common.BaseView"
      name="loops.concept_macros" />

  <zope:adapter
      factory="loops.browser.util.node_macros"
      for="loops.browser.common.BaseView"
      name="loops.node_macros" />

  <!-- loops top-level container -->

  <page
      name="AddLoopsContainer.html"
      for="zope.app.container.interfaces.IAdding"
      class="loops.browser.manager.LoopsAddForm"
      permission="zope.ManageApplication"
      />

  <addMenuItem
      class="loops.base.Loops"
      title="loops Container"
      description="A top-level loops container"
      permission="zope.ManageContent"
      view="AddLoopsContainer.html"
      />

  <containerViews
      for="loops.interfaces.ILoops"
      contents="zope.ManageContent"
      add="zope.ManageContent"
      />

  <page
      name="edit.html"
      for="loops.interfaces.ILoops"
      class="loops.browser.manager.LoopsEditForm"
      permission="zope.ManageApplication"
      menu="zmi_views" title="Edit"
      />

  <!-- concept manager -->

  <addform
      label="Add Concept Manager"
      name="AddLoopsConceptManager.html"
      schema="loops.interfaces.IConceptManager"
      content_factory="loops.concept.ConceptManager"
      template="add.pt"
      permission="zope.ManageContent"
      />

  <!--<addMenuItem
      class="loops.concept.ConceptManager"
      title="Concept Manager"
      description="A concept manager manages concepts"
      permission="zope.ManageContent"
      view="AddLoopsConceptManager.html"
      />-->

  <containerViews
      for="loops.interfaces.IConceptManager"
      add="zope.ManageContent"
      />

  <!-- concept -->

  <addform
      label="Add Concept"
      name="AddLoopsConcept.html"
      schema="loops.interfaces.IConcept"
      content_factory="loops.concept.Concept"
      fields="title conceptType"
      template="add.pt"
      permission="zope.ManageContent"
      />

  <addMenuItem
      class="loops.concept.Concept"
      title="Concept"
      description="A Concept is a Concept is a Concept..."
      permission="zope.ManageContent"
      view="AddLoopsConcept.html"
      />

  <pages
      for="loops.interfaces.IConcept"
      class=".concept.ConceptConfigureView"
      permission="zope.ManageContent">

    <page
        name="configure.html"
        template="concept_related.pt"
        menu="zmi_views" title="Related Concepts"
        />

    <page
        name="resources.html"
        template="concept_resources.pt"
        menu="zmi_views" title="Resources"
        />

  </pages>

  <page
      name="edit.html"
      for="loops.interfaces.IConcept"
      class="loops.browser.concept.ConceptEditForm"
      permission="zope.ManageContent"
      menu="zmi_views" title="Edit"
      />

  <page
      name="concept.html"
      for="loops.interfaces.IConcept"
      class=".concept.ConceptView"
      template="concept.pt"
      permission="zope.View"
      menu="zmi_views" title="View"
      />

  <defaultView
      for="loops.interfaces.IConcept"
      name="concept.html"
      />

  <zope:adapter
      for="loops.interfaces.IConcept
           zope.publisher.interfaces.browser.IBrowserRequest"
      provides="zope.interface.Interface"
      factory="loops.browser.concept.ConceptView"
      permission="zope.View"
      />

  <zope:adapter
      name="folder.html"
      for="loops.interfaces.IConcept
           zope.publisher.interfaces.browser.IBrowserRequest"
      provides="zope.interface.Interface"
      factory="loops.browser.folder.FolderView"
      permission="zope.View"
      />

  <!-- resource manager -->

  <addform
      label="Add Resource Manager"
      name="AddLoopsResourceManager.html"
      schema="loops.interfaces.IResourceManager"
      content_factory="loops.resource.ResourceManager"
      template="add.pt"
      permission="zope.ManageContent"
      />

  <!--<addMenuItem
      class="loops.resource.ResourceManager"
      title="Resource Manager"
      description="A resource manager manages resources"
      permission="zope.ManageContent"
      view="AddLoopsResourceManager.html"
      />-->

  <containerViews
      for="loops.interfaces.IResourceManager"
      add="zope.ManageContent"
      />

  <!-- resource in general -->

  <page
      for="loops.interfaces.IResource"
      name="index.html"
      permission="zope.View"
      class=".resource.ResourceView"
      attribute="show" />

  <page
      for="loops.interfaces.IResource"
      name="download.html"
      permission="zope.View"
      class=".resource.ResourceView"
      attribute="download" />

  <zope:adapter
      for="loops.interfaces.IResource
           zope.publisher.interfaces.browser.IBrowserRequest"
      provides="zope.interface.Interface"
      factory="loops.browser.resource.ResourceView"
      permission="zope.View"
      />

  <pages
      for="loops.interfaces.IResource"
      class=".resource.ResourceConfigureView"
      permission="zope.ManageContent">

    <page
        name="configure.html"
        template="resource_configure.pt"
        menu="zmi_views" title="Configure"
        />

  </pages>

  <page
      name="edit.html"
      for="loops.interfaces.IResource"
      class="loops.browser.resource.ResourceEditForm"
      permission="zope.ManageContent"
      menu="zmi_views" title="Edit"
      />

  <!-- suppress the upload menu item: -->
  <menuItem
      for="loops.interfaces.IResource"
      menu="zmi_views" action="upload.html" title="Upload"
      filter="nothing"
      />

  <!-- document -->

  <page
      for="loops.interfaces.IDocument"
      name="index.html"
      permission="zope.View"
      class=".resource.DocumentView"
      attribute="show" />

  <page
      name="edit.html"
      for="loops.interfaces.IDocument"
      class="loops.browser.resource.DocumentEditForm"
      permission="zope.ManageContent"
      menu="zmi_views" title="Edit"
      />

  <page
      for="loops.interfaces.IResource"
      name="document.html"
      permission="zope.View"
      template="document.pt"
      class=".resource.DocumentView" />

  <menuItem
      for="loops.interfaces.IDocument"
      action="document.html"
      permission="zope.View"
      menu="zmi_views" title="View"
      />

  <zope:adapter
      for="loops.interfaces.IDocument
           zope.publisher.interfaces.browser.IBrowserRequest"
      provides="zope.interface.Interface"
      factory="loops.browser.resource.DocumentView"
      permission="zope.View"
      />

  <zope:adapter
      name="note.html"
      for="loops.interfaces.IResource
           zope.publisher.interfaces.browser.IBrowserRequest"
      provides="zope.interface.Interface"
      factory="loops.browser.resource.NoteView"
      permission="zope.View"
      />

  <!-- view manager -->

  <addform
      label="Add View Manager"
      name="AddLoopsViewManager.html"
      schema="loops.interfaces.IViewManager"
      content_factory="loops.view.ViewManager"
      template="add.pt"
      permission="zope.ManageContent"
      />

  <!--<addMenuItem
      class="loops.view.ViewManager"
      title="View Manager"
      description="A view manager manages views, like nodes, menu items, ..."
      permission="zope.ManageContent"
      view="AddLoopsViewManager.html"
      />-->

  <containerViews
      for="loops.interfaces.IViewManager"
      index="zope.ManageContent"
      add="zope.ManageContent"
      />

  <menuItem
      for="loops.interfaces.IViewManager"
      action="contents.html"
      permission="zope.ManageContent"
      menu="zmi_views" title="Contents"
      />

  <!-- record manager -->

  <containerViews
      for="loops.interfaces.IRecordManager"
      index="zope.ManageContent"
      />

  <menuItem
      for="loops.interfaces.IRecordManager"
      action="contents.html"
      permission="zope.ManageContent"
      menu="zmi_views" title="Contents"
      />

  <!-- import/export - obsolete:
  <pages for="loops.interfaces.IViewManager"
         class=".external.NodesExportImport"
         permission="zope.ManageContent">
    <page name="exportimport.html"
          template="exportimport.pt"
          menu="zmi_views" title="Export/Import"  />
    <page name="export_nodes.html"
          attribute="export" />
  </pages>-->

  <!-- node -->

  <icon
      name="zmi_icon"
      for="loops.interfaces.INode"
      file="node_icon.gif"
      />

  <menuItem
      for="loops.interfaces.INode"
      action="@@contents.html"
      permission="zope.ManageContent"
      menu="zmi_views" title="Contents"
      />

  <!--<containerViews
      for="loops.interfaces.INode"
      index="zope.ManageContent"
      />-->

  <addform
      label="Add Node"
      name="AddLoopsNode.html"
      content_factory="loops.view.Node"
      schema="loops.interfaces.INode"
      fields="title description nodeType viewName body"
      template="add.pt"
      permission="zope.ManageContent">

    <widget field="description" height="2" />
    <widget field="body" height="8" />

  </addform>

  <addMenuItem
      class="loops.view.Node"
      title="Node"
      description="A node provides access to concepts, possibly hierarchically organized"
      permission="zope.ManageContent"
      view="AddLoopsNode.html"
      />

  <editform
      label="Edit Node"
      name="edit.html"
      schema="loops.interfaces.INode"
      fields="title description nodeType viewName body"
      for="loops.interfaces.INode"
      template="edit.pt"
      permission="zope.ManageContent"
      menu="zmi_views" title="Edit Node">

    <widget field="description" height="2" />
    <widget field="body" height="8" />

  </editform>

  <addform
      label="Add Node with Document"
      name="AddLoopsNodeDocument.html"
      content_factory="loops.view.Node"
      schema="loops.interfaces.IDocument"
      fields="title contentType data"
      template="add.pt"
      permission="zope.ManageContent">
  </addform>

  <view
      for="loops.interfaces.INode"
      name="+"
      menu="zmi_actions" title="Add"
      class="loops.browser.node.NodeAdding"
      permission="zope.ManageContent"
      allowed_attributes="addingInfo isSingleMenuItem hasCustomAddView">
    <page name="index.html" template="selectAdd.pt" />
    <page name="action.html" attribute="action" />
  </view>

  <page
      name="configure.html"
      for="loops.interfaces.INode"
      template="node_target.pt"
      class="loops.browser.node.ConfigureView"
      permission="zope.ManageContent"
      />

  <menuItem
      for="loops.interfaces.INode"
      action="@@configure.html"
      permission="zope.ManageContent"
      menu="zmi_views" title="Configure"
      />

  <!--<page
      name="node.html"
      for="loops.interfaces.INode"
      template="node.pt"
      class=".node.NodeView"
      permission="zope.View"
      menu="zmi_views" title="View"
      />-->

  <!--<defaultView
      for="loops.interfaces.INode"
      name="main.html"
      />-->

  <zope:adapter
      name="listpages"
      for="loops.interfaces.INode
           zope.publisher.interfaces.browser.IBrowserRequest"
      provides="zope.interface.Interface"
      factory="loops.browser.node.ListPages"
      permission="zope.View"
      />

  <zope:adapter
      name="listresources"
      for="loops.interfaces.INode
           zope.publisher.interfaces.browser.IBrowserRequest"
      provides="zope.interface.Interface"
      factory="loops.browser.node.ListResources"
      permission="zope.View"
      />

  <zope:adapter
      name="listchildren"
      for="loops.interfaces.INode
           zope.publisher.interfaces.browser.IBrowserRequest"
      provides="zope.interface.Interface"
      factory="loops.browser.node.ListChildren"
      permission="zope.View"
      />

  <page
      name="external_edit"
      for="loops.interfaces.INode"
      class="loops.browser.node.NodeView"
      attribute="externalEdit"
      permission="zope.ManageContent">
  </page>

  <pages for="loops.interfaces.IResource"
         class="loops.browser.resource.ExternalEditorView"
         permission="zope.ManageContent">

    <page name="external_edit" attribute="load" />
    <!--
    <page name="save" attribute="save" />
    <page name="lock" attribute="lock" />
    <page name="unlock" attribute="unlock" />-->

  </pages>

  <!-- forms (end-user view) -->

  <page
      name="create_object.html"
      for="loops.interfaces.INode"
      class="loops.browser.form.CreateObjectForm"
      permission="zope.ManageContent"
      />

  <page
      name="create_object_popup.html"
      for="loops.interfaces.INode"
      class="loops.browser.form.CreateObjectPopup"
      permission="zope.ManageContent"
      />

  <page
      name="edit_object.html"
      for="loops.interfaces.INode"
      class="loops.browser.form.EditObjectForm"
      permission="zope.ManageContent"
      />

  <page
      name="create_concept.html"
      for="loops.interfaces.INode"
      class="loops.browser.form.CreateConceptForm"
      permission="zope.ManageContent"
      />

  <page
      name="edit_concept.html"
      for="loops.interfaces.INode"
      class="loops.browser.form.EditConceptForm"
      permission="zope.ManageContent"
      />

  <page
      name="inner_form.html"
      for="loops.interfaces.INode"
      class="loops.browser.form.InnerForm"
      permission="zope.ManageContent"
      />

  <page
      name="inner_concept_form.html"
      for="loops.interfaces.INode"
      class="loops.browser.form.InnerConceptForm"
      permission="zope.ManageContent"
      />

  <page
      name="inner_concept_edit_form.html"
      for="loops.interfaces.INode"
      class="loops.browser.form.InnerConceptEditForm"
      permission="zope.ManageContent"
      />

  <zope:adapter
      name="create_resource"
      for="loops.browser.node.NodeView
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory="loops.browser.form.CreateObject"
      permission="zope.ManageContent"
      />

  <zope:adapter
      name="edit_resource"
      for="loops.browser.node.NodeView
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory="loops.browser.form.EditObject"
      permission="zope.ManageContent"
      />

  <zope:adapter
      name="create_concept"
      for="loops.browser.node.NodeView
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory="loops.browser.form.CreateConcept"
      permission="zope.ManageContent"
      />

  <zope:adapter
      name="edit_concept"
      for="loops.browser.node.NodeView
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory="loops.browser.form.EditConcept"
      permission="zope.ManageContent"
      />

  <!-- inner HTML views -->

  <page
      name="inline_edit.html"
      for="loops.interfaces.INode"
      class="loops.browser.node.InlineEdit"
      permission="zope.View"
      />

  <page
      name="inline_save"
      for="loops.interfaces.INode"
      class="loops.browser.node.InlineEdit"
      attribute="save"
      permission="zope.ManageContent"
      />

  <!-- render file or image assigned to a node as target -->

  <page
      name="view"
      for="loops.interfaces.INode"
      class=".node.NodeView"
      attribute="targetDefaultView"
      permission="zope.View"
      />

  <page
      name="download.html"
      for="loops.interfaces.INode"
      class=".node.NodeView"
      attribute="targetDownload"
      permission="zope.View"
      />

  <!-- vocabulary, traversing, and other stuff -->

  <zope:adapter factory="loops.browser.common.LoopsTerms"
           for="loops.concept.ConceptTypeSourceList
                zope.publisher.interfaces.browser.IBrowserRequest" />

  <zope:adapter factory="loops.browser.common.LoopsTerms"
           for="loops.concept.PredicateSourceList
                zope.publisher.interfaces.browser.IBrowserRequest" />

  <zope:adapter factory="loops.browser.common.InterfaceTerms"
           for="loops.type.TypeInterfaceSourceList
                zope.publisher.interfaces.browser.IBrowserRequest" />

  <zope:adapter factory="loops.browser.common.LoopsTerms"
           for="loops.resource.ResourceTypeSourceList
                zope.publisher.interfaces.browser.IBrowserRequest" />

  <zope:view factory="loops.browser.node.NodeTraverser"
        for="loops.interfaces.INode"
        type="zope.publisher.interfaces.http.IHTTPRequest"
        provides="zope.publisher.interfaces.browser.IBrowserPublisher"
        allowed_interface="zope.publisher.interfaces.browser.IBrowserPublisher"
        permission="zope.Public" />

  <!-- view configurator stuff -->

  <zope:adapter factory="loops.browser.node.ViewPropertiesConfigurator" />

  <editform
      label="Configure View Properties"
      name="viewconfigure.html"
      schema="loops.interfaces.IViewConfiguratorSchema"
      for="loops.interfaces.INode"
      template="edit.pt"
      permission="zope.ManageContent"
      />

  <menuItem
      for="loops.interfaces.INode"
      action="viewconfigure.html"
      permission="zope.ManageContent"
      menu="zmi_views" title="View Properties"
      filter="python: context.nodeType == 'menu'"
      />

  <zope:adapter
      factory="loops.browser.node.NodeViewConfigurator"
      for="loops.interfaces.INode
           zope.publisher.interfaces.browser.IBrowserRequest"
      provides="cybertools.browser.configurator.IViewConfigurator"
      />

  <!-- manual setup action(s) -->

  <page
      name="setup_loopssite"
      for="loops.interfaces.ILoops"
      class="loops.setup.SetupView"
      attribute="setupLoopsSite"
      permission="zope.ManageSite"
      />

  <include package=".skin" />

</configure>
