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