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