Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 3 | xmlns:p="http://www.springframework.org/schema/p" |
| 4 | xmlns:util="http://www.springframework.org/schema/util" |
| 5 | xmlns:aop="http://www.springframework.org/schema/aop" |
| 6 | xmlns:tx="http://www.springframework.org/schema/tx" |
| 7 | xmlns="http://www.springframework.org/schema/beans" |
| 8 | xmlns:context="http://www.springframework.org/schema/context" |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 9 | xmlns:cache="http://www.springframework.org/schema/cache" |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 10 | xsi:schemaLocation="http://www.springframework.org/schema/beans |
margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame] | 11 | http://www.springframework.org/schema/beans/spring-beans.xsd |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 12 | http://www.springframework.org/schema/tx |
margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame] | 13 | http://www.springframework.org/schema/tx/spring-tx.xsd |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 14 | http://www.springframework.org/schema/aop |
margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame] | 15 | http://www.springframework.org/schema/aop/spring-aop.xsd |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 16 | http://www.springframework.org/schema/context |
margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame] | 17 | http://www.springframework.org/schema/context/spring-context.xsd |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 18 | http://www.springframework.org/schema/util |
margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame] | 19 | http://www.springframework.org/schema/util/spring-util.xsd"> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 20 | |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 21 | <context:component-scan |
| 22 | base-package="de.ids_mannheim.korap" /> |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 23 | <context:annotation-config /> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 24 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 25 | <bean id="props" |
| 26 | class="org.springframework.beans.factory.config.PropertiesFactoryBean"> |
| 27 | <property name="ignoreResourceNotFound" value="true" /> |
| 28 | <property name="locations"> |
| 29 | <array> |
margaretha | 0c47c65 | 2017-04-19 18:44:40 +0200 | [diff] [blame] | 30 | <value>classpath:kustvakt-test.conf</value> |
| 31 | <value>file:./kustvakt-test.conf</value> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 32 | </array> |
| 33 | </property> |
| 34 | </bean> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 35 | |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 36 | <bean id="placeholders" |
| 37 | class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 38 | <property name="ignoreResourceNotFound" value="true" /> |
| 39 | <property name="locations"> |
| 40 | <array> |
margaretha | 6c2a20f | 2017-07-24 15:33:01 +0200 | [diff] [blame] | 41 | <value>classpath:test-jdbc.properties</value> |
margaretha | 1f106f6 | 2017-10-18 22:27:30 +0200 | [diff] [blame] | 42 | <value>file:./test-jdbc.properties</value> |
margaretha | aecee1b | 2018-02-20 14:44:21 +0100 | [diff] [blame] | 43 | <value>classpath:properties/mail.properties</value> |
| 44 | <value>file:./mail.properties</value> |
margaretha | f6d5a82 | 2017-10-19 19:51:20 +0200 | [diff] [blame] | 45 | <value>classpath:test-hibernate.properties</value> |
margaretha | 1960ea5 | 2023-02-28 11:20:15 +0100 | [diff] [blame] | 46 | <value>file:./kustvakt-test.conf</value> |
margaretha | f18298b | 2017-09-14 22:14:32 +0200 | [diff] [blame] | 47 | <value>classpath:kustvakt-test.conf</value> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 48 | </array> |
| 49 | </property> |
| 50 | </bean> |
margaretha | f6f6c3c | 2024-06-11 10:51:06 +0200 | [diff] [blame] | 51 | |
| 52 | <!-- props are injected from default-config.xml --> |
| 53 | <bean id="kustvakt_config" |
| 54 | class="de.ids_mannheim.korap.config.FullConfiguration"> |
| 55 | <constructor-arg name="properties" ref="props" /> |
| 56 | </bean> |
| 57 | |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 58 | |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 59 | <!-- <bean id='cacheManager' class='org.springframework.cache.ehcache.EhCacheCacheManager' |
| 60 | p:cacheManager-ref='ehcache' /> <bean id='ehcache' class='org.springframework.cache.ehcache.EhCacheManagerFactoryBean' |
margaretha | 7c21ec8 | 2023-08-21 09:55:58 +0200 | [diff] [blame] | 61 | p:configLocation='classpath:ehcache.xml' p:shared='true' /> --> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 62 | |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 63 | <bean id="dataSource" |
| 64 | class="org.apache.commons.dbcp2.BasicDataSource" lazy-init="true"> |
margaretha | 4edc70e | 2018-03-14 22:34:29 +0100 | [diff] [blame] | 65 | <!-- <property name="driverClassName" value="${jdbc.driverClassName}" /> --> |
margaretha | 6c2a20f | 2017-07-24 15:33:01 +0200 | [diff] [blame] | 66 | <property name="url" value="${jdbc.url}" /> |
| 67 | <property name="username" value="${jdbc.username}" /> |
| 68 | <property name="password" value="${jdbc.password}" /> |
margaretha | 318fec3 | 2017-10-24 12:11:58 +0200 | [diff] [blame] | 69 | <property name="maxTotal" value="4" /> |
margaretha | 514e141 | 2017-10-10 15:54:20 +0200 | [diff] [blame] | 70 | <property name="maxIdle" value="1" /> |
margaretha | 6c2a20f | 2017-07-24 15:33:01 +0200 | [diff] [blame] | 71 | <property name="minIdle" value="1" /> |
| 72 | <property name="maxWaitMillis" value="15000" /> |
| 73 | <!--<property name="poolPreparedStatements" value="true"/> --> |
| 74 | </bean> |
| 75 | |
margaretha | f6f6c3c | 2024-06-11 10:51:06 +0200 | [diff] [blame] | 76 | <!-- <bean id="sqliteDataSource" class="org.springframework.jdbc.datasource.SingleConnectionDataSource" |
| 77 | lazy-init="true"> <property name="driverClassName" value="${jdbc.driverClassName}" |
| 78 | /> <property name="url" value="${jdbc.url}" /> <property name="username" |
| 79 | value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" |
| 80 | /> <property name="connectionProperties"> <props> <prop key="date_string_format">yyyy-MM-dd |
| 81 | HH:mm:ss</prop> </props> </property> Sqlite can only have a single connection |
| 82 | <property name="suppressClose"> <value>true</value> </property> </bean> --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 83 | <bean id="c3p0DataSource" |
| 84 | class="com.mchange.v2.c3p0.ComboPooledDataSource" |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 85 | destroy-method="close"> |
| 86 | <property name="driverClass" value="${jdbc.driverClassName}" /> |
margaretha | 514e141 | 2017-10-10 15:54:20 +0200 | [diff] [blame] | 87 | <property name="jdbcUrl" value="${jdbc.url}" /> |
| 88 | <property name="user" value="${jdbc.username}" /> |
| 89 | <property name="password" value="${jdbc.password}" /> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 90 | <property name="maxPoolSize" value="4" /> |
| 91 | <property name="minPoolSize" value="1" /> |
| 92 | <property name="maxStatements" value="1" /> |
| 93 | <property name="testConnectionOnCheckout" value="true" /> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 94 | </bean> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 95 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 96 | <!-- to configure database for sqlite, mysql, etc. migrations --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 97 | <bean id="flywayConfig" |
| 98 | class="org.flywaydb.core.api.configuration.ClassicConfiguration"> |
margaretha | f6d5a82 | 2017-10-19 19:51:20 +0200 | [diff] [blame] | 99 | <!-- drop existing tables and create new tables --> |
| 100 | <property name="validateOnMigrate" value="true" /> |
| 101 | <property name="cleanOnValidationError" value="true" /> |
margaretha | 514e141 | 2017-10-10 15:54:20 +0200 | [diff] [blame] | 102 | <property name="baselineOnMigrate" value="false" /> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 103 | <property name="locations" |
| 104 | value="#{'${jdbc.schemaPath}'.split(',')}" /> |
margaretha | 8fe51e9 | 2023-09-20 11:22:20 +0200 | [diff] [blame] | 105 | <!-- <property name="dataSource" ref="sqliteDataSource" /> --> |
| 106 | <property name="dataSource" ref="dataSource" /> |
margaretha | d66a683 | 2022-03-03 08:47:13 +0100 | [diff] [blame] | 107 | <property name="outOfOrder" value="true" /> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 108 | </bean> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 109 | |
| 110 | <bean id="flyway" class="org.flywaydb.core.Flyway" |
| 111 | init-method="migrate"> |
| 112 | <constructor-arg ref="flywayConfig" /> |
margaretha | fcf8bd9 | 2021-01-14 10:55:53 +0100 | [diff] [blame] | 113 | </bean> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 114 | |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 115 | |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 116 | <bean id="entityManagerFactory" |
| 117 | class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> |
margaretha | 8fe51e9 | 2023-09-20 11:22:20 +0200 | [diff] [blame] | 118 | <property name="dataSource" ref="dataSource" /> |
| 119 | <!-- <property name="dataSource" ref="sqliteDataSource" /> --> |
margaretha | a452c5e | 2018-04-25 22:48:09 +0200 | [diff] [blame] | 120 | <property name="packagesToScan"> |
| 121 | <array> |
margaretha | 5b70879 | 2023-05-12 16:55:29 +0200 | [diff] [blame] | 122 | <value>de.ids_mannheim.korap.core.entity</value> |
margaretha | a452c5e | 2018-04-25 22:48:09 +0200 | [diff] [blame] | 123 | <value>de.ids_mannheim.korap.entity</value> |
| 124 | <value>de.ids_mannheim.korap.oauth2.entity</value> |
| 125 | </array> |
| 126 | </property> |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 127 | <property name="jpaVendorAdapter"> |
| 128 | <bean id="jpaVendorAdapter" |
| 129 | class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 130 | <property name="databasePlatform" |
| 131 | value="${hibernate.dialect}" /> |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 132 | </bean> |
| 133 | </property> |
| 134 | <property name="jpaProperties"> |
| 135 | <props> |
| 136 | <prop key="hibernate.dialect">${hibernate.dialect}</prop> |
| 137 | <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> |
| 138 | <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> |
| 139 | <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> |
| 140 | <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache} |
| 141 | </prop> |
| 142 | <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop> |
| 143 | <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop> |
margaretha | 6ad08b4 | 2018-08-22 18:33:54 +0200 | [diff] [blame] | 144 | <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop> |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 145 | <!-- <prop key="net.sf.ehcache.configurationResourceName">classpath:ehcache.xml</prop> --> |
| 146 | </props> |
| 147 | </property> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 148 | </bean> |
Michael Hanl | e4fc775 | 2016-02-17 11:41:18 +0100 | [diff] [blame] | 149 | |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 150 | <tx:annotation-driven proxy-target-class="true" |
| 151 | transaction-manager="transactionManager" /> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 152 | <bean id="transactionManager" |
| 153 | class="org.springframework.orm.jpa.JpaTransactionManager"> |
| 154 | <property name="entityManagerFactory" |
| 155 | ref="entityManagerFactory" /> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 156 | </bean> |
Michael Hanl | e4fc775 | 2016-02-17 11:41:18 +0100 | [diff] [blame] | 157 | |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 158 | <bean id="transactionTemplate" |
| 159 | class="org.springframework.transaction.support.TransactionTemplate"> |
| 160 | <constructor-arg ref="transactionManager" /> |
| 161 | </bean> |
| 162 | |
| 163 | <!-- Data access objects --> |
margaretha | 3495447 | 2018-10-24 20:05:17 +0200 | [diff] [blame] | 164 | <bean id="adminDao" class="de.ids_mannheim.korap.dao.AdminDaoImpl" /> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 165 | <bean id="resourceDao" |
| 166 | class="de.ids_mannheim.korap.dao.ResourceDao" /> |
| 167 | <bean id="accessScopeDao" |
| 168 | class="de.ids_mannheim.korap.oauth2.dao.AccessScopeDao" /> |
| 169 | <bean id="authorizationDao" |
| 170 | class="de.ids_mannheim.korap.oauth2.dao.CachedAuthorizationDaoImpl" /> |
| 171 | |
margaretha | 3495447 | 2018-10-24 20:05:17 +0200 | [diff] [blame] | 172 | <!-- Services --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 173 | <bean id="scopeService" |
| 174 | class="de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl" /> |
| 175 | |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 176 | <bean id="initializator" |
| 177 | class="de.ids_mannheim.korap.init.Initializator" |
margaretha | 1b32045 | 2018-08-02 16:56:25 +0200 | [diff] [blame] | 178 | init-method="initTest"> |
margaretha | b4ce660 | 2018-04-26 20:23:57 +0200 | [diff] [blame] | 179 | </bean> |
| 180 | |
margaretha | 6c2a20f | 2017-07-24 15:33:01 +0200 | [diff] [blame] | 181 | <!-- Krill --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 182 | <bean id="search_krill" |
| 183 | class="de.ids_mannheim.korap.web.SearchKrill"> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 184 | <constructor-arg value="${krill.indexDir}" /> |
margaretha | 6c2a20f | 2017-07-24 15:33:01 +0200 | [diff] [blame] | 185 | </bean> |
| 186 | |
margaretha | 6cd27f3 | 2019-01-24 14:47:47 +0100 | [diff] [blame] | 187 | <!-- Validator --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 188 | <bean id="validator" |
| 189 | class="de.ids_mannheim.korap.validator.ApacheValidator" /> |
| 190 | |
margaretha | 31a9f52 | 2018-04-03 20:40:45 +0200 | [diff] [blame] | 191 | <!-- URLValidator --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 192 | <bean id="redirectURIValidator" |
| 193 | class="org.apache.commons.validator.routines.UrlValidator"> |
margaretha | e4034a8 | 2018-07-02 14:46:59 +0200 | [diff] [blame] | 194 | <constructor-arg value="http,https" index="0" /> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 195 | <constructor-arg index="1" type="long" |
| 196 | value="#{T(org.apache.commons.validator.routines.UrlValidator).ALLOW_LOCAL_URLS + |
| 197 | T(org.apache.commons.validator.routines.UrlValidator).NO_FRAGMENTS}" /> |
margaretha | 31a9f52 | 2018-04-03 20:40:45 +0200 | [diff] [blame] | 198 | </bean> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 199 | <bean id="urlValidator" |
| 200 | class="org.apache.commons.validator.routines.UrlValidator"> |
margaretha | d7cab21 | 2018-07-02 19:01:43 +0200 | [diff] [blame] | 201 | <constructor-arg value="http,https" /> |
| 202 | </bean> |
margaretha | 56e8e55 | 2017-12-05 16:31:21 +0100 | [diff] [blame] | 203 | |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 204 | <!-- Rewrite --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 205 | <bean id="foundryRewrite" |
| 206 | class="de.ids_mannheim.korap.rewrite.FoundryRewrite" /> |
| 207 | <bean id="collectionRewrite" |
| 208 | class="de.ids_mannheim.korap.rewrite.CollectionRewrite" /> |
| 209 | <bean id="collectionCleanRewrite" |
| 210 | class="de.ids_mannheim.korap.rewrite.CollectionCleanRewrite" /> |
| 211 | <bean id="virtualCorpusRewrite" |
| 212 | class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite" /> |
| 213 | <bean id="collectionConstraint" |
| 214 | class="de.ids_mannheim.korap.rewrite.CollectionConstraint" /> |
| 215 | <bean id="queryReferenceRewrite" |
| 216 | class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite" /> |
| 217 | |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 218 | <util:list id="rewriteTasks" |
| 219 | value-type="de.ids_mannheim.korap.rewrite.RewriteTask"> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 220 | <!-- <ref bean="collectionConstraint" /> <ref bean="collectionCleanRewrite" |
| 221 | /> --> |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 222 | <ref bean="foundryRewrite" /> |
| 223 | <ref bean="collectionRewrite" /> |
| 224 | <ref bean="virtualCorpusRewrite" /> |
Akron | bee031a | 2020-10-29 16:58:14 +0100 | [diff] [blame] | 225 | <ref bean="queryReferenceRewrite" /> |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 226 | </util:list> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 227 | |
| 228 | <bean id="rewriteHandler" |
| 229 | class="de.ids_mannheim.korap.rewrite.RewriteHandler"> |
| 230 | <constructor-arg ref="rewriteTasks" /> |
margaretha | 56e8e55 | 2017-12-05 16:31:21 +0100 | [diff] [blame] | 231 | </bean> |
| 232 | |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 233 | <bean id="kustvaktResponseHandler" |
| 234 | class="de.ids_mannheim.korap.web.KustvaktResponseHandler"> |
margaretha | 0512231 | 2018-04-16 15:01:34 +0200 | [diff] [blame] | 235 | </bean> |
margaretha | fb027f9 | 2018-04-23 20:00:13 +0200 | [diff] [blame] | 236 | |
| 237 | <!-- OAuth --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 238 | <bean id="oauth2ResponseHandler" |
| 239 | class="de.ids_mannheim.korap.web.OAuth2ResponseHandler"> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 240 | </bean> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 241 | |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 242 | <bean name="kustvakt_encryption" |
| 243 | class="de.ids_mannheim.korap.encryption.KustvaktEncryption"> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 244 | <constructor-arg ref="kustvakt_config" /> |
| 245 | </bean> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 246 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 247 | <!-- authentication providers to use --> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 248 | <bean id="basic_auth" |
| 249 | class="de.ids_mannheim.korap.authentication.BasicAuthentication" /> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 250 | |
| 251 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 252 | <bean id="session_auth" |
margaretha | 139d0f7 | 2017-11-14 18:56:22 +0100 | [diff] [blame] | 253 | class="de.ids_mannheim.korap.authentication.SessionAuthentication"> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 254 | <constructor-arg |
| 255 | type="de.ids_mannheim.korap.config.KustvaktConfiguration" |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 256 | ref="kustvakt_config" /> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 257 | <constructor-arg |
| 258 | type="de.ids_mannheim.korap.interfaces.EncryptionIface" |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 259 | ref="kustvakt_encryption" /> |
| 260 | </bean> |
margaretha | e4034a8 | 2018-07-02 14:46:59 +0200 | [diff] [blame] | 261 | |
margaretha | cf306d3 | 2018-05-30 19:45:35 +0200 | [diff] [blame] | 262 | <bean id="oauth2_auth" |
| 263 | class="de.ids_mannheim.korap.authentication.OAuth2Authentication" /> |
margaretha | e4034a8 | 2018-07-02 14:46:59 +0200 | [diff] [blame] | 264 | |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 265 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 266 | <util:list id="kustvakt_authproviders" |
| 267 | value-type="de.ids_mannheim.korap.interfaces.AuthenticationIface"> |
| 268 | <ref bean="basic_auth" /> |
| 269 | <ref bean="session_auth" /> |
margaretha | cf306d3 | 2018-05-30 19:45:35 +0200 | [diff] [blame] | 270 | <ref bean="oauth2_auth" /> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 271 | </util:list> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 272 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 273 | <!-- specify type for constructor argument --> |
margaretha | 3495447 | 2018-10-24 20:05:17 +0200 | [diff] [blame] | 274 | <bean id="authenticationManager" |
margaretha | 139d0f7 | 2017-11-14 18:56:22 +0100 | [diff] [blame] | 275 | class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager"> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 276 | <constructor-arg |
| 277 | type="de.ids_mannheim.korap.interfaces.EncryptionIface" |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 278 | ref="kustvakt_encryption" /> |
| 279 | <constructor-arg ref="kustvakt_config" /> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 280 | <!-- inject authentication providers to use --> |
| 281 | <property name="providers" ref="kustvakt_authproviders" /> |
| 282 | </bean> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 283 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 284 | <!-- todo: if db interfaces not loaded via spring, does transaction even |
| 285 | work then? --> |
| 286 | <!-- the transactional advice (i.e. what 'happens'; see the <aop:advisor/> |
| 287 | bean below) --> |
| 288 | <tx:advice id="txAdvice" transaction-manager="txManager"> |
| 289 | <!-- the transactional semantics... --> |
| 290 | <tx:attributes> |
| 291 | <!-- all methods starting with 'get' are read-only --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 292 | <tx:method name="get*" read-only="true" |
| 293 | rollback-for="KorAPException" /> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 294 | <!-- other methods use the default transaction settings (see below) --> |
| 295 | <tx:method name="*" rollback-for="KorAPException" /> |
| 296 | </tx:attributes> |
| 297 | </tx:advice> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 298 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 299 | <!-- ensure that the above transactional advice runs for any execution of |
| 300 | an operation defined by the service interface --> |
| 301 | <aop:config> |
| 302 | <aop:pointcut id="service" |
| 303 | expression="execution(* de.ids_mannheim.korap.interfaces.db.*.*(..))" /> |
| 304 | <aop:advisor advice-ref="txAdvice" pointcut-ref="service" /> |
| 305 | </aop:config> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 306 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 307 | <!-- similarly, don't forget the PlatformTransactionManager --> |
| 308 | <bean id="txManager" |
| 309 | class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> |
| 310 | <property name="dataSource" ref="dataSource" /> |
| 311 | </bean> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 312 | |
| 313 | <!-- mail --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 314 | <bean id="authenticator" |
| 315 | class="de.ids_mannheim.korap.service.MailAuthenticator"> |
margaretha | fb027f9 | 2018-04-23 20:00:13 +0200 | [diff] [blame] | 316 | <constructor-arg index="0" value="${mail.username}" /> |
| 317 | <constructor-arg index="1" value="${mail.password}" /> |
margaretha | aecee1b | 2018-02-20 14:44:21 +0100 | [diff] [blame] | 318 | </bean> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 319 | <bean id="smtpSession" class="jakarta.mail.Session" |
| 320 | factory-method="getInstance"> |
margaretha | aecee1b | 2018-02-20 14:44:21 +0100 | [diff] [blame] | 321 | <constructor-arg index="0"> |
| 322 | <props> |
| 323 | <prop key="mail.smtp.submitter">${mail.username}</prop> |
| 324 | <prop key="mail.smtp.auth">${mail.auth}</prop> |
| 325 | <prop key="mail.smtp.host">${mail.host}</prop> |
| 326 | <prop key="mail.smtp.port">${mail.port}</prop> |
| 327 | <prop key="mail.smtp.starttls.enable">${mail.starttls.enable}</prop> |
| 328 | <prop key="mail.smtp.connectiontimeout">${mail.connectiontimeout}</prop> |
| 329 | </props> |
| 330 | </constructor-arg> |
margaretha | fb027f9 | 2018-04-23 20:00:13 +0200 | [diff] [blame] | 331 | <constructor-arg index="1" ref="authenticator" /> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 332 | </bean> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 333 | <bean id="mailSender" |
| 334 | class="org.springframework.mail.javamail.JavaMailSenderImpl"> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 335 | <property name="session" ref="smtpSession" /> |
| 336 | </bean> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 337 | <bean id="velocityEngine" |
| 338 | class="org.apache.velocity.app.VelocityEngine"> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 339 | <constructor-arg index="0"> |
| 340 | <props> |
| 341 | <prop key="resource.loader">class</prop> |
| 342 | <prop key="class.resource.loader.class">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader |
| 343 | </prop> |
| 344 | </props> |
| 345 | </constructor-arg> |
margaretha | aecee1b | 2018-02-20 14:44:21 +0100 | [diff] [blame] | 346 | </bean> |
Akron | bee031a | 2020-10-29 16:58:14 +0100 | [diff] [blame] | 347 | </beans> |