blob: 56f1201dc06a87ca8a7645c9b549324fc78c9487 [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>
margaretha390f37d2024-04-22 12:07:34 +020032 <value>file:./data/lite-jdbc.properties</value>
margaretha92ad2ec2023-05-15 14:10:00 +020033 <value>classpath:properties/hibernate.properties</value>
margaretha2df06602018-11-14 19:10:30 +010034 <value>classpath:kustvakt-lite.conf</value>
35 <value>file:./kustvakt-lite.conf</value>
margaretha390f37d2024-04-22 12:07:34 +020036 <value>file:./data/kustvakt-lite.conf</value>
margaretha2df06602018-11-14 19:10:30 +010037 </array>
margarethaf92485a2017-11-14 17:12:36 +010038 </property>
39 </bean>
40
margaretha2df06602018-11-14 19:10:30 +010041 <bean id="properties"
42 class="org.springframework.beans.factory.config.PropertiesFactoryBean">
43 <property name="ignoreResourceNotFound" value="true" />
44 <property name="locations">
45 <array>
46 <value>classpath:kustvakt-lite.conf</value>
47 <value>file:./kustvakt-lite.conf</value>
margaretha390f37d2024-04-22 12:07:34 +020048 <value>file:./data/kustvakt-lite.conf</value>
margaretha2df06602018-11-14 19:10:30 +010049 </array>
50 </property>
margaretha56e8e552017-12-05 16:31:21 +010051 </bean>
margaretha2df06602018-11-14 19:10:30 +010052
margaretha35e1ca22023-11-16 22:00:01 +010053 <bean id="config"
54 class="de.ids_mannheim.korap.config.KustvaktConfiguration">
55 <constructor-arg index="0" name="properties"
56 ref="properties" />
margaretha2df06602018-11-14 19:10:30 +010057 </bean>
58
59 <!-- Database -->
60
61 <bean id="sqliteDataSource"
62 class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
63 lazy-init="true">
margaretha35e1ca22023-11-16 22:00:01 +010064 <property name="driverClassName"
65 value="${jdbc.driverClassName}" />
margaretha2df06602018-11-14 19:10:30 +010066 <property name="url" value="${jdbc.url}" />
67 <property name="username" value="${jdbc.username}" />
68 <property name="password" value="${jdbc.password}" />
69 <property name="connectionProperties">
70 <props>
71 <prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop>
72 </props>
73 </property>
74
75 <!-- relevant for single connection datasource and sqlite -->
76 <property name="suppressClose">
77 <value>true</value>
78 </property>
79 <!--<property name="initialSize" value="2"/> -->
80 <!--<property name="poolPreparedStatements" value="true"/> -->
81 </bean>
margaretha35e1ca22023-11-16 22:00:01 +010082 <bean id="flywayConfig"
83 class="org.flywaydb.core.api.configuration.ClassicConfiguration">
margaretha2df06602018-11-14 19:10:30 +010084 <property name="baselineOnMigrate" value="true" />
85 <!-- <property name="validateOnMigrate" value="false" /> -->
86 <!-- <property name="cleanOnValidationError" value="true" /> -->
margaretha35e1ca22023-11-16 22:00:01 +010087 <property name="locations"
88 value="#{'${jdbc.schemaPath}'.split(',')}" />
margaretha2df06602018-11-14 19:10:30 +010089 <property name="dataSource" ref="sqliteDataSource" />
margarethad66a6832022-03-03 08:47:13 +010090 <property name="outOfOrder" value="true" />
margaretha2df06602018-11-14 19:10:30 +010091 </bean>
margaretha35e1ca22023-11-16 22:00:01 +010092
93 <bean id="flyway" class="org.flywaydb.core.Flyway"
94 init-method="migrate">
95 <constructor-arg ref="flywayConfig" />
margarethafcf8bd92021-01-14 10:55:53 +010096 </bean>
margaretha35e1ca22023-11-16 22:00:01 +010097
margaretha2df06602018-11-14 19:10:30 +010098
99 <bean id="entityManagerFactory"
100 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
101 <property name="dataSource" ref="sqliteDataSource" />
102
103 <property name="packagesToScan">
104 <array>
margaretha5b708792023-05-12 16:55:29 +0200105 <value>de.ids_mannheim.korap.core.entity</value>
margaretha2df06602018-11-14 19:10:30 +0100106 </array>
107 </property>
108 <property name="jpaVendorAdapter">
109 <bean id="jpaVendorAdapter"
110 class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
margaretha35e1ca22023-11-16 22:00:01 +0100111 <property name="databasePlatform"
112 value="${hibernate.dialect}" />
margaretha2df06602018-11-14 19:10:30 +0100113 </bean>
114 </property>
115 <property name="jpaProperties">
116 <props>
117 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
118 <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
119 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
120 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
121 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
122 </prop>
123 <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
124 <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
125 <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
126 </props>
127 </property>
128 </bean>
129 <tx:annotation-driven proxy-target-class="true"
130 transaction-manager="transactionManager" />
131
margaretha35e1ca22023-11-16 22:00:01 +0100132 <bean id="transactionManager"
133 class="org.springframework.orm.jpa.JpaTransactionManager">
134 <property name="entityManagerFactory"
135 ref="entityManagerFactory" />
margaretha2df06602018-11-14 19:10:30 +0100136 </bean>
137
138 <bean id="transactionTemplate"
139 class="org.springframework.transaction.support.TransactionTemplate">
140 <constructor-arg ref="transactionManager" />
141 </bean>
142 <bean id="txManager"
143 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
144 <property name="dataSource" ref="sqliteDataSource" />
145 </bean>
146
147 <!-- Initialization -->
margaretha35e1ca22023-11-16 22:00:01 +0100148 <!-- <bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser"
149 scope="singleton" /> -->
margaretha4dee07a2022-05-27 11:45:28 +0200150 <!-- Search Engine -->
margaretha35e1ca22023-11-16 22:00:01 +0100151 <bean id="search_krill"
152 class="de.ids_mannheim.korap.web.SearchKrill">
margaretha2df06602018-11-14 19:10:30 +0100153 <constructor-arg value="${krill.indexDir}" />
154 </bean>
margaretha35e1ca22023-11-16 22:00:01 +0100155
margaretha2df06602018-11-14 19:10:30 +0100156
157 <!-- Filters -->
margaretha35e1ca22023-11-16 22:00:01 +0100158 <!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter"
margaretha398f4722019-01-09 19:07:20 +0100159 scope="singleton" /> -->
margaretha2df06602018-11-14 19:10:30 +0100160
161 <!-- Authentication -->
162 <bean id="authenticationManager"
163 class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" />
164
165 <!-- Response handler -->
margaretha35e1ca22023-11-16 22:00:01 +0100166 <bean id="kustvaktResponseHandler"
167 class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
margaretha2df06602018-11-14 19:10:30 +0100168 </bean>
169
170 <!-- Controllers -->
margaretha35e1ca22023-11-16 22:00:01 +0100171 <!-- added via component-scan <bean id="annotationController" class="de.ids_mannheim.korap.web.controller.AnnotationController"
172 /> <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController"
173 /> <bean id="statisticController" class="de.ids_mannheim.korap.web.controller.StatisticController"
174 /> -->
margaretha2df06602018-11-14 19:10:30 +0100175 <!-- Services -->
margaretha2df06602018-11-14 19:10:30 +0100176 <bean id="scopeService"
177 class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
margaretha2df06602018-11-14 19:10:30 +0100178
179 <!-- DAO -->
margaretha35e1ca22023-11-16 22:00:01 +0100180 <bean id="adminDao"
181 class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
182 <bean id="annotationDao"
183 class="de.ids_mannheim.korap.dao.AnnotationDao" />
margaretha2df06602018-11-14 19:10:30 +0100184
185 <!-- DTO Converter -->
margaretha35e1ca22023-11-16 22:00:01 +0100186 <bean id="annotationConverter"
187 class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
margaretha2df06602018-11-14 19:10:30 +0100188
189 <!-- Rewrite -->
margaretha35e1ca22023-11-16 22:00:01 +0100190 <bean id="layerMapper"
191 class="de.ids_mannheim.korap.rewrite.LayerMapper" />
192 <bean id="foundryInject"
193 class="de.ids_mannheim.korap.rewrite.FoundryInject" />
margaretha92ad2ec2023-05-15 14:10:00 +0200194
margaretha35e1ca22023-11-16 22:00:01 +0100195 <util:list id="rewriteTasks"
196 value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
margaretha92ad2ec2023-05-15 14:10:00 +0200197 <ref bean="foundryInject" />
margaretha4fa4b062019-01-28 19:43:30 +0100198 </util:list>
margaretha35e1ca22023-11-16 22:00:01 +0100199
200 <bean id="rewriteHandler"
201 class="de.ids_mannheim.korap.rewrite.RewriteHandler">
margaretha4fa4b062019-01-28 19:43:30 +0100202 <constructor-arg ref="rewriteTasks" />
margaretha2df06602018-11-14 19:10:30 +0100203 </bean>
margarethaf92485a2017-11-14 17:12:36 +0100204</beans>