blob: ba6713be3ecad4e7f03127db6436f54af471400f [file] [log] [blame]
margaretha2df06602018-11-14 19:10:30 +01001<?xml version="1.0" encoding="UTF-8"?>
2<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
6 http://www.springframework.org/schema/beans/spring-beans.xsd
7 http://www.springframework.org/schema/tx
8 http://www.springframework.org/schema/tx/spring-tx.xsd
9 http://www.springframework.org/schema/context
10 http://www.springframework.org/schema/context/spring-context.xsd
11 http://www.springframework.org/schema/util
12 http://www.springframework.org/schema/util/spring-util.xsd">
13
14
15 <context:component-scan
margaretha4fa4b062019-01-28 19:43:30 +010016 base-package="de.ids_mannheim.korap.rewrite,
17 de.ids_mannheim.korap.web.filter,
18 de.ids_mannheim.korap.web.utils,
margaretha2df06602018-11-14 19:10:30 +010019 de.ids_mannheim.korap.authentication.http" />
20 <context:annotation-config />
21
22 <bean id="placeholders"
23 class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
24 <property name="ignoreResourceNotFound" value="true" />
25 <property name="locations">
26 <array>
27 <value>classpath:test-jdbc.properties</value>
28 <value>file:./test-jdbc.properties</value>
29 <value>classpath:hibernate.properties</value>
30 <value>classpath:kustvakt-lite.conf</value>
31 <value>file:./kustvakt-lite.conf</value>
32 </array>
33 </property>
34 </bean>
35
36 <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>
45 </bean>
46
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>
margaretha2df06602018-11-14 19:10:30 +010070 </bean>
71
72 <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
73 <property name="baselineOnMigrate" value="true" />
74 <!-- <property name="validateOnMigrate" value="false" /> -->
75 <!-- <property name="cleanOnValidationError" value="true" /> -->
76 <property name="locations" value="${jdbc.schemaPath}" />
77 <property name="dataSource" ref="sqliteDataSource" />
78 </bean>
79
80 <bean id="entityManagerFactory"
81 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
82 <property name="dataSource" ref="sqliteDataSource" />
83
84 <property name="packagesToScan">
85 <array>
86 <value>de.ids_mannheim.korap.entity</value>
87 </array>
88 </property>
89 <property name="jpaVendorAdapter">
90 <bean id="jpaVendorAdapter"
91 class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
92 <property name="databasePlatform" value="${hibernate.dialect}" />
93 </bean>
94 </property>
95 <property name="jpaProperties">
96 <props>
97 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
98 <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
99 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
100 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
101 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
102 </prop>
103 <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
104 <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
105 <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
106 </props>
107 </property>
108 </bean>
109 <tx:annotation-driven proxy-target-class="true"
110 transaction-manager="transactionManager" />
111
112 <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
113 <property name="entityManagerFactory" ref="entityManagerFactory" />
114 </bean>
115
116 <bean id="transactionTemplate"
117 class="org.springframework.transaction.support.TransactionTemplate">
118 <constructor-arg ref="transactionManager" />
119 </bean>
120 <bean id="txManager"
121 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
122 <property name="dataSource" ref="sqliteDataSource" />
123 </bean>
124
125 <!-- Initialization -->
126 <bean id="initializator" class="de.ids_mannheim.de.init.LiteInitializatorImpl"
margaretha398f4722019-01-09 19:07:20 +0100127 init-method="initTest">
margaretha2df06602018-11-14 19:10:30 +0100128 </bean>
129 <bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser"
130 scope="singleton" />
131
margaretha47a72a82019-07-03 16:00:54 +0200132 <bean id="vcLoader" class="de.ids_mannheim.de.init.VCLoaderImpl"/>
133
margaretha2df06602018-11-14 19:10:30 +0100134 <!-- Krill -->
135 <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
136 <constructor-arg value="${krill.indexDir}" />
137 </bean>
138
139 <!-- Filters -->
margaretha4fa4b062019-01-28 19:43:30 +0100140 <!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter"
141 scope="singleton" /> -->
margaretha2df06602018-11-14 19:10:30 +0100142 <!-- Authentication -->
143 <bean id="authenticationManager"
144 class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" />
145
146 <!-- Response handler -->
147 <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
148 <constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
149 </bean>
150
151 <!-- Controllers -->
152 <bean id="annotationController"
153 class="de.ids_mannheim.korap.web.controller.AnnotationController" />
154 <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" />
155 <bean id="statisticController"
156 class="de.ids_mannheim.korap.web.controller.StatisticController" />
157
158 <!-- Services -->
159 <bean id="annotationService" class="de.ids_mannheim.korap.service.AnnotationService"></bean>
160 <bean id="scopeService"
161 class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
162 <bean id="searchService" class="de.ids_mannheim.korap.service.SearchService"></bean>
163
164 <!-- DAO -->
165 <bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
166 <bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" />
167
168 <!-- DTO Converter -->
169 <bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
170
171 <!-- Rewrite -->
margaretha4fa4b062019-01-28 19:43:30 +0100172 <bean id="foundryInject" class="de.ids_mannheim.korap.rewrite.FoundryInject" />
173
174 <util:list id="rewriteTasks" value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
175 <ref bean="foundryInject" />
176 </util:list>
177
margaretha398f4722019-01-09 19:07:20 +0100178 <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
margaretha4fa4b062019-01-28 19:43:30 +0100179 <constructor-arg ref="rewriteTasks" />
margaretha2df06602018-11-14 19:10:30 +0100180 </bean>
181
182
183
margaretha4fa4b062019-01-28 19:43:30 +0100184
margaretha2df06602018-11-14 19:10:30 +0100185 <bean id="kustvakt_auditing"
186 class="de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing">
187 </bean>
188
189</beans>