blob: 5c9b8fff01bda83679ef25220ca9a995c3876989 [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"
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
margaretha3da7cd32018-10-22 17:42:52 +02006 http://www.springframework.org/schema/beans/spring-beans.xsd
margaretha2df06602018-11-14 19:10:30 +01007 http://www.springframework.org/schema/tx
8 http://www.springframework.org/schema/tx/spring-tx.xsd
margarethaf92485a2017-11-14 17:12:36 +01009 http://www.springframework.org/schema/context
margaretha3da7cd32018-10-22 17:42:52 +020010 http://www.springframework.org/schema/context/spring-context.xsd
margarethaf92485a2017-11-14 17:12:36 +010011 http://www.springframework.org/schema/util
margaretha3da7cd32018-10-22 17:42:52 +020012 http://www.springframework.org/schema/util/spring-util.xsd">
margarethaf92485a2017-11-14 17:12:36 +010013
margaretha92ad2ec2023-05-15 14:10:00 +020014 <context:component-scan base-package="
15 de.ids_mannheim.korap.core.service,
16 de.ids_mannheim.korap.core.web,
17 de.ids_mannheim.korap.web.filter,
margaretha4fa4b062019-01-28 19:43:30 +010018 de.ids_mannheim.korap.web.utils,
margaretha2df06602018-11-14 19:10:30 +010019 de.ids_mannheim.korap.authentication.http" />
margarethaf92485a2017-11-14 17:12:36 +010020 <context:annotation-config />
21
margaretha2df06602018-11-14 19:10:30 +010022 <bean id="placeholders"
23 class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
24 <property name="ignoreResourceNotFound" value="true" />
25 <property name="locations">
26 <array>
margaretha92ad2ec2023-05-15 14:10:00 +020027 <value>classpath:properties/lite-jdbc.properties</value>
margaretha2df06602018-11-14 19:10:30 +010028 <value>file:./lite-jdbc.properties</value>
margaretha92ad2ec2023-05-15 14:10:00 +020029 <value>classpath:properties/hibernate.properties</value>
margaretha2df06602018-11-14 19:10:30 +010030 <value>classpath:kustvakt-lite.conf</value>
31 <value>file:./kustvakt-lite.conf</value>
32 </array>
margarethaf92485a2017-11-14 17:12:36 +010033 </property>
34 </bean>
35
margaretha2df06602018-11-14 19:10:30 +010036 <bean id="properties"
37 class="org.springframework.beans.factory.config.PropertiesFactoryBean">
38 <property name="ignoreResourceNotFound" value="true" />
39 <property name="locations">
40 <array>
41 <value>classpath:kustvakt-lite.conf</value>
42 <value>file:./kustvakt-lite.conf</value>
43 </array>
44 </property>
margaretha56e8e552017-12-05 16:31:21 +010045 </bean>
margaretha2df06602018-11-14 19:10:30 +010046
47 <bean id="config" class="de.ids_mannheim.korap.config.KustvaktConfiguration">
48 <constructor-arg index="0" name="properties" ref="properties" />
49 </bean>
50
51 <!-- Database -->
52
53 <bean id="sqliteDataSource"
54 class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
55 lazy-init="true">
56 <property name="driverClassName" value="${jdbc.driverClassName}" />
57 <property name="url" value="${jdbc.url}" />
58 <property name="username" value="${jdbc.username}" />
59 <property name="password" value="${jdbc.password}" />
60 <property name="connectionProperties">
61 <props>
62 <prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop>
63 </props>
64 </property>
65
66 <!-- relevant for single connection datasource and sqlite -->
67 <property name="suppressClose">
68 <value>true</value>
69 </property>
70 <!--<property name="initialSize" value="2"/> -->
71 <!--<property name="poolPreparedStatements" value="true"/> -->
72 </bean>
margarethafcf8bd92021-01-14 10:55:53 +010073 <bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
margaretha2df06602018-11-14 19:10:30 +010074 <property name="baselineOnMigrate" value="true" />
75 <!-- <property name="validateOnMigrate" value="false" /> -->
76 <!-- <property name="cleanOnValidationError" value="true" /> -->
margarethafcf8bd92021-01-14 10:55:53 +010077 <property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
margaretha2df06602018-11-14 19:10:30 +010078 <property name="dataSource" ref="sqliteDataSource" />
margarethad66a6832022-03-03 08:47:13 +010079 <property name="outOfOrder" value="true" />
margaretha2df06602018-11-14 19:10:30 +010080 </bean>
margarethafcf8bd92021-01-14 10:55:53 +010081
82 <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
83 <constructor-arg ref="flywayConfig"/>
84 </bean>
85
margaretha2df06602018-11-14 19:10:30 +010086
87 <bean id="entityManagerFactory"
88 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
89 <property name="dataSource" ref="sqliteDataSource" />
90
91 <property name="packagesToScan">
92 <array>
margaretha5b708792023-05-12 16:55:29 +020093 <value>de.ids_mannheim.korap.core.entity</value>
margaretha2df06602018-11-14 19:10:30 +010094 </array>
95 </property>
96 <property name="jpaVendorAdapter">
97 <bean id="jpaVendorAdapter"
98 class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
99 <property name="databasePlatform" value="${hibernate.dialect}" />
100 </bean>
101 </property>
102 <property name="jpaProperties">
103 <props>
104 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
105 <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
106 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
107 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
108 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
109 </prop>
110 <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
111 <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
112 <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
113 </props>
114 </property>
115 </bean>
116 <tx:annotation-driven proxy-target-class="true"
117 transaction-manager="transactionManager" />
118
119 <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
120 <property name="entityManagerFactory" ref="entityManagerFactory" />
121 </bean>
122
123 <bean id="transactionTemplate"
124 class="org.springframework.transaction.support.TransactionTemplate">
125 <constructor-arg ref="transactionManager" />
126 </bean>
127 <bean id="txManager"
128 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
129 <property name="dataSource" ref="sqliteDataSource" />
130 </bean>
131
132 <!-- Initialization -->
margarethaf795a042021-08-12 09:57:22 +0200133 <!-- <bean id="initializator" class="de.ids_mannheim.de.init.LiteInitializatorImpl"
margaretha2df06602018-11-14 19:10:30 +0100134 init-method="init">
margaretha6a925fe2023-05-15 16:50:32 +0200135 </bean>
margaretha2df06602018-11-14 19:10:30 +0100136 <bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser"
137 scope="singleton" />
margaretha6a925fe2023-05-15 16:50:32 +0200138 -->
margaretha4dee07a2022-05-27 11:45:28 +0200139 <!-- Search Engine -->
margaretha2df06602018-11-14 19:10:30 +0100140 <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
141 <constructor-arg value="${krill.indexDir}" />
142 </bean>
margaretha92ad2ec2023-05-15 14:10:00 +0200143
margaretha2df06602018-11-14 19:10:30 +0100144
145 <!-- Filters -->
margaretha398f4722019-01-09 19:07:20 +0100146 <!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter"
147 scope="singleton" /> -->
margaretha2df06602018-11-14 19:10:30 +0100148
149 <!-- Authentication -->
150 <bean id="authenticationManager"
151 class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" />
152
153 <!-- Response handler -->
154 <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
155 <constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
156 </bean>
157
158 <!-- Controllers -->
margarethaac92c822023-05-15 11:43:22 +0200159 <!-- added via component-scan
margaretha2df06602018-11-14 19:10:30 +0100160 <bean id="annotationController"
161 class="de.ids_mannheim.korap.web.controller.AnnotationController" />
162 <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" />
163 <bean id="statisticController"
164 class="de.ids_mannheim.korap.web.controller.StatisticController" />
margaretha92ad2ec2023-05-15 14:10:00 +0200165 -->
margaretha2df06602018-11-14 19:10:30 +0100166 <!-- Services -->
margaretha2df06602018-11-14 19:10:30 +0100167 <bean id="scopeService"
168 class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
margaretha2df06602018-11-14 19:10:30 +0100169
170 <!-- DAO -->
171 <bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
172 <bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" />
173
174 <!-- DTO Converter -->
175 <bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
176
177 <!-- Rewrite -->
margaretha92ad2ec2023-05-15 14:10:00 +0200178 <bean id="layerMapper" class="de.ids_mannheim.korap.rewrite.LayerMapper" />
margaretha4fa4b062019-01-28 19:43:30 +0100179 <bean id="foundryInject" class="de.ids_mannheim.korap.rewrite.FoundryInject" />
margaretha92ad2ec2023-05-15 14:10:00 +0200180
margaretha4fa4b062019-01-28 19:43:30 +0100181 <util:list id="rewriteTasks" value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
margaretha92ad2ec2023-05-15 14:10:00 +0200182 <ref bean="foundryInject" />
margaretha4fa4b062019-01-28 19:43:30 +0100183 </util:list>
184
margaretha398f4722019-01-09 19:07:20 +0100185 <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
margaretha4fa4b062019-01-28 19:43:30 +0100186 <constructor-arg ref="rewriteTasks" />
margaretha2df06602018-11-14 19:10:30 +0100187 </bean>
188
189
190
191 <bean id="kustvakt_auditing"
192 class="de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing">
193 </bean>
194
margarethaf92485a2017-11-14 17:12:36 +0100195</beans>