blob: 5de7bd698d41f486151bfe01098022e2cb2cf862 [file] [log] [blame]
margaretha2df06602018-11-14 19:10:30 +01001<?xml version="1.0" encoding="UTF-8"?>
2<beans xmlns="http://www.springframework.org/schema/beans"
margaretha35e1ca22023-11-16 22:00:01 +01003 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xmlns:util="http://www.springframework.org/schema/util"
5 xmlns:context="http://www.springframework.org/schema/context"
6 xmlns:tx="http://www.springframework.org/schema/tx"
margaretha2df06602018-11-14 19:10:30 +01007 xsi:schemaLocation="http://www.springframework.org/schema/beans
8 http://www.springframework.org/schema/beans/spring-beans.xsd
9 http://www.springframework.org/schema/tx
10 http://www.springframework.org/schema/tx/spring-tx.xsd
11 http://www.springframework.org/schema/context
12 http://www.springframework.org/schema/context/spring-context.xsd
13 http://www.springframework.org/schema/util
14 http://www.springframework.org/schema/util/spring-util.xsd">
margaretha35e1ca22023-11-16 22:00:01 +010015
16 <context:component-scan
17 base-package="
margaretha5b708792023-05-12 16:55:29 +020018 de.ids_mannheim.korap.core.service,
margarethaac92c822023-05-15 11:43:22 +020019 de.ids_mannheim.korap.core.web,
margaretha4fa4b062019-01-28 19:43:30 +010020 de.ids_mannheim.korap.web.filter,
21 de.ids_mannheim.korap.web.utils,
margaretha2df06602018-11-14 19:10:30 +010022 de.ids_mannheim.korap.authentication.http" />
23 <context:annotation-config />
24
25 <bean id="placeholders"
26 class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
27 <property name="ignoreResourceNotFound" value="true" />
28 <property name="locations">
29 <array>
30 <value>classpath:test-jdbc.properties</value>
31 <value>file:./test-jdbc.properties</value>
margaretha92ad2ec2023-05-15 14:10:00 +020032 <value>classpath:test-hibernate.properties</value>
margaretha2df06602018-11-14 19:10:30 +010033 <value>classpath:kustvakt-lite.conf</value>
34 <value>file:./kustvakt-lite.conf</value>
35 </array>
36 </property>
37 </bean>
38
39 <bean id="properties"
40 class="org.springframework.beans.factory.config.PropertiesFactoryBean">
41 <property name="ignoreResourceNotFound" value="true" />
42 <property name="locations">
43 <array>
44 <value>classpath:kustvakt-lite.conf</value>
45 <value>file:./kustvakt-lite.conf</value>
46 </array>
47 </property>
48 </bean>
49
margaretha35e1ca22023-11-16 22:00:01 +010050 <bean id="config"
51 class="de.ids_mannheim.korap.config.KustvaktConfiguration">
52 <constructor-arg index="0" name="properties"
53 ref="properties" />
margaretha2df06602018-11-14 19:10:30 +010054 </bean>
55
56 <!-- Database -->
57
margaretha35e1ca22023-11-16 22:00:01 +010058 <bean id="dataSource"
59 class="org.apache.commons.dbcp2.BasicDataSource" lazy-init="true">
margaretha6ff2a972023-09-21 14:54:39 +020060 <!-- <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 <property name="maxTotal" value="4" />
65 <property name="maxIdle" value="1" />
66 <property name="minIdle" value="1" />
67 <property name="maxWaitMillis" value="15000" />
68 <!--<property name="poolPreparedStatements" value="true"/> -->
69 </bean>
70
margaretha2df06602018-11-14 19:10:30 +010071 <bean id="sqliteDataSource"
72 class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
73 lazy-init="true">
margaretha35e1ca22023-11-16 22:00:01 +010074 <property name="driverClassName"
75 value="${jdbc.driverClassName}" />
margaretha2df06602018-11-14 19:10:30 +010076 <property name="url" value="${jdbc.url}" />
77 <property name="username" value="${jdbc.username}" />
78 <property name="password" value="${jdbc.password}" />
79 <property name="connectionProperties">
80 <props>
81 <prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop>
82 </props>
83 </property>
84
85 <!-- relevant for single connection datasource and sqlite -->
86 <property name="suppressClose">
87 <value>true</value>
88 </property>
margaretha2df06602018-11-14 19:10:30 +010089 </bean>
90
margaretha35e1ca22023-11-16 22:00:01 +010091 <bean id="flywayConfig"
92 class="org.flywaydb.core.api.configuration.ClassicConfiguration">
93 <property name="baselineOnMigrate" value="true" />
margaretha2df06602018-11-14 19:10:30 +010094 <!-- <property name="validateOnMigrate" value="false" /> -->
95 <!-- <property name="cleanOnValidationError" value="true" /> -->
margaretha35e1ca22023-11-16 22:00:01 +010096 <property name="locations"
97 value="#{'${jdbc.schemaPath}'.split(',')}" />
margaretha6ff2a972023-09-21 14:54:39 +020098 <property name="dataSource" ref="dataSource" />
margarethad66a6832022-03-03 08:47:13 +010099 <property name="outOfOrder" value="true" />
margaretha2df06602018-11-14 19:10:30 +0100100 </bean>
margaretha35e1ca22023-11-16 22:00:01 +0100101
102 <bean id="flyway" class="org.flywaydb.core.Flyway"
103 init-method="migrate">
104 <constructor-arg ref="flywayConfig" />
margarethafcf8bd92021-01-14 10:55:53 +0100105 </bean>
margaretha2df06602018-11-14 19:10:30 +0100106
107 <bean id="entityManagerFactory"
108 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
margaretha6ff2a972023-09-21 14:54:39 +0200109 <property name="dataSource" ref="dataSource" />
margaretha2df06602018-11-14 19:10:30 +0100110
111 <property name="packagesToScan">
112 <array>
margaretha5b708792023-05-12 16:55:29 +0200113 <value>de.ids_mannheim.korap.core.entity</value>
margaretha2df06602018-11-14 19:10:30 +0100114 </array>
115 </property>
116 <property name="jpaVendorAdapter">
117 <bean id="jpaVendorAdapter"
118 class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
margaretha35e1ca22023-11-16 22:00:01 +0100119 <property name="databasePlatform"
120 value="${hibernate.dialect}" />
margaretha2df06602018-11-14 19:10:30 +0100121 </bean>
122 </property>
123 <property name="jpaProperties">
124 <props>
125 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
126 <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
127 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
128 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
129 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
130 </prop>
131 <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
132 <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
133 <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
134 </props>
135 </property>
136 </bean>
137 <tx:annotation-driven proxy-target-class="true"
138 transaction-manager="transactionManager" />
139
margaretha35e1ca22023-11-16 22:00:01 +0100140 <bean id="transactionManager"
141 class="org.springframework.orm.jpa.JpaTransactionManager">
142 <property name="entityManagerFactory"
143 ref="entityManagerFactory" />
margaretha2df06602018-11-14 19:10:30 +0100144 </bean>
145
146 <bean id="transactionTemplate"
147 class="org.springframework.transaction.support.TransactionTemplate">
148 <constructor-arg ref="transactionManager" />
149 </bean>
150 <bean id="txManager"
151 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
152 <property name="dataSource" ref="sqliteDataSource" />
153 </bean>
154
margaretha4dee07a2022-05-27 11:45:28 +0200155 <!-- Search Engine -->
margaretha35e1ca22023-11-16 22:00:01 +0100156 <bean id="search_krill"
157 class="de.ids_mannheim.korap.web.SearchKrill">
margaretha2df06602018-11-14 19:10:30 +0100158 <constructor-arg value="${krill.indexDir}" />
159 </bean>
margaretha35e1ca22023-11-16 22:00:01 +0100160
margaretha2df06602018-11-14 19:10:30 +0100161
162 <!-- Filters -->
margaretha4fa4b062019-01-28 19:43:30 +0100163 <!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter"
164 scope="singleton" /> -->
margaretha2df06602018-11-14 19:10:30 +0100165 <!-- Authentication -->
166 <bean id="authenticationManager"
167 class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" />
168
169 <!-- Response handler -->
margaretha35e1ca22023-11-16 22:00:01 +0100170 <bean id="kustvaktResponseHandler"
171 class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
margaretha2df06602018-11-14 19:10:30 +0100172 </bean>
173
174 <!-- Controllers -->
margaretha35e1ca22023-11-16 22:00:01 +0100175 <!-- added via component-scan <bean id="annotationController" class="de.ids_mannheim.korap.web.controller.AnnotationController"
176 /> <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController"
177 /> <bean id="statisticController" class="de.ids_mannheim.korap.web.controller.StatisticController"
178 /> -->
margaretha2df06602018-11-14 19:10:30 +0100179 <!-- Services -->
margaretha2df06602018-11-14 19:10:30 +0100180 <bean id="scopeService"
181 class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
margaretha2df06602018-11-14 19:10:30 +0100182
183 <!-- DAO -->
margaretha35e1ca22023-11-16 22:00:01 +0100184 <bean id="adminDao"
185 class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
186 <bean id="annotationDao"
187 class="de.ids_mannheim.korap.dao.AnnotationDao" />
margaretha2df06602018-11-14 19:10:30 +0100188
189 <!-- DTO Converter -->
margaretha35e1ca22023-11-16 22:00:01 +0100190 <bean id="annotationConverter"
191 class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
margaretha2df06602018-11-14 19:10:30 +0100192
193 <!-- Rewrite -->
margaretha35e1ca22023-11-16 22:00:01 +0100194 <bean id="layerMapper"
195 class="de.ids_mannheim.korap.rewrite.LayerMapper" />
196 <bean id="foundryInject"
197 class="de.ids_mannheim.korap.rewrite.FoundryInject" />
margaretha4fa4b062019-01-28 19:43:30 +0100198
margaretha35e1ca22023-11-16 22:00:01 +0100199 <util:list id="rewriteTasks"
200 value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
margaretha4fa4b062019-01-28 19:43:30 +0100201 <ref bean="foundryInject" />
202 </util:list>
203
margaretha35e1ca22023-11-16 22:00:01 +0100204 <bean id="rewriteHandler"
205 class="de.ids_mannheim.korap.rewrite.RewriteHandler">
margaretha4fa4b062019-01-28 19:43:30 +0100206 <constructor-arg ref="rewriteTasks" />
margaretha2df06602018-11-14 19:10:30 +0100207 </bean>
margaretha2df06602018-11-14 19:10:30 +0100208</beans>