blob: d597eb42e44d9e722ce90d7b186af9c54d07cdea [file] [log] [blame]
Michael Hanlbd852b82015-11-18 22:17:00 +01001<?xml version="1.0" encoding="UTF-8"?>
2<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
margaretha62055f72017-04-11 19:17:43 +02003 xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util"
4 xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
margarethaade7d4a2017-07-20 19:53:35 +02005 xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
6 xmlns:cache="http://www.springframework.org/schema/cache"
margaretha62055f72017-04-11 19:17:43 +02007 xsi:schemaLocation="http://www.springframework.org/schema/beans
margaretha3da7cd32018-10-22 17:42:52 +02008 http://www.springframework.org/schema/beans/spring-beans.xsd
margarethaade7d4a2017-07-20 19:53:35 +02009 http://www.springframework.org/schema/tx
margaretha3da7cd32018-10-22 17:42:52 +020010 http://www.springframework.org/schema/tx/spring-tx.xsd
margarethaade7d4a2017-07-20 19:53:35 +020011 http://www.springframework.org/schema/aop
margaretha3da7cd32018-10-22 17:42:52 +020012 http://www.springframework.org/schema/aop/spring-aop.xsd
margarethaade7d4a2017-07-20 19:53:35 +020013 http://www.springframework.org/schema/context
margaretha3da7cd32018-10-22 17:42:52 +020014 http://www.springframework.org/schema/context/spring-context.xsd
margarethaade7d4a2017-07-20 19:53:35 +020015 http://www.springframework.org/schema/util
margaretha3da7cd32018-10-22 17:42:52 +020016 http://www.springframework.org/schema/util/spring-util.xsd">
Michael Hanlbd852b82015-11-18 22:17:00 +010017
margarethaade7d4a2017-07-20 19:53:35 +020018 <context:component-scan base-package="de.ids_mannheim.korap" />
19 <context:annotation-config />
Michael Hanlbd852b82015-11-18 22:17:00 +010020
margaretha62055f72017-04-11 19:17:43 +020021 <bean id="props"
22 class="org.springframework.beans.factory.config.PropertiesFactoryBean">
23 <property name="ignoreResourceNotFound" value="true" />
24 <property name="locations">
25 <array>
margaretha0c47c652017-04-19 18:44:40 +020026 <value>classpath:kustvakt-test.conf</value>
27 <value>file:./kustvakt-test.conf</value>
margaretha62055f72017-04-11 19:17:43 +020028 </array>
29 </property>
30 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +010031
margarethaade7d4a2017-07-20 19:53:35 +020032 <bean id="placeholders"
33 class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
margaretha62055f72017-04-11 19:17:43 +020034 <property name="ignoreResourceNotFound" value="true" />
35 <property name="locations">
36 <array>
margaretha6c2a20f2017-07-24 15:33:01 +020037 <value>classpath:test-jdbc.properties</value>
margaretha1f106f62017-10-18 22:27:30 +020038 <value>file:./test-jdbc.properties</value>
margarethaaecee1b2018-02-20 14:44:21 +010039 <value>classpath:properties/mail.properties</value>
40 <value>file:./mail.properties</value>
margarethaf6d5a822017-10-19 19:51:20 +020041 <value>classpath:test-hibernate.properties</value>
margarethaf18298b2017-09-14 22:14:32 +020042 <value>classpath:kustvakt-test.conf</value>
margaretha62055f72017-04-11 19:17:43 +020043 </array>
44 </property>
45 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +010046
margaretha62055f72017-04-11 19:17:43 +020047 <bean id='cacheManager' class='org.springframework.cache.ehcache.EhCacheCacheManager'
48 p:cacheManager-ref='ehcache' />
Michael Hanlbd852b82015-11-18 22:17:00 +010049
margaretha62055f72017-04-11 19:17:43 +020050 <bean id='ehcache'
51 class='org.springframework.cache.ehcache.EhCacheManagerFactoryBean'
52 p:configLocation='classpath:ehcache.xml' p:shared='true' />
Michael Hanlbd852b82015-11-18 22:17:00 +010053
margaretha6c2a20f2017-07-24 15:33:01 +020054 <bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource"
55 lazy-init="true">
margaretha4edc70e2018-03-14 22:34:29 +010056 <!-- <property name="driverClassName" value="${jdbc.driverClassName}" /> -->
margaretha6c2a20f2017-07-24 15:33:01 +020057 <property name="url" value="${jdbc.url}" />
58 <property name="username" value="${jdbc.username}" />
59 <property name="password" value="${jdbc.password}" />
margaretha318fec32017-10-24 12:11:58 +020060 <property name="maxTotal" value="4" />
margaretha514e1412017-10-10 15:54:20 +020061 <property name="maxIdle" value="1" />
margaretha6c2a20f2017-07-24 15:33:01 +020062 <property name="minIdle" value="1" />
63 <property name="maxWaitMillis" value="15000" />
64 <!--<property name="poolPreparedStatements" value="true"/> -->
65 </bean>
66
margaretha514e1412017-10-10 15:54:20 +020067 <!-- use SingleConnection only for testing! -->
margaretha6c2a20f2017-07-24 15:33:01 +020068 <bean id="sqliteDataSource"
margaretha62055f72017-04-11 19:17:43 +020069 class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
margaretha318fec32017-10-24 12:11:58 +020070 lazy-init="true">
margaretha514e1412017-10-10 15:54:20 +020071 <!-- <property name="driverClassName" value="${jdbc.driverClassName}" /> -->
margaretha6c2a20f2017-07-24 15:33:01 +020072 <property name="url" value="${jdbc.url}" />
73 <property name="username" value="${jdbc.username}" />
74 <property name="password" value="${jdbc.password}" />
margarethae6c711b2018-02-06 21:55:04 +010075 <property name="connectionProperties">
margaretha58e18632018-02-15 13:04:42 +010076 <props>
77 <prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop>
78 </props>
79 </property>
80
margaretha514e1412017-10-10 15:54:20 +020081 <!-- Sqlite can only have a single connection -->
margaretha62055f72017-04-11 19:17:43 +020082 <property name="suppressClose">
83 <value>true</value>
84 </property>
margaretha514e1412017-10-10 15:54:20 +020085 </bean>
margaretha58e18632018-02-15 13:04:42 +010086
margaretha514e1412017-10-10 15:54:20 +020087 <bean id="c3p0DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
margaretha58e18632018-02-15 13:04:42 +010088 destroy-method="close">
89 <property name="driverClass" value="${jdbc.driverClassName}" />
margaretha514e1412017-10-10 15:54:20 +020090 <property name="jdbcUrl" value="${jdbc.url}" />
91 <property name="user" value="${jdbc.username}" />
92 <property name="password" value="${jdbc.password}" />
margaretha58e18632018-02-15 13:04:42 +010093 <property name="maxPoolSize" value="4" />
94 <property name="minPoolSize" value="1" />
95 <property name="maxStatements" value="1" />
96 <property name="testConnectionOnCheckout" value="true" />
margaretha62055f72017-04-11 19:17:43 +020097 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +010098
margaretha62055f72017-04-11 19:17:43 +020099 <!-- to configure database for sqlite, mysql, etc. migrations -->
100 <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
margarethaf6d5a822017-10-19 19:51:20 +0200101 <!-- drop existing tables and create new tables -->
102 <property name="validateOnMigrate" value="true" />
103 <property name="cleanOnValidationError" value="true" />
104
margaretha514e1412017-10-10 15:54:20 +0200105 <property name="baselineOnMigrate" value="false" />
106 <property name="locations" value="${jdbc.schemaPath}" />
margaretha6c2a20f2017-07-24 15:33:01 +0200107 <property name="dataSource" ref="sqliteDataSource" />
margaretha318fec32017-10-24 12:11:58 +0200108 <!-- <property name="dataSource" ref="dataSource" /> -->
margaretha62055f72017-04-11 19:17:43 +0200109 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100110
margaretha62055f72017-04-11 19:17:43 +0200111 <bean id="kustvakt_db" class="de.ids_mannheim.korap.handlers.JDBCClient">
margaretha318fec32017-10-24 12:11:58 +0200112 <!-- <constructor-arg index="0" ref="dataSource" /> -->
margarethabc9caf42017-09-21 18:52:52 +0200113 <constructor-arg index="0" ref="sqliteDataSource" />
margaretha318fec32017-10-24 12:11:58 +0200114 <property name="database" value="${jdbc.database}" />
margaretha62055f72017-04-11 19:17:43 +0200115 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100116
margarethaade7d4a2017-07-20 19:53:35 +0200117 <bean id="entityManagerFactory"
118 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
margaretha318fec32017-10-24 12:11:58 +0200119 <!-- <property name="dataSource" ref="dataSource" /> -->
120 <property name="dataSource" ref="sqliteDataSource" />
margarethaa452c5e2018-04-25 22:48:09 +0200121 <property name="packagesToScan">
122 <array>
123 <value>de.ids_mannheim.korap.entity</value>
124 <value>de.ids_mannheim.korap.oauth2.entity</value>
125 </array>
126 </property>
margarethaade7d4a2017-07-20 19:53:35 +0200127 <property name="jpaVendorAdapter">
128 <bean id="jpaVendorAdapter"
129 class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
130 <property name="databasePlatform" value="${hibernate.dialect}" />
131 </bean>
132 </property>
133 <property name="jpaProperties">
134 <props>
135 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
136 <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
137 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
138 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
139 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
140 </prop>
141 <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
142 <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
margaretha6ad08b42018-08-22 18:33:54 +0200143 <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
margarethaade7d4a2017-07-20 19:53:35 +0200144 <!-- <prop key="net.sf.ehcache.configurationResourceName">classpath:ehcache.xml</prop> -->
145 </props>
146 </property>
margaretha62055f72017-04-11 19:17:43 +0200147 </bean>
Michael Hanle4fc7752016-02-17 11:41:18 +0100148
margarethaade7d4a2017-07-20 19:53:35 +0200149 <tx:annotation-driven proxy-target-class="true"
150 transaction-manager="transactionManager" />
151 <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
152 <property name="entityManagerFactory" ref="entityManagerFactory" />
margaretha62055f72017-04-11 19:17:43 +0200153 </bean>
Michael Hanle4fc7752016-02-17 11:41:18 +0100154
margarethaade7d4a2017-07-20 19:53:35 +0200155 <bean id="transactionTemplate"
156 class="org.springframework.transaction.support.TransactionTemplate">
157 <constructor-arg ref="transactionManager" />
158 </bean>
159
160 <!-- Data access objects -->
margaretha34954472018-10-24 20:05:17 +0200161 <bean id="adminDao" class="de.ids_mannheim.korap.dao.AdminDaoImpl" />
margaretha58e18632018-02-15 13:04:42 +0100162 <bean id="resourceDao" class="de.ids_mannheim.korap.dao.ResourceDao" />
margarethab4ce6602018-04-26 20:23:57 +0200163 <bean id="accessScopeDao" class="de.ids_mannheim.korap.oauth2.dao.AccessScopeDao" />
margaretha34954472018-10-24 20:05:17 +0200164 <bean id="authorizationDao" class="de.ids_mannheim.korap.oauth2.dao.CachedAuthorizationDaoImpl" />
165
166 <!-- Services -->
167 <bean id="scopeService" class="de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl" />
margaretha064eb6f2018-07-10 18:33:01 +0200168
margarethab4ce6602018-04-26 20:23:57 +0200169 <!-- props are injected from default-config.xml -->
170 <bean id="kustvakt_config" class="de.ids_mannheim.korap.config.FullConfiguration">
171 <constructor-arg name="properties" ref="props" />
172 </bean>
173
margaretha34954472018-10-24 20:05:17 +0200174 <bean id="initializator" class="de.ids_mannheim.de.init.InitializatorImpl"
margaretha1b320452018-08-02 16:56:25 +0200175 init-method="initTest">
margarethab4ce6602018-04-26 20:23:57 +0200176 </bean>
177
margarethaade7d4a2017-07-20 19:53:35 +0200178
margaretha6c2a20f2017-07-24 15:33:01 +0200179 <!-- Krill -->
180 <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
margaretha58e18632018-02-15 13:04:42 +0100181 <constructor-arg value="${krill.indexDir}" />
margaretha6c2a20f2017-07-24 15:33:01 +0200182 </bean>
183
margaretha31a9f522018-04-03 20:40:45 +0200184 <!-- URLValidator -->
margarethae4034a82018-07-02 14:46:59 +0200185 <bean id="redirectURIValidator" class="org.apache.commons.validator.routines.UrlValidator">
186 <constructor-arg value="http,https" index="0" />
187 <constructor-arg index="1" type="long">
188 <util:constant
189 static-field="org.apache.commons.validator.routines.UrlValidator.NO_FRAGMENTS" />
190 </constructor-arg>
margaretha31a9f522018-04-03 20:40:45 +0200191 </bean>
margarethad7cab212018-07-02 19:01:43 +0200192 <bean id="urlValidator" class="org.apache.commons.validator.routines.UrlValidator">
193 <constructor-arg value="http,https" />
194 </bean>
margaretha56e8e552017-12-05 16:31:21 +0100195
margaretha34954472018-10-24 20:05:17 +0200196 <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.FullRewriteHandler">
margaretha56e8e552017-12-05 16:31:21 +0100197 <constructor-arg ref="kustvakt_config" />
198 </bean>
199
margaretha62055f72017-04-11 19:17:43 +0200200 <bean id="kustvakt_auditing" class="de.ids_mannheim.korap.handlers.JDBCAuditing">
201 <constructor-arg ref="kustvakt_db" />
202 </bean>
margaretha58e18632018-02-15 13:04:42 +0100203
margarethada3c7852018-06-14 20:35:11 +0200204 <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
margaretha05122312018-04-16 15:01:34 +0200205 <constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
206 </bean>
margarethafb027f92018-04-23 20:00:13 +0200207
208 <!-- OAuth -->
margarethaf839dde2018-04-16 17:52:57 +0200209 <bean id="oauth2ResponseHandler" class="de.ids_mannheim.korap.web.OAuth2ResponseHandler">
margaretha58e18632018-02-15 13:04:42 +0100210 <constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
211 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100212
margarethafb027f92018-04-23 20:00:13 +0200213 <bean id="mdGenerator" class="org.apache.oltu.oauth2.as.issuer.MD5Generator">
214 </bean>
215 <bean id="oauthIssuer" class="org.apache.oltu.oauth2.as.issuer.OAuthIssuerImpl">
216 <constructor-arg index="0" ref="mdGenerator" />
217 </bean>
218
margaretha62055f72017-04-11 19:17:43 +0200219 <bean id="kustvakt_userdb" class="de.ids_mannheim.korap.handlers.EntityDao">
220 <constructor-arg ref="kustvakt_db" />
221 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100222
margarethafb027f92018-04-23 20:00:13 +0200223 <bean name="kustvakt_encryption" class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
margaretha62055f72017-04-11 19:17:43 +0200224 <constructor-arg ref="kustvakt_config" />
225 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100226
margaretha62055f72017-04-11 19:17:43 +0200227 <!-- authentication providers to use -->
margaretha58e18632018-02-15 13:04:42 +0100228 <!-- <bean id="api_auth" class="de.ids_mannheim.korap.authentication.APIAuthentication">
229 <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
230 ref="kustvakt_config" /> </bean> -->
margaretha4de41192017-11-15 11:47:11 +0100231 <bean id="ldap_auth" class="de.ids_mannheim.korap.authentication.LdapAuth3">
margaretha62055f72017-04-11 19:17:43 +0200232 <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
233 ref="kustvakt_config" />
234 </bean>
margaretha58e18632018-02-15 13:04:42 +0100235
margaretha6ef00dd2018-09-12 14:06:38 +0200236 <!-- <bean id="openid_auth"
margaretha139d0f72017-11-14 18:56:22 +0100237 class="de.ids_mannheim.korap.authentication.OpenIDconnectAuthentication">
margaretha62055f72017-04-11 19:17:43 +0200238 <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
239 ref="kustvakt_config" />
240 <constructor-arg
241 type="de.ids_mannheim.korap.interfaces.db.PersistenceClient" ref="kustvakt_db" />
margaretha6ef00dd2018-09-12 14:06:38 +0200242 </bean> -->
margaretha62055f72017-04-11 19:17:43 +0200243
margaretha58e18632018-02-15 13:04:42 +0100244 <bean id="basic_auth"
245 class="de.ids_mannheim.korap.authentication.BasicAuthentication" />
Michael Hanlbd852b82015-11-18 22:17:00 +0100246
247
margaretha62055f72017-04-11 19:17:43 +0200248 <bean id="session_auth"
margaretha139d0f72017-11-14 18:56:22 +0100249 class="de.ids_mannheim.korap.authentication.SessionAuthentication">
margaretha62055f72017-04-11 19:17:43 +0200250 <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
251 ref="kustvakt_config" />
252 <constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
253 ref="kustvakt_encryption" />
254 </bean>
margarethae4034a82018-07-02 14:46:59 +0200255
margarethacf306d32018-05-30 19:45:35 +0200256 <bean id="oauth2_auth"
257 class="de.ids_mannheim.korap.authentication.OAuth2Authentication" />
margarethae4034a82018-07-02 14:46:59 +0200258
Michael Hanlbd852b82015-11-18 22:17:00 +0100259
margaretha62055f72017-04-11 19:17:43 +0200260 <util:list id="kustvakt_authproviders"
261 value-type="de.ids_mannheim.korap.interfaces.AuthenticationIface">
262 <ref bean="basic_auth" />
margaretha4de41192017-11-15 11:47:11 +0100263 <ref bean="ldap_auth" />
margaretha62055f72017-04-11 19:17:43 +0200264 <ref bean="session_auth" />
margaretha4de41192017-11-15 11:47:11 +0100265 <!-- <ref bean="api_auth" /> -->
margaretha6ef00dd2018-09-12 14:06:38 +0200266 <!-- <ref bean="openid_auth" /> -->
margarethacf306d32018-05-30 19:45:35 +0200267 <ref bean="oauth2_auth" />
margaretha62055f72017-04-11 19:17:43 +0200268 </util:list>
Michael Hanlbd852b82015-11-18 22:17:00 +0100269
margarethaade7d4a2017-07-20 19:53:35 +0200270
margaretha62055f72017-04-11 19:17:43 +0200271 <bean id="userdata_details" class="de.ids_mannheim.korap.handlers.UserDetailsDao">
margarethaade7d4a2017-07-20 19:53:35 +0200272 <constructor-arg ref="kustvakt_db" />
margaretha62055f72017-04-11 19:17:43 +0200273 </bean>
margarethaade7d4a2017-07-20 19:53:35 +0200274
margaretha62055f72017-04-11 19:17:43 +0200275 <bean id="userdata_settings" class="de.ids_mannheim.korap.handlers.UserSettingsDao">
margarethaade7d4a2017-07-20 19:53:35 +0200276 <constructor-arg ref="kustvakt_db" />
margaretha62055f72017-04-11 19:17:43 +0200277 </bean>
Michael Hanldaf86602016-05-12 14:31:52 +0200278
margaretha62055f72017-04-11 19:17:43 +0200279 <util:list id="kustvakt_userdata"
280 value-type="de.ids_mannheim.korap.interfaces.db.UserdataDbIface">
281 <ref bean="userdata_details" />
282 <ref bean="userdata_settings" />
283 </util:list>
Michael Hanldaf86602016-05-12 14:31:52 +0200284
margaretha62055f72017-04-11 19:17:43 +0200285 <!-- specify type for constructor argument -->
margaretha34954472018-10-24 20:05:17 +0200286 <bean id="authenticationManager"
margaretha139d0f72017-11-14 18:56:22 +0100287 class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager">
margarethafb027f92018-04-23 20:00:13 +0200288 <constructor-arg type="de.ids_mannheim.korap.interfaces.EntityHandlerIface"
289 ref="kustvakt_userdb" />
margaretha62055f72017-04-11 19:17:43 +0200290 <constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
291 ref="kustvakt_encryption" />
292 <constructor-arg ref="kustvakt_config" />
293 <constructor-arg type="de.ids_mannheim.korap.interfaces.db.AuditingIface"
294 ref="kustvakt_auditing" />
295 <constructor-arg ref="kustvakt_userdata" />
296 <!-- inject authentication providers to use -->
297 <property name="providers" ref="kustvakt_authproviders" />
298 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100299
margaretha62055f72017-04-11 19:17:43 +0200300 <!-- todo: if db interfaces not loaded via spring, does transaction even
301 work then? -->
302 <!-- the transactional advice (i.e. what 'happens'; see the <aop:advisor/>
303 bean below) -->
304 <tx:advice id="txAdvice" transaction-manager="txManager">
305 <!-- the transactional semantics... -->
306 <tx:attributes>
307 <!-- all methods starting with 'get' are read-only -->
308 <tx:method name="get*" read-only="true" rollback-for="KorAPException" />
309 <!-- other methods use the default transaction settings (see below) -->
310 <tx:method name="*" rollback-for="KorAPException" />
311 </tx:attributes>
312 </tx:advice>
Michael Hanlbd852b82015-11-18 22:17:00 +0100313
margaretha62055f72017-04-11 19:17:43 +0200314 <!-- ensure that the above transactional advice runs for any execution of
315 an operation defined by the service interface -->
316 <aop:config>
317 <aop:pointcut id="service"
318 expression="execution(* de.ids_mannheim.korap.interfaces.db.*.*(..))" />
319 <aop:advisor advice-ref="txAdvice" pointcut-ref="service" />
320 </aop:config>
Michael Hanlbd852b82015-11-18 22:17:00 +0100321
margaretha62055f72017-04-11 19:17:43 +0200322 <!-- similarly, don't forget the PlatformTransactionManager -->
323 <bean id="txManager"
324 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
325 <property name="dataSource" ref="dataSource" />
326 </bean>
margaretha58e18632018-02-15 13:04:42 +0100327
328 <!-- mail -->
margarethaaecee1b2018-02-20 14:44:21 +0100329 <bean id="authenticator" class="de.ids_mannheim.korap.service.MailAuthenticator">
margarethafb027f92018-04-23 20:00:13 +0200330 <constructor-arg index="0" value="${mail.username}" />
331 <constructor-arg index="1" value="${mail.password}" />
margarethaaecee1b2018-02-20 14:44:21 +0100332 </bean>
333 <bean id="smtpSession" class="javax.mail.Session" factory-method="getInstance">
334 <constructor-arg index="0">
335 <props>
336 <prop key="mail.smtp.submitter">${mail.username}</prop>
337 <prop key="mail.smtp.auth">${mail.auth}</prop>
338 <prop key="mail.smtp.host">${mail.host}</prop>
339 <prop key="mail.smtp.port">${mail.port}</prop>
340 <prop key="mail.smtp.starttls.enable">${mail.starttls.enable}</prop>
341 <prop key="mail.smtp.connectiontimeout">${mail.connectiontimeout}</prop>
342 </props>
343 </constructor-arg>
margarethafb027f92018-04-23 20:00:13 +0200344 <constructor-arg index="1" ref="authenticator" />
margaretha58e18632018-02-15 13:04:42 +0100345 </bean>
346 <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
347 <property name="session" ref="smtpSession" />
348 </bean>
349 <bean id="velocityEngine" class="org.apache.velocity.app.VelocityEngine">
350 <constructor-arg index="0">
351 <props>
352 <prop key="resource.loader">class</prop>
353 <prop key="class.resource.loader.class">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
354 </prop>
355 </props>
356 </constructor-arg>
margarethaaecee1b2018-02-20 14:44:21 +0100357 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100358</beans>