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