<#escape x as x?xml>
<?xml version="1.0"?>
<component name="default-repository-config">
  <extension target="org.nuxeo.ecm.core.blob.BlobManager" point="configuration">
    <blobprovider name="default">
      <class>${nuxeo.core.binarymanager}</class>
      <property name="path">${repository.binary.store}</property>
      <property name="key">${nuxeo.core.binarymanager_key}</property>
    </blobprovider>
  </extension>
<#if "${nuxeo.mongodb.server}" == "">
  <extension target="org.nuxeo.ecm.core.storage.sql.RepositoryService"
    point="repository">
    <repository name="default" label="label.default.repository">
      <pool minPoolSize="${nuxeo.vcs["min-pool-size"]}" maxPoolSize="${nuxeo.vcs["max-pool-size"]}"
        blockingTimeoutMillis="${nuxeo.vcs["blocking-timeout-millis"]}"
        idleTimeoutMinutes="${nuxeo.vcs["idle-timeout-minutes"]}"
        activeTimeoutMinutes="${nuxeo.vcs["active-timeout-minutes"]}" />
      <clustering id="${repository.clustering.id}" enabled="${repository.clustering.enabled}" delay="${repository.clustering.delay}" />
<#if "${repository.clustering.invalidation}" == "pubsub">
      <clusterInvalidatorClass>org.nuxeo.ecm.core.storage.sql.VCSPubSubInvalidator</clusterInvalidatorClass>
<#elseif "${repository.clustering.invalidation}" == "redis">
      <clusterInvalidatorClass>org.nuxeo.ecm.core.redis.contribs.RedisClusterInvalidator</clusterInvalidatorClass>
</#if>
      <noDDL>${nuxeo.vcs.noddl}</noDDL>
      <ddlMode>${nuxeo.vcs.ddlmode}</ddlMode>
      <aclOptimizations enabled="${nuxeo.vcs.optimizations.acl.enabled}"/>
      <pathOptimizations enabled="${nuxeo.vcs.optimizations.path.enabled}"/>
      <idType>${nuxeo.vcs.idtype}</idType>
      <changeTokenEnabled>${nuxeo.changetoken.enabled}</changeTokenEnabled>
      <indexing>
<#if "${nuxeo.db.type}" == "postgresql">
        <fulltext disabled="${nuxeo.vcs.fulltext.disabled}" searchDisabled="${nuxeo.vcs.fulltext.search.disabled}"
                  analyzer="${nuxeo.vcs.fulltext.analyzer.language}">
          <index name="default">
            <!-- all props implied -->
          </index>
          <index name="title">
            <field>dc:title</field>
          </index>
          <index name="description">
            <field>dc:description</field>
          </index>
        </fulltext>
<#elseif "${nuxeo.db.type}" == "oracle">
        <fulltext disabled="${nuxeo.vcs.fulltext.disabled}" searchDisabled="${nuxeo.vcs.fulltext.search.disabled}">
          <index name="default">
            <!-- all props implied -->
          </index>
          <index name="title">
            <field>dc:title</field>
          </index>
          <index name="description">
            <field>dc:description</field>
          </index>
        </fulltext>
        <!--
          For Oracle (Oracle Text indexing parameters):
          <fulltext analyzer="LEXER MY_LEXER"/>
          See doc at:
          http://jira.nuxeo.org/browse/NXP-4035
          http://download.oracle.com/docs/cd/B19306_01/text.102/b14218/cdatadic.htm
        -->
<#elseif "${nuxeo.db.type}" == "mssql">
        <fulltext disabled="${nuxeo.vcs.fulltext.disabled}" searchDisabled="${nuxeo.vcs.fulltext.search.disabled}"
                  analyzer="${nuxeo.vcs.fulltext.analyzer.language}">
          <index name="default">
            <!-- all props implied -->
          </index>
          <!-- SQL Server does not support more than one fulltext index per
          table: to add support for multiple fulltext index would required to
          change the datamodel of VCS -->
       </fulltext>
<#elseif "${nuxeo.db.type}" == "mysql">
        <!-- For MySQL -->
        <fulltext disabled="${nuxeo.vcs.fulltext.disabled}" searchDisabled="${nuxeo.vcs.fulltext.search.disabled}">
          <index name="default">
            <!-- all props implied -->
          </index>
          <index name="title">
            <field>dc:title</field>
          </index>
          <index name="description">
            <field>dc:description</field>
          </index>
        </fulltext>
<#else>
        <!-- for H2 (Lucene Analyzer): -->
        <fulltext disabled="${nuxeo.vcs.fulltext.disabled}" searchDisabled="${nuxeo.vcs.fulltext.search.disabled}" analyzer="org.apache.lucene.analysis.standard.StandardAnalyzer">
          <index name="default">
            <!-- all props implied -->
          </index>
          <index name="title">
            <field>dc:title</field>
          </index>
          <index name="description">
            <field>dc:description</field>
          </index>
        </fulltext>
</#if>
      </indexing>
<#if "${nuxeo.db.type}" != "mysql">
      <usersSeparator key="${nuxeo.db.user_separator_key}" />
</#if>
<#if "${nuxeo.db.type}" == "mysql">
      <schema>
        <field type="largetext">var_ParallelDocumentReview:review_result</field>
      </schema>
</#if>
    </repository>
  </extension>
<#else>
  <extension target="org.nuxeo.ecm.core.storage.mongodb.MongoDBRepositoryService"
      point="repository">
    <repository name="default" label="label.default.repository">
      <server>${nuxeo.mongodb.server}</server>
      <dbname>${nuxeo.mongodb.dbname}</dbname>
      <fulltext disabled="${nuxeo.vcs.fulltext.disabled}" searchDisabled="${nuxeo.vcs.fulltext.search.disabled}" />
      <cache enabled="${nuxeo.dbs.cache.enabled}" maxSize="${nuxeo.dbs.cache.maxSize}"
             concurrencyLevel="${nuxeo.dbs.cache.concurrencyLevel}" ttl="${nuxeo.dbs.cache.ttl}" />
      <clustering id="${repository.clustering.id}" enabled="${repository.clustering.enabled}">
<#if "${repository.clustering.invalidation}" == "pubsub">
        <invalidatorClass>org.nuxeo.ecm.core.storage.dbs.DBSPubSubInvalidator</invalidatorClass>
<#elseif "${repository.clustering.invalidation}" == "redis">
        <invalidatorClass>org.nuxeo.ecm.core.redis.contribs.RedisDBSClusterInvalidator</invalidatorClass>
</#if>
      </clustering>
      <changeTokenEnabled>${nuxeo.changetoken.enabled}</changeTokenEnabled>
    </repository>
  </extension>
</#if>
</component>
</#escape>
