blob: f5c135288136aa2fccff1d277d2cd89775d84669 [file] [log] [blame]
Michael Hanlca740d72015-06-16 10:04:58 +02001<?xml version="1.0" encoding="UTF-8"?>
2<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
margaretha0e8f4e72018-04-05 14:11:52 +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"
5 xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
margaretha543f2002017-07-14 00:27:15 +02006 xmlns:cache="http://www.springframework.org/schema/cache"
7 xsi:schemaLocation="http://www.springframework.org/schema/beans
margaretha3da7cd32018-10-22 17:42:52 +02008 http://www.springframework.org/schema/beans/spring-beans.xsd
margaretha543f2002017-07-14 00:27:15 +02009 http://www.springframework.org/schema/tx
margaretha3da7cd32018-10-22 17:42:52 +020010 http://www.springframework.org/schema/tx/spring-tx.xsd
margaretha543f2002017-07-14 00:27:15 +020011 http://www.springframework.org/schema/aop
margaretha3da7cd32018-10-22 17:42:52 +020012 http://www.springframework.org/schema/aop/spring-aop.xsd
margaretha543f2002017-07-14 00:27:15 +020013 http://www.springframework.org/schema/context
margaretha3da7cd32018-10-22 17:42:52 +020014 http://www.springframework.org/schema/context/spring-context.xsd
margaretha543f2002017-07-14 00:27:15 +020015 http://www.springframework.org/schema/util
margaretha3da7cd32018-10-22 17:42:52 +020016 http://www.springframework.org/schema/util/spring-util.xsd">
margaretha543f2002017-07-14 00:27:15 +020017
18 <context:component-scan base-package="de.ids_mannheim.korap" />
19 <context:annotation-config />
20
21 <bean id="props"
22 class="org.springframework.beans.factory.config.PropertiesFactoryBean">
23 <property name="ignoreResourceNotFound" value="true" />
24 <property name="locations">
25 <array>
26 <value>classpath:kustvakt.conf</value>
27 <value>file:./kustvakt.conf</value>
28 </array>
29 </property>
30 </bean>
31
32 <bean id="placeholders"
33 class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
34 <property name="ignoreResourceNotFound" value="true" />
35 <property name="locations">
36 <array>
margarethaaecee1b2018-02-20 14:44:21 +010037 <value>classpath:properties/jdbc.properties</value>
margarethaea68a0a2017-09-21 03:09:49 +020038 <value>file:./jdbc.properties</value>
margarethaaecee1b2018-02-20 14:44:21 +010039 <value>classpath:properties/mail.properties</value>
40 <value>file:./mail.properties</value>
margarethae72355a2018-11-28 16:53:09 +010041 <value>classpath:hibernate.properties</value>
margaretha0e8f4e72018-04-05 14:11:52 +020042
margarethaade7d4a2017-07-20 19:53:35 +020043 <value>classpath:kustvakt.conf</value>
margaretha14503cd2017-09-08 15:35:24 +020044 <value>file:./kustvakt.conf</value>
margaretha543f2002017-07-14 00:27:15 +020045 </array>
46 </property>
47 </bean>
48
49 <bean id='cacheManager' class='org.springframework.cache.ehcache.EhCacheCacheManager'
50 p:cacheManager-ref='ehcache' />
51
52 <bean id='ehcache'
53 class='org.springframework.cache.ehcache.EhCacheManagerFactoryBean'
54 p:configLocation='classpath:ehcache.xml' p:shared='true' />
55
margaretha543f2002017-07-14 00:27:15 +020056 <!--class="org.apache.commons.dbcp2.BasicDataSource" -->
57 <!-- org.springframework.jdbc.datasource.SingleConnectionDataSource -->
58 <bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource"
59 lazy-init="true">
60 <property name="driverClassName" value="${jdbc.driverClassName}" />
61 <property name="url" value="${jdbc.url}" />
62 <property name="username" value="${jdbc.username}" />
63 <property name="password" value="${jdbc.password}" />
64 <!-- relevant for single connection datasource and sqlite -->
65 <!-- <property name="suppressClose"> <value>true</value> </property> -->
66 <!--<property name="initialSize" value="2"/> -->
67 <property name="maxTotal" value="4" />
68 <property name="maxIdle" value="2" />
69 <property name="minIdle" value="1" />
margaretha45211af2018-08-28 12:49:07 +020070 <property name="maxWaitMillis" value="-1" />
margaretha543f2002017-07-14 00:27:15 +020071 <!--<property name="poolPreparedStatements" value="true"/> -->
72 </bean>
margaretha45211af2018-08-28 12:49:07 +020073
74 <bean id="c3p0DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
75 destroy-method="close" lazy-init="true">
76 <property name="driverClass" value="${jdbc.driverClassName}" />
77 <property name="jdbcUrl" value="${jdbc.url}" />
78 <property name="user" value="${jdbc.username}" />
79 <property name="password" value="${jdbc.password}" />
80 <property name="maxPoolSize" value="4" />
81 <property name="minPoolSize" value="1" />
82 <property name="maxStatements" value="100" />
83 <!-- <property name="testConnectionOnCheckOut" value="true" /> -->
84 <property name="idleConnectionTestPeriod" value="60" />
85 <property name="testConnectionOnCheckin" value="true" />
86 </bean>
margaretha543f2002017-07-14 00:27:15 +020087
88 <bean id="sqliteDataSource"
89 class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
90 lazy-init="true">
91 <property name="driverClassName" value="${jdbc.driverClassName}" />
92 <property name="url" value="${jdbc.url}" />
93 <property name="username" value="${jdbc.username}" />
94 <property name="password" value="${jdbc.password}" />
margarethae6c711b2018-02-06 21:55:04 +010095 <property name="connectionProperties">
margaretha0e8f4e72018-04-05 14:11:52 +020096 <props>
97 <prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop>
98 </props>
99 </property>
100
margaretha543f2002017-07-14 00:27:15 +0200101 <!-- relevant for single connection datasource and sqlite -->
102 <property name="suppressClose">
103 <value>true</value>
104 </property>
105 <!--<property name="initialSize" value="2"/> -->
106 <!--<property name="poolPreparedStatements" value="true"/> -->
107 </bean>
108
109 <!-- to configure database for sqlite, mysql, etc. migrations -->
margarethafcf8bd92021-01-14 10:55:53 +0100110 <bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
margarethaf6d5a822017-10-19 19:51:20 +0200111 <property name="baselineOnMigrate" value="true" />
margarethaecbe72d2017-07-26 17:13:32 +0200112 <!-- <property name="validateOnMigrate" value="false" /> -->
113 <!-- <property name="cleanOnValidationError" value="true" /> -->
margarethafcf8bd92021-01-14 10:55:53 +0100114 <property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
margaretha894a7d72017-11-08 19:24:20 +0100115 <!-- <property name="dataSource" ref="dataSource" /> -->
margaretha8514d782018-08-28 17:36:56 +0200116 <property name="dataSource" ref="sqliteDataSource" />
117 <!-- <property name="dataSource" ref="c3p0DataSource" /> -->
margaretha45211af2018-08-28 12:49:07 +0200118
margaretha543f2002017-07-14 00:27:15 +0200119 </bean>
margarethafcf8bd92021-01-14 10:55:53 +0100120
121 <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
122 <constructor-arg ref="flywayConfig"/>
123 </bean>
margaretha0e8f4e72018-04-05 14:11:52 +0200124
margaretha543f2002017-07-14 00:27:15 +0200125 <bean id="kustvakt_db" class="de.ids_mannheim.korap.handlers.JDBCClient">
126 <constructor-arg index="0" ref="dataSource" />
127 <!-- deprecated property -->
128 <property name="database" value="${jdbc.database}" />
129 </bean>
130
131 <bean id="entityManagerFactory"
margarethafcf8bd92021-01-14 10:55:53 +0100132 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
133 depends-on="flyway">
margaretha894a7d72017-11-08 19:24:20 +0100134 <!-- <property name="dataSource" ref="dataSource" /> -->
margaretha8514d782018-08-28 17:36:56 +0200135 <property name="dataSource" ref="sqliteDataSource" />
136 <!-- <property name="dataSource" ref="c3p0DataSource" /> -->
margaretha0e8f4e72018-04-05 14:11:52 +0200137
margarethaa452c5e2018-04-25 22:48:09 +0200138 <property name="packagesToScan">
139 <array>
140 <value>de.ids_mannheim.korap.entity</value>
141 <value>de.ids_mannheim.korap.oauth2.entity</value>
142 </array>
143 </property>
margaretha543f2002017-07-14 00:27:15 +0200144 <property name="jpaVendorAdapter">
145 <bean id="jpaVendorAdapter"
146 class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
147 <property name="databasePlatform" value="${hibernate.dialect}" />
148 </bean>
149 </property>
150 <property name="jpaProperties">
151 <props>
152 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
153 <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
154 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
155 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
156 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
157 </prop>
158 <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
159 <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
margaretha6ad08b42018-08-22 18:33:54 +0200160 <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
margaretha543f2002017-07-14 00:27:15 +0200161 </props>
162 </property>
163 </bean>
164
165 <tx:annotation-driven proxy-target-class="true"
166 transaction-manager="transactionManager" />
margaretha0e8f4e72018-04-05 14:11:52 +0200167
margaretha543f2002017-07-14 00:27:15 +0200168 <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
169 <property name="entityManagerFactory" ref="entityManagerFactory" />
170 </bean>
171
172 <bean id="transactionTemplate"
173 class="org.springframework.transaction.support.TransactionTemplate">
174 <constructor-arg ref="transactionManager" />
175 </bean>
176
margarethaade7d4a2017-07-20 19:53:35 +0200177 <!-- Data access objects -->
margaretha34954472018-10-24 20:05:17 +0200178 <bean id="adminDao" class="de.ids_mannheim.korap.dao.AdminDaoImpl" />
margaretha34954472018-10-24 20:05:17 +0200179 <bean id="authorizationDao" class="de.ids_mannheim.korap.oauth2.dao.CachedAuthorizationDaoImpl" />
margarethab4ce6602018-04-26 20:23:57 +0200180
margaretha34954472018-10-24 20:05:17 +0200181 <!-- Filters -->
182 <!-- <bean id="authenticationFilter" class="de.ids_mannheim.korap.web.filter.AuthenticationFilter" >
183 <property name="authenticationManager" ref="kustvakt_authenticationmanager"/>
184 </bean>
185 <bean id="piwikFilter" class="de.ids_mannheim.korap.web.filter.PiwikFilter" >
186 <property name="authenticationManager" ref="kustvakt_authenticationmanager"/>
187 </bean> -->
188
189 <!-- Services -->
190 <bean id="scopeService" class="de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl" />
191
margarethab4ce6602018-04-26 20:23:57 +0200192 <!-- props are injected from default-config.xml -->
193 <bean id="kustvakt_config" class="de.ids_mannheim.korap.config.FullConfiguration">
194 <constructor-arg name="properties" ref="props" />
195 </bean>
196
margarethafc5fab22021-07-26 12:17:39 +0200197 <bean id="initializator" class="de.ids_mannheim.de.init.Initializator"
198 init-method="init">
margarethab4ce6602018-04-26 20:23:57 +0200199 </bean>
margaretha47a72a82019-07-03 16:00:54 +0200200
201 <bean id="vcLoader" class="de.ids_mannheim.de.init.VCLoaderImpl"/>
202
margarethaade7d4a2017-07-20 19:53:35 +0200203 <!-- Krill -->
204 <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
margaretha0e8f4e72018-04-05 14:11:52 +0200205 <constructor-arg value="${krill.indexDir}" />
margaretha543f2002017-07-14 00:27:15 +0200206 </bean>
margaretha6cd27f32019-01-24 14:47:47 +0100207
208 <!-- Validator -->
209 <bean id="validator" class="de.ids_mannheim.korap.validator.ApacheValidator"/>
margaretha543f2002017-07-14 00:27:15 +0200210
margaretha31a9f522018-04-03 20:40:45 +0200211 <!-- URLValidator -->
margarethae4034a82018-07-02 14:46:59 +0200212 <bean id="redirectURIValidator" class="org.apache.commons.validator.routines.UrlValidator">
213 <constructor-arg value="http,https" index="0" />
214 <constructor-arg index="1" type="long">
215 <util:constant
216 static-field="org.apache.commons.validator.routines.UrlValidator.NO_FRAGMENTS" />
217 </constructor-arg>
margarethaa0486272018-04-12 19:59:31 +0200218 </bean>
margarethad7cab212018-07-02 19:01:43 +0200219 <bean id="urlValidator" class="org.apache.commons.validator.routines.UrlValidator">
220 <constructor-arg value="http,https" />
221 </bean>
222
margaretha34954472018-10-24 20:05:17 +0200223 <!-- Rewrite -->
margaretha4fa4b062019-01-28 19:43:30 +0100224 <bean id="foundryRewrite" class="de.ids_mannheim.korap.rewrite.FoundryRewrite"/>
225 <bean id="collectionRewrite" class="de.ids_mannheim.korap.rewrite.CollectionRewrite"/>
226 <bean id="virtualCorpusRewrite" class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite"/>
Akronbee031a2020-10-29 16:58:14 +0100227 <bean id="queryReferenceRewrite" class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite"/>
margaretha4fa4b062019-01-28 19:43:30 +0100228
229 <util:list id="rewriteTasks"
230 value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
231 <ref bean="foundryRewrite" />
232 <ref bean="collectionRewrite" />
233 <ref bean="virtualCorpusRewrite" />
Akronbee031a2020-10-29 16:58:14 +0100234 <ref bean="queryReferenceRewrite" />
margaretha4fa4b062019-01-28 19:43:30 +0100235 </util:list>
236
237 <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
238 <constructor-arg ref="rewriteTasks"/>
margaretha56e8e552017-12-05 16:31:21 +0100239 </bean>
240
margaretha543f2002017-07-14 00:27:15 +0200241 <bean id="kustvakt_auditing" class="de.ids_mannheim.korap.handlers.JDBCAuditing">
242 <constructor-arg ref="kustvakt_db" />
243 </bean>
244
margarethad7cab212018-07-02 19:01:43 +0200245 <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
margaretha0e8f4e72018-04-05 14:11:52 +0200246 <constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
247 </bean>
margarethaa452c5e2018-04-25 22:48:09 +0200248
margarethafb027f92018-04-23 20:00:13 +0200249 <!-- OAuth -->
250 <bean id="oauth2ResponseHandler" class="de.ids_mannheim.korap.web.OAuth2ResponseHandler">
margaretha05122312018-04-16 15:01:34 +0200251 <constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
252 </bean>
margarethaa452c5e2018-04-25 22:48:09 +0200253
margarethafb027f92018-04-23 20:00:13 +0200254 <bean id="mdGenerator" class="org.apache.oltu.oauth2.as.issuer.MD5Generator">
255 </bean>
256 <bean id="oauthIssuer" class="org.apache.oltu.oauth2.as.issuer.OAuthIssuerImpl">
257 <constructor-arg index="0" ref="mdGenerator" />
258 </bean>
margaretha0e8f4e72018-04-05 14:11:52 +0200259
margaretha543f2002017-07-14 00:27:15 +0200260 <bean id="kustvakt_userdb" class="de.ids_mannheim.korap.handlers.EntityDao">
261 <constructor-arg ref="kustvakt_db" />
262 </bean>
263
margarethaa452c5e2018-04-25 22:48:09 +0200264 <bean name="kustvakt_encryption" class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
margaretha543f2002017-07-14 00:27:15 +0200265 <constructor-arg ref="kustvakt_config" />
266 </bean>
267
268 <!-- authentication providers to use -->
margaretha0e8f4e72018-04-05 14:11:52 +0200269 <!-- <bean id="api_auth" class="de.ids_mannheim.korap.authentication.APIAuthentication">
270 <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
271 ref="kustvakt_config" /> </bean> -->
272
margaretha4de41192017-11-15 11:47:11 +0100273 <bean id="ldap_auth" class="de.ids_mannheim.korap.authentication.LdapAuth3">
margaretha543f2002017-07-14 00:27:15 +0200274 <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
275 ref="kustvakt_config" />
276 </bean>
277
margaretha6ef00dd2018-09-12 14:06:38 +0200278 <!-- <bean id="openid_auth"
margaretha139d0f72017-11-14 18:56:22 +0100279 class="de.ids_mannheim.korap.authentication.OpenIDconnectAuthentication">
margaretha543f2002017-07-14 00:27:15 +0200280 <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
281 ref="kustvakt_config" />
282 <constructor-arg
283 type="de.ids_mannheim.korap.interfaces.db.PersistenceClient" ref="kustvakt_db" />
margaretha6ef00dd2018-09-12 14:06:38 +0200284 </bean> -->
margaretha543f2002017-07-14 00:27:15 +0200285
margaretha543f2002017-07-14 00:27:15 +0200286 <bean id="session_auth"
margaretha139d0f72017-11-14 18:56:22 +0100287 class="de.ids_mannheim.korap.authentication.SessionAuthentication">
margaretha543f2002017-07-14 00:27:15 +0200288 <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
289 ref="kustvakt_config" />
290 <constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
291 ref="kustvakt_encryption" />
292 </bean>
Michael Hanlca740d72015-06-16 10:04:58 +0200293
margarethacf306d32018-05-30 19:45:35 +0200294 <bean id="oauth2_auth"
295 class="de.ids_mannheim.korap.authentication.OAuth2Authentication" />
296
margaretha543f2002017-07-14 00:27:15 +0200297 <util:list id="kustvakt_authproviders"
298 value-type="de.ids_mannheim.korap.interfaces.AuthenticationIface">
margaretha4de41192017-11-15 11:47:11 +0100299 <ref bean="ldap_auth" />
margaretha543f2002017-07-14 00:27:15 +0200300 <ref bean="session_auth" />
margaretha4de41192017-11-15 11:47:11 +0100301 <!-- <ref bean="api_auth" /> -->
margaretha6ef00dd2018-09-12 14:06:38 +0200302 <!-- <ref bean="openid_auth" /> -->
margarethacf306d32018-05-30 19:45:35 +0200303 <ref bean="oauth2_auth" />
margaretha543f2002017-07-14 00:27:15 +0200304 </util:list>
Michael Hanl72c7b832015-09-03 08:42:15 +0200305
306
margaretha543f2002017-07-14 00:27:15 +0200307 <bean id="userdata_details" class="de.ids_mannheim.korap.handlers.UserDetailsDao">
308 <constructor-arg ref="kustvakt_db" />
309 </bean>
Michael Hanl72c7b832015-09-03 08:42:15 +0200310
margaretha543f2002017-07-14 00:27:15 +0200311 <bean id="userdata_settings" class="de.ids_mannheim.korap.handlers.UserSettingsDao">
312 <constructor-arg ref="kustvakt_db" />
313 </bean>
314
315 <util:list id="kustvakt_userdata"
316 value-type="de.ids_mannheim.korap.interfaces.db.UserdataDbIface">
317 <ref bean="userdata_details" />
318 <ref bean="userdata_settings" />
319 </util:list>
Michael Hanl72c7b832015-09-03 08:42:15 +0200320
margaretha543f2002017-07-14 00:27:15 +0200321 <!-- specify type for constructor argument -->
margaretha34954472018-10-24 20:05:17 +0200322 <bean id="authenticationManager"
margaretha139d0f72017-11-14 18:56:22 +0100323 class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager">
margaretha0e8f4e72018-04-05 14:11:52 +0200324 <constructor-arg type="de.ids_mannheim.korap.interfaces.EntityHandlerIface"
325 ref="kustvakt_userdb" />
margaretha543f2002017-07-14 00:27:15 +0200326 <constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
327 ref="kustvakt_encryption" />
328 <constructor-arg ref="kustvakt_config" />
329 <constructor-arg type="de.ids_mannheim.korap.interfaces.db.AuditingIface"
330 ref="kustvakt_auditing" />
331 <constructor-arg ref="kustvakt_userdata" />
332 <!-- inject authentication providers to use -->
333 <property name="providers" ref="kustvakt_authproviders" />
334 </bean>
margaretha34954472018-10-24 20:05:17 +0200335
margaretha543f2002017-07-14 00:27:15 +0200336 <!-- todo: if db interfaces not loaded via spring, does transaction even
337 work then? -->
338 <!-- the transactional advice (i.e. what 'happens'; see the <aop:advisor/>
339 bean below) -->
340 <tx:advice id="txAdvice" transaction-manager="txManager">
341 <!-- the transactional semantics... -->
342 <tx:attributes>
343 <!-- all methods starting with 'get' are read-only -->
344 <tx:method name="get*" read-only="true" rollback-for="KorAPException" />
345 <!-- other methods use the default transaction settings (see below) -->
346 <tx:method name="*" rollback-for="KorAPException" />
347 </tx:attributes>
348 </tx:advice>
Michael Hanldaf86602016-05-12 14:31:52 +0200349
margaretha543f2002017-07-14 00:27:15 +0200350 <!-- ensure that the above transactional advice runs for any execution of
351 an operation defined by the service interface -->
352 <aop:config>
353 <aop:pointcut id="service"
354 expression="execution(* de.ids_mannheim.korap.interfaces.db.*.*(..))" />
355 <aop:advisor advice-ref="txAdvice" pointcut-ref="service" />
356 </aop:config>
Michael Hanlf8fcc7a2016-06-03 17:41:07 +0200357
margaretha543f2002017-07-14 00:27:15 +0200358 <!-- similarly, don't forget the PlatformTransactionManager -->
359 <bean id="txManager"
360 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
margaretha894a7d72017-11-08 19:24:20 +0100361 <!-- <property name="dataSource" ref="dataSource" /> -->
margaretha8514d782018-08-28 17:36:56 +0200362 <property name="dataSource" ref="sqliteDataSource" />
363 <!-- <property name="dataSource" ref="c3p0DataSource" /> -->
margaretha543f2002017-07-14 00:27:15 +0200364 </bean>
margaretha0e8f4e72018-04-05 14:11:52 +0200365
margarethac9f1dfa2018-02-07 17:50:33 +0100366 <!-- mail -->
margaretha0e8f4e72018-04-05 14:11:52 +0200367 <bean id="authenticator" class="de.ids_mannheim.korap.service.MailAuthenticator">
368 <constructor-arg index="0" value="${mail.username}" />
369 <constructor-arg index="1" value="${mail.password}" />
margarethaaecee1b2018-02-20 14:44:21 +0100370 </bean>
371 <bean id="smtpSession" class="javax.mail.Session" factory-method="getInstance">
372 <constructor-arg index="0">
373 <props>
374 <prop key="mail.smtp.submitter">${mail.username}</prop>
375 <prop key="mail.smtp.auth">${mail.auth}</prop>
376 <prop key="mail.smtp.host">${mail.host}</prop>
377 <prop key="mail.smtp.port">${mail.port}</prop>
378 <prop key="mail.smtp.starttls.enable">${mail.starttls.enable}</prop>
379 <prop key="mail.smtp.connectiontimeout">${mail.connectiontimeout}</prop>
380 </props>
381 </constructor-arg>
margaretha0e8f4e72018-04-05 14:11:52 +0200382 <constructor-arg index="1" ref="authenticator" />
margarethac9f1dfa2018-02-07 17:50:33 +0100383 </bean>
384 <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
margarethaaecee1b2018-02-20 14:44:21 +0100385 <property name="username" value="${mail.username}" />
margaretha0e8f4e72018-04-05 14:11:52 +0200386 <property name="password" value="${mail.password}" />
margarethac9f1dfa2018-02-07 17:50:33 +0100387 <property name="session" ref="smtpSession" />
388 </bean>
389 <bean id="velocityEngine" class="org.apache.velocity.app.VelocityEngine">
390 <constructor-arg index="0">
391 <props>
392 <prop key="resource.loader">class</prop>
margaretha0e8f4e72018-04-05 14:11:52 +0200393 <prop key="class.resource.loader.class">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
394 </prop>
margarethac9f1dfa2018-02-07 17:50:33 +0100395 </props>
396 </constructor-arg>
margarethaaecee1b2018-02-20 14:44:21 +0100397 </bean>
Akronbee031a2020-10-29 16:58:14 +0100398</beans>