blob: e474b650a363be2247369e29774ed861235ae6f2 [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
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" />
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>
27 <value>classpath:lite-jdbc.properties</value>
28 <value>file:./lite-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>
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>
73
74 <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
75 <property name="baselineOnMigrate" value="true" />
76 <!-- <property name="validateOnMigrate" value="false" /> -->
77 <!-- <property name="cleanOnValidationError" value="true" /> -->
78 <property name="locations" value="${jdbc.schemaPath}" />
79 <property name="dataSource" ref="sqliteDataSource" />
80 </bean>
81
82 <bean id="entityManagerFactory"
83 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
84 <property name="dataSource" ref="sqliteDataSource" />
85
86 <property name="packagesToScan">
87 <array>
88 <value>de.ids_mannheim.korap.entity</value>
89 </array>
90 </property>
91 <property name="jpaVendorAdapter">
92 <bean id="jpaVendorAdapter"
93 class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
94 <property name="databasePlatform" value="${hibernate.dialect}" />
95 </bean>
96 </property>
97 <property name="jpaProperties">
98 <props>
99 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
100 <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
101 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
102 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
103 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
104 </prop>
105 <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
106 <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
107 <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
108 </props>
109 </property>
110 </bean>
111 <tx:annotation-driven proxy-target-class="true"
112 transaction-manager="transactionManager" />
113
114 <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
115 <property name="entityManagerFactory" ref="entityManagerFactory" />
116 </bean>
117
118 <bean id="transactionTemplate"
119 class="org.springframework.transaction.support.TransactionTemplate">
120 <constructor-arg ref="transactionManager" />
121 </bean>
122 <bean id="txManager"
123 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
124 <property name="dataSource" ref="sqliteDataSource" />
125 </bean>
126
127 <!-- Initialization -->
128 <bean id="initializator" class="de.ids_mannheim.de.init.LiteInitializatorImpl"
129 init-method="init">
130 </bean>
131 <bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser"
132 scope="singleton" />
133
margaretha47a72a82019-07-03 16:00:54 +0200134 <bean id="vcLoader" class="de.ids_mannheim.de.init.VCLoaderImpl"/>
135
margaretha2df06602018-11-14 19:10:30 +0100136 <!-- Krill -->
137 <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
138 <constructor-arg value="${krill.indexDir}" />
139 </bean>
140
141 <!-- Filters -->
margaretha398f4722019-01-09 19:07:20 +0100142 <!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter"
143 scope="singleton" /> -->
margaretha2df06602018-11-14 19:10:30 +0100144
145 <!-- Authentication -->
146 <bean id="authenticationManager"
147 class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" />
148
149 <!-- Response handler -->
150 <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
151 <constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
152 </bean>
153
154 <!-- Controllers -->
155 <bean id="annotationController"
156 class="de.ids_mannheim.korap.web.controller.AnnotationController" />
157 <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" />
158 <bean id="statisticController"
159 class="de.ids_mannheim.korap.web.controller.StatisticController" />
160
161 <!-- Services -->
162 <bean id="annotationService" class="de.ids_mannheim.korap.service.AnnotationService"></bean>
163 <bean id="scopeService"
164 class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
165 <bean id="searchService" class="de.ids_mannheim.korap.service.SearchService"></bean>
166
167 <!-- DAO -->
168 <bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
169 <bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" />
170
171 <!-- DTO Converter -->
172 <bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
173
174 <!-- Rewrite -->
margaretha4fa4b062019-01-28 19:43:30 +0100175 <bean id="foundryInject" class="de.ids_mannheim.korap.rewrite.FoundryInject" />
176
177 <util:list id="rewriteTasks" value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
178 <ref bean="foundryInject"/>
179 </util:list>
180
margaretha398f4722019-01-09 19:07:20 +0100181 <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
margaretha4fa4b062019-01-28 19:43:30 +0100182 <constructor-arg ref="rewriteTasks" />
margaretha2df06602018-11-14 19:10:30 +0100183 </bean>
184
185
186
187 <bean id="kustvakt_auditing"
188 class="de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing">
189 </bean>
190
margarethaf92485a2017-11-14 17:12:36 +0100191</beans>