blob: a18056354ecaa47a2f6de349a75854b058278a85 [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
134 <!-- Krill -->
135 <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
136 <constructor-arg value="${krill.indexDir}" />
137 </bean>
138
139 <!-- Filters -->
margaretha398f4722019-01-09 19:07:20 +0100140 <!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter"
141 scope="singleton" /> -->
margaretha2df06602018-11-14 19:10:30 +0100142
143 <!-- Authentication -->
144 <bean id="authenticationManager"
145 class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" />
146
147 <!-- Response handler -->
148 <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
149 <constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
150 </bean>
151
152 <!-- Controllers -->
153 <bean id="annotationController"
154 class="de.ids_mannheim.korap.web.controller.AnnotationController" />
155 <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" />
156 <bean id="statisticController"
157 class="de.ids_mannheim.korap.web.controller.StatisticController" />
158
159 <!-- Services -->
160 <bean id="annotationService" class="de.ids_mannheim.korap.service.AnnotationService"></bean>
161 <bean id="scopeService"
162 class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
163 <bean id="searchService" class="de.ids_mannheim.korap.service.SearchService"></bean>
164
165 <!-- DAO -->
166 <bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
167 <bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" />
168
169 <!-- DTO Converter -->
170 <bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
171
172 <!-- Rewrite -->
margaretha4fa4b062019-01-28 19:43:30 +0100173 <bean id="foundryInject" class="de.ids_mannheim.korap.rewrite.FoundryInject" />
174
175 <util:list id="rewriteTasks" value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
176 <ref bean="foundryInject"/>
177 </util:list>
178
margaretha398f4722019-01-09 19:07:20 +0100179 <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
margaretha4fa4b062019-01-28 19:43:30 +0100180 <constructor-arg ref="rewriteTasks" />
margaretha2df06602018-11-14 19:10:30 +0100181 </bean>
182
183
184
185 <bean id="kustvakt_auditing"
186 class="de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing">
187 </bean>
188
margarethaf92485a2017-11-14 17:12:36 +0100189</beans>