Project

General

Profile

Download (6.19 KB) Statistics
| Branch: | Tag: | Revision:
1 11a07691 Katja Luther
<?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 b1222d68 Andreas Kohlbecker
	xsi:schemaLocation="http://www.springframework.org/schema/beans
8 11a07691 Katja Luther
    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 b1222d68 Andreas Kohlbecker
    http://www.springframework.org/schema/security
12 11a07691 Katja Luther
    http://www.springframework.org/schema/security/spring-security-3.0.4.xsd">
13 b1222d68 Andreas Kohlbecker
14
    <!--
15
16
        ************************************************************************
17
        *                                                                      *
18
        *       DETLETE this file, only kept as reference, replaced by         *
19 bce1dda8 Katja Luther
        *                 *-securityTest.xml                                   *
20 b1222d68 Andreas Kohlbecker
        *                                                                      *
21
        ************************************************************************
22
     -->
23
24 11a07691 Katja Luther
    <!--  <import resource="classpath:/eu/etaxonomy/cdm/defaultSecurityContext.xml"/>  -->
25 b1222d68 Andreas Kohlbecker
26 11a07691 Katja Luther
     <!--<import resource="classpath:/eu/etaxonomy/cdm/persistence.xml"/>   -->
27 b1222d68 Andreas Kohlbecker
28 bce1dda8 Katja Luther
    <context:component-scan base-package="eu/etaxonomy/cdm/persistence_security">
29 11a07691 Katja Luther
   		<context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.persistence\.dao\.hibernate\.taxon\.TaxonAlternativeSpellingSuggestionParser"/>
30
    </context:component-scan>
31
    <context:component-scan base-package="eu/etaxonomy/cdm/database"/>
32 b1222d68 Andreas Kohlbecker
33 11a07691 Katja Luther
    	<!-- includes service beans e.g. in eu/etaxonomy/cdm/api -->
34
	<context:component-scan base-package="eu/etaxonomy/cdm/api/service">
35
		<!--  <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.api\.service\.UserService"/> -->
36
	</context:component-scan>
37 b1222d68 Andreas Kohlbecker
38 11a07691 Katja Luther
	<context:component-scan base-package="eu/etaxonomy/cdm/api/application"/>
39 b1222d68 Andreas Kohlbecker
40 11a07691 Katja Luther
 	<!-- enable the configuration of transactional behavior based on annotations -->
41
	<tx:annotation-driven transaction-manager="transactionManager"/>
42 b1222d68 Andreas Kohlbecker
43
  	 <bean id="transactionManager"
44 11a07691 Katja Luther
          class="org.springframework.orm.hibernate3.HibernateTransactionManager">
45
        <property name="sessionFactory" ref="sessionFactory"/>
46
    </bean>
47 b1222d68 Andreas Kohlbecker
48 11a07691 Katja Luther
   	<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
49
	    <property name="namingStrategy">
50
	    	<bean class="org.hibernate.cfg.DefaultComponentSafeNamingStrategy" />
51
	    </property>
52 b1222d68 Andreas Kohlbecker
53 11a07691 Katja Luther
	    <property name="configLocation" value="classpath:eu/etaxonomy/cdm/hibernate.cfg.xml"/>
54
	    <property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration"/>
55
	    <property name="dataSource" ref="dataSource"/>
56
	    <property name="hibernateProperties" ref="hibernateProperties"/>
57 b1222d68 Andreas Kohlbecker
	</bean>
58
59
60
    <bean id="dataSource" class="org.unitils.database.UnitilsDataSourceFactoryBean"/>
61
62
    <bean id="hibernateProperties"
63 11a07691 Katja Luther
        class="org.springframework.beans.factory.config.PropertiesFactoryBean">
64
        <property name="properties">
65
            <props>
66
                <prop key="hibernate.dialect">org.hibernate.dialect.HSQLCorrectedDialect</prop>
67
                <prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
68
                <!-- TODO trying to use a managed session context -->
69
                <!--  <prop key="hibernate.current_session_context_class">managed</prop>-->
70
                <prop key="hibernate.show_sql">false</prop>
71
                <prop key="hibernate.format_sql">false</prop>
72
                <prop key="hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</prop>
73
                <prop key="hibernate.search.default.indexBase">./target/test-classes</prop>
74
            </props>
75
        </property>
76 b1222d68 Andreas Kohlbecker
    </bean>
77
78 11a07691 Katja Luther
    <bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
79
        <property name="providers">
80
            <list>
81
                <bean class="org.springframework.security.authentication.TestingAuthenticationProvider"/>
82
                <ref local="daoAuthenticationProvider"/>
83
            </list>
84
        </property>
85
    </bean>
86 b1222d68 Andreas Kohlbecker
87 11a07691 Katja Luther
    <bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
88
        <property name="userDetailsService" ref="userService"/>
89
        <property name="saltSource" ref="saltSource"/>
90
        <property name="passwordEncoder" ref="passwordEncoder"/>
91
    </bean>
92 b1222d68 Andreas Kohlbecker
93 11a07691 Katja Luther
    <bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.Md5PasswordEncoder"/>
94 b1222d68 Andreas Kohlbecker
95 11a07691 Katja Luther
    <bean id="saltSource" class="org.springframework.security.authentication.dao.ReflectionSaltSource">
96
        <property name="userPropertyToUse" value="getUsername"/>
97
    </bean>
98 b1222d68 Andreas Kohlbecker
99 11a07691 Katja Luther
    <security:global-method-security pre-post-annotations="enabled">
100
		<security:expression-handler ref="expressionHandler"/>
101
	</security:global-method-security>
102
103
	<bean id="expressionHandler" class="org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler">
104
        <property name="permissionEvaluator" ref="cdmPermissionEvaluator"/>
105
	</bean>
106 b1222d68 Andreas Kohlbecker
107
108 9cdb4588 Katja Luther
 	<bean class="eu.etaxonomy.cdm.permission.CdmPermissionEvaluator" id="cdmPermissionEvaluator"/>
109 b1222d68 Andreas Kohlbecker
110 11a07691 Katja Luther
      <bean id="userService" class="eu.etaxonomy.cdm.api.service.UserService">
111 b1222d68 Andreas Kohlbecker
112 11a07691 Katja Luther
    	</bean>
113
114 b1222d68 Andreas Kohlbecker
115 11a07691 Katja Luther
    <bean id="groupService" class="eu.etaxonomy.cdm.api.service.GroupServiceImpl">
116 b1222d68 Andreas Kohlbecker
117 11a07691 Katja Luther
    </bean>
118 b1222d68 Andreas Kohlbecker
119
120 11a07691 Katja Luther
    <bean id="titleCacheAutoInitializer" class="eu.etaxonomy.cdm.persistence.dao.TitleCacheAutoInitializer"></bean>
121 b1222d68 Andreas Kohlbecker
122 11a07691 Katja Luther
    <bean id="defaultBeanInitializer" class="eu.etaxonomy.cdm.persistence.dao.hibernate.HibernateBeanInitializer">
123
	   <property name="beanAutoInitializers">
124
	       <map>
125
	           <entry key="eu.etaxonomy.cdm.model.common.IdentifiableEntity"  value-ref="titleCacheAutoInitializer" />
126
	       </map>
127
	   </property>
128
	</bean>
129
</beans>