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