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

  <!-- Silva permissions -->

  <permission
    id="silva.ReadSilvaContent"
    title="Read Silva content"
    />

  <permission
    id="silva.ChangeSilvaContent"
    title="Change Silva content"
    />

  <permission
    id="silva.ApproveSilvaContent"
    title="Approve Silva content"
    />

  <permission
    id="silva.ChangeSilvaAccess"
    title="Change Silva access"
    />

  <!-- i18n -->
  <i18n:registerTranslations directory="i18n" />

  <include package=".adapters" /> 
  <include package=".browser" />
  <include package=".utility" />

  <!-- define Silva core as the root 'extension' -->
  <silva:extension
    name="Silva"
    title="Silva Core"
    depends=""
    />

  <!-- register content types -->

  <silva:content
    content=".Folder.Folder"
    extension_name="Silva"
    icon="www/silvafolder.gif"
    priority="-5"
    content_factory=".Folder.manage_addFolder"
    />

  <silva:content
    content=".Publication.Publication"
    extension_name="Silva"
    icon="www/silvapublication.gif"
    priority="-5"
    content_factory=".Publication.manage_addPublication"
    />

  <silva:content
    content=".GhostFolder.GhostFolder"
    extension_name="Silva"
    icon="www/silvaghostfolder.gif"
    content_factory=".GhostFolder.manage_addGhostFolder"
    />

  <silva:content
    content=".Image.Image"
    extension_name="Silva"
    icon="www/silvaimage.gif"
    priority="-4"
    content_factory=".Image.manage_addImage"
    />

  <silva:content
    content=".File.File"
    extension_name="Silva"
    icon="www/silvafile.png"
    priority="-3"
    content_factory=".File.manage_addFile"
    />

  <silva:content
    content=".Group.Group"
    extension_name="Silva"
    icon="www/group.png"
    content_factory=".Group.manage_addGroup"
    />

  <silva:content
    content=".VirtualGroup.VirtualGroup"
    extension_name="Silva"
    icon="www/virtual_group.png"
    content_factory=".VirtualGroup.manage_addVirtualGroup"
    />

  <silva:content
    content=".IPGroup.IPGroup"
    extension_name="Silva"
    icon="www/ip_group.png"
    content_factory=".IPGroup.manage_addIPGroup"
    />

  <silva:content
    content=".AutoTOC.AutoTOC"
    extension_name="Silva"
    icon="www/autotoc.png"
    priority="0.2"
    />

  <silva:content
    content=".Indexer.Indexer"
    extension_name="Silva"
    icon="www/silvaindexer.png"
    />

  <silva:versionedcontent
    content=".Link.Link"
    version=".Link.LinkVersion"
    extension_name="Silva"
    icon="www/link.png"
    />
  
  <silva:versionedcontent
    content=".Ghost.Ghost"
    version=".Ghost.GhostVersion"
    extension_name="Silva"
    icon="www/silvaghost.gif"
    content_factory=".Ghost.manage_addGhost"
    version_factory=".Ghost.manage_addGhostVersion"
    />

  <!-- event handlers -->

  <subscriber
     for=".interfaces.ISilvaObject
          zope.app.container.interfaces.IObjectMovedEvent"
     handler=".SilvaObject.object_moved" 
     />

  <subscriber
     for=".interfaces.ISilvaObject
          OFS.interfaces.IObjectWillBeMovedEvent"
     handler=".SilvaObject.object_will_be_moved" 
     />

  <subscriber
     for=".interfaces.ICatalogedVersionedContent
          zope.app.container.interfaces.IObjectMovedEvent"
     handler=".VersionedContent.versionedcontent_moved" 
     />

  <subscriber
     for=".interfaces.ICatalogedVersionedContent
          OFS.interfaces.IObjectWillBeMovedEvent"
     handler=".VersionedContent.versionedcontent_will_be_moved" 
     />

  <subscriber
     for=".interfaces.IRoot
          OFS.interfaces.IObjectWillBeMovedEvent"
     handler=".Root.root_will_be_moved" 
     />

  <subscriber
     for=".interfaces.IRoot
          zope.app.container.interfaces.IObjectMovedEvent"
     handler=".Root.root_moved" 
     />
  
  <subscriber
     for=".interfaces.IFile
          OFS.interfaces.IObjectWillBeMovedEvent"
     handler=".File.file_will_be_moved" 
     />

  <subscriber
     for=".interfaces.IFile
          zope.app.container.interfaces.IObjectMovedEvent"
     handler=".File.file_moved" 
     />
  
  <subscriber
     for=".interfaces.IFile
          OFS.interfaces.IObjectClonedEvent"
     handler=".File.file_cloned" 
     />
  
  <subscriber
     for=".interfaces.IImage
          OFS.interfaces.IObjectWillBeRemovedEvent"
     handler=".Image.image_will_be_removed" 
     />
  
  <subscriber
     for=".interfaces.IImage
          zope.app.container.interfaces.IObjectAddedEvent"
     handler=".Image.image_added" 
     />
  
  <subscriber
     for=".interfaces.IImage
         OFS.interfaces.IObjectClonedEvent"
     handler=".Image.image_cloned" 
     />
  
  <subscriber
     for=".interfaces.IBaseGroup
         OFS.interfaces.IObjectWillBeRemovedEvent"
     handler=".Group.group_will_be_removed" 
     />
    
  <subscriber
     for=".interfaces.IVersion
          zope.app.container.interfaces.IObjectMovedEvent"
     handler=".Version.version_moved"
     />

  <!-- quota support -->

  <subscriber
     for=".interfaces.IAsset
          OFS.interfaces.IObjectWillBeMovedEvent"
     handler=".Asset.asset_moved_update_quota"
     />

  <subscriber
     for=".interfaces.IFolder
          OFS.interfaces.IObjectWillBeMovedEvent"
     handler=".Folder.folder_moved_update_quota"
     />
     
  
</configure>
