<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:browser="http://namespaces.zope.org/browser"
    xmlns:plone="http://namespaces.plone.org/plone"
    i18n_domain="senaite.databox">

  <!-- Needed for cmf.AddPortalContent permission -->
  <include package="Products.CMFCore" file="permissions.zcml" />

  <!-- Package includes -->
  <include package=".theme"/>
  <include package=".viewlets"/>

  <browser:page
      name="view"
      for="senaite.databox.content.databoxfolder.IDataBoxFolder"
      class="senaite.databox.browser.folder_view.DataBoxFolderView"
      permission="zope2.View"
      />

  <browser:page
      name="view"
      for="senaite.databox.content.databox.IDataBox"
      class="senaite.databox.browser.view.DataBoxView"
      permission="zope2.View"
      />

  <browser:page
      name="export_to_csv"
      for="senaite.databox.content.databox.IDataBox"
      class="senaite.databox.browser.view.DataBoxView"
      attribute="export_to_csv"
      permission="zope2.View"
      />

  <browser:page
      name="export_to_excel"
      for="senaite.databox.content.databox.IDataBox"
      class="senaite.databox.browser.view.DataBoxView"
      attribute="export_to_excel"
      permission="zope2.View"
      />

  <browser:page
      name="edit"
      for="senaite.databox.content.databox.IDataBox"
      class="senaite.databox.browser.edit.DataBoxEdit"
      permission="zope2.View"
      />

  <browser:page
      name="update"
      for="senaite.databox.content.databox.IDataBox"
      class="senaite.databox.browser.form.FormController"
      permission="cmf.ModifyPortalContent"
      />

  <!-- Add view and form - invoked from ++add++ traverser -->
  <adapter
      for="Products.CMFCore.interfaces.IFolderish
           zope.publisher.interfaces.browser.IDefaultBrowserLayer
           plone.dexterity.interfaces.IDexterityFTI"
      provides="zope.publisher.interfaces.browser.IBrowserPage"
      factory=".add.AddView"
      name="DataBox"/>

  <class class=".add.AddView">
    <require
        permission="cmf.AddPortalContent"
        interface="zope.publisher.interfaces.browser.IBrowserPage"/>
  </class>

  <!-- Static directory for js, css and image resources -->
  <plone:static
      directory="static"
      type="plone"
      name="senaite.databox.static"
      />

</configure>
