blob: b26c65de998dc585aec0fc236760b50115d5ba49 [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
14
margaretha2df06602018-11-14 19:10:30 +010015 <context:component-scan
margarethaed2ee242019-12-12 17:34:18 +010016 base-package="de.ids_mannheim.korap.rewrite,
margaretha5b708792023-05-12 16:55:29 +020017 de.ids_mannheim.korap.core.service,
margarethaac92c822023-05-15 11:43:22 +020018 de.ids_mannheim.korap.core.web,
margaretha4fa4b062019-01-28 19:43:30 +010019 de.ids_mannheim.korap.web.filter,
20 de.ids_mannheim.korap.web.utils,
margaretha2df06602018-11-14 19:10:30 +010021 de.ids_mannheim.korap.authentication.http" />
margarethaf92485a2017-11-14 17:12:36 +010022 <context:annotation-config />
23
margaretha2df06602018-11-14 19:10:30 +010024 <bean id="placeholders"
25 class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
26 <property name="ignoreResourceNotFound" value="true" />
27 <property name="locations">
28 <array>
29 <value>classpath:lite-jdbc.properties</value>
30 <value>file:./lite-jdbc.properties</value>
31 <value>classpath:hibernate.properties</value>
32 <value>classpath:kustvakt-lite.conf</value>
33 <value>file:./kustvakt-lite.conf</value>
34 </array>
margarethaf92485a2017-11-14 17:12:36 +010035 </property>
36 </bean>
37
margaretha2df06602018-11-14 19:10:30 +010038 <bean id="properties"
39 class="org.springframework.beans.factory.config.PropertiesFactoryBean">
40 <property name="ignoreResourceNotFound" value="true" />
41 <property name="locations">
42 <array>
43 <value>classpath:kustvakt-lite.conf</value>
44 <value>file:./kustvakt-lite.conf</value>
45 </array>
46 </property>
margaretha56e8e552017-12-05 16:31:21 +010047 </bean>
margaretha2df06602018-11-14 19:10:30 +010048
49 <bean id="config" class="de.ids_mannheim.korap.config.KustvaktConfiguration">
50 <constructor-arg index="0" name="properties" ref="properties" />
51 </bean>
52
53 <!-- Database -->
54
55 <bean id="sqliteDataSource"
56 class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
57 lazy-init="true">
58 <property name="driverClassName" value="${jdbc.driverClassName}" />
59 <property name="url" value="${jdbc.url}" />
60 <property name="username" value="${jdbc.username}" />
61 <property name="password" value="${jdbc.password}" />
62 <property name="connectionProperties">
63 <props>
64 <prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop>
65 </props>
66 </property>
67
68 <!-- relevant for single connection datasource and sqlite -->
69 <property name="suppressClose">
70 <value>true</value>
71 </property>
72 <!--<property name="initialSize" value="2"/> -->
73 <!--<property name="poolPreparedStatements" value="true"/> -->
74 </bean>
margarethafcf8bd92021-01-14 10:55:53 +010075 <bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
margaretha2df06602018-11-14 19:10:30 +010076 <property name="baselineOnMigrate" value="true" />
77 <!-- <property name="validateOnMigrate" value="false" /> -->
78 <!-- <property name="cleanOnValidationError" value="true" /> -->
margarethafcf8bd92021-01-14 10:55:53 +010079 <property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
margaretha2df06602018-11-14 19:10:30 +010080 <property name="dataSource" ref="sqliteDataSource" />
margarethad66a6832022-03-03 08:47:13 +010081 <property name="outOfOrder" value="true" />
margaretha2df06602018-11-14 19:10:30 +010082 </bean>
margarethafcf8bd92021-01-14 10:55:53 +010083
84 <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
85 <constructor-arg ref="flywayConfig"/>
86 </bean>
87
margaretha2df06602018-11-14 19:10:30 +010088
89 <bean id="entityManagerFactory"
90 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
91 <property name="dataSource" ref="sqliteDataSource" />
92
93 <property name="packagesToScan">
94 <array>
margaretha5b708792023-05-12 16:55:29 +020095 <value>de.ids_mannheim.korap.core.entity</value>
margaretha2df06602018-11-14 19:10:30 +010096 </array>
97 </property>
98 <property name="jpaVendorAdapter">
99 <bean id="jpaVendorAdapter"
100 class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
101 <property name="databasePlatform" value="${hibernate.dialect}" />
102 </bean>
103 </property>
104 <property name="jpaProperties">
105 <props>
106 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
107 <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
108 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
109 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
110 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
111 </prop>
112 <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
113 <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
114 <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
115 </props>
116 </property>
117 </bean>
118 <tx:annotation-driven proxy-target-class="true"
119 transaction-manager="transactionManager" />
120
121 <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
122 <property name="entityManagerFactory" ref="entityManagerFactory" />
123 </bean>
124
125 <bean id="transactionTemplate"
126 class="org.springframework.transaction.support.TransactionTemplate">
127 <constructor-arg ref="transactionManager" />
128 </bean>
129 <bean id="txManager"
130 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
131 <property name="dataSource" ref="sqliteDataSource" />
132 </bean>
133
134 <!-- Initialization -->
margarethaf795a042021-08-12 09:57:22 +0200135 <!-- <bean id="initializator" class="de.ids_mannheim.de.init.LiteInitializatorImpl"
margaretha2df06602018-11-14 19:10:30 +0100136 init-method="init">
margarethaf795a042021-08-12 09:57:22 +0200137 </bean> -->
margaretha2df06602018-11-14 19:10:30 +0100138 <bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser"
139 scope="singleton" />
140
margaretha4dee07a2022-05-27 11:45:28 +0200141 <!-- Search Engine -->
margaretha2df06602018-11-14 19:10:30 +0100142 <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
143 <constructor-arg value="${krill.indexDir}" />
144 </bean>
145
146 <!-- Filters -->
margaretha398f4722019-01-09 19:07:20 +0100147 <!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter"
148 scope="singleton" /> -->
margaretha2df06602018-11-14 19:10:30 +0100149
150 <!-- Authentication -->
151 <bean id="authenticationManager"
152 class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" />
153
154 <!-- Response handler -->
155 <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
156 <constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
157 </bean>
158
159 <!-- Controllers -->
margarethaac92c822023-05-15 11:43:22 +0200160 <!-- added via component-scan
margaretha2df06602018-11-14 19:10:30 +0100161 <bean id="annotationController"
162 class="de.ids_mannheim.korap.web.controller.AnnotationController" />
163 <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" />
164 <bean id="statisticController"
165 class="de.ids_mannheim.korap.web.controller.StatisticController" />
margarethaac92c822023-05-15 11:43:22 +0200166 -->
margaretha2df06602018-11-14 19:10:30 +0100167 <!-- Services -->
margaretha2df06602018-11-14 19:10:30 +0100168 <bean id="scopeService"
169 class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
margaretha2df06602018-11-14 19:10:30 +0100170
171 <!-- DAO -->
172 <bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
173 <bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" />
174
175 <!-- DTO Converter -->
176 <bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
177
178 <!-- Rewrite -->
margaretha4fa4b062019-01-28 19:43:30 +0100179 <bean id="foundryInject" class="de.ids_mannheim.korap.rewrite.FoundryInject" />
180
181 <util:list id="rewriteTasks" value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
182 <ref bean="foundryInject"/>
183 </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>