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