blob: aaea39c794484d406ad82a81c0d6647e97ffdbf1 [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 -->
margarethafcf8bd92021-01-14 10:55:53 +0100100 <bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
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" />
margaretha514e1412017-10-10 15:54:20 +0200104 <property name="baselineOnMigrate" value="false" />
margarethafcf8bd92021-01-14 10:55:53 +0100105 <property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
margaretha6c2a20f2017-07-24 15:33:01 +0200106 <property name="dataSource" ref="sqliteDataSource" />
margaretha318fec32017-10-24 12:11:58 +0200107 <!-- <property name="dataSource" ref="dataSource" /> -->
margarethad66a6832022-03-03 08:47:13 +0100108 <property name="outOfOrder" value="true" />
margaretha62055f72017-04-11 19:17:43 +0200109 </bean>
margarethafcf8bd92021-01-14 10:55:53 +0100110
111 <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
112 <constructor-arg ref="flywayConfig"/>
113 </bean>
114
Michael Hanlbd852b82015-11-18 22:17:00 +0100115
margaretha62055f72017-04-11 19:17:43 +0200116 <bean id="kustvakt_db" class="de.ids_mannheim.korap.handlers.JDBCClient">
margaretha318fec32017-10-24 12:11:58 +0200117 <!-- <constructor-arg index="0" ref="dataSource" /> -->
margarethabc9caf42017-09-21 18:52:52 +0200118 <constructor-arg index="0" ref="sqliteDataSource" />
margaretha318fec32017-10-24 12:11:58 +0200119 <property name="database" value="${jdbc.database}" />
margaretha62055f72017-04-11 19:17:43 +0200120 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100121
margarethaade7d4a2017-07-20 19:53:35 +0200122 <bean id="entityManagerFactory"
123 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
margaretha318fec32017-10-24 12:11:58 +0200124 <!-- <property name="dataSource" ref="dataSource" /> -->
125 <property name="dataSource" ref="sqliteDataSource" />
margarethaa452c5e2018-04-25 22:48:09 +0200126 <property name="packagesToScan">
127 <array>
128 <value>de.ids_mannheim.korap.entity</value>
129 <value>de.ids_mannheim.korap.oauth2.entity</value>
130 </array>
131 </property>
margarethaade7d4a2017-07-20 19:53:35 +0200132 <property name="jpaVendorAdapter">
133 <bean id="jpaVendorAdapter"
134 class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
135 <property name="databasePlatform" value="${hibernate.dialect}" />
136 </bean>
137 </property>
138 <property name="jpaProperties">
139 <props>
140 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
141 <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
142 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
143 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
144 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
145 </prop>
146 <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
147 <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
margaretha6ad08b42018-08-22 18:33:54 +0200148 <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
margarethaade7d4a2017-07-20 19:53:35 +0200149 <!-- <prop key="net.sf.ehcache.configurationResourceName">classpath:ehcache.xml</prop> -->
150 </props>
151 </property>
margaretha62055f72017-04-11 19:17:43 +0200152 </bean>
Michael Hanle4fc7752016-02-17 11:41:18 +0100153
margarethaade7d4a2017-07-20 19:53:35 +0200154 <tx:annotation-driven proxy-target-class="true"
155 transaction-manager="transactionManager" />
156 <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
157 <property name="entityManagerFactory" ref="entityManagerFactory" />
margaretha62055f72017-04-11 19:17:43 +0200158 </bean>
Michael Hanle4fc7752016-02-17 11:41:18 +0100159
margarethaade7d4a2017-07-20 19:53:35 +0200160 <bean id="transactionTemplate"
161 class="org.springframework.transaction.support.TransactionTemplate">
162 <constructor-arg ref="transactionManager" />
163 </bean>
164
165 <!-- Data access objects -->
margaretha34954472018-10-24 20:05:17 +0200166 <bean id="adminDao" class="de.ids_mannheim.korap.dao.AdminDaoImpl" />
margaretha58e18632018-02-15 13:04:42 +0100167 <bean id="resourceDao" class="de.ids_mannheim.korap.dao.ResourceDao" />
margarethab4ce6602018-04-26 20:23:57 +0200168 <bean id="accessScopeDao" class="de.ids_mannheim.korap.oauth2.dao.AccessScopeDao" />
margaretha34954472018-10-24 20:05:17 +0200169 <bean id="authorizationDao" class="de.ids_mannheim.korap.oauth2.dao.CachedAuthorizationDaoImpl" />
170
171 <!-- Services -->
172 <bean id="scopeService" class="de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl" />
margaretha064eb6f2018-07-10 18:33:01 +0200173
margarethab4ce6602018-04-26 20:23:57 +0200174 <!-- props are injected from default-config.xml -->
175 <bean id="kustvakt_config" class="de.ids_mannheim.korap.config.FullConfiguration">
176 <constructor-arg name="properties" ref="props" />
177 </bean>
178
margarethafc5fab22021-07-26 12:17:39 +0200179 <bean id="initializator" class="de.ids_mannheim.de.init.Initializator"
margaretha1b320452018-08-02 16:56:25 +0200180 init-method="initTest">
margarethab4ce6602018-04-26 20:23:57 +0200181 </bean>
182
margaretha6c2a20f2017-07-24 15:33:01 +0200183 <!-- Krill -->
184 <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
margaretha58e18632018-02-15 13:04:42 +0100185 <constructor-arg value="${krill.indexDir}" />
margaretha6c2a20f2017-07-24 15:33:01 +0200186 </bean>
187
margaretha6cd27f32019-01-24 14:47:47 +0100188 <!-- Validator -->
189 <bean id="validator" class="de.ids_mannheim.korap.validator.ApacheValidator"/>
190
margaretha31a9f522018-04-03 20:40:45 +0200191 <!-- URLValidator -->
margarethae4034a82018-07-02 14:46:59 +0200192 <bean id="redirectURIValidator" class="org.apache.commons.validator.routines.UrlValidator">
193 <constructor-arg value="http,https" index="0" />
margarethacc929592023-01-31 11:07:35 +0100194 <constructor-arg index="1" type="long"
195 value="#{T(org.apache.commons.validator.routines.UrlValidator).ALLOW_LOCAL_URLS +
196 T(org.apache.commons.validator.routines.UrlValidator).NO_FRAGMENTS}"/>
margaretha31a9f522018-04-03 20:40:45 +0200197 </bean>
margarethad7cab212018-07-02 19:01:43 +0200198 <bean id="urlValidator" class="org.apache.commons.validator.routines.UrlValidator">
199 <constructor-arg value="http,https" />
200 </bean>
margaretha56e8e552017-12-05 16:31:21 +0100201
margaretha4fa4b062019-01-28 19:43:30 +0100202 <!-- Rewrite -->
203 <bean id="foundryRewrite" class="de.ids_mannheim.korap.rewrite.FoundryRewrite"/>
204 <bean id="collectionRewrite" class="de.ids_mannheim.korap.rewrite.CollectionRewrite"/>
205 <bean id="collectionCleanRewrite" class="de.ids_mannheim.korap.rewrite.CollectionCleanRewrite"/>
206 <bean id="virtualCorpusRewrite" class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite"/>
207 <bean id="collectionConstraint" class="de.ids_mannheim.korap.rewrite.CollectionConstraint"/>
Akronbee031a2020-10-29 16:58:14 +0100208 <bean id="queryReferenceRewrite" class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite"/>
margaretha4fa4b062019-01-28 19:43:30 +0100209
210 <util:list id="rewriteTasks"
211 value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
212 <!-- <ref bean="collectionConstraint" />
213 <ref bean="collectionCleanRewrite" /> -->
214 <ref bean="foundryRewrite" />
215 <ref bean="collectionRewrite" />
216 <ref bean="virtualCorpusRewrite" />
Akronbee031a2020-10-29 16:58:14 +0100217 <ref bean="queryReferenceRewrite" />
margaretha4fa4b062019-01-28 19:43:30 +0100218 </util:list>
219
220 <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
221 <constructor-arg ref="rewriteTasks"/>
margaretha56e8e552017-12-05 16:31:21 +0100222 </bean>
223
margaretha62055f72017-04-11 19:17:43 +0200224 <bean id="kustvakt_auditing" class="de.ids_mannheim.korap.handlers.JDBCAuditing">
225 <constructor-arg ref="kustvakt_db" />
226 </bean>
margaretha58e18632018-02-15 13:04:42 +0100227
margarethada3c7852018-06-14 20:35:11 +0200228 <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
margaretha05122312018-04-16 15:01:34 +0200229 <constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
230 </bean>
margarethafb027f92018-04-23 20:00:13 +0200231
232 <!-- OAuth -->
margarethaf839dde2018-04-16 17:52:57 +0200233 <bean id="oauth2ResponseHandler" class="de.ids_mannheim.korap.web.OAuth2ResponseHandler">
margaretha58e18632018-02-15 13:04:42 +0100234 <constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
235 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100236
margarethafb027f92018-04-23 20:00:13 +0200237 <bean id="mdGenerator" class="org.apache.oltu.oauth2.as.issuer.MD5Generator">
238 </bean>
239 <bean id="oauthIssuer" class="org.apache.oltu.oauth2.as.issuer.OAuthIssuerImpl">
240 <constructor-arg index="0" ref="mdGenerator" />
241 </bean>
242
margaretha62055f72017-04-11 19:17:43 +0200243 <bean id="kustvakt_userdb" class="de.ids_mannheim.korap.handlers.EntityDao">
244 <constructor-arg ref="kustvakt_db" />
245 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100246
margarethafb027f92018-04-23 20:00:13 +0200247 <bean name="kustvakt_encryption" class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
margaretha62055f72017-04-11 19:17:43 +0200248 <constructor-arg ref="kustvakt_config" />
249 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100250
margaretha62055f72017-04-11 19:17:43 +0200251 <!-- authentication providers to use -->
margaretha58e18632018-02-15 13:04:42 +0100252 <!-- <bean id="api_auth" class="de.ids_mannheim.korap.authentication.APIAuthentication">
253 <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
254 ref="kustvakt_config" /> </bean> -->
margaretha4de41192017-11-15 11:47:11 +0100255 <bean id="ldap_auth" class="de.ids_mannheim.korap.authentication.LdapAuth3">
margaretha62055f72017-04-11 19:17:43 +0200256 <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
257 ref="kustvakt_config" />
258 </bean>
margaretha58e18632018-02-15 13:04:42 +0100259
margaretha6ef00dd2018-09-12 14:06:38 +0200260 <!-- <bean id="openid_auth"
margaretha139d0f72017-11-14 18:56:22 +0100261 class="de.ids_mannheim.korap.authentication.OpenIDconnectAuthentication">
margaretha62055f72017-04-11 19:17:43 +0200262 <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
263 ref="kustvakt_config" />
264 <constructor-arg
265 type="de.ids_mannheim.korap.interfaces.db.PersistenceClient" ref="kustvakt_db" />
margaretha6ef00dd2018-09-12 14:06:38 +0200266 </bean> -->
margaretha62055f72017-04-11 19:17:43 +0200267
margaretha58e18632018-02-15 13:04:42 +0100268 <bean id="basic_auth"
269 class="de.ids_mannheim.korap.authentication.BasicAuthentication" />
Michael Hanlbd852b82015-11-18 22:17:00 +0100270
271
margaretha62055f72017-04-11 19:17:43 +0200272 <bean id="session_auth"
margaretha139d0f72017-11-14 18:56:22 +0100273 class="de.ids_mannheim.korap.authentication.SessionAuthentication">
margaretha62055f72017-04-11 19:17:43 +0200274 <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
275 ref="kustvakt_config" />
276 <constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
277 ref="kustvakt_encryption" />
278 </bean>
margarethae4034a82018-07-02 14:46:59 +0200279
margarethacf306d32018-05-30 19:45:35 +0200280 <bean id="oauth2_auth"
281 class="de.ids_mannheim.korap.authentication.OAuth2Authentication" />
margarethae4034a82018-07-02 14:46:59 +0200282
Michael Hanlbd852b82015-11-18 22:17:00 +0100283
margaretha62055f72017-04-11 19:17:43 +0200284 <util:list id="kustvakt_authproviders"
285 value-type="de.ids_mannheim.korap.interfaces.AuthenticationIface">
286 <ref bean="basic_auth" />
margaretha4de41192017-11-15 11:47:11 +0100287 <ref bean="ldap_auth" />
margaretha62055f72017-04-11 19:17:43 +0200288 <ref bean="session_auth" />
margaretha4de41192017-11-15 11:47:11 +0100289 <!-- <ref bean="api_auth" /> -->
margaretha6ef00dd2018-09-12 14:06:38 +0200290 <!-- <ref bean="openid_auth" /> -->
margarethacf306d32018-05-30 19:45:35 +0200291 <ref bean="oauth2_auth" />
margaretha62055f72017-04-11 19:17:43 +0200292 </util:list>
Michael Hanlbd852b82015-11-18 22:17:00 +0100293
margarethaade7d4a2017-07-20 19:53:35 +0200294
margaretha62055f72017-04-11 19:17:43 +0200295 <bean id="userdata_details" class="de.ids_mannheim.korap.handlers.UserDetailsDao">
margarethaade7d4a2017-07-20 19:53:35 +0200296 <constructor-arg ref="kustvakt_db" />
margaretha62055f72017-04-11 19:17:43 +0200297 </bean>
margarethaade7d4a2017-07-20 19:53:35 +0200298
margaretha62055f72017-04-11 19:17:43 +0200299 <bean id="userdata_settings" class="de.ids_mannheim.korap.handlers.UserSettingsDao">
margarethaade7d4a2017-07-20 19:53:35 +0200300 <constructor-arg ref="kustvakt_db" />
margaretha62055f72017-04-11 19:17:43 +0200301 </bean>
Michael Hanldaf86602016-05-12 14:31:52 +0200302
margaretha62055f72017-04-11 19:17:43 +0200303 <util:list id="kustvakt_userdata"
304 value-type="de.ids_mannheim.korap.interfaces.db.UserdataDbIface">
305 <ref bean="userdata_details" />
306 <ref bean="userdata_settings" />
307 </util:list>
Michael Hanldaf86602016-05-12 14:31:52 +0200308
margaretha62055f72017-04-11 19:17:43 +0200309 <!-- specify type for constructor argument -->
margaretha34954472018-10-24 20:05:17 +0200310 <bean id="authenticationManager"
margaretha139d0f72017-11-14 18:56:22 +0100311 class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager">
margarethafb027f92018-04-23 20:00:13 +0200312 <constructor-arg type="de.ids_mannheim.korap.interfaces.EntityHandlerIface"
313 ref="kustvakt_userdb" />
margaretha62055f72017-04-11 19:17:43 +0200314 <constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
315 ref="kustvakt_encryption" />
316 <constructor-arg ref="kustvakt_config" />
317 <constructor-arg type="de.ids_mannheim.korap.interfaces.db.AuditingIface"
318 ref="kustvakt_auditing" />
319 <constructor-arg ref="kustvakt_userdata" />
320 <!-- inject authentication providers to use -->
321 <property name="providers" ref="kustvakt_authproviders" />
322 </bean>
Michael Hanlbd852b82015-11-18 22:17:00 +0100323
margaretha62055f72017-04-11 19:17:43 +0200324 <!-- todo: if db interfaces not loaded via spring, does transaction even
325 work then? -->
326 <!-- the transactional advice (i.e. what 'happens'; see the <aop:advisor/>
327 bean below) -->
328 <tx:advice id="txAdvice" transaction-manager="txManager">
329 <!-- the transactional semantics... -->
330 <tx:attributes>
331 <!-- all methods starting with 'get' are read-only -->
332 <tx:method name="get*" read-only="true" rollback-for="KorAPException" />
333 <!-- other methods use the default transaction settings (see below) -->
334 <tx:method name="*" rollback-for="KorAPException" />
335 </tx:attributes>
336 </tx:advice>
Michael Hanlbd852b82015-11-18 22:17:00 +0100337
margaretha62055f72017-04-11 19:17:43 +0200338 <!-- ensure that the above transactional advice runs for any execution of
339 an operation defined by the service interface -->
340 <aop:config>
341 <aop:pointcut id="service"
342 expression="execution(* de.ids_mannheim.korap.interfaces.db.*.*(..))" />
343 <aop:advisor advice-ref="txAdvice" pointcut-ref="service" />
344 </aop:config>
Michael Hanlbd852b82015-11-18 22:17:00 +0100345
margaretha62055f72017-04-11 19:17:43 +0200346 <!-- similarly, don't forget the PlatformTransactionManager -->
347 <bean id="txManager"
348 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
349 <property name="dataSource" ref="dataSource" />
350 </bean>
margaretha58e18632018-02-15 13:04:42 +0100351
352 <!-- mail -->
margarethaaecee1b2018-02-20 14:44:21 +0100353 <bean id="authenticator" class="de.ids_mannheim.korap.service.MailAuthenticator">
margarethafb027f92018-04-23 20:00:13 +0200354 <constructor-arg index="0" value="${mail.username}" />
355 <constructor-arg index="1" value="${mail.password}" />
margarethaaecee1b2018-02-20 14:44:21 +0100356 </bean>
357 <bean id="smtpSession" class="javax.mail.Session" factory-method="getInstance">
358 <constructor-arg index="0">
359 <props>
360 <prop key="mail.smtp.submitter">${mail.username}</prop>
361 <prop key="mail.smtp.auth">${mail.auth}</prop>
362 <prop key="mail.smtp.host">${mail.host}</prop>
363 <prop key="mail.smtp.port">${mail.port}</prop>
364 <prop key="mail.smtp.starttls.enable">${mail.starttls.enable}</prop>
365 <prop key="mail.smtp.connectiontimeout">${mail.connectiontimeout}</prop>
366 </props>
367 </constructor-arg>
margarethafb027f92018-04-23 20:00:13 +0200368 <constructor-arg index="1" ref="authenticator" />
margaretha58e18632018-02-15 13:04:42 +0100369 </bean>
370 <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
371 <property name="session" ref="smtpSession" />
372 </bean>
373 <bean id="velocityEngine" class="org.apache.velocity.app.VelocityEngine">
374 <constructor-arg index="0">
375 <props>
376 <prop key="resource.loader">class</prop>
377 <prop key="class.resource.loader.class">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
378 </prop>
379 </props>
380 </constructor-arg>
margarethaaecee1b2018-02-20 14:44:21 +0100381 </bean>
Akronbee031a2020-10-29 16:58:14 +0100382</beans>