1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
3
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4
|
xmlns:context="http://www.springframework.org/schema/context"
|
5
|
xmlns:tx="http://www.springframework.org/schema/tx"
|
6
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
7
|
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
|
8
|
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
|
9
|
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
|
10
|
">
|
11
|
|
12
|
<context:property-override location="classpath:override.properties"/>
|
13
|
|
14
|
<context:component-scan base-package="eu/etaxonomy/cdm/api/config" />
|
15
|
|
16
|
<context:component-scan base-package="eu/etaxonomy/cdm/api/service">
|
17
|
</context:component-scan>
|
18
|
|
19
|
<context:component-scan base-package="eu/etaxonomy/cdm/api/application">
|
20
|
</context:component-scan>
|
21
|
|
22
|
<import resource="classpath:/eu/etaxonomy/cdm/services.xml"/>
|
23
|
|
24
|
<context:component-scan base-package="eu/etaxonomy/cdm/api/cache"/>
|
25
|
<!-- enable the configuration of transactional behavior based on annotations -->
|
26
|
<tx:annotation-driven transaction-manager="transactionManager"/>
|
27
|
|
28
|
<bean id="dataSource" class="org.unitils.database.UnitilsDataSourceFactoryBean" />
|
29
|
|
30
|
<bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer">
|
31
|
<property name="omit" value="true"/>
|
32
|
</bean>
|
33
|
|
34
|
<bean id="termInitializer" class="eu.etaxonomy.cdm.database.TestingTermInitializer">
|
35
|
<property name="termsDataSet" value="classpath:/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml"/>
|
36
|
<property name="termsDtd" value="classpath:/eu/etaxonomy/cdm/database/schema/dataset.dtd"/>
|
37
|
</bean>
|
38
|
|
39
|
<bean id="hibernateProperties"
|
40
|
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
|
41
|
<property name="properties">
|
42
|
<props>
|
43
|
<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.internal.NoCachingRegionFactory</prop>
|
44
|
<prop key="hibernate.show_sql">false</prop>
|
45
|
<prop key="hibernate.format_sql">false</prop>
|
46
|
<prop key="hibernate.search.autoregister_listeners">false</prop>
|
47
|
<prop key="hibernate.jdbc.batch_size">0</prop><!-- NOTE AM: needed? batch_size 0 was orginally introduce due to a bug in hsqldb as far as I remember -->
|
48
|
</props>
|
49
|
</property>
|
50
|
</bean>
|
51
|
|
52
|
<bean id="tableGeneratorGlobalOverride"
|
53
|
class="eu.etaxonomy.cdm.persistence.hibernate.TableGeneratorGlobalOverride">
|
54
|
<property name="properties">
|
55
|
<props>
|
56
|
<!--
|
57
|
globally overriding id generation settings see: eu.etaxonomy.cdm.persistence.hibernate.TableGenerator
|
58
|
-->
|
59
|
<prop key="optimizer">none</prop>
|
60
|
<prop key="initial_value">5000</prop><!-- must be higher than any term id in TermsDataSet.xml -->
|
61
|
</props>
|
62
|
</property>
|
63
|
</bean>
|
64
|
|
65
|
|
66
|
<!--
|
67
|
We do not use spelling suggestions anymore. This one relates to spring modules which is
|
68
|
somewhat out-dated. Once we work again with spelling suggestions we better use a modern
|
69
|
approach, e.g. annotation based.
|
70
|
<bean id="taxonSpellingDirectory" class="org.springmodules.lucene.index.support.FSDirectoryFactoryBean">
|
71
|
<property name="location" value="file:./target/index/eu.etaxonomy.cdm.model.taxon.TaxonBase_spelling"/>
|
72
|
<property name="create" value="true"/>
|
73
|
</bean> -->
|
74
|
|
75
|
<bean id="validatorFactory" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
|
76
|
<property name="mappingLocations">
|
77
|
<set>
|
78
|
<value>classpath:/eu/etaxonomy/cdm/validation/name/TaxonName-Constraints.xml</value>
|
79
|
</set>
|
80
|
</property>
|
81
|
</bean>
|
82
|
|
83
|
|
84
|
<!-- equips a new and empty database with the initial set of meta data and admin user -->
|
85
|
<bean id="firstDataInserter" class="eu.etaxonomy.cdm.api.application.FirstDataInserter" />
|
86
|
|
87
|
<!-- security -->
|
88
|
<bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.Md5PasswordEncoder"/>
|
89
|
<bean id="saltSource" class="org.springframework.security.authentication.dao.ReflectionSaltSource">
|
90
|
<property name="userPropertyToUse" value="getUsername"/>
|
91
|
</bean>
|
92
|
<bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
|
93
|
<property name="userDetailsService" ref="userService"/>
|
94
|
<property name="saltSource" ref="saltSource"/>
|
95
|
<property name="passwordEncoder" ref="passwordEncoder"/>
|
96
|
</bean>
|
97
|
<bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
|
98
|
<constructor-arg>
|
99
|
<list>
|
100
|
<ref bean="daoAuthenticationProvider"/>
|
101
|
</list>
|
102
|
</constructor-arg>
|
103
|
<!-- <property name="providers"> -->
|
104
|
<!-- <list> -->
|
105
|
<!-- <bean class="org.springframework.security.authentication.TestingAuthenticationProvider"/> -->
|
106
|
<!-- <ref bean="daoAuthenticationProvider"/> -->
|
107
|
<!-- </list> -->
|
108
|
<!-- </property> -->
|
109
|
</bean>
|
110
|
|
111
|
</beans>
|