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