<binding>
  <!-- the default deserializer to use for String -->
  <format type="java.lang.String" deserializer="org.exoplatform.container.xml.Deserializer.resolveString"/>
  <!-- the default deserializer to use for boolean -->
  <format type="boolean" deserializer="org.exoplatform.services.jcr.util.ConfigurationFormat.parseBoolean"/>

  <mapping name="repository-service" class="org.exoplatform.services.jcr.config.RepositoryServiceConfiguration">
    <value name="default-repository" field="defaultRepositoryName" style="attribute" />
    <collection name="repositories" field="repositoryConfigurations"
      item-type="org.exoplatform.services.jcr.config.RepositoryEntry"
      factory="org.jibx.runtime.Utility.arrayListFactory" />
  </mapping>

  <mapping name="repository" class="org.exoplatform.services.jcr.config.RepositoryEntry">
    <value name="name" field="name" style="attribute" />
    <value name="system-workspace" field="systemWorkspaceName" style="attribute" />
    <value name="default-workspace" field="defaultWorkspaceName" style="attribute" />
    <value name="security-domain" field="securityDomain" />
    <value name="access-control" field="accessControl" usage="optional" />
    <value name="session-max-age" field="sessionTimeOut"  usage="optional"
          serializer="org.exoplatform.services.jcr.util.ConfigurationFormat.serializeTime"
          deserializer="org.exoplatform.services.jcr.util.ConfigurationFormat.parseTime" />
    <value name="lock-remover-max-threads" field="lockRemoverMaxThreadCount" usage="optional"
          serializer="org.exoplatform.services.jcr.util.ConfigurationFormat.serializeInt"
          deserializer="org.exoplatform.services.jcr.util.ConfigurationFormat.parseInt"  />
    <value name="authentication-policy" field="authenticationPolicy" />
    <collection name="workspaces" field="workspaces" item-type="org.exoplatform.services.jcr.config.WorkspaceEntry" 
                factory="org.jibx.runtime.Utility.arrayListFactory" />
  </mapping>

  <mapping name="workspace" class="org.exoplatform.services.jcr.config.WorkspaceEntry">
    <value name="name" field="name" style="attribute" />
    <value name="lazy-read-threshold" field="lazyReadThreshold" style="attribute" usage="optional"
        serializer="org.exoplatform.services.jcr.util.ConfigurationFormat.serializeInt"
        deserializer="org.exoplatform.services.jcr.util.ConfigurationFormat.parseInt" />
    <structure name="container" field="container">
      <value name="class" field="type" style="attribute" />
      <collection name="properties" usage="optional"
        item-type="org.exoplatform.services.jcr.config.SimpleParameterEntry"
        add-method="addParameter" iter-method="getParameterIterator" test-method="hasParameters"/>
      <collection name="value-storages" field="valueStorages" usage="optional"
        item-type="org.exoplatform.services.jcr.config.ValueStorageEntry" 
        factory="org.jibx.runtime.Utility.arrayListFactory"/>
    </structure>
    
    <structure name="initializer" field="initializer" usage="optional">
      <value name="class" field="type" style="attribute" usage="optional" />
      <collection name="properties" usage="optional"
        item-type="org.exoplatform.services.jcr.config.SimpleParameterEntry"
        add-method="addParameter" iter-method="getParameterIterator" test-method="hasParameters"/>
    </structure>

    <structure name="cache" field="cache" usage="optional">
      <value name="enabled" field="enabled" style="attribute" />
      <value name="class" field="type" style="attribute" usage="optional" />
      <collection name="properties" usage="optional"
        item-type="org.exoplatform.services.jcr.config.SimpleParameterEntry"
        add-method="addParameter" iter-method="getParameterIterator" test-method="hasParameters"/>
    </structure>

    <structure name="query-handler" field="queryHandler" 
    usage="optional">
      <value name="class" field="type" style="attribute" />
      <collection name="properties" usage="optional"
        item-type="org.exoplatform.services.jcr.config.SimpleParameterEntry"
        add-method="addParameter" iter-method="getParameterIterator" test-method="hasParameters"/>
    </structure>

    <structure name="access-manager" field="accessManager" usage="optional">
      <value name="class" field="type" style="attribute" />
      <collection name="properties" usage="optional"
        item-type="org.exoplatform.services.jcr.config.SimpleParameterEntry"
        add-method="addParameter" iter-method="getParameterIterator" test-method="hasParameters"/>
    </structure>

    <structure name="lock-manager" field="lockManager" usage="optional">
      <value name="class" field="type" style="attribute" usage="optional" />
      <collection name="properties" usage="optional"
        item-type="org.exoplatform.services.jcr.config.SimpleParameterEntry"
        add-method="addParameter" iter-method="getParameterIterator" test-method="hasParameters"/>
    </structure>
  </mapping>

  <mapping name="property" class="org.exoplatform.services.jcr.config.SimpleParameterEntry">
    <value name="name" field="name" style="attribute" />
    <value name="value" field="value" style="attribute" />	
  </mapping>

  <mapping name="value-storage" class="org.exoplatform.services.jcr.config.ValueStorageEntry">
    <value name="class" field="type" style="attribute" />
    <value name="id" field="id" style="attribute" />
    <collection name="properties" usage="optional"
      item-type="org.exoplatform.services.jcr.config.SimpleParameterEntry"
      add-method="addParameter" iter-method="getParameterIterator" test-method="hasParameters"/>
    <collection name="filters" field="filters" item-type="org.exoplatform.services.jcr.config.ValueStorageFilterEntry"
                factory="org.jibx.runtime.Utility.arrayListFactory"/>
  </mapping>
  <mapping name="filter" class="org.exoplatform.services.jcr.config.ValueStorageFilterEntry">
    <value name="property-type" field="propertyType" style="attribute" usage="optional" />
    <value name="min-value-size" field="minValueSize" style="attribute" usage="optional"
          serializer="org.exoplatform.services.jcr.util.ConfigurationFormat.serializeLong" 
          deserializer="org.exoplatform.services.jcr.util.ConfigurationFormat.parseLong" />
    <value name="ancestor-path" field="ancestorPath" style="attribute" usage="optional" />
    <value name="property-name" field="propertyName" style="attribute" usage="optional" />
  </mapping>

</binding>
