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