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 | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 54 | <!-- props are injected from default-config.xml --> |
margaretha | 56e8e55 | 2017-12-05 16:31:21 +0100 | [diff] [blame] | 55 | <bean id="kustvakt_config" class="de.ids_mannheim.korap.config.FullConfiguration"> |
margaretha | f68daa6 | 2017-09-21 02:11:24 +0200 | [diff] [blame] | 56 | <constructor-arg name="properties" ref="props" /> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 57 | </bean> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 58 | |
margaretha | 6c2a20f | 2017-07-24 15:33:01 +0200 | [diff] [blame] | 59 | <bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" |
| 60 | lazy-init="true"> |
margaretha | 4edc70e | 2018-03-14 22:34:29 +0100 | [diff] [blame] | 61 | <!-- <property name="driverClassName" value="${jdbc.driverClassName}" /> --> |
margaretha | 6c2a20f | 2017-07-24 15:33:01 +0200 | [diff] [blame] | 62 | <property name="url" value="${jdbc.url}" /> |
| 63 | <property name="username" value="${jdbc.username}" /> |
| 64 | <property name="password" value="${jdbc.password}" /> |
margaretha | 318fec3 | 2017-10-24 12:11:58 +0200 | [diff] [blame] | 65 | <property name="maxTotal" value="4" /> |
margaretha | 514e141 | 2017-10-10 15:54:20 +0200 | [diff] [blame] | 66 | <property name="maxIdle" value="1" /> |
margaretha | 6c2a20f | 2017-07-24 15:33:01 +0200 | [diff] [blame] | 67 | <property name="minIdle" value="1" /> |
| 68 | <property name="maxWaitMillis" value="15000" /> |
| 69 | <!--<property name="poolPreparedStatements" value="true"/> --> |
| 70 | </bean> |
| 71 | |
margaretha | 514e141 | 2017-10-10 15:54:20 +0200 | [diff] [blame] | 72 | <!-- use SingleConnection only for testing! --> |
margaretha | 6c2a20f | 2017-07-24 15:33:01 +0200 | [diff] [blame] | 73 | <bean id="sqliteDataSource" |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 74 | class="org.springframework.jdbc.datasource.SingleConnectionDataSource" |
margaretha | 318fec3 | 2017-10-24 12:11:58 +0200 | [diff] [blame] | 75 | lazy-init="true"> |
margaretha | 514e141 | 2017-10-10 15:54:20 +0200 | [diff] [blame] | 76 | <!-- <property name="driverClassName" value="${jdbc.driverClassName}" /> --> |
margaretha | 6c2a20f | 2017-07-24 15:33:01 +0200 | [diff] [blame] | 77 | <property name="url" value="${jdbc.url}" /> |
| 78 | <property name="username" value="${jdbc.username}" /> |
| 79 | <property name="password" value="${jdbc.password}" /> |
margaretha | e6c711b | 2018-02-06 21:55:04 +0100 | [diff] [blame] | 80 | <property name="connectionProperties"> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 81 | <props> |
| 82 | <prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop> |
| 83 | </props> |
| 84 | </property> |
| 85 | |
margaretha | 514e141 | 2017-10-10 15:54:20 +0200 | [diff] [blame] | 86 | <!-- Sqlite can only have a single connection --> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 87 | <property name="suppressClose"> |
| 88 | <value>true</value> |
| 89 | </property> |
margaretha | 514e141 | 2017-10-10 15:54:20 +0200 | [diff] [blame] | 90 | </bean> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 91 | |
margaretha | 514e141 | 2017-10-10 15:54:20 +0200 | [diff] [blame] | 92 | <bean id="c3p0DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 93 | destroy-method="close"> |
| 94 | <property name="driverClass" value="${jdbc.driverClassName}" /> |
margaretha | 514e141 | 2017-10-10 15:54:20 +0200 | [diff] [blame] | 95 | <property name="jdbcUrl" value="${jdbc.url}" /> |
| 96 | <property name="user" value="${jdbc.username}" /> |
| 97 | <property name="password" value="${jdbc.password}" /> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 98 | <property name="maxPoolSize" value="4" /> |
| 99 | <property name="minPoolSize" value="1" /> |
| 100 | <property name="maxStatements" value="1" /> |
| 101 | <property name="testConnectionOnCheckout" value="true" /> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 102 | </bean> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 103 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 104 | <!-- to configure database for sqlite, mysql, etc. migrations --> |
| 105 | <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate"> |
margaretha | f6d5a82 | 2017-10-19 19:51:20 +0200 | [diff] [blame] | 106 | <!-- drop existing tables and create new tables --> |
| 107 | <property name="validateOnMigrate" value="true" /> |
| 108 | <property name="cleanOnValidationError" value="true" /> |
| 109 | |
margaretha | 514e141 | 2017-10-10 15:54:20 +0200 | [diff] [blame] | 110 | <property name="baselineOnMigrate" value="false" /> |
| 111 | <property name="locations" value="${jdbc.schemaPath}" /> |
margaretha | 6c2a20f | 2017-07-24 15:33:01 +0200 | [diff] [blame] | 112 | <property name="dataSource" ref="sqliteDataSource" /> |
margaretha | 318fec3 | 2017-10-24 12:11:58 +0200 | [diff] [blame] | 113 | <!-- <property name="dataSource" ref="dataSource" /> --> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 114 | </bean> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 115 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 116 | <bean id="kustvakt_db" class="de.ids_mannheim.korap.handlers.JDBCClient"> |
margaretha | 318fec3 | 2017-10-24 12:11:58 +0200 | [diff] [blame] | 117 | <!-- <constructor-arg index="0" ref="dataSource" /> --> |
margaretha | bc9caf4 | 2017-09-21 18:52:52 +0200 | [diff] [blame] | 118 | <constructor-arg index="0" ref="sqliteDataSource" /> |
margaretha | 318fec3 | 2017-10-24 12:11:58 +0200 | [diff] [blame] | 119 | <property name="database" value="${jdbc.database}" /> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 120 | </bean> |
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 | 318fec3 | 2017-10-24 12:11:58 +0200 | [diff] [blame] | 124 | <!-- <property name="dataSource" ref="dataSource" /> --> |
| 125 | <property name="dataSource" ref="sqliteDataSource" /> |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 126 | <property name="packagesToScan" value="de.ids_mannheim.korap.entity" /> |
| 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 | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 161 | <!-- <bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao"/> --> |
| 162 | |
margaretha | 6c2a20f | 2017-07-24 15:33:01 +0200 | [diff] [blame] | 163 | <!-- Krill --> |
| 164 | <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill"> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 165 | <constructor-arg value="${krill.indexDir}" /> |
margaretha | 6c2a20f | 2017-07-24 15:33:01 +0200 | [diff] [blame] | 166 | </bean> |
| 167 | |
margaretha | 31a9f52 | 2018-04-03 20:40:45 +0200 | [diff] [blame] | 168 | <!-- URLValidator --> |
| 169 | <bean id="urlValidator" class="org.apache.commons.validator.routines.UrlValidator"> |
| 170 | <constructor-arg value="http,https"/> |
| 171 | </bean> |
margaretha | a048627 | 2018-04-12 19:59:31 +0200 | [diff] [blame^] | 172 | <bean id="httpsValidator" class="org.apache.commons.validator.routines.UrlValidator"> |
| 173 | <constructor-arg value="https"/> |
| 174 | </bean> |
margaretha | 56e8e55 | 2017-12-05 16:31:21 +0100 | [diff] [blame] | 175 | |
| 176 | <bean id="kustvakt_rewrite" class="de.ids_mannheim.korap.rewrite.FullRewriteHandler"> |
| 177 | <constructor-arg ref="kustvakt_config" /> |
| 178 | </bean> |
| 179 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 180 | <bean id="kustvakt_auditing" class="de.ids_mannheim.korap.handlers.JDBCAuditing"> |
| 181 | <constructor-arg ref="kustvakt_db" /> |
| 182 | </bean> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 183 | |
| 184 | <bean id="kustvakt_response" class="de.ids_mannheim.korap.web.FullResponseHandler"> |
| 185 | <constructor-arg index="0" name="iface" ref="kustvakt_auditing" /> |
| 186 | </bean> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 187 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 188 | <bean id="kustvakt_userdb" class="de.ids_mannheim.korap.handlers.EntityDao"> |
| 189 | <constructor-arg ref="kustvakt_db" /> |
| 190 | </bean> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 191 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 192 | <bean id="resource_provider" class="de.ids_mannheim.korap.handlers.ResourceDao"> |
| 193 | <constructor-arg ref="kustvakt_db" /> |
| 194 | </bean> |
Michael Hanl | f8fcc7a | 2016-06-03 17:41:07 +0200 | [diff] [blame] | 195 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 196 | <bean id="document_provider" class="de.ids_mannheim.korap.handlers.DocumentDao"> |
| 197 | <constructor-arg ref="kustvakt_db" /> |
| 198 | </bean> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 199 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 200 | <bean name="kustvakt_encryption" |
margaretha | 6d61a55 | 2018-04-10 19:26:44 +0200 | [diff] [blame] | 201 | class="de.ids_mannheim.korap.encryption.KustvaktEncryption"> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 202 | <constructor-arg ref="kustvakt_config" /> |
| 203 | </bean> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 204 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 205 | <!-- authentication providers to use --> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 206 | <!-- <bean id="api_auth" class="de.ids_mannheim.korap.authentication.APIAuthentication"> |
| 207 | <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration" |
| 208 | ref="kustvakt_config" /> </bean> --> |
margaretha | 4de4119 | 2017-11-15 11:47:11 +0100 | [diff] [blame] | 209 | <bean id="ldap_auth" class="de.ids_mannheim.korap.authentication.LdapAuth3"> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 210 | <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration" |
| 211 | ref="kustvakt_config" /> |
| 212 | </bean> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 213 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 214 | <bean id="openid_auth" |
margaretha | 139d0f7 | 2017-11-14 18:56:22 +0100 | [diff] [blame] | 215 | class="de.ids_mannheim.korap.authentication.OpenIDconnectAuthentication"> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 216 | <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration" |
| 217 | ref="kustvakt_config" /> |
| 218 | <constructor-arg |
| 219 | type="de.ids_mannheim.korap.interfaces.db.PersistenceClient" ref="kustvakt_db" /> |
| 220 | </bean> |
| 221 | |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 222 | <bean id="basic_auth" |
| 223 | class="de.ids_mannheim.korap.authentication.BasicAuthentication" /> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 224 | |
| 225 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 226 | <bean id="session_auth" |
margaretha | 139d0f7 | 2017-11-14 18:56:22 +0100 | [diff] [blame] | 227 | class="de.ids_mannheim.korap.authentication.SessionAuthentication"> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 228 | <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration" |
| 229 | ref="kustvakt_config" /> |
| 230 | <constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface" |
| 231 | ref="kustvakt_encryption" /> |
| 232 | </bean> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 233 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 234 | <util:list id="kustvakt_authproviders" |
| 235 | value-type="de.ids_mannheim.korap.interfaces.AuthenticationIface"> |
| 236 | <ref bean="basic_auth" /> |
margaretha | 4de4119 | 2017-11-15 11:47:11 +0100 | [diff] [blame] | 237 | <ref bean="ldap_auth" /> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 238 | <ref bean="session_auth" /> |
margaretha | 4de4119 | 2017-11-15 11:47:11 +0100 | [diff] [blame] | 239 | <!-- <ref bean="api_auth" /> --> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 240 | <ref bean="openid_auth" /> |
| 241 | </util:list> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 242 | |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 243 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 244 | <bean id="userdata_details" class="de.ids_mannheim.korap.handlers.UserDetailsDao"> |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 245 | <constructor-arg ref="kustvakt_db" /> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 246 | </bean> |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 247 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 248 | <bean id="userdata_settings" class="de.ids_mannheim.korap.handlers.UserSettingsDao"> |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 249 | <constructor-arg ref="kustvakt_db" /> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 250 | </bean> |
Michael Hanl | daf8660 | 2016-05-12 14:31:52 +0200 | [diff] [blame] | 251 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 252 | <util:list id="kustvakt_userdata" |
| 253 | value-type="de.ids_mannheim.korap.interfaces.db.UserdataDbIface"> |
| 254 | <ref bean="userdata_details" /> |
| 255 | <ref bean="userdata_settings" /> |
| 256 | </util:list> |
Michael Hanl | daf8660 | 2016-05-12 14:31:52 +0200 | [diff] [blame] | 257 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 258 | <util:list id="kustvakt_resources" |
| 259 | value-type="de.ids_mannheim.korap.interfaces.db.ResourceOperationIface"> |
| 260 | <ref bean="document_provider" /> |
| 261 | <ref bean="resource_provider" /> |
| 262 | </util:list> |
Michael Hanl | f8fcc7a | 2016-06-03 17:41:07 +0200 | [diff] [blame] | 263 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 264 | <!-- specify type for constructor argument --> |
| 265 | <bean id="kustvakt_authenticationmanager" |
margaretha | 139d0f7 | 2017-11-14 18:56:22 +0100 | [diff] [blame] | 266 | class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager"> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 267 | <constructor-arg |
margaretha | 69e8adc | 2018-03-15 15:14:22 +0100 | [diff] [blame] | 268 | type="de.ids_mannheim.korap.interfaces.EntityHandlerIface" ref="kustvakt_userdb" /> |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 269 | <constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface" |
| 270 | ref="kustvakt_encryption" /> |
| 271 | <constructor-arg ref="kustvakt_config" /> |
| 272 | <constructor-arg type="de.ids_mannheim.korap.interfaces.db.AuditingIface" |
| 273 | ref="kustvakt_auditing" /> |
| 274 | <constructor-arg ref="kustvakt_userdata" /> |
| 275 | <!-- inject authentication providers to use --> |
| 276 | <property name="providers" ref="kustvakt_authproviders" /> |
| 277 | </bean> |
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 | <!-- todo: if db interfaces not loaded via spring, does transaction even |
| 280 | work then? --> |
| 281 | <!-- the transactional advice (i.e. what 'happens'; see the <aop:advisor/> |
| 282 | bean below) --> |
| 283 | <tx:advice id="txAdvice" transaction-manager="txManager"> |
| 284 | <!-- the transactional semantics... --> |
| 285 | <tx:attributes> |
| 286 | <!-- all methods starting with 'get' are read-only --> |
| 287 | <tx:method name="get*" read-only="true" rollback-for="KorAPException" /> |
| 288 | <!-- other methods use the default transaction settings (see below) --> |
| 289 | <tx:method name="*" rollback-for="KorAPException" /> |
| 290 | </tx:attributes> |
| 291 | </tx:advice> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 292 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 293 | <!-- ensure that the above transactional advice runs for any execution of |
| 294 | an operation defined by the service interface --> |
| 295 | <aop:config> |
| 296 | <aop:pointcut id="service" |
| 297 | expression="execution(* de.ids_mannheim.korap.interfaces.db.*.*(..))" /> |
| 298 | <aop:advisor advice-ref="txAdvice" pointcut-ref="service" /> |
| 299 | </aop:config> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 300 | |
margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 301 | <!-- similarly, don't forget the PlatformTransactionManager --> |
| 302 | <bean id="txManager" |
| 303 | class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> |
| 304 | <property name="dataSource" ref="dataSource" /> |
| 305 | </bean> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 306 | |
| 307 | <!-- mail --> |
margaretha | aecee1b | 2018-02-20 14:44:21 +0100 | [diff] [blame] | 308 | <bean id="authenticator" class="de.ids_mannheim.korap.service.MailAuthenticator"> |
| 309 | <constructor-arg index="0" value="${mail.username}"/> |
| 310 | <constructor-arg index="1" value="${mail.password}"/> |
| 311 | </bean> |
| 312 | <bean id="smtpSession" class="javax.mail.Session" factory-method="getInstance"> |
| 313 | <constructor-arg index="0"> |
| 314 | <props> |
| 315 | <prop key="mail.smtp.submitter">${mail.username}</prop> |
| 316 | <prop key="mail.smtp.auth">${mail.auth}</prop> |
| 317 | <prop key="mail.smtp.host">${mail.host}</prop> |
| 318 | <prop key="mail.smtp.port">${mail.port}</prop> |
| 319 | <prop key="mail.smtp.starttls.enable">${mail.starttls.enable}</prop> |
| 320 | <prop key="mail.smtp.connectiontimeout">${mail.connectiontimeout}</prop> |
| 321 | </props> |
| 322 | </constructor-arg> |
| 323 | <constructor-arg index="1" ref="authenticator"/> |
margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 324 | </bean> |
| 325 | <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"> |
| 326 | <property name="session" ref="smtpSession" /> |
| 327 | </bean> |
| 328 | <bean id="velocityEngine" class="org.apache.velocity.app.VelocityEngine"> |
| 329 | <constructor-arg index="0"> |
| 330 | <props> |
| 331 | <prop key="resource.loader">class</prop> |
| 332 | <prop key="class.resource.loader.class">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader |
| 333 | </prop> |
| 334 | </props> |
| 335 | </constructor-arg> |
margaretha | aecee1b | 2018-02-20 14:44:21 +0100 | [diff] [blame] | 336 | </bean> |
Michael Hanl | bd852b8 | 2015-11-18 22:17:00 +0100 | [diff] [blame] | 337 | </beans> |