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> |
| 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 | |
| 49 | <bean id='cacheManager' class='org.springframework.cache.ehcache.EhCacheCacheManager' |
| 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' /> |
| 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 --> |
| 110 | <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate"> |
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 | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 114 | <property name="locations" value="${jdbc.schemaPath}" /> |
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 | 45211af | 2018-08-28 12:49:07 +0200 | [diff] [blame] | 118 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 119 | </bean> |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 120 | |
| 121 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 122 | <bean id="kustvakt_db" class="de.ids_mannheim.korap.handlers.JDBCClient"> |
| 123 | <constructor-arg index="0" ref="dataSource" /> |
| 124 | <!-- deprecated property --> |
| 125 | <property name="database" value="${jdbc.database}" /> |
| 126 | </bean> |
| 127 | |
| 128 | <bean id="entityManagerFactory" |
| 129 | class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> |
margaretha | 894a7d7 | 2017-11-08 19:24:20 +0100 | [diff] [blame] | 130 | <!-- <property name="dataSource" ref="dataSource" /> --> |
margaretha | 8514d78 | 2018-08-28 17:36:56 +0200 | [diff] [blame] | 131 | <property name="dataSource" ref="sqliteDataSource" /> |
| 132 | <!-- <property name="dataSource" ref="c3p0DataSource" /> --> |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 133 | |
margaretha | a452c5e | 2018-04-25 22:48:09 +0200 | [diff] [blame] | 134 | <property name="packagesToScan"> |
| 135 | <array> |
| 136 | <value>de.ids_mannheim.korap.entity</value> |
| 137 | <value>de.ids_mannheim.korap.oauth2.entity</value> |
| 138 | </array> |
| 139 | </property> |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 140 | <property name="jpaVendorAdapter"> |
| 141 | <bean id="jpaVendorAdapter" |
| 142 | class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> |
| 143 | <property name="databasePlatform" value="${hibernate.dialect}" /> |
| 144 | </bean> |
| 145 | </property> |
| 146 | <property name="jpaProperties"> |
| 147 | <props> |
| 148 | <prop key="hibernate.dialect">${hibernate.dialect}</prop> |
| 149 | <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> |
| 150 | <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> |
| 151 | <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> |
| 152 | <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache} |
| 153 | </prop> |
| 154 | <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop> |
| 155 | <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop> |
margaretha | 6ad08b4 | 2018-08-22 18:33:54 +0200 | [diff] [blame] | 156 | <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop> |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 157 | </props> |
| 158 | </property> |
| 159 | </bean> |
| 160 | |
| 161 | <tx:annotation-driven proxy-target-class="true" |
| 162 | transaction-manager="transactionManager" /> |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 163 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 164 | <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> |
| 165 | <property name="entityManagerFactory" ref="entityManagerFactory" /> |
| 166 | </bean> |
| 167 | |
| 168 | <bean id="transactionTemplate" |
| 169 | class="org.springframework.transaction.support.TransactionTemplate"> |
| 170 | <constructor-arg ref="transactionManager" /> |
| 171 | </bean> |
| 172 | |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 173 | <!-- Data access objects --> |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 174 | <bean id="resourceDao" class="de.ids_mannheim.korap.dao.ResourceDao" /> |
margaretha | b4ce660 | 2018-04-26 20:23:57 +0200 | [diff] [blame] | 175 | <bean id="accessScopeDao" class="de.ids_mannheim.korap.oauth2.dao.AccessScopeDao" /> |
margaretha | 064eb6f | 2018-07-10 18:33:01 +0200 | [diff] [blame] | 176 | <bean id="authorizationDao" class="de.ids_mannheim.korap.oauth2.dao.AuthorizationCacheDao" /> |
margaretha | b4ce660 | 2018-04-26 20:23:57 +0200 | [diff] [blame] | 177 | |
| 178 | <!-- props are injected from default-config.xml --> |
| 179 | <bean id="kustvakt_config" class="de.ids_mannheim.korap.config.FullConfiguration"> |
| 180 | <constructor-arg name="properties" ref="props" /> |
| 181 | </bean> |
| 182 | |
| 183 | <bean id="initializator" class="de.ids_mannheim.korap.config.Initializator" |
margaretha | 2c50c73 | 2018-10-17 18:48:52 +0200 | [diff] [blame] | 184 | init-method="initAnnotation"> |
margaretha | b4ce660 | 2018-04-26 20:23:57 +0200 | [diff] [blame] | 185 | </bean> |
margaretha | ade7d4a | 2017-07-20 19:53:35 +0200 | [diff] [blame] | 186 | |
| 187 | <!-- Krill --> |
| 188 | <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill"> |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 189 | <constructor-arg value="${krill.indexDir}" /> |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 190 | </bean> |
| 191 | |
margaretha | 31a9f52 | 2018-04-03 20:40:45 +0200 | [diff] [blame] | 192 | <!-- URLValidator --> |
margaretha | e4034a8 | 2018-07-02 14:46:59 +0200 | [diff] [blame] | 193 | <bean id="redirectURIValidator" class="org.apache.commons.validator.routines.UrlValidator"> |
| 194 | <constructor-arg value="http,https" index="0" /> |
| 195 | <constructor-arg index="1" type="long"> |
| 196 | <util:constant |
| 197 | static-field="org.apache.commons.validator.routines.UrlValidator.NO_FRAGMENTS" /> |
| 198 | </constructor-arg> |
margaretha | a048627 | 2018-04-12 19:59:31 +0200 | [diff] [blame] | 199 | </bean> |
margaretha | d7cab21 | 2018-07-02 19:01:43 +0200 | [diff] [blame] | 200 | <bean id="urlValidator" class="org.apache.commons.validator.routines.UrlValidator"> |
| 201 | <constructor-arg value="http,https" /> |
| 202 | </bean> |
| 203 | |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 204 | |
margaretha | 56e8e55 | 2017-12-05 16:31:21 +0100 | [diff] [blame] | 205 | <bean id="kustvakt_rewrite" class="de.ids_mannheim.korap.rewrite.FullRewriteHandler"> |
| 206 | <constructor-arg ref="kustvakt_config" /> |
| 207 | </bean> |
| 208 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 209 | <bean id="kustvakt_auditing" class="de.ids_mannheim.korap.handlers.JDBCAuditing"> |
| 210 | <constructor-arg ref="kustvakt_db" /> |
| 211 | </bean> |
| 212 | |
margaretha | d7cab21 | 2018-07-02 19:01:43 +0200 | [diff] [blame] | 213 | <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler"> |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 214 | <constructor-arg index="0" name="iface" ref="kustvakt_auditing" /> |
| 215 | </bean> |
margaretha | a452c5e | 2018-04-25 22:48:09 +0200 | [diff] [blame] | 216 | |
margaretha | fb027f9 | 2018-04-23 20:00:13 +0200 | [diff] [blame] | 217 | <!-- OAuth --> |
| 218 | <bean id="oauth2ResponseHandler" class="de.ids_mannheim.korap.web.OAuth2ResponseHandler"> |
margaretha | 0512231 | 2018-04-16 15:01:34 +0200 | [diff] [blame] | 219 | <constructor-arg index="0" name="iface" ref="kustvakt_auditing" /> |
| 220 | </bean> |
margaretha | a452c5e | 2018-04-25 22:48:09 +0200 | [diff] [blame] | 221 | |
margaretha | fb027f9 | 2018-04-23 20:00:13 +0200 | [diff] [blame] | 222 | <bean id="mdGenerator" class="org.apache.oltu.oauth2.as.issuer.MD5Generator"> |
| 223 | </bean> |
| 224 | <bean id="oauthIssuer" class="org.apache.oltu.oauth2.as.issuer.OAuthIssuerImpl"> |
| 225 | <constructor-arg index="0" ref="mdGenerator" /> |
| 226 | </bean> |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 227 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 228 | <bean id="kustvakt_userdb" class="de.ids_mannheim.korap.handlers.EntityDao"> |
| 229 | <constructor-arg ref="kustvakt_db" /> |
| 230 | </bean> |
| 231 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 232 | <bean id="document_provider" class="de.ids_mannheim.korap.handlers.DocumentDao"> |
| 233 | <constructor-arg ref="kustvakt_db" /> |
| 234 | </bean> |
| 235 | |
margaretha | a452c5e | 2018-04-25 22:48:09 +0200 | [diff] [blame] | 236 | <bean name="kustvakt_encryption" class="de.ids_mannheim.korap.encryption.KustvaktEncryption"> |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 237 | <constructor-arg ref="kustvakt_config" /> |
| 238 | </bean> |
| 239 | |
| 240 | <!-- authentication providers to use --> |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 241 | <!-- <bean id="api_auth" class="de.ids_mannheim.korap.authentication.APIAuthentication"> |
| 242 | <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration" |
| 243 | ref="kustvakt_config" /> </bean> --> |
| 244 | |
margaretha | 4de4119 | 2017-11-15 11:47:11 +0100 | [diff] [blame] | 245 | <bean id="ldap_auth" class="de.ids_mannheim.korap.authentication.LdapAuth3"> |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 246 | <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration" |
| 247 | ref="kustvakt_config" /> |
| 248 | </bean> |
| 249 | |
margaretha | 6ef00dd | 2018-09-12 14:06:38 +0200 | [diff] [blame] | 250 | <!-- <bean id="openid_auth" |
margaretha | 139d0f7 | 2017-11-14 18:56:22 +0100 | [diff] [blame] | 251 | class="de.ids_mannheim.korap.authentication.OpenIDconnectAuthentication"> |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 252 | <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration" |
| 253 | ref="kustvakt_config" /> |
| 254 | <constructor-arg |
| 255 | type="de.ids_mannheim.korap.interfaces.db.PersistenceClient" ref="kustvakt_db" /> |
margaretha | 6ef00dd | 2018-09-12 14:06:38 +0200 | [diff] [blame] | 256 | </bean> --> |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 257 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 258 | <bean id="session_auth" |
margaretha | 139d0f7 | 2017-11-14 18:56:22 +0100 | [diff] [blame] | 259 | class="de.ids_mannheim.korap.authentication.SessionAuthentication"> |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 260 | <constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration" |
| 261 | ref="kustvakt_config" /> |
| 262 | <constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface" |
| 263 | ref="kustvakt_encryption" /> |
| 264 | </bean> |
Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 265 | |
margaretha | cf306d3 | 2018-05-30 19:45:35 +0200 | [diff] [blame] | 266 | <bean id="oauth2_auth" |
| 267 | class="de.ids_mannheim.korap.authentication.OAuth2Authentication" /> |
| 268 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 269 | <util:list id="kustvakt_authproviders" |
| 270 | value-type="de.ids_mannheim.korap.interfaces.AuthenticationIface"> |
margaretha | 4de4119 | 2017-11-15 11:47:11 +0100 | [diff] [blame] | 271 | <ref bean="ldap_auth" /> |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 272 | <ref bean="session_auth" /> |
margaretha | 4de4119 | 2017-11-15 11:47:11 +0100 | [diff] [blame] | 273 | <!-- <ref bean="api_auth" /> --> |
margaretha | 6ef00dd | 2018-09-12 14:06:38 +0200 | [diff] [blame] | 274 | <!-- <ref bean="openid_auth" /> --> |
margaretha | cf306d3 | 2018-05-30 19:45:35 +0200 | [diff] [blame] | 275 | <ref bean="oauth2_auth" /> |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 276 | </util:list> |
Michael Hanl | 72c7b83 | 2015-09-03 08:42:15 +0200 | [diff] [blame] | 277 | |
| 278 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 279 | <bean id="userdata_details" class="de.ids_mannheim.korap.handlers.UserDetailsDao"> |
| 280 | <constructor-arg ref="kustvakt_db" /> |
| 281 | </bean> |
Michael Hanl | 72c7b83 | 2015-09-03 08:42:15 +0200 | [diff] [blame] | 282 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 283 | <bean id="userdata_settings" class="de.ids_mannheim.korap.handlers.UserSettingsDao"> |
| 284 | <constructor-arg ref="kustvakt_db" /> |
| 285 | </bean> |
| 286 | |
| 287 | <util:list id="kustvakt_userdata" |
| 288 | value-type="de.ids_mannheim.korap.interfaces.db.UserdataDbIface"> |
| 289 | <ref bean="userdata_details" /> |
| 290 | <ref bean="userdata_settings" /> |
| 291 | </util:list> |
Michael Hanl | 72c7b83 | 2015-09-03 08:42:15 +0200 | [diff] [blame] | 292 | |
Michael Hanl | daf8660 | 2016-05-12 14:31:52 +0200 | [diff] [blame] | 293 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 294 | <util:list id="kustvakt_resources" |
| 295 | value-type="de.ids_mannheim.korap.interfaces.db.ResourceOperationIface"> |
| 296 | <ref bean="document_provider" /> |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 297 | </util:list> |
Michael Hanl | f8fcc7a | 2016-06-03 17:41:07 +0200 | [diff] [blame] | 298 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 299 | <!-- specify type for constructor argument --> |
| 300 | <bean id="kustvakt_authenticationmanager" |
margaretha | 139d0f7 | 2017-11-14 18:56:22 +0100 | [diff] [blame] | 301 | class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager"> |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 302 | <constructor-arg type="de.ids_mannheim.korap.interfaces.EntityHandlerIface" |
| 303 | ref="kustvakt_userdb" /> |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 304 | <constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface" |
| 305 | ref="kustvakt_encryption" /> |
| 306 | <constructor-arg ref="kustvakt_config" /> |
| 307 | <constructor-arg type="de.ids_mannheim.korap.interfaces.db.AuditingIface" |
| 308 | ref="kustvakt_auditing" /> |
| 309 | <constructor-arg ref="kustvakt_userdata" /> |
| 310 | <!-- inject authentication providers to use --> |
| 311 | <property name="providers" ref="kustvakt_authproviders" /> |
| 312 | </bean> |
Michael Hanl | daf8660 | 2016-05-12 14:31:52 +0200 | [diff] [blame] | 313 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 314 | <!-- todo: if db interfaces not loaded via spring, does transaction even |
| 315 | work then? --> |
| 316 | <!-- the transactional advice (i.e. what 'happens'; see the <aop:advisor/> |
| 317 | bean below) --> |
| 318 | <tx:advice id="txAdvice" transaction-manager="txManager"> |
| 319 | <!-- the transactional semantics... --> |
| 320 | <tx:attributes> |
| 321 | <!-- all methods starting with 'get' are read-only --> |
| 322 | <tx:method name="get*" read-only="true" rollback-for="KorAPException" /> |
| 323 | <!-- other methods use the default transaction settings (see below) --> |
| 324 | <tx:method name="*" rollback-for="KorAPException" /> |
| 325 | </tx:attributes> |
| 326 | </tx:advice> |
Michael Hanl | daf8660 | 2016-05-12 14:31:52 +0200 | [diff] [blame] | 327 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 328 | <!-- ensure that the above transactional advice runs for any execution of |
| 329 | an operation defined by the service interface --> |
| 330 | <aop:config> |
| 331 | <aop:pointcut id="service" |
| 332 | expression="execution(* de.ids_mannheim.korap.interfaces.db.*.*(..))" /> |
| 333 | <aop:advisor advice-ref="txAdvice" pointcut-ref="service" /> |
| 334 | </aop:config> |
Michael Hanl | f8fcc7a | 2016-06-03 17:41:07 +0200 | [diff] [blame] | 335 | |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 336 | <!-- similarly, don't forget the PlatformTransactionManager --> |
| 337 | <bean id="txManager" |
| 338 | class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> |
margaretha | 894a7d7 | 2017-11-08 19:24:20 +0100 | [diff] [blame] | 339 | <!-- <property name="dataSource" ref="dataSource" /> --> |
margaretha | 8514d78 | 2018-08-28 17:36:56 +0200 | [diff] [blame] | 340 | <property name="dataSource" ref="sqliteDataSource" /> |
| 341 | <!-- <property name="dataSource" ref="c3p0DataSource" /> --> |
margaretha | 543f200 | 2017-07-14 00:27:15 +0200 | [diff] [blame] | 342 | </bean> |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 343 | |
margaretha | c9f1dfa | 2018-02-07 17:50:33 +0100 | [diff] [blame] | 344 | <!-- mail --> |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 345 | <bean id="authenticator" class="de.ids_mannheim.korap.service.MailAuthenticator"> |
| 346 | <constructor-arg index="0" value="${mail.username}" /> |
| 347 | <constructor-arg index="1" value="${mail.password}" /> |
margaretha | aecee1b | 2018-02-20 14:44:21 +0100 | [diff] [blame] | 348 | </bean> |
| 349 | <bean id="smtpSession" class="javax.mail.Session" factory-method="getInstance"> |
| 350 | <constructor-arg index="0"> |
| 351 | <props> |
| 352 | <prop key="mail.smtp.submitter">${mail.username}</prop> |
| 353 | <prop key="mail.smtp.auth">${mail.auth}</prop> |
| 354 | <prop key="mail.smtp.host">${mail.host}</prop> |
| 355 | <prop key="mail.smtp.port">${mail.port}</prop> |
| 356 | <prop key="mail.smtp.starttls.enable">${mail.starttls.enable}</prop> |
| 357 | <prop key="mail.smtp.connectiontimeout">${mail.connectiontimeout}</prop> |
| 358 | </props> |
| 359 | </constructor-arg> |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 360 | <constructor-arg index="1" ref="authenticator" /> |
margaretha | c9f1dfa | 2018-02-07 17:50:33 +0100 | [diff] [blame] | 361 | </bean> |
| 362 | <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"> |
margaretha | aecee1b | 2018-02-20 14:44:21 +0100 | [diff] [blame] | 363 | <property name="username" value="${mail.username}" /> |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 364 | <property name="password" value="${mail.password}" /> |
margaretha | c9f1dfa | 2018-02-07 17:50:33 +0100 | [diff] [blame] | 365 | <property name="session" ref="smtpSession" /> |
| 366 | </bean> |
| 367 | <bean id="velocityEngine" class="org.apache.velocity.app.VelocityEngine"> |
| 368 | <constructor-arg index="0"> |
| 369 | <props> |
| 370 | <prop key="resource.loader">class</prop> |
margaretha | 0e8f4e7 | 2018-04-05 14:11:52 +0200 | [diff] [blame] | 371 | <prop key="class.resource.loader.class">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader |
| 372 | </prop> |
margaretha | c9f1dfa | 2018-02-07 17:50:33 +0100 | [diff] [blame] | 373 | </props> |
| 374 | </constructor-arg> |
margaretha | aecee1b | 2018-02-20 14:44:21 +0100 | [diff] [blame] | 375 | </bean> |
Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 376 | </beans> |