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