<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:browser="http://namespaces.zope.org/browser"
    xmlns:zcml="http://namespaces.zope.org/zcml"
    i18n_domain="plone.app.dexterity">
    
    <!-- Default view for Dexterity types in Plone  4 -->
    <configure zcml:condition="have plone-4">
      <browser:page
          for="plone.dexterity.interfaces.IDexterityItem"
          name="view"
          class="plone.dexterity.browser.view.DefaultView"
          template="item.pt"
          permission="zope2.View"
          />
    
      <browser:page
          for="plone.dexterity.interfaces.IDexterityContainer"
          name="view"
          class="plone.dexterity.browser.view.DefaultView"
          template="container.pt"
          permission="zope2.View"
          />
    </configure>

    <!-- Default view for Dexterity types in Plone  3 -->
    <configure zcml:condition="not-have plone-4">
      <browser:page
          for="plone.dexterity.interfaces.IDexterityItem"
          name="view"
          class="plone.dexterity.browser.view.DefaultView"
          template="plone3-item.pt"
          permission="zope2.View"
          />
    
      <browser:page
          for="plone.dexterity.interfaces.IDexterityContainer"
          name="view"
          class="plone.dexterity.browser.view.DefaultView"
          template="plone3-container.pt"
          permission="zope2.View"
          />
    </configure>

    <!-- Control panel -->

    <browser:page
        name="dexterity-types"
        for="Products.CMFPlone.interfaces.IPloneSiteRoot"
        class=".types.TypesContext"
        permission="plone.schemaeditor.ManageSchemata"
        allowed_interface="OFS.interfaces.IItem" />
    
    <adapter
        factory=".types.TypeSettingsAdapter"
        provides="..interfaces.ITypeSettings"
        for="plone.dexterity.interfaces.IDexterityFTI"
        />
    
    <adapter
        factory=".types.TypeStatsAdapter"
        provides="..interfaces.ITypeStats"
        for="plone.dexterity.interfaces.IDexterityFTI"
        />

    <browser:page
        name="edit"
        for="plone.app.dexterity.interfaces.ITypesContext"
        class=".types.TypesListingPage"
        permission="plone.schemaeditor.ManageSchemata" />
    
    <browser:page
        name="add-type"
        for="plone.app.dexterity.interfaces.ITypesContext"
        class=".add_type.TypeAddFormPage"
        permission="plone.schemaeditor.ManageSchemata"
        />
    
    <browser:page
        name="edit"
        for="plone.app.dexterity.interfaces.ITypeSchemaContext"
        class=".edit_type.TypeEditPage"
        permission="plone.schemaeditor.ManageSchemata" />
    
    <browser:page
        name="behaviors"
        for="plone.app.dexterity.interfaces.ITypeSchemaContext"
        class=".behaviors.BehaviorsFormPage"
        permission="plone.schemaeditor.ManageSchemata" />

    <browser:page
        name="clone"
        for="plone.app.dexterity.interfaces.ITypeSchemaContext"
        class=".clone_type.TypeCloneFormPage"
        permission="plone.schemaeditor.ManageSchemata" />

    <browser:page
        name="types-export"
        for="plone.app.dexterity.interfaces.ITypesContext"
        class=".export.TypesExport"
        permission="plone.schemaeditor.ManageSchemata"
        />

    <browser:page
        name="models-export"
        for="plone.app.dexterity.interfaces.ITypesContext"
        class=".export.ModelsExport"
        permission="plone.schemaeditor.ManageSchemata"
        />

    <!-- overlay CSS (only needed in Plone 3) -->
    <configure zcml:condition="not-have plone-4">
      <browser:resource
          name="plone.app.dexterity.overlays.css"
          file="overlays.css"
          />
    </configure>
    <configure zcml:condition="have plone-4">
      <browser:resource
          name="plone.app.dexterity.overlays.css"
          file="blank.css"
          />
    </configure>

</configure>
