blob: 84ba8759d2e88fe6c3ee5816f1a611d39de4c020 [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>
margaretha1960ea52023-02-28 11:20:15 +010042 <value>file:./kustvakt-test.conf</value>
margarethaf18298b2017-09-14 22:14:32 +020043 <value>classpath:kustvakt-test.conf</value>
margaretha62055f72017-04-11 19:17:43 +020044 </array>
45 </property>
46 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +010047
margaretha62055f72017-04-11 19:17:43 +020048 <bean id='cacheManager' class='org.springframework.cache.ehcache.EhCacheCacheManager'
49 p:cacheManager-ref='ehcache' />
Michael Hanlbd852b82015-11-18 22:17:00 +010050
margaretha62055f72017-04-11 19:17:43 +020051 <bean id='ehcache'
52 class='org.springframework.cache.ehcache.EhCacheManagerFactoryBean'
53 p:configLocation='classpath:ehcache.xml' p:shared='true' />
Michael Hanlbd852b82015-11-18 22:17:00 +010054
margaretha6c2a20f2017-07-24 15:33:01 +020055 <bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource"
56 lazy-init="true">
margaretha4edc70e2018-03-14 22:34:29 +010057 <!-- <property name="driverClassName" value="${jdbc.driverClassName}" /> -->
margaretha6c2a20f2017-07-24 15:33:01 +020058 <property name="url" value="${jdbc.url}" />
59 <property name="username" value="${jdbc.username}" />
60 <property name="password" value="${jdbc.password}" />
margaretha318fec32017-10-24 12:11:58 +020061 <property name="maxTotal" value="4" />
margaretha514e1412017-10-10 15:54:20 +020062 <property name="maxIdle" value="1" />
margaretha6c2a20f2017-07-24 15:33:01 +020063 <property name="minIdle" value="1" />
64 <property name="maxWaitMillis" value="15000" />
65 <!--<property name="poolPreparedStatements" value="true"/> -->
66 </bean>
67
margaretha514e1412017-10-10 15:54:20 +020068 <!-- use SingleConnection only for testing! -->
margaretha6c2a20f2017-07-24 15:33:01 +020069 <bean id="sqliteDataSource"
margaretha62055f72017-04-11 19:17:43 +020070 class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
margaretha318fec32017-10-24 12:11:58 +020071 lazy-init="true">
margaretha514e1412017-10-10 15:54:20 +020072 <!-- <property name="driverClassName" value="${jdbc.driverClassName}" /> -->
margaretha6c2a20f2017-07-24 15:33:01 +020073 <property name="url" value="${jdbc.url}" />
74 <property name="username" value="${jdbc.username}" />
75 <property name="password" value="${jdbc.password}" />
margarethae6c711b2018-02-06 21:55:04 +010076 <property name="connectionProperties">
margaretha58e18632018-02-15 13:04:42 +010077 <props>
78 <prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop>
79 </props>
80 </property>
81
margaretha514e1412017-10-10 15:54:20 +020082 <!-- Sqlite can only have a single connection -->
margaretha62055f72017-04-11 19:17:43 +020083 <property name="suppressClose">
84 <value>true</value>
85 </property>
margaretha514e1412017-10-10 15:54:20 +020086 </bean>
margaretha58e18632018-02-15 13:04:42 +010087
margaretha514e1412017-10-10 15:54:20 +020088 <bean id="c3p0DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
margaretha58e18632018-02-15 13:04:42 +010089 destroy-method="close">
90 <property name="driverClass" value="${jdbc.driverClassName}" />
margaretha514e1412017-10-10 15:54:20 +020091 <property name="jdbcUrl" value="${jdbc.url}" />
92 <property name="user" value="${jdbc.username}" />
93 <property name="password" value="${jdbc.password}" />
margaretha58e18632018-02-15 13:04:42 +010094 <property name="maxPoolSize" value="4" />
95 <property name="minPoolSize" value="1" />
96 <property name="maxStatements" value="1" />
97 <property name="testConnectionOnCheckout" value="true" />
margaretha62055f72017-04-11 19:17:43 +020098 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +010099
margaretha62055f72017-04-11 19:17:43 +0200100 <!-- to configure database for sqlite, mysql, etc. migrations -->
margarethafcf8bd92021-01-14 10:55:53 +0100101 <bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
margarethaf6d5a822017-10-19 19:51:20 +0200102 <!-- drop existing tables and create new tables -->
103 <property name="validateOnMigrate" value="true" />
104 <property name="cleanOnValidationError" value="true" />
margaretha514e1412017-10-10 15:54:20 +0200105 <property name="baselineOnMigrate" value="false" />
margarethafcf8bd92021-01-14 10:55:53 +0100106 <property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
margaretha6c2a20f2017-07-24 15:33:01 +0200107 <property name="dataSource" ref="sqliteDataSource" />
margaretha318fec32017-10-24 12:11:58 +0200108 <!-- <property name="dataSource" ref="dataSource" /> -->
margarethad66a6832022-03-03 08:47:13 +0100109 <property name="outOfOrder" value="true" />
margaretha62055f72017-04-11 19:17:43 +0200110 </bean>
margarethafcf8bd92021-01-14 10:55:53 +0100111
112 <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
113 <constructor-arg ref="flywayConfig"/>
114 </bean>
115
Michael Hanlbd852b82015-11-18 22:17:00 +0100116
margaretha62055f72017-04-11 19:17:43 +0200117 <bean id="kustvakt_db" class="de.ids_mannheim.korap.handlers.JDBCClient">
margaretha318fec32017-10-24 12:11:58 +0200118 <!-- <constructor-arg index="0" ref="dataSource" /> -->
margarethabc9caf42017-09-21 18:52:52 +0200119 <constructor-arg index="0" ref="sqliteDataSource" />
margaretha318fec32017-10-24 12:11:58 +0200120 <property name="database" value="${jdbc.database}" />
margaretha62055f72017-04-11 19:17:43 +0200121 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100122
margarethaade7d4a2017-07-20 19:53:35 +0200123 <bean id="entityManagerFactory"
124 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
margaretha318fec32017-10-24 12:11:58 +0200125 <!-- <property name="dataSource" ref="dataSource" /> -->
126 <property name="dataSource" ref="sqliteDataSource" />
margarethaa452c5e2018-04-25 22:48:09 +0200127 <property name="packagesToScan">
128 <array>
margaretha5b708792023-05-12 16:55:29 +0200129 <value>de.ids_mannheim.korap.core.entity</value>
margarethaa452c5e2018-04-25 22:48:09 +0200130 <value>de.ids_mannheim.korap.entity</value>
131 <value>de.ids_mannheim.korap.oauth2.entity</value>
132 </array>
133 </property>
margarethaade7d4a2017-07-20 19:53:35 +0200134 <property name="jpaVendorAdapter">
135 <bean id="jpaVendorAdapter"
136 class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
137 <property name="databasePlatform" value="${hibernate.dialect}" />
138 </bean>
139 </property>
140 <property name="jpaProperties">
141 <props>
142 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
143 <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
144 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
145 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
146 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
147 </prop>
148 <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
149 <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
margaretha6ad08b42018-08-22 18:33:54 +0200150 <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
margarethaade7d4a2017-07-20 19:53:35 +0200151 <!-- <prop key="net.sf.ehcache.configurationResourceName">classpath:ehcache.xml</prop> -->
152 </props>
153 </property>
margaretha62055f72017-04-11 19:17:43 +0200154 </bean>
Michael Hanle4fc7752016-02-17 11:41:18 +0100155
margarethaade7d4a2017-07-20 19:53:35 +0200156 <tx:annotation-driven proxy-target-class="true"
157 transaction-manager="transactionManager" />
158 <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
159 <property name="entityManagerFactory" ref="entityManagerFactory" />
margaretha62055f72017-04-11 19:17:43 +0200160 </bean>
Michael Hanle4fc7752016-02-17 11:41:18 +0100161
margarethaade7d4a2017-07-20 19:53:35 +0200162 <bean id="transactionTemplate"
163 class="org.springframework.transaction.support.TransactionTemplate">
164 <constructor-arg ref="transactionManager" />
165 </bean>
166
167 <!-- Data access objects -->
margaretha34954472018-10-24 20:05:17 +0200168 <bean id="adminDao" class="de.ids_mannheim.korap.dao.AdminDaoImpl" />
margaretha58e18632018-02-15 13:04:42 +0100169 <bean id="resourceDao" class="de.ids_mannheim.korap.dao.ResourceDao" />
margarethab4ce6602018-04-26 20:23:57 +0200170 <bean id="accessScopeDao" class="de.ids_mannheim.korap.oauth2.dao.AccessScopeDao" />
margaretha34954472018-10-24 20:05:17 +0200171 <bean id="authorizationDao" class="de.ids_mannheim.korap.oauth2.dao.CachedAuthorizationDaoImpl" />
172
173 <!-- Services -->
174 <bean id="scopeService" class="de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl" />
margaretha064eb6f2018-07-10 18:33:01 +0200175
margarethab4ce6602018-04-26 20:23:57 +0200176 <!-- props are injected from default-config.xml -->
177 <bean id="kustvakt_config" class="de.ids_mannheim.korap.config.FullConfiguration">
178 <constructor-arg name="properties" ref="props" />
179 </bean>
180
margarethafc5fab22021-07-26 12:17:39 +0200181 <bean id="initializator" class="de.ids_mannheim.de.init.Initializator"
margaretha1b320452018-08-02 16:56:25 +0200182 init-method="initTest">
margarethab4ce6602018-04-26 20:23:57 +0200183 </bean>
184
margaretha6c2a20f2017-07-24 15:33:01 +0200185 <!-- Krill -->
186 <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
margaretha58e18632018-02-15 13:04:42 +0100187 <constructor-arg value="${krill.indexDir}" />
margaretha6c2a20f2017-07-24 15:33:01 +0200188 </bean>
189
margaretha6cd27f32019-01-24 14:47:47 +0100190 <!-- Validator -->
191 <bean id="validator" class="de.ids_mannheim.korap.validator.ApacheValidator"/>
192
margaretha31a9f522018-04-03 20:40:45 +0200193 <!-- URLValidator -->
margarethae4034a82018-07-02 14:46:59 +0200194 <bean id="redirectURIValidator" class="org.apache.commons.validator.routines.UrlValidator">
195 <constructor-arg value="http,https" index="0" />
margarethacc929592023-01-31 11:07:35 +0100196 <constructor-arg index="1" type="long"
197 value="#{T(org.apache.commons.validator.routines.UrlValidator).ALLOW_LOCAL_URLS +
198 T(org.apache.commons.validator.routines.UrlValidator).NO_FRAGMENTS}"/>
margaretha31a9f522018-04-03 20:40:45 +0200199 </bean>
margarethad7cab212018-07-02 19:01:43 +0200200 <bean id="urlValidator" class="org.apache.commons.validator.routines.UrlValidator">
201 <constructor-arg value="http,https" />
202 </bean>
margaretha56e8e552017-12-05 16:31:21 +0100203
margaretha4fa4b062019-01-28 19:43:30 +0100204 <!-- Rewrite -->
205 <bean id="foundryRewrite" class="de.ids_mannheim.korap.rewrite.FoundryRewrite"/>
206 <bean id="collectionRewrite" class="de.ids_mannheim.korap.rewrite.CollectionRewrite"/>
207 <bean id="collectionCleanRewrite" class="de.ids_mannheim.korap.rewrite.CollectionCleanRewrite"/>
208 <bean id="virtualCorpusRewrite" class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite"/>
209 <bean id="collectionConstraint" class="de.ids_mannheim.korap.rewrite.CollectionConstraint"/>
Akronbee031a2020-10-29 16:58:14 +0100210 <bean id="queryReferenceRewrite" class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite"/>
margaretha4fa4b062019-01-28 19:43:30 +0100211
212 <util:list id="rewriteTasks"
213 value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
214 <!-- <ref bean="collectionConstraint" />
215 <ref bean="collectionCleanRewrite" /> -->
216 <ref bean="foundryRewrite" />
217 <ref bean="collectionRewrite" />
218 <ref bean="virtualCorpusRewrite" />
Akronbee031a2020-10-29 16:58:14 +0100219 <ref bean="queryReferenceRewrite" />
margaretha4fa4b062019-01-28 19:43:30 +0100220 </util:list>
221
222 <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
223 <constructor-arg ref="rewriteTasks"/>
margaretha56e8e552017-12-05 16:31:21 +0100224 </bean>
225
margaretha62055f72017-04-11 19:17:43 +0200226 <bean id="kustvakt_auditing" class="de.ids_mannheim.korap.handlers.JDBCAuditing">
227 <constructor-arg ref="kustvakt_db" />
228 </bean>
margaretha58e18632018-02-15 13:04:42 +0100229
margarethada3c7852018-06-14 20:35:11 +0200230 <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
margaretha05122312018-04-16 15:01:34 +0200231 <constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
232 </bean>
margarethafb027f92018-04-23 20:00:13 +0200233
234 <!-- OAuth -->
margarethaf839dde2018-04-16 17:52:57 +0200235 <bean id="oauth2ResponseHandler" class="de.ids_mannheim.korap.web.OAuth2ResponseHandler">
margaretha58e18632018-02-15 13:04:42 +0100236 <constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
237 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100238
margarethafb027f92018-04-23 20:00:13 +0200239 <bean id="mdGenerator" class="org.apache.oltu.oauth2.as.issuer.MD5Generator">
240 </bean>
241 <bean id="oauthIssuer" class="org.apache.oltu.oauth2.as.issuer.OAuthIssuerImpl">
242 <constructor-arg index="0" ref="mdGenerator" />
243 </bean>
244
margaretha62055f72017-04-11 19:17:43 +0200245 <bean id="kustvakt_userdb" class="de.ids_mannheim.korap.handlers.EntityDao">
246 <constructor-arg ref="kustvakt_db" />
247 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100248
margarethafb027f92018-04-23 20:00:13 +0200249 <bean name="kustvakt_encryption" class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
margaretha62055f72017-04-11 19:17:43 +0200250 <constructor-arg ref="kustvakt_config" />
251 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100252
margaretha62055f72017-04-11 19:17:43 +0200253 <!-- authentication providers to use -->
margaretha6ef00dd2018-09-12 14:06:38 +0200254 <!-- <bean id="openid_auth"
margaretha139d0f72017-11-14 18:56:22 +0100255 class="de.ids_mannheim.korap.authentication.OpenIDconnectAuthentication">
margaretha62055f72017-04-11 19:17:43 +0200256 <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
257 ref="kustvakt_config" />
258 <constructor-arg
259 type="de.ids_mannheim.korap.interfaces.db.PersistenceClient" ref="kustvakt_db" />
margaretha6ef00dd2018-09-12 14:06:38 +0200260 </bean> -->
margaretha62055f72017-04-11 19:17:43 +0200261
margaretha58e18632018-02-15 13:04:42 +0100262 <bean id="basic_auth"
263 class="de.ids_mannheim.korap.authentication.BasicAuthentication" />
Michael Hanlbd852b82015-11-18 22:17:00 +0100264
265
margaretha62055f72017-04-11 19:17:43 +0200266 <bean id="session_auth"
margaretha139d0f72017-11-14 18:56:22 +0100267 class="de.ids_mannheim.korap.authentication.SessionAuthentication">
margaretha62055f72017-04-11 19:17:43 +0200268 <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
269 ref="kustvakt_config" />
270 <constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
271 ref="kustvakt_encryption" />
272 </bean>
margarethae4034a82018-07-02 14:46:59 +0200273
margarethacf306d32018-05-30 19:45:35 +0200274 <bean id="oauth2_auth"
275 class="de.ids_mannheim.korap.authentication.OAuth2Authentication" />
margarethae4034a82018-07-02 14:46:59 +0200276
Michael Hanlbd852b82015-11-18 22:17:00 +0100277
margaretha62055f72017-04-11 19:17:43 +0200278 <util:list id="kustvakt_authproviders"
279 value-type="de.ids_mannheim.korap.interfaces.AuthenticationIface">
280 <ref bean="basic_auth" />
281 <ref bean="session_auth" />
margaretha6ef00dd2018-09-12 14:06:38 +0200282 <!-- <ref bean="openid_auth" /> -->
margarethacf306d32018-05-30 19:45:35 +0200283 <ref bean="oauth2_auth" />
margaretha62055f72017-04-11 19:17:43 +0200284 </util:list>
Michael Hanlbd852b82015-11-18 22:17:00 +0100285
margarethaade7d4a2017-07-20 19:53:35 +0200286
margaretha62055f72017-04-11 19:17:43 +0200287 <bean id="userdata_details" class="de.ids_mannheim.korap.handlers.UserDetailsDao">
margarethaade7d4a2017-07-20 19:53:35 +0200288 <constructor-arg ref="kustvakt_db" />
margaretha62055f72017-04-11 19:17:43 +0200289 </bean>
margarethaade7d4a2017-07-20 19:53:35 +0200290
margaretha62055f72017-04-11 19:17:43 +0200291 <bean id="userdata_settings" class="de.ids_mannheim.korap.handlers.UserSettingsDao">
margarethaade7d4a2017-07-20 19:53:35 +0200292 <constructor-arg ref="kustvakt_db" />
margaretha62055f72017-04-11 19:17:43 +0200293 </bean>
Michael Hanldaf86602016-05-12 14:31:52 +0200294
margaretha62055f72017-04-11 19:17:43 +0200295 <util:list id="kustvakt_userdata"
296 value-type="de.ids_mannheim.korap.interfaces.db.UserdataDbIface">
297 <ref bean="userdata_details" />
298 <ref bean="userdata_settings" />
299 </util:list>
Michael Hanldaf86602016-05-12 14:31:52 +0200300
margaretha62055f72017-04-11 19:17:43 +0200301 <!-- specify type for constructor argument -->
margaretha34954472018-10-24 20:05:17 +0200302 <bean id="authenticationManager"
margaretha139d0f72017-11-14 18:56:22 +0100303 class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager">
margarethafb027f92018-04-23 20:00:13 +0200304 <constructor-arg type="de.ids_mannheim.korap.interfaces.EntityHandlerIface"
305 ref="kustvakt_userdb" />
margaretha62055f72017-04-11 19:17:43 +0200306 <constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
307 ref="kustvakt_encryption" />
308 <constructor-arg ref="kustvakt_config" />
309 <constructor-arg type="de.ids_mannheim.korap.interfaces.db.AuditingIface"
310 ref="kustvakt_auditing" />
311 <constructor-arg ref="kustvakt_userdata" />
312 <!-- inject authentication providers to use -->
313 <property name="providers" ref="kustvakt_authproviders" />
314 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100315
margaretha62055f72017-04-11 19:17:43 +0200316 <!-- todo: if db interfaces not loaded via spring, does transaction even
317 work then? -->
318 <!-- the transactional advice (i.e. what 'happens'; see the <aop:advisor/>
319 bean below) -->
320 <tx:advice id="txAdvice" transaction-manager="txManager">
321 <!-- the transactional semantics... -->
322 <tx:attributes>
323 <!-- all methods starting with 'get' are read-only -->
324 <tx:method name="get*" read-only="true" rollback-for="KorAPException" />
325 <!-- other methods use the default transaction settings (see below) -->
326 <tx:method name="*" rollback-for="KorAPException" />
327 </tx:attributes>
328 </tx:advice>
Michael Hanlbd852b82015-11-18 22:17:00 +0100329
margaretha62055f72017-04-11 19:17:43 +0200330 <!-- ensure that the above transactional advice runs for any execution of
331 an operation defined by the service interface -->
332 <aop:config>
333 <aop:pointcut id="service"
334 expression="execution(* de.ids_mannheim.korap.interfaces.db.*.*(..))" />
335 <aop:advisor advice-ref="txAdvice" pointcut-ref="service" />
336 </aop:config>
Michael Hanlbd852b82015-11-18 22:17:00 +0100337
margaretha62055f72017-04-11 19:17:43 +0200338 <!-- similarly, don't forget the PlatformTransactionManager -->
339 <bean id="txManager"
340 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
341 <property name="dataSource" ref="dataSource" />
342 </bean>
margaretha58e18632018-02-15 13:04:42 +0100343
344 <!-- mail -->
margarethaaecee1b2018-02-20 14:44:21 +0100345 <bean id="authenticator" class="de.ids_mannheim.korap.service.MailAuthenticator">
margarethafb027f92018-04-23 20:00:13 +0200346 <constructor-arg index="0" value="${mail.username}" />
347 <constructor-arg index="1" value="${mail.password}" />
margarethaaecee1b2018-02-20 14:44:21 +0100348 </bean>
349 <bean id="smtpSession" class="javax.mail.Session" factory-method="getInstance">
350 <constructor-arg index="0">
351 <props>
352 <prop key="mail.smtp.submitter">${mail.username}</prop>
353 <prop key="mail.smtp.auth">${mail.auth}</prop>
354 <prop key="mail.smtp.host">${mail.host}</prop>
355 <prop key="mail.smtp.port">${mail.port}</prop>
356 <prop key="mail.smtp.starttls.enable">${mail.starttls.enable}</prop>
357 <prop key="mail.smtp.connectiontimeout">${mail.connectiontimeout}</prop>
358 </props>
359 </constructor-arg>
margarethafb027f92018-04-23 20:00:13 +0200360 <constructor-arg index="1" ref="authenticator" />
margaretha58e18632018-02-15 13:04:42 +0100361 </bean>
362 <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
363 <property name="session" ref="smtpSession" />
364 </bean>
365 <bean id="velocityEngine" class="org.apache.velocity.app.VelocityEngine">
366 <constructor-arg index="0">
367 <props>
368 <prop key="resource.loader">class</prop>
369 <prop key="class.resource.loader.class">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
370 </prop>
371 </props>
372 </constructor-arg>
margarethaaecee1b2018-02-20 14:44:21 +0100373 </bean>
Akronbee031a2020-10-29 16:58:14 +0100374</beans>