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 xmlns:
security=
"http://www.springframework.org/schema/security"
7 xsi:
schemaLocation=
"http://www.springframework.org/schema/beans
8 http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
9 http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
10 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
11 http://www.springframework.org/schema/security
12 http://www.springframework.org/schema/security/spring-security-3.0.4.xsd">
14 <!-- <import resource="classpath:/eu/etaxonomy/cdm/defaultSecurityContext.xml"/> -->
16 <!--<import resource="classpath:/eu/etaxonomy/cdm/persistence.xml"/> -->
18 <context:component-scan base-package=
"eu/etaxonomy/cdm/persistence">
19 <context:exclude-filter type=
"regex" expression=
"eu\.etaxonomy\.cdm\.persistence\.dao\.hibernate\.taxon\.TaxonAlternativeSpellingSuggestionParser"/>
20 </context:component-scan>
21 <context:component-scan base-package=
"eu/etaxonomy/cdm/database"/>
23 <!-- includes service beans e.g. in eu/etaxonomy/cdm/api -->
24 <context:component-scan base-package=
"eu/etaxonomy/cdm/api/service">
25 <!-- <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.api\.service\.UserService"/> -->
26 </context:component-scan>
28 <context:component-scan base-package=
"eu/etaxonomy/cdm/api/application"/>
30 <!-- enable the configuration of transactional behavior based on annotations -->
31 <tx:annotation-driven transaction-manager=
"transactionManager"/>
33 <bean id=
"transactionManager"
34 class=
"org.springframework.orm.hibernate3.HibernateTransactionManager">
35 <property name=
"sessionFactory" ref=
"sessionFactory"/>
38 <bean id=
"sessionFactory" class=
"org.springframework.orm.hibernate3.LocalSessionFactoryBean">
39 <property name=
"namingStrategy">
40 <bean class=
"org.hibernate.cfg.DefaultComponentSafeNamingStrategy" />
43 <property name=
"configLocation" value=
"classpath:eu/etaxonomy/cdm/hibernate.cfg.xml"/>
44 <property name=
"configurationClass" value=
"org.hibernate.cfg.AnnotationConfiguration"/>
45 <property name=
"dataSource" ref=
"dataSource"/>
46 <property name=
"hibernateProperties" ref=
"hibernateProperties"/>
50 <bean id=
"dataSource" class=
"org.unitils.database.UnitilsDataSourceFactoryBean"/>
52 <bean id=
"hibernateProperties"
53 class=
"org.springframework.beans.factory.config.PropertiesFactoryBean">
54 <property name=
"properties">
56 <prop key=
"hibernate.dialect">org.hibernate.dialect.HSQLCorrectedDialect
</prop>
57 <prop key=
"hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider
</prop>
58 <!-- TODO trying to use a managed session context -->
59 <!-- <prop key="hibernate.current_session_context_class">managed</prop>-->
60 <prop key=
"hibernate.show_sql">false
</prop>
61 <prop key=
"hibernate.format_sql">false
</prop>
62 <prop key=
"hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider
</prop>
63 <prop key=
"hibernate.search.default.indexBase">./target/test-classes
</prop>
68 <bean id=
"authenticationManager" class=
"org.springframework.security.authentication.ProviderManager">
69 <property name=
"providers">
71 <bean class=
"org.springframework.security.authentication.TestingAuthenticationProvider"/>
72 <ref local=
"daoAuthenticationProvider"/>
77 <bean id=
"daoAuthenticationProvider" class=
"org.springframework.security.authentication.dao.DaoAuthenticationProvider">
78 <property name=
"userDetailsService" ref=
"userService"/>
79 <property name=
"saltSource" ref=
"saltSource"/>
80 <property name=
"passwordEncoder" ref=
"passwordEncoder"/>
83 <bean id=
"passwordEncoder" class=
"org.springframework.security.authentication.encoding.Md5PasswordEncoder"/>
85 <bean id=
"saltSource" class=
"org.springframework.security.authentication.dao.ReflectionSaltSource">
86 <property name=
"userPropertyToUse" value=
"getUsername"/>
89 <security:global-method-security pre-post-annotations=
"enabled">
90 <security:expression-handler ref=
"expressionHandler"/>
91 </security:global-method-security>
93 <bean id=
"expressionHandler" class=
"org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler">
94 <property name=
"permissionEvaluator" ref=
"cdmPermissionEvaluator"/>
98 <bean class=
"eu.etaxonomy.cdm.permission.CdmPermissionEvaluator" id=
"cdmPermissionEvaluator"/>
100 <bean id=
"userService" class=
"eu.etaxonomy.cdm.api.service.UserService">
105 <bean id=
"groupService" class=
"eu.etaxonomy.cdm.api.service.GroupServiceImpl">
110 <bean id=
"titleCacheAutoInitializer" class=
"eu.etaxonomy.cdm.persistence.dao.TitleCacheAutoInitializer"></bean>
112 <bean id=
"defaultBeanInitializer" class=
"eu.etaxonomy.cdm.persistence.dao.hibernate.HibernateBeanInitializer">
113 <property name=
"beanAutoInitializers">
115 <entry key=
"eu.etaxonomy.cdm.model.common.IdentifiableEntity" value-ref=
"titleCacheAutoInitializer" />