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

  <include package=".reader" />

  <browser:resourceDirectory name="ftw.book-resources" directory="resources" />
  <browser:resourceDirectory name="ftw.book-select2" directory="select2-3.4.5" />

  <adapter factory=".simplelayout.ChapterConfigAdapter" />

  <browser:page
      for="ftw.book.contents.chapter.IChapterSchema"
      name="simplelayout-view"
      permission="zope2.View"
      class=".simplelayout.ChapterSimplelayoutView"
      />

  <browser:page
      for="ftw.book.interfaces.IChapter"
      name="block_view"
      template="templates/chapter.pt"
      class=".blockview.BookChapterView"
      permission="zope2.View"
      />

  <browser:page
      for="ftw.book.interfaces.IBookTextBlock"
      name="block_view"
      class=".blockview.BookTextBlockView"
      permission="zope2.View"
      />

  <browser:page
      for="ftw.book.interfaces.IHTMLBlock"
      name="block_view"
      class=".blockview.HTMLBlockView"
      permission="zope2.View"
      />

  <browser:page
      for="ftw.book.interfaces.IBookFileListingBlock"
      name="block_view"
      permission="zope2.View"
      class=".blockview.BookFileListingBlockView"
      />

  <browser:page
      for="ftw.book.interfaces.ITable"
      name="block_view"
      template="templates/table.pt"
      permission="zope2.View"
      />

  <browser:page
      for="ftw.book.interfaces.ITable"
      name="table_export_import"
      class=".table_export_import.TableExportImport"
      permission="zope.Public"
      template="templates/table_export_import.pt"
      />

  <browser:page
      for="..interfaces.IBook"
      name="book_view"
      class=".book_view.BookView"
      template="templates/book_view.pt"
      permission="zope2.View"
      />

  <browser:page
      for="..interfaces.IBook"
      name="index_view"
      class=".index_view.IndexView"
      permission="zope2.View"
      />

  <configure zcml:condition="installed ftw.tabbedview">
    <browser:page
        for="Products.CMFCore.interfaces._content.IFolderish"
        name="tabbed_book_view"
        class=".tabbed_book_view.BooksView"
        permission="zope2.View"
        allowed_attributes="listing"
        />
    <browser:page
        for="Products.CMFCore.interfaces._content.IFolderish"
        name="tabbedview_view-books"
        class=".tabbed_book_view.BooksTab"
        permission="zope2.View"
        />
    <browser:page
        for="ftw.book.interfaces.IBook"
        name="tabbedview_view-index"
        class=".book_tabs.IndexTab"
        permission="zope2.View"
        />
    <browser:page
        for="ftw.book.interfaces.IBook"
        name="tabbedview_view-bookdocuments"
        class=".book_tabs.DocumentsTab"
        permission="zope2.View"
        />
    <browser:page
        for="ftw.book.interfaces.IBook"
        name="tabbedview_view-keywords"
        class=".keywords.KeywordsTab"
        permission="zope2.View"
        allowed_attributes="load macros"
        />
  </configure>

</configure>
