<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:five="http://namespaces.zope.org/five"
    xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
    xmlns:i18n="http://namespaces.zope.org/i18n"
    xmlns:profilehook="http://namespaces.zope.org/profilehook"
    xmlns:zcml="http://namespaces.zope.org/zcml"
    i18n_domain="ftw.book">

  <include package="ftw.profilehook" />

  <five:registerPackage package="." initialize=".initialize" />
  <i18n:registerTranslations directory="locales" />

  <include file="permissions.zcml" />
  <include file="resources.zcml" />
  <include package=".behaviors" />
  <include package=".browser" />
  <include package=".contents" />
  <include package=".footnote" />
  <include package=".keyword" />
  <include package=".latex" />
  <include package=".portlets" />
  <include package=".tinymce" />

  <include zcml:condition="installed ftw.lawgiver" file="lawgiver.zcml" />

  <genericsetup:registerProfile
      name="default"
      title="ftw.book"
      directory="profiles/default"
      description=""
      provides="Products.GenericSetup.interfaces.EXTENSION"
      />

  <profilehook:hook
      profile="ftw.book:default"
      handler=".hooks.installed"
      />

  <genericsetup:registerProfile
      name="uninstall"
      title="Uninstall ftw.book"
      directory="profiles/uninstall"
      description=""
      provides="Products.GenericSetup.interfaces.EXTENSION"
      for="Products.CMFPlone.interfaces.IMigratingPloneSiteRoot"
      />

  <profilehook:hook
      profile="ftw.book:uninstall"
      handler=".hooks.uninstalled"
      />

  <include package=".upgrades" />

  <subscriber
      for=".interfaces.IBook
           zope.lifecycleevent.interfaces.IObjectMovedEvent"
      handler=".subscribers.add_navigation_portlet" />

  <subscriber
      for=".interfaces.IBook
           zope.lifecycleevent.interfaces.IObjectAddedEvent"
      handler=".subscribers.add_navigation_portlet" />

  <adapter name="show_in_toc" factory=".indexers.show_in_toc" />

  <!-- https://github.com/4teamwork/ftw.simplelayout/issues/406 -->
  <configure package="ftw.simplelayout.contenttypes.contents">
    <adapter
        factory=".textblock.TextBlockActions"
        name="ftw-book-textblock-actions"
        for="* *"
        />

    <adapter
        factory=".filelistingblock.ListingBlockActions"
        name="ftw-book-filelistingblock-actions"
        for="* *"
        />
  </configure>

  <configure zcml:condition="installed ftw.zipexport">
    <adapter factory=".zipexport.BookZipRepresentation" />
  </configure>

</configure>
