margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <beans xmlns="http://www.springframework.org/schema/beans" |
| 3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" |
| 4 | xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" |
| 5 | xsi:schemaLocation="http://www.springframework.org/schema/beans |
| 6 | http://www.springframework.org/schema/beans/spring-beans.xsd |
| 7 | http://www.springframework.org/schema/tx |
| 8 | http://www.springframework.org/schema/tx/spring-tx.xsd |
| 9 | http://www.springframework.org/schema/context |
| 10 | http://www.springframework.org/schema/context/spring-context.xsd |
| 11 | http://www.springframework.org/schema/util |
| 12 | http://www.springframework.org/schema/util/spring-util.xsd"> |
| 13 | |
| 14 | |
| 15 | <context:component-scan |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 16 | base-package="de.ids_mannheim.korap.rewrite, |
margaretha | ed2ee24 | 2019-12-12 17:34:18 +0100 | [diff] [blame^] | 17 | de.ids_mannheim.korap.service, |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 18 | de.ids_mannheim.korap.web.filter, |
| 19 | de.ids_mannheim.korap.web.utils, |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 20 | de.ids_mannheim.korap.authentication.http" /> |
| 21 | <context:annotation-config /> |
| 22 | |
| 23 | <bean id="placeholders" |
| 24 | class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"> |
| 25 | <property name="ignoreResourceNotFound" value="true" /> |
| 26 | <property name="locations"> |
| 27 | <array> |
| 28 | <value>classpath:test-jdbc.properties</value> |
| 29 | <value>file:./test-jdbc.properties</value> |
| 30 | <value>classpath:hibernate.properties</value> |
| 31 | <value>classpath:kustvakt-lite.conf</value> |
| 32 | <value>file:./kustvakt-lite.conf</value> |
| 33 | </array> |
| 34 | </property> |
| 35 | </bean> |
| 36 | |
| 37 | <bean id="properties" |
| 38 | class="org.springframework.beans.factory.config.PropertiesFactoryBean"> |
| 39 | <property name="ignoreResourceNotFound" value="true" /> |
| 40 | <property name="locations"> |
| 41 | <array> |
| 42 | <value>classpath:kustvakt-lite.conf</value> |
| 43 | <value>file:./kustvakt-lite.conf</value> |
| 44 | </array> |
| 45 | </property> |
| 46 | </bean> |
| 47 | |
| 48 | <bean id="config" class="de.ids_mannheim.korap.config.KustvaktConfiguration"> |
| 49 | <constructor-arg index="0" name="properties" ref="properties" /> |
| 50 | </bean> |
| 51 | |
| 52 | <!-- Database --> |
| 53 | |
| 54 | <bean id="sqliteDataSource" |
| 55 | class="org.springframework.jdbc.datasource.SingleConnectionDataSource" |
| 56 | lazy-init="true"> |
| 57 | <property name="driverClassName" value="${jdbc.driverClassName}" /> |
| 58 | <property name="url" value="${jdbc.url}" /> |
| 59 | <property name="username" value="${jdbc.username}" /> |
| 60 | <property name="password" value="${jdbc.password}" /> |
| 61 | <property name="connectionProperties"> |
| 62 | <props> |
| 63 | <prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop> |
| 64 | </props> |
| 65 | </property> |
| 66 | |
| 67 | <!-- relevant for single connection datasource and sqlite --> |
| 68 | <property name="suppressClose"> |
| 69 | <value>true</value> |
| 70 | </property> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 71 | </bean> |
| 72 | |
| 73 | <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate"> |
| 74 | <property name="baselineOnMigrate" value="true" /> |
| 75 | <!-- <property name="validateOnMigrate" value="false" /> --> |
| 76 | <!-- <property name="cleanOnValidationError" value="true" /> --> |
| 77 | <property name="locations" value="${jdbc.schemaPath}" /> |
| 78 | <property name="dataSource" ref="sqliteDataSource" /> |
| 79 | </bean> |
| 80 | |
| 81 | <bean id="entityManagerFactory" |
| 82 | class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> |
| 83 | <property name="dataSource" ref="sqliteDataSource" /> |
| 84 | |
| 85 | <property name="packagesToScan"> |
| 86 | <array> |
| 87 | <value>de.ids_mannheim.korap.entity</value> |
| 88 | </array> |
| 89 | </property> |
| 90 | <property name="jpaVendorAdapter"> |
| 91 | <bean id="jpaVendorAdapter" |
| 92 | class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> |
| 93 | <property name="databasePlatform" value="${hibernate.dialect}" /> |
| 94 | </bean> |
| 95 | </property> |
| 96 | <property name="jpaProperties"> |
| 97 | <props> |
| 98 | <prop key="hibernate.dialect">${hibernate.dialect}</prop> |
| 99 | <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> |
| 100 | <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> |
| 101 | <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> |
| 102 | <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache} |
| 103 | </prop> |
| 104 | <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop> |
| 105 | <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop> |
| 106 | <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop> |
| 107 | </props> |
| 108 | </property> |
| 109 | </bean> |
| 110 | <tx:annotation-driven proxy-target-class="true" |
| 111 | transaction-manager="transactionManager" /> |
| 112 | |
| 113 | <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> |
| 114 | <property name="entityManagerFactory" ref="entityManagerFactory" /> |
| 115 | </bean> |
| 116 | |
| 117 | <bean id="transactionTemplate" |
| 118 | class="org.springframework.transaction.support.TransactionTemplate"> |
| 119 | <constructor-arg ref="transactionManager" /> |
| 120 | </bean> |
| 121 | <bean id="txManager" |
| 122 | class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> |
| 123 | <property name="dataSource" ref="sqliteDataSource" /> |
| 124 | </bean> |
| 125 | |
| 126 | <!-- Initialization --> |
| 127 | <bean id="initializator" class="de.ids_mannheim.de.init.LiteInitializatorImpl" |
margaretha | 398f472 | 2019-01-09 19:07:20 +0100 | [diff] [blame] | 128 | init-method="initTest"> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 129 | </bean> |
| 130 | <bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser" |
| 131 | scope="singleton" /> |
| 132 | |
margaretha | 47a72a8 | 2019-07-03 16:00:54 +0200 | [diff] [blame] | 133 | <bean id="vcLoader" class="de.ids_mannheim.de.init.VCLoaderImpl"/> |
| 134 | |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 135 | <!-- Krill --> |
| 136 | <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill"> |
| 137 | <constructor-arg value="${krill.indexDir}" /> |
| 138 | </bean> |
| 139 | |
| 140 | <!-- Filters --> |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 141 | <!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter" |
| 142 | scope="singleton" /> --> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 143 | <!-- Authentication --> |
| 144 | <bean id="authenticationManager" |
| 145 | class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" /> |
| 146 | |
| 147 | <!-- Response handler --> |
| 148 | <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler"> |
| 149 | <constructor-arg index="0" name="iface" ref="kustvakt_auditing" /> |
| 150 | </bean> |
| 151 | |
| 152 | <!-- Controllers --> |
| 153 | <bean id="annotationController" |
| 154 | class="de.ids_mannheim.korap.web.controller.AnnotationController" /> |
| 155 | <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" /> |
| 156 | <bean id="statisticController" |
| 157 | class="de.ids_mannheim.korap.web.controller.StatisticController" /> |
| 158 | |
| 159 | <!-- Services --> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 160 | <bean id="scopeService" |
| 161 | class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 162 | |
| 163 | <!-- DAO --> |
| 164 | <bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" /> |
| 165 | <bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" /> |
| 166 | |
| 167 | <!-- DTO Converter --> |
| 168 | <bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" /> |
| 169 | |
| 170 | <!-- Rewrite --> |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 171 | <bean id="foundryInject" class="de.ids_mannheim.korap.rewrite.FoundryInject" /> |
| 172 | |
| 173 | <util:list id="rewriteTasks" value-type="de.ids_mannheim.korap.rewrite.RewriteTask"> |
| 174 | <ref bean="foundryInject" /> |
| 175 | </util:list> |
| 176 | |
margaretha | 398f472 | 2019-01-09 19:07:20 +0100 | [diff] [blame] | 177 | <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler"> |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 178 | <constructor-arg ref="rewriteTasks" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 179 | </bean> |
| 180 | |
| 181 | |
| 182 | |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 183 | |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 184 | <bean id="kustvakt_auditing" |
| 185 | class="de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing"> |
| 186 | </bean> |
| 187 | |
| 188 | </beans> |