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