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