<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p" xmlns="http://www.springframework.org/schema/beans"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="propertyLocations" class="eu.dnetlib.conf.WebappContextPropertyLocationFactory">
        <property name="locations">
            <list>
                <value>classpath*:eu/dnetlib/**/applicationContext-*.properties</value>

                <!-- this stuff should gradually disappear -->
                <value>classpath*:eu/dnetlib/cnr-default.properties</value>
                <value>classpath*:eu/dnetlib/cnr-site.properties</value>
                <value>classpath*:cnr-override.properties</value>

                <!-- this stuff will be moved into a common place -->
                <value>classpath*:eu/dnetlib/dnet-default.properties</value>

                <value>classpath*:dnet-site-override.properties</value>

                <value>classpath*:dnet-wizard.properties</value>
                <value>classpath*:dnet-override.properties</value>

                <value>classpath*:dnet-@{webapp}-override.properties</value>

                <value>classpath*:dnet-site-force-override.properties</value>
                <value>classpath*:dnet-force-override.properties</value>

                <value>classpath*:dnet-@{webapp}-force-override.properties</value>
            </list>
        </property>
    </bean>

    <bean id="propertyFetcher" class="eu.dnetlib.conf.PropertyFetcher"
          p:locations-ref="propertyLocations"/>


    <bean id="propertyConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
          p:ignoreResourceNotFound="true" p:localOverride="true"
          p:locations-ref="propertyLocations">
        <property name="properties">
            <bean class="eu.dnetlib.conf.WebappContextProperyFactory"
                  p:propertyFetcher-ref="propertyFetcher"/>
        </property>
    </bean>
</beans>
