blob: da27995ca701468601120094aa8d2ed0e7c65fa5 [file] [log] [blame]
margarethaf92485a2017-11-14 17:12:36 +01001<?xml version="1.0" encoding="UTF-8"?>
margaretha2df06602018-11-14 19:10:30 +01002<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
margaretha3da7cd32018-10-22 17:42:52 +02008 http://www.springframework.org/schema/beans/spring-beans.xsd
margaretha2df06602018-11-14 19:10:30 +01009 http://www.springframework.org/schema/tx
10 http://www.springframework.org/schema/tx/spring-tx.xsd
margarethaf92485a2017-11-14 17:12:36 +010011 http://www.springframework.org/schema/context
margaretha3da7cd32018-10-22 17:42:52 +020012 http://www.springframework.org/schema/context/spring-context.xsd
margarethaf92485a2017-11-14 17:12:36 +010013 http://www.springframework.org/schema/util
margaretha3da7cd32018-10-22 17:42:52 +020014 http://www.springframework.org/schema/util/spring-util.xsd">
margarethaf92485a2017-11-14 17:12:36 +010015
margaretha35e1ca22023-11-16 22:00:01 +010016 <context:component-scan
17 base-package="
margaretha92ad2ec2023-05-15 14:10:00 +020018 de.ids_mannheim.korap.core.service,
19 de.ids_mannheim.korap.core.web,
20 de.ids_mannheim.korap.web.filter,
margaretha4fa4b062019-01-28 19:43:30 +010021 de.ids_mannheim.korap.web.utils,
margaretha2df06602018-11-14 19:10:30 +010022 de.ids_mannheim.korap.authentication.http" />
margarethaf92485a2017-11-14 17:12:36 +010023 <context:annotation-config />
24
margaretha2df06602018-11-14 19:10:30 +010025 <bean id="placeholders"
26 class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
27 <property name="ignoreResourceNotFound" value="true" />
28 <property name="locations">
29 <array>
margaretha92ad2ec2023-05-15 14:10:00 +020030 <value>classpath:properties/lite-jdbc.properties</value>
margaretha2df06602018-11-14 19:10:30 +010031 <value>file:./lite-jdbc.properties</value>
margaretha92ad2ec2023-05-15 14:10:00 +020032 <value>classpath:properties/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>
margarethaf92485a2017-11-14 17:12:36 +010036 </property>
37 </bean>
38
margaretha2df06602018-11-14 19:10:30 +010039 <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>
margaretha56e8e552017-12-05 16:31:21 +010048 </bean>
margaretha2df06602018-11-14 19:10:30 +010049
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
58 <bean id="sqliteDataSource"
59 class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
60 lazy-init="true">
margaretha35e1ca22023-11-16 22:00:01 +010061 <property name="driverClassName"
62 value="${jdbc.driverClassName}" />
margaretha2df06602018-11-14 19:10:30 +010063 <property name="url" value="${jdbc.url}" />
64 <property name="username" value="${jdbc.username}" />
65 <property name="password" value="${jdbc.password}" />
66 <property name="connectionProperties">
67 <props>
68 <prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop>
69 </props>
70 </property>
71
72 <!-- relevant for single connection datasource and sqlite -->
73 <property name="suppressClose">
74 <value>true</value>
75 </property>
76 <!--<property name="initialSize" value="2"/> -->
77 <!--<property name="poolPreparedStatements" value="true"/> -->
78 </bean>
margaretha35e1ca22023-11-16 22:00:01 +010079 <bean id="flywayConfig"
80 class="org.flywaydb.core.api.configuration.ClassicConfiguration">
margaretha2df06602018-11-14 19:10:30 +010081 <property name="baselineOnMigrate" value="true" />
82 <!-- <property name="validateOnMigrate" value="false" /> -->
83 <!-- <property name="cleanOnValidationError" value="true" /> -->
margaretha35e1ca22023-11-16 22:00:01 +010084 <property name="locations"
85 value="#{'${jdbc.schemaPath}'.split(',')}" />
margaretha2df06602018-11-14 19:10:30 +010086 <property name="dataSource" ref="sqliteDataSource" />
margarethad66a6832022-03-03 08:47:13 +010087 <property name="outOfOrder" value="true" />
margaretha2df06602018-11-14 19:10:30 +010088 </bean>
margaretha35e1ca22023-11-16 22:00:01 +010089
90 <bean id="flyway" class="org.flywaydb.core.Flyway"
91 init-method="migrate">
92 <constructor-arg ref="flywayConfig" />
margarethafcf8bd92021-01-14 10:55:53 +010093 </bean>
margaretha35e1ca22023-11-16 22:00:01 +010094
margaretha2df06602018-11-14 19:10:30 +010095
96 <bean id="entityManagerFactory"
97 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
98 <property name="dataSource" ref="sqliteDataSource" />
99
100 <property name="packagesToScan">
101 <array>
margaretha5b708792023-05-12 16:55:29 +0200102 <value>de.ids_mannheim.korap.core.entity</value>
margaretha2df06602018-11-14 19:10:30 +0100103 </array>
104 </property>
105 <property name="jpaVendorAdapter">
106 <bean id="jpaVendorAdapter"
107 class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
margaretha35e1ca22023-11-16 22:00:01 +0100108 <property name="databasePlatform"
109 value="${hibernate.dialect}" />
margaretha2df06602018-11-14 19:10:30 +0100110 </bean>
111 </property>
112 <property name="jpaProperties">
113 <props>
114 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
115 <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
116 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
117 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
118 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
119 </prop>
120 <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
121 <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
122 <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
123 </props>
124 </property>
125 </bean>
126 <tx:annotation-driven proxy-target-class="true"
127 transaction-manager="transactionManager" />
128
margaretha35e1ca22023-11-16 22:00:01 +0100129 <bean id="transactionManager"
130 class="org.springframework.orm.jpa.JpaTransactionManager">
131 <property name="entityManagerFactory"
132 ref="entityManagerFactory" />
margaretha2df06602018-11-14 19:10:30 +0100133 </bean>
134
135 <bean id="transactionTemplate"
136 class="org.springframework.transaction.support.TransactionTemplate">
137 <constructor-arg ref="transactionManager" />
138 </bean>
139 <bean id="txManager"
140 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
141 <property name="dataSource" ref="sqliteDataSource" />
142 </bean>
143
144 <!-- Initialization -->
margaretha35e1ca22023-11-16 22:00:01 +0100145 <!-- <bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser"
146 scope="singleton" /> -->
margaretha4dee07a2022-05-27 11:45:28 +0200147 <!-- Search Engine -->
margaretha35e1ca22023-11-16 22:00:01 +0100148 <bean id="search_krill"
149 class="de.ids_mannheim.korap.web.SearchKrill">
margaretha2df06602018-11-14 19:10:30 +0100150 <constructor-arg value="${krill.indexDir}" />
151 </bean>
margaretha35e1ca22023-11-16 22:00:01 +0100152
margaretha2df06602018-11-14 19:10:30 +0100153
154 <!-- Filters -->
margaretha35e1ca22023-11-16 22:00:01 +0100155 <!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter"
margaretha398f4722019-01-09 19:07:20 +0100156 scope="singleton" /> -->
margaretha2df06602018-11-14 19:10:30 +0100157
158 <!-- Authentication -->
159 <bean id="authenticationManager"
160 class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" />
161
162 <!-- Response handler -->
margaretha35e1ca22023-11-16 22:00:01 +0100163 <bean id="kustvaktResponseHandler"
164 class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
margaretha2df06602018-11-14 19:10:30 +0100165 </bean>
166
167 <!-- Controllers -->
margaretha35e1ca22023-11-16 22:00:01 +0100168 <!-- added via component-scan <bean id="annotationController" class="de.ids_mannheim.korap.web.controller.AnnotationController"
169 /> <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController"
170 /> <bean id="statisticController" class="de.ids_mannheim.korap.web.controller.StatisticController"
171 /> -->
margaretha2df06602018-11-14 19:10:30 +0100172 <!-- Services -->
margaretha2df06602018-11-14 19:10:30 +0100173 <bean id="scopeService"
174 class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
margaretha2df06602018-11-14 19:10:30 +0100175
176 <!-- DAO -->
margaretha35e1ca22023-11-16 22:00:01 +0100177 <bean id="adminDao"
178 class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
179 <bean id="annotationDao"
180 class="de.ids_mannheim.korap.dao.AnnotationDao" />
margaretha2df06602018-11-14 19:10:30 +0100181
182 <!-- DTO Converter -->
margaretha35e1ca22023-11-16 22:00:01 +0100183 <bean id="annotationConverter"
184 class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
margaretha2df06602018-11-14 19:10:30 +0100185
186 <!-- Rewrite -->
margaretha35e1ca22023-11-16 22:00:01 +0100187 <bean id="layerMapper"
188 class="de.ids_mannheim.korap.rewrite.LayerMapper" />
189 <bean id="foundryInject"
190 class="de.ids_mannheim.korap.rewrite.FoundryInject" />
margaretha92ad2ec2023-05-15 14:10:00 +0200191
margaretha35e1ca22023-11-16 22:00:01 +0100192 <util:list id="rewriteTasks"
193 value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
margaretha92ad2ec2023-05-15 14:10:00 +0200194 <ref bean="foundryInject" />
margaretha4fa4b062019-01-28 19:43:30 +0100195 </util:list>
margaretha35e1ca22023-11-16 22:00:01 +0100196
197 <bean id="rewriteHandler"
198 class="de.ids_mannheim.korap.rewrite.RewriteHandler">
margaretha4fa4b062019-01-28 19:43:30 +0100199 <constructor-arg ref="rewriteTasks" />
margaretha2df06602018-11-14 19:10:30 +0100200 </bean>
margarethaf92485a2017-11-14 17:12:36 +0100201</beans>