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