blob: 6eec95fd4d7d544820c3e051c94cc3de0fd9431d [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,
margarethaed2ee242019-12-12 17:34:18 +010017 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" />
21 <context:annotation-config />
22
23 <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:test-jdbc.properties</value>
29 <value>file:./test-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>
34 </property>
35 </bean>
36
37 <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>
46 </bean>
47
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>
margaretha2df06602018-11-14 19:10:30 +010071 </bean>
72
margarethafcf8bd92021-01-14 10:55:53 +010073 <bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
74 <property name="baselineOnMigrate" value="true" />
margaretha2df06602018-11-14 19:10:30 +010075 <!-- <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>
margaretha2df06602018-11-14 19:10:30 +010085
86 <bean id="entityManagerFactory"
87 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
88 <property name="dataSource" ref="sqliteDataSource" />
89
90 <property name="packagesToScan">
91 <array>
92 <value>de.ids_mannheim.korap.entity</value>
93 </array>
94 </property>
95 <property name="jpaVendorAdapter">
96 <bean id="jpaVendorAdapter"
97 class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
98 <property name="databasePlatform" value="${hibernate.dialect}" />
99 </bean>
100 </property>
101 <property name="jpaProperties">
102 <props>
103 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
104 <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
105 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
106 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
107 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
108 </prop>
109 <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
110 <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
111 <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
112 </props>
113 </property>
114 </bean>
115 <tx:annotation-driven proxy-target-class="true"
116 transaction-manager="transactionManager" />
117
118 <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
119 <property name="entityManagerFactory" ref="entityManagerFactory" />
120 </bean>
121
122 <bean id="transactionTemplate"
123 class="org.springframework.transaction.support.TransactionTemplate">
124 <constructor-arg ref="transactionManager" />
125 </bean>
126 <bean id="txManager"
127 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
128 <property name="dataSource" ref="sqliteDataSource" />
129 </bean>
130
margaretha2df06602018-11-14 19:10:30 +0100131 <!-- Krill -->
132 <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
133 <constructor-arg value="${krill.indexDir}" />
134 </bean>
135
136 <!-- Filters -->
margaretha4fa4b062019-01-28 19:43:30 +0100137 <!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter"
138 scope="singleton" /> -->
margaretha2df06602018-11-14 19:10:30 +0100139 <!-- Authentication -->
140 <bean id="authenticationManager"
141 class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" />
142
143 <!-- Response handler -->
144 <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
145 <constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
146 </bean>
147
148 <!-- Controllers -->
149 <bean id="annotationController"
150 class="de.ids_mannheim.korap.web.controller.AnnotationController" />
151 <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" />
152 <bean id="statisticController"
153 class="de.ids_mannheim.korap.web.controller.StatisticController" />
margaretha5da1f9d2020-12-04 09:22:26 +0100154 <!-- <bean id="testController"
155 class="de.ids_mannheim.korap.test.TestController" /> -->
margaretha2df06602018-11-14 19:10:30 +0100156
157 <!-- Services -->
margaretha2df06602018-11-14 19:10:30 +0100158 <bean id="scopeService"
159 class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
margaretha2df06602018-11-14 19:10:30 +0100160
161 <!-- DAO -->
162 <bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
163 <bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" />
164
165 <!-- DTO Converter -->
166 <bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
167
168 <!-- Rewrite -->
margaretha4fa4b062019-01-28 19:43:30 +0100169 <bean id="foundryInject" class="de.ids_mannheim.korap.rewrite.FoundryInject" />
170
171 <util:list id="rewriteTasks" value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
172 <ref bean="foundryInject" />
173 </util:list>
174
margaretha398f4722019-01-09 19:07:20 +0100175 <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
margaretha4fa4b062019-01-28 19:43:30 +0100176 <constructor-arg ref="rewriteTasks" />
margaretha2df06602018-11-14 19:10:30 +0100177 </bean>
178
179
180
margaretha4fa4b062019-01-28 19:43:30 +0100181
margaretha2df06602018-11-14 19:10:30 +0100182 <bean id="kustvakt_auditing"
183 class="de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing">
184 </bean>
185
186</beans>