blob: 3e7aacde47f319cb9f5dfe182dee63bf9ad74720 [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,
17 de.ids_mannheim.korap.service,
margaretha4fa4b062019-01-28 19:43:30 +010018 de.ids_mannheim.korap.web.filter,
19 de.ids_mannheim.korap.web.utils,
margaretha2df06602018-11-14 19:10:30 +010020 de.ids_mannheim.korap.authentication.http" />
margarethaf92485a2017-11-14 17:12:36 +010021 <context:annotation-config />
22
margaretha2df06602018-11-14 19:10:30 +010023 <bean id="placeholders"
24 class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
25 <property name="ignoreResourceNotFound" value="true" />
26 <property name="locations">
27 <array>
28 <value>classpath:lite-jdbc.properties</value>
29 <value>file:./lite-jdbc.properties</value>
30 <value>classpath:hibernate.properties</value>
31 <value>classpath:kustvakt-lite.conf</value>
32 <value>file:./kustvakt-lite.conf</value>
33 </array>
margarethaf92485a2017-11-14 17:12:36 +010034 </property>
35 </bean>
36
margaretha2df06602018-11-14 19:10:30 +010037 <bean id="properties"
38 class="org.springframework.beans.factory.config.PropertiesFactoryBean">
39 <property name="ignoreResourceNotFound" value="true" />
40 <property name="locations">
41 <array>
42 <value>classpath:kustvakt-lite.conf</value>
43 <value>file:./kustvakt-lite.conf</value>
44 </array>
45 </property>
margaretha56e8e552017-12-05 16:31:21 +010046 </bean>
margaretha2df06602018-11-14 19:10:30 +010047
48 <bean id="config" class="de.ids_mannheim.korap.config.KustvaktConfiguration">
49 <constructor-arg index="0" name="properties" ref="properties" />
50 </bean>
51
52 <!-- Database -->
53
54 <bean id="sqliteDataSource"
55 class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
56 lazy-init="true">
57 <property name="driverClassName" value="${jdbc.driverClassName}" />
58 <property name="url" value="${jdbc.url}" />
59 <property name="username" value="${jdbc.username}" />
60 <property name="password" value="${jdbc.password}" />
61 <property name="connectionProperties">
62 <props>
63 <prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop>
64 </props>
65 </property>
66
67 <!-- relevant for single connection datasource and sqlite -->
68 <property name="suppressClose">
69 <value>true</value>
70 </property>
71 <!--<property name="initialSize" value="2"/> -->
72 <!--<property name="poolPreparedStatements" value="true"/> -->
73 </bean>
margarethafcf8bd92021-01-14 10:55:53 +010074 <bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
margaretha2df06602018-11-14 19:10:30 +010075 <property name="baselineOnMigrate" value="true" />
76 <!-- <property name="validateOnMigrate" value="false" /> -->
77 <!-- <property name="cleanOnValidationError" value="true" /> -->
margarethafcf8bd92021-01-14 10:55:53 +010078 <property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
margaretha2df06602018-11-14 19:10:30 +010079 <property name="dataSource" ref="sqliteDataSource" />
margarethad66a6832022-03-03 08:47:13 +010080 <property name="outOfOrder" value="true" />
margaretha2df06602018-11-14 19:10:30 +010081 </bean>
margarethafcf8bd92021-01-14 10:55:53 +010082
83 <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
84 <constructor-arg ref="flywayConfig"/>
85 </bean>
86
margaretha2df06602018-11-14 19:10:30 +010087
88 <bean id="entityManagerFactory"
89 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
90 <property name="dataSource" ref="sqliteDataSource" />
91
92 <property name="packagesToScan">
93 <array>
94 <value>de.ids_mannheim.korap.entity</value>
95 </array>
96 </property>
97 <property name="jpaVendorAdapter">
98 <bean id="jpaVendorAdapter"
99 class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
100 <property name="databasePlatform" value="${hibernate.dialect}" />
101 </bean>
102 </property>
103 <property name="jpaProperties">
104 <props>
105 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
106 <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
107 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
108 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
109 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
110 </prop>
111 <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
112 <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
113 <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
114 </props>
115 </property>
116 </bean>
117 <tx:annotation-driven proxy-target-class="true"
118 transaction-manager="transactionManager" />
119
120 <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
121 <property name="entityManagerFactory" ref="entityManagerFactory" />
122 </bean>
123
124 <bean id="transactionTemplate"
125 class="org.springframework.transaction.support.TransactionTemplate">
126 <constructor-arg ref="transactionManager" />
127 </bean>
128 <bean id="txManager"
129 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
130 <property name="dataSource" ref="sqliteDataSource" />
131 </bean>
132
133 <!-- Initialization -->
margarethaf795a042021-08-12 09:57:22 +0200134 <!-- <bean id="initializator" class="de.ids_mannheim.de.init.LiteInitializatorImpl"
margaretha2df06602018-11-14 19:10:30 +0100135 init-method="init">
margarethaf795a042021-08-12 09:57:22 +0200136 </bean> -->
margaretha2df06602018-11-14 19:10:30 +0100137 <bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser"
138 scope="singleton" />
139
140 <!-- Krill -->
141 <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
142 <constructor-arg value="${krill.indexDir}" />
143 </bean>
144
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 -->
159 <bean id="annotationController"
160 class="de.ids_mannheim.korap.web.controller.AnnotationController" />
161 <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" />
162 <bean id="statisticController"
163 class="de.ids_mannheim.korap.web.controller.StatisticController" />
164
165 <!-- Services -->
margaretha2df06602018-11-14 19:10:30 +0100166 <bean id="scopeService"
167 class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
margaretha2df06602018-11-14 19:10:30 +0100168
169 <!-- DAO -->
170 <bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
171 <bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" />
172
173 <!-- DTO Converter -->
174 <bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
175
176 <!-- Rewrite -->
margaretha4fa4b062019-01-28 19:43:30 +0100177 <bean id="foundryInject" class="de.ids_mannheim.korap.rewrite.FoundryInject" />
178
179 <util:list id="rewriteTasks" value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
180 <ref bean="foundryInject"/>
181 </util:list>
182
margaretha398f4722019-01-09 19:07:20 +0100183 <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
margaretha4fa4b062019-01-28 19:43:30 +0100184 <constructor-arg ref="rewriteTasks" />
margaretha2df06602018-11-14 19:10:30 +0100185 </bean>
186
187
188
189 <bean id="kustvakt_auditing"
190 class="de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing">
191 </bean>
192
margarethaf92485a2017-11-14 17:12:36 +0100193</beans>