<!--
Copyright (c) 2002-2008 Infrae. All rights reserved.
See also LICENSE.txt
-->

<configure 
  xmlns="http://namespaces.zope.org/zope"
  xmlns:browser="http://namespaces.zope.org/browser"
  xmlns:five="http://namespaces.zope.org/five"
  xmlns:silva="http://infrae.com/ns/silvaconf">

  <include package="Products.Silva" />
  <!-- this should be in Five -->
  <utility
     name="Browser Skins"
     component="zope.app.publisher.browser.vocabulary.BrowserSkinsVocabulary"
    />
    
  <!-- default views should be index.html -->
  <browser:defaultView
    for="Products.Silva.interfaces.IContent"
    name="index.html"
  />

  <browser:defaultView
    for="Products.Silva.interfaces.IContainer"
    name="index.html"
  />

  <!-- metadata adapters -->
  
  <adapter
    for="Products.Silva.interfaces.ISilvaObject"
    provides=".interfaces.IMetadata"
    factory=".adapters.metadata.Metadata"
  />

  <adapter
    for="Products.Silva.interfaces.IGhost"
    provides=".interfaces.IMetadata"
    factory=".adapters.metadata.GhostMetadata"
  />

  <adapter
    for="Products.Silva.interfaces.IGhostFolder"
    provides=".interfaces.IMetadata"
    factory=".adapters.metadata.GhostMetadata"
  />
  
  <!-- traverser adapters -->
  
  <adapter
    for="Products.Silva.interfaces.IPublication zope.publisher.interfaces.browser.IBrowserRequest"
    factory=".adapters.traverser.SkinnyTraverser"
    provides="zope.publisher.interfaces.browser.IBrowserPublisher"
    />

  <adapter
    for="Products.Silva.interfaces.IPublication zope.publisher.interfaces.browser.IBrowserRequest"
    factory=".adapters.traverser.ResourceSkinnyTraversable"
    provides="zope.traversing.interfaces.ITraversable"
    name="resource"
   />

  <adapter
    for="Products.Silva.interfaces.IPublication zope.publisher.interfaces.browser.IBrowserRequest"
    factory=".adapters.traverser.ViewSkinnyTraversable"
    provides="zope.traversing.interfaces.ITraversable"
    name="view"
   />

  <!-- tree node adapters -->
  
  <adapter
    for="Products.Silva.interfaces.IContent"
    provides=".interfaces.ITreeNode"
    factory=".adapters.treenode.Node"
  />

  <adapter
    for="Products.Silva.interfaces.IContainer"
    provides=".interfaces.ITreeNode"
    factory=".adapters.treenode.ContainerNode"
  />

  <adapter
    for="Products.Silva.interfaces.IRoot"
    provides=".interfaces.ITreeNode"
    factory=".adapters.treenode.RootNode"
  />

  <!-- absolute url views -->
  
  <view
    for="Products.Silva.interfaces.ISilvaObject"
    factory=".browser.absoluteurl.AbsoluteURL"
    type="zope.publisher.interfaces.http.IHTTPRequest"
    permission="zope.Public"
    provides="zope.traversing.browser.interfaces.IAbsoluteURL"
  />

  <browser:page
    for="Products.Silva.interfaces.ISilvaObject"
    name="absolute_url"
    class=".browser.absoluteurl.AbsoluteURL"
    permission="zope.Public"
    allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
  />

  <view
    for="Products.Silva.interfaces.IRoot"
    factory=".browser.absoluteurl.SiteAbsoluteURL"
    type="zope.publisher.interfaces.http.IHTTPRequest"
    permission="zope.Public"
    provides="zope.traversing.browser.interfaces.IAbsoluteURL"
  />
  
  <browser:page
    for="Products.Silva.interfaces.IRoot"
    name="absolute_url"
    class=".browser.absoluteurl.SiteAbsoluteURL"
    permission="zope.Public"
    allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
  />
  
  <!-- content objects -->

  <silva:extension
    name="SilvaLayout"
    title="SilvaLayout"
    />

  <silva:content
    content=".configobj.LayoutConfiguration"
    icon="www/config.png"
    extension_name="SilvaLayout"
    priority="100"
    />

  <!-- include views -->
  
  <include 
    package=".browser"
  />
  
</configure>
