<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:browser="http://namespaces.zope.org/browser"
    xmlns:five="http://namespaces.zope.org/five"
    xmlns:plone="http://namespaces.plone.org/plone"
    i18n_domain="plone.jsonapi.routes">

  <!-- Zope2 initialization -->
  <five:registerPackage package="." initialize=".initialize" />

  <!-- Include meta directives -->
  <include file="meta.zcml"/>

  <!-- Enable/Disable Route Registration on Startup (default: True) -->
  <plone:jsonapi
      register_api_routes="True"
      />

  <!-- CATALOG -->

  <!-- Default catalog adapter -->
  <adapter
      for="*"
      factory=".catalog.Catalog"
      />

  <!-- Default catalog query adapter -->
  <adapter
      for=".interfaces.ICatalog"
      factory=".catalog.CatalogQuery"
      />


  <!-- BATCHING -->

  <!-- Batch adapter for Plone 4.3 Batching -->
  <adapter
      for="*"
      factory=".batch.Batch"
      />

  <!-- Batch adapter for Plone 4.2 Batching -->
  <adapter
      for="ZTUtils.Batch.Batch"
      factory=".batch.Batch42"
      />


  <!-- DATA MANAGERS -->

  <!-- Default Data adapter (AT based content types) -->
  <adapter
      for="*"
      factory=".datamanagers.ATDataManager"
      />

  <!-- Data manager for the Plone site -->
  <adapter
      for="Products.CMFPlone.interfaces.siteroot.IPloneSiteRoot"
      factory=".datamanagers.PortalDataManager"
      />

  <!-- Data manager for catalog brains -->
  <adapter
      for="Products.ZCatalog.interfaces.ICatalogBrain"
      factory=".datamanagers.BrainDataManager"
      />

  <!-- Data manager for Dexterity field manipulation -->
  <adapter
      for="plone.dexterity.interfaces.IDexterityContent"
      factory=".datamanagers.DexterityDataManager"
      />


  <!-- AT FIELD MANAGERS -->

  <!-- Adapter for AT Fields -->
  <adapter
      for="Products.Archetypes.interfaces.field.IField"
      factory=".fieldmanagers.ATFieldManager"
      />

  <!-- Adapter for AT Text Fields -->
  <adapter
      for="Products.Archetypes.interfaces.field.ITextField"
      factory=".fieldmanagers.TextFieldManager"
      />

  <!-- Adapter for AT DateTime Field -->
  <adapter
      for="Products.Archetypes.interfaces.field.IDateTimeField"
      factory=".fieldmanagers.DateTimeFieldManager"
      />

  <!-- Adapter for AT File Field -->
  <adapter
      for="Products.Archetypes.interfaces.field.IFileField"
      factory=".fieldmanagers.FileFieldManager"
      />

  <!-- Adapter for AT Reference Field -->
  <adapter
      for="Products.Archetypes.interfaces.field.IReferenceField"
      factory=".fieldmanagers.ReferenceFieldManager"
      />


  <!-- ZOPE SCHEMA FIELD MANAGERS -->

  <!-- Adapter for Zope Schema Fields -->
  <adapter
      for="zope.schema.interfaces.IField"
      factory=".fieldmanagers.ZopeSchemaFieldManager"
      />

  <!-- Adapter for Rich Text Fields Fields -->
  <adapter
      for="plone.app.textfield.interfaces.IRichText"
      factory=".fieldmanagers.RichTextFieldManager"
      />

  <!-- Adapter for Named File Fields -->
  <adapter
      for="plone.namedfile.interfaces.INamedFileField"
      factory=".fieldmanagers.NamedFileFieldManager"
      />

  <!-- Adapter for Named Image Fields -->
  <adapter
      for="plone.namedfile.interfaces.INamedImageField"
      factory=".fieldmanagers.NamedImageFieldManager"
      />


  <!-- DATA PROVIDERS -->

  <!-- Default data provider (AT based content types) -->
  <adapter
      for="*"
      factory=".dataproviders.ATDataProvider"
      />

  <!-- Data provider for catalog brains -->
  <adapter
      for="Products.ZCatalog.interfaces.ICatalogBrain"
      factory=".dataproviders.ZCDataProvider"
      />

  <!-- Data provider for the Plone site -->
  <adapter
      for="Products.CMFCore.interfaces.ISiteRoot"
      factory=".dataproviders.SiteRootDataProvider"
      />

  <!-- Data provider for Dexterity content types -->
  <adapter
      for="plone.dexterity.interfaces.IDexterityContent"
      factory=".dataproviders.DexterityDataProvider"
      />

</configure>
