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

  <!-- this is a test whether five:traversable can be called more than
       once on a class; SimpleContent inherits from api.Viewable, so
       one directive suffices here -->

  <five:traversable class=".simplecontent.SimpleContent" />

  <five:defaultViewable class=".simplecontent.SimpleContent" />

  <!-- this is a test whether the *directive* can be called -->
  <!-- more than once without raising a conflicting -->
  <!-- configuration exception -->

  <five:traversable class=".simplecontent.SimpleContent" />

  <five:defaultViewable class=".simplecontent.SimpleContent" />

  <browser:defaultView
      for=".interfaces.ISimpleContent"
      name="eagle.txt"
      />

  <!-- this tests whether five:traversable can be called on a class that
       already provides __bobo_traverse__, such as our FancyContent -->

  <five:traversable class=".fancycontent.FancyContent" />


  <!-- this tests whether five:defaultViewable can be called on a class that
       already provides __call__, such as our
       CallableSimpleContent
  -->

  <five:defaultViewable class=".simplecontent.CallableSimpleContent" />

  <!-- five:pagesFromDirectory loads all .pt files in a directory as pages.
       This is mainly used to load Zope2 skin templates so they can be used
       in five skins and layers. -->
  <five:pagesFromDirectory
      module="Products.Five.tests.products.FiveTest"
      directory="pages"
      />

  <browser:defaultView
      for=".interfaces.ICallableSimpleContent"
      name="__call__"
      />

  <!-- this tests whether five:defaultViewable can be called on a class that
       already provides index_html, such as our
       IndexSimpleContent
  -->

  <five:defaultViewable class=".simplecontent.IndexSimpleContent" />

  <browser:defaultView
      for=".interfaces.IIndexSimpleContent"
      name="index_html"
      />

  <adapter
      for=".interfaces.IAdaptable"
      provides=".interfaces.IAdapted"
      factory=".classes.Adapter"
      />

  <!-- attribute page -->
  <browser:page
      for=".interfaces.ISimpleContent"
      class=".browser.SimpleContentView"
      attribute="eagle"
      name="eagle.txt"
      permission="zope2.ViewManagementScreens"
      />

  <browser:page
      for=".interfaces.ISimpleContent"
      class=".browser.SimpleContentView"
      name="eagle.method"
      permission="zope2.ViewManagementScreens"
      allowed_attributes="eagle"
      />

  <browser:page
      for=".interfaces.IFancyContent"
      class=".browser.FancyContentView"
      attribute="view"
      name="fancy"
      permission="zope2.Public"
      />

  <browser:pages
      for=".interfaces.ISimpleContent"
      class=".browser.NoDocstringView"
      permission="zope2.Public">
    <browser:page
        name="nodoc-method"
        attribute="method"
        />
    <browser:page
        name="nodoc-function"
        attribute="function"
        />
    <browser:page
        name="nodoc-object"
        attribute="object"
        />
  </browser:pages>

  <!-- attribute page -->
  <browser:pages
      for=".interfaces.ISimpleContent"
      class=".browser.SimpleContentView"
      permission="zope2.ViewManagementScreens"
      >
    <browser:page
        name="eagle-page.txt"
        attribute="eagle"
        />
    <browser:page
        name="mouse-page.txt"
        attribute="mouse"
        />
  </browser:pages>

  <!-- template/class page -->
  <browser:page
      for=".interfaces.ISimpleContent"
      class=".browser.SimpleContentView"
      template="falcon.pt"
      name="falcon.html"
      permission="zope2.ViewManagementScreens"
      />

  <!-- template page (with simple python expression) -->
  <browser:page
      for=".interfaces.ISimpleContent"
      template="owl.pt"
      name="owl.html"
      permission="zope2.ViewManagementScreens"
      />

  <!-- template page which calls on context using python -->
  <browser:page
      for=".interfaces.ISimpleContent"
      template="flamingo.pt"
      name="flamingo.html"
      permission="zope2.ViewManagementScreens"
      />

  <!-- template page which calls on context using path -->
  <browser:page
      for=".interfaces.ISimpleContent"
      template="flamingo2.pt"
      name="flamingo2.html"
      permission="zope2.ViewManagementScreens"
      />

  <!-- template/class page which calls on context, view, views -->
  <browser:page
      for=".interfaces.ISimpleContent"
      class=".browser.SimpleContentView"
      template="condor.pt"
      name="condor.html"
      permission="zope2.ViewManagementScreens"
      />

  <!-- test TALES -->
  <browser:page
      for=".interfaces.ISimpleContent"
      template="ostrich.pt"
      name="ostrich.html"
      permission="zope2.ViewManagementScreens"
      />

  <browser:page
      for=".interfaces.ISimpleContent"
      template="ostrich2.pt"
      name="ostrich2.html"
      permission="zope2.ViewManagementScreens"
      />

  <browser:page
      for=".interfaces.ISimpleContent"
      template="tales_traversal.pt"
      name="tales_traversal.html"
      permission="zope2.ViewManagementScreens"
      />

  <!-- template security -->

  <browser:page
      for=".interfaces.ISimpleContent"
      template="security.pt"
      name="security.html"
      permission="zope2.View"
      />

  <!-- macro page -->
  <browser:page
      for=".interfaces.ISimpleContent"
      template="bird.pt"
      name="bird.pt"
      permission="zope2.ViewManagementScreens"
      />

  <!-- macro aggregation page -->
  <browser:page
      for="*"
      name="fivetest_macros"
      permission="zope2.View"
      class=".browser.StandardMacros"
      allowed_interface="zope.interface.common.mapping.IItemMapping"
      />

  <browser:page
      for=".interfaces.ISimpleContent"
      template="bird.pt"
      name="bird_macros"
      permission="zope2.ViewManagementScreens"
      />

  <browser:page
      for=".interfaces.ISimpleContent"
      template="dog.pt"
      name="dog_macros"
      permission="zope2.ViewManagementScreens"
      />


  <!-- template page that uses macro page -->
  <browser:page
      for=".interfaces.ISimpleContent"
      class=".browser.SimpleContentView"
      template="seagull.pt"
      name="seagull.html"
      permission="zope2.ViewManagementScreens"
      />

  <browser:page
      for=".interfaces.ISimpleContent"
      class=".browser.SimpleContentView"
      template="parakeet.pt"
      name="parakeet.html"
      permission="zope2.ViewManagementScreens"
      />

  <!-- a publicly accessible page, attribute, template, template/class -->

  <browser:page
      for=".interfaces.ISimpleContent"
      class=".browser.SimpleContentView"
      attribute="eagle"
      name="public_attribute_page"
      permission="zope2.Public"
      />

  <browser:page
      for=".interfaces.ISimpleContent"
      template="owl.pt"
      name="public_template_page"
      permission="zope2.Public"
      />

  <browser:page
      for=".interfaces.ISimpleContent"
      class=".browser.SimpleContentView"
      template="falcon.pt"
      name="public_template_class_page"
      permission="zope2.Public"
      />


  <!-- a couple simple resources -->
  <browser:resource
      template="cockatiel.pt"
      name="cockatiel.html"
      permission="zope2.ViewManagementScreens"
      />

  <browser:resource
      file="style.css"
      name="style.css"
      permission="zope2.ViewManagementScreens"
      />

  <browser:resource
      image="pattern.png"
      name="pattern.png"
      permission="zope2.ViewManagementScreens"
      />

  <browser:resourceDirectory
      name="fivetest_resources"
      directory="."
      permission="zope2.ViewManagementScreens"
      />

  <!-- browser forms -->
  <five:traversable class=".simplecontent.FieldSimpleContent" />

  <browser:editform
      schema=".interfaces.IFieldSimpleContent"
      for=".interfaces.IFieldSimpleContent"
      name="edit.html"
      permission="zope2.Public"
      />
      
  <browser:editform
      schema=".interfaces.ISimpleContent"
      for=".interfaces.ISimpleContent"
      name="protectededitform.html"
      permission="zope2.ViewManagementScreens"
      />

  <five:traversable class=".schemacontent.ComplexSchemaContent" />

  <browser:editform
      schema=".interfaces.IComplexSchemaContent"
      for=".interfaces.IComplexSchemaContent"
      name="edit.html"
      permission="zope2.Public"
      class=".browser.ComplexSchemaView"
      />

  <view
      type="zope.publisher.interfaces.browser.IBrowserRequest"
      for="zope.schema.interfaces.IObject"
      provides="zope.app.form.interfaces.IInputWidget"
      factory="zope.app.form.browser.objectwidget.ObjectWidget"
      permission="zope.Public"
      />

  <!-- With a widget override -->
  <browser:editform
      schema=".interfaces.IFieldSimpleContent"
      for=".interfaces.IFieldSimpleContent"
      name="widgetoverride.html"
      permission="zope2.Public"
      >
      
      <widget
         field="description"
         class="zope.app.form.browser.TextAreaWidget"
         />
         
  </browser:editform>
      
  <five:traversable class=".helpers.FiveTraversableFolder" />
  
  <browser:addform
     schema=".interfaces.IFieldSimpleContent"
     content_factory=".simplecontent.FieldSimpleContent"
     name="addfieldcontent.html"
     permission="zope2.Public"
     />
     
  <browser:addform
     schema=".interfaces.IFieldSimpleContent"
     content_factory=".simplecontent.FieldSimpleContent"
     name="addwidgetoverride.html"
     permission="zope2.Public">

     <widget
         field="description"
         class="zope.app.form.browser.TextAreaWidget"
         />
         
  </browser:addform>

  <browser:addform
     schema=".interfaces.IFieldSimpleContent"
     content_factory=".simplecontent.FieldSimpleContent"
     name="protectedaddform.html"
     permission="zope2.ViewManagementScreens"
     />

  <!-- stuff that we'll override in overrides.zcml -->

  <browser:page
      for=".interfaces.ISimpleContent"
      class=".browser.SimpleContentView"
      attribute="eagle"
      name="overridden_view"
      permission="zope2.Public"
      />

  <adapter
      for=".interfaces.IOrigin"
      provides=".interfaces.IDestination"
      factory=".classes.OriginalAdapter"
      />

  <!-- browser:page directives with new style classes are ignored -->

  <browser:page
      for=".interfaces.ISimpleContent"
      class=".browser.NewStyleClass"
      name="invalid_page"
      attribute="method"
      permission="zope2.Public"
      />

  <!-- browser menu support -->
  <browser:menu
      id="testmenu"
      title="Test menu" />

  <browser:menuItem
      for=".interfaces.ISimpleContent"
      menu="testmenu"
      title="Test Menu Item"
      action="seagull.html"
      description="This is a test menu item"
      permission="zope2.Public"
      />

  <browser:menuItems
      for=".interfaces.ISimpleContent"
      menu="testmenu">

      <menuItem
          title="Test Menu Item 2"
          action="parakeet.html"
          description="This is a test menu item"
          permission="zope2.Public"
          />

      <menuItem
          title="Test Menu Item 3"
          action="falcon.html"
          description="This is a test menu item"
          permission="zope2.Public"
          />

  </browser:menuItems>

  <!-- page in a menu -->
  <browser:page
      for=".interfaces.ISimpleContent"
      class=".browser.SimpleContentView"
      template="parakeet.pt"
      name="parakeet_beyond.html"
      permission="zope2.ViewManagementScreens"
      title="A page based entry"
      menu="testmenu"
      />

  <browser:editform
      schema=".interfaces.IFieldSimpleContent"
      for=".interfaces.IFieldSimpleContent"
      name="edit2.html"
      permission="zope2.Public"
      title="An edit form based entry"
      menu="testmenu"
      />

  <!-- register size adapters -->

  <five:sizable
      class=".simplecontent.SimpleContent"
      />

  <five:sizable
      class=".fancycontent.FancyContent"
      />

  <adapter
      for=".interfaces.ISimpleContent"
      provides="zope.app.size.interfaces.ISized"
      factory=".size.SimpleContentSize"
      />

  <adapter
      for=".interfaces.IFancyContent"
      provides="zope.app.size.interfaces.ISized"
      factory=".size.FancyContentSize"
      />

  <!-- subscribe to all events -->
  <five:sendEvents
      class=".simplecontent.SimpleContent"
      />

  <subscriber
      factory=".subscriber.objectEventSubscriber"
      for="zope.app.event.interfaces.IObjectEvent"
     />

  <subscriber
      factory=".subscriber.objectMovedEventSubscriber"
      for="zope.app.container.interfaces.IObjectMovedEvent"
      />

  <subscriber
      factory=".subscriber.objectAddedEventSubscriber"
      for="zope.app.container.interfaces.IObjectAddedEvent"
      />

  <subscriber
      factory=".subscriber.objectCopiedEventSubscriber"
      for="zope.app.event.interfaces.IObjectCopiedEvent"
      />

  <subscriber
      factory=".subscriber.objectRemovedEventSubscriber"
      for="zope.app.container.interfaces.IObjectRemovedEvent"
      />

  <!-- Testing the vocabulary directive -->
  <vocabulary
     name="aVocabulary"
     factory="zope.schema.tests.test_vocabulary.SampleVocabulary"
     />

  <!-- testing that products meta.zcml statements are picked up. -->
  <five:parrot
      class=".metaconfigure.NorwegianBlue"
      name="Polly"
      />
      
  <!-- as new style classes are ignored, zope.app.form.browser
       can be imported -->
  <include package="zope.app.form.browser"/>

</configure>
