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-2.5.xsd
8 http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
9 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
12 <context:property-override location=
"classpath:override.properties"/>
14 <context:component-scan base-package=
"eu/etaxonomy/cdm/api/service">
15 </context:component-scan>
17 <import resource=
"classpath:/eu/etaxonomy/cdm/services.xml"/>
19 <context:component-scan base-package=
"eu/etaxonomy/cdm/api/cache"/>
20 <!-- enable the configuration of transactional behavior based on annotations -->
21 <tx:annotation-driven transaction-manager=
"transactionManager"/>
23 <bean id=
"dataSource" class=
"org.unitils.database.UnitilsDataSourceFactoryBean"/>
26 use TestingTermInitializer
28 <bean id=
"testingTermInitializer" class=
"eu.etaxonomy.cdm.database.TestingTermInitializer">
29 <property name=
"termsDataSet" value=
"classpath:/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml"/>
30 <property name=
"termsDtd" value=
"classpath:/eu/etaxonomy/cdm/persistence/dao/hibernate/dataset.dtd"/>
31 <property name=
"omit" value=
"false"/>
33 <bean id=
"persistentTermInitializer" class=
"eu.etaxonomy.cdm.database.PersistentTermInitializer">
34 <property name=
"omit" value=
"true"/>
37 <bean id=
"hibernateProperties"
38 class=
"org.springframework.beans.factory.config.PropertiesFactoryBean">
39 <property name=
"properties">
41 <prop key=
"hibernate.cache.region.factory_class">org.hibernate.cache.internal.NoCachingRegionFactory
</prop>
42 <prop key=
"hibernate.show_sql">false
</prop>
43 <prop key=
"hibernate.format_sql">false
</prop>
44 <prop key=
"hibernate.search.default.directory_provider">org.hibernate.search.store.impl.FSDirectoryProvider
</prop>
45 <!-- TODO trying to use a managed session context
46 <prop key="hibernate.current_session_context_class">managed</prop>
48 <!-- temp for h4 migration testing -->
49 <!-- <prop key="hibernate.connection.driver_class">org.h2.Driver</prop> -->
50 <!-- <prop key="hibernate.connection.url">jdbc:h2:mem:cdm</prop> -->
51 <!-- <prop key="hibernate.connection.username">sa</prop> -->
52 <!-- <prop key="hibernate.connection.password"></prop> -->
53 <!-- <prop key="hibernate.search.lucene_version">LUCENE_36</prop> -->
54 <!-- end temp for h4 migration testing -->
55 <prop key=
"hibernate.search.default.indexBase">./target/index
</prop>
56 <!-- hibernate.search.default.exclusive_index_use=false
57 locks must not only be released after application shutdown in test environment -->
58 <prop key=
"hibernate.search.default.exclusive_index_use">false
</prop>
59 <!-- hsqldb v. <1.9 has a bug (http://sourceforge.net/tracker/?func=detail&atid=378131&aid=1407528&group_id=23316)
60 due to which it is not possible to use batch updates, so we need to disable
61 hibernate batching when using hsqldb in the app context: -->
62 <prop key=
"hibernate.jdbc.batch_size">0</prop>
67 <bean id=
"tableGeneratorGlobalOverride"
68 class=
"eu.etaxonomy.cdm.persistence.hibernate.TableGeneratorGlobalOverride">
69 <property name=
"properties">
72 globally overriding id generation settings see: eu.etaxonomy.cdm.persistence.hibernate.TableGenerator
74 <prop key=
"optimizer">none
</prop>
75 <prop key=
"initial_value">5000</prop><!-- must be higher than any term id in TermsDataSet.xml -->
82 We do not use spelling suggestions anymore. This one relates to spring modules which is
83 somewhat out-dated. Once we work again with spelling suggestions we better use a modern
84 approach, e.g. annotation based.
85 <bean id="taxonSpellingDirectory" class="org.springmodules.lucene.index.support.FSDirectoryFactoryBean">
86 <property name="location" value="file:./target/index/eu.etaxonomy.cdm.model.taxon.TaxonBase_spelling"/>
87 <property name="create" value="true"/>
90 <bean id=
"validatorFactory" class=
"org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
91 <property name=
"mappingLocations">
93 <value>classpath:/eu/etaxonomy/cdm/validation/name/TaxonNameBase-Constraints.xml
</value>
99 <!-- equips a new and empty database with the initial set of meta data and admin user -->
100 <bean id=
"firstDataInserter" class=
"eu.etaxonomy.cdm.api.application.FirstDataInserter" />
103 <bean id=
"passwordEncoder" class=
"org.springframework.security.authentication.encoding.Md5PasswordEncoder"/>
104 <bean id=
"saltSource" class=
"org.springframework.security.authentication.dao.ReflectionSaltSource">
105 <property name=
"userPropertyToUse" value=
"getUsername"/>
107 <bean id=
"daoAuthenticationProvider" class=
"org.springframework.security.authentication.dao.DaoAuthenticationProvider">
108 <property name=
"userDetailsService" ref=
"userService"/>
109 <property name=
"saltSource" ref=
"saltSource"/>
110 <property name=
"passwordEncoder" ref=
"passwordEncoder"/>
112 <bean id=
"authenticationManager" class=
"org.springframework.security.authentication.ProviderManager">
113 <property name=
"providers">
115 <bean class=
"org.springframework.security.authentication.TestingAuthenticationProvider"/>
116 <ref local=
"daoAuthenticationProvider"/>