blob: 717499843377486a8cacddb1ff1251995245199e [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">
margaretha92ad2ec2023-05-15 14:10:00 +020013
14 <context:component-scan base-package="
margaretha5b708792023-05-12 16:55:29 +020015 de.ids_mannheim.korap.core.service,
margarethaac92c822023-05-15 11:43:22 +020016 de.ids_mannheim.korap.core.web,
margaretha4fa4b062019-01-28 19:43:30 +010017 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>
margaretha92ad2ec2023-05-15 14:10:00 +020029 <value>classpath:test-hibernate.properties</value>
margaretha2df06602018-11-14 19:10:30 +010030 <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
margarethafcf8bd92021-01-14 10:55:53 +010072 <bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
73 <property name="baselineOnMigrate" value="true" />
margaretha2df06602018-11-14 19:10:30 +010074 <!-- <property name="validateOnMigrate" value="false" /> -->
75 <!-- <property name="cleanOnValidationError" value="true" /> -->
margarethafcf8bd92021-01-14 10:55:53 +010076 <property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
margaretha2df06602018-11-14 19:10:30 +010077 <property name="dataSource" ref="sqliteDataSource" />
margarethad66a6832022-03-03 08:47:13 +010078 <property name="outOfOrder" value="true" />
margaretha2df06602018-11-14 19:10:30 +010079 </bean>
margarethafcf8bd92021-01-14 10:55:53 +010080
81 <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
82 <constructor-arg ref="flywayConfig"/>
83 </bean>
margaretha2df06602018-11-14 19:10:30 +010084
85 <bean id="entityManagerFactory"
86 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
87 <property name="dataSource" ref="sqliteDataSource" />
88
89 <property name="packagesToScan">
90 <array>
margaretha5b708792023-05-12 16:55:29 +020091 <value>de.ids_mannheim.korap.core.entity</value>
margaretha2df06602018-11-14 19:10:30 +010092 </array>
93 </property>
94 <property name="jpaVendorAdapter">
95 <bean id="jpaVendorAdapter"
96 class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
97 <property name="databasePlatform" value="${hibernate.dialect}" />
98 </bean>
99 </property>
100 <property name="jpaProperties">
101 <props>
102 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
103 <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
104 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
105 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
106 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
107 </prop>
108 <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
109 <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
110 <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
111 </props>
112 </property>
113 </bean>
114 <tx:annotation-driven proxy-target-class="true"
115 transaction-manager="transactionManager" />
116
117 <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
118 <property name="entityManagerFactory" ref="entityManagerFactory" />
119 </bean>
120
121 <bean id="transactionTemplate"
122 class="org.springframework.transaction.support.TransactionTemplate">
123 <constructor-arg ref="transactionManager" />
124 </bean>
125 <bean id="txManager"
126 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
127 <property name="dataSource" ref="sqliteDataSource" />
128 </bean>
129
margaretha4dee07a2022-05-27 11:45:28 +0200130 <!-- Search Engine -->
margaretha2df06602018-11-14 19:10:30 +0100131 <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
132 <constructor-arg value="${krill.indexDir}" />
133 </bean>
margaretha92ad2ec2023-05-15 14:10:00 +0200134
margaretha2df06602018-11-14 19:10:30 +0100135
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">
margaretha2df06602018-11-14 19:10:30 +0100145 </bean>
146
147 <!-- Controllers -->
margaretha92ad2ec2023-05-15 14:10:00 +0200148 <!-- added via component-scan
margaretha2df06602018-11-14 19:10:30 +0100149 <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" />
margaretha92ad2ec2023-05-15 14:10:00 +0200154 -->
margaretha2df06602018-11-14 19:10:30 +0100155 <!-- Services -->
margaretha2df06602018-11-14 19:10:30 +0100156 <bean id="scopeService"
157 class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
margaretha2df06602018-11-14 19:10:30 +0100158
159 <!-- DAO -->
160 <bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
161 <bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" />
162
163 <!-- DTO Converter -->
164 <bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
165
166 <!-- Rewrite -->
margaretha92ad2ec2023-05-15 14:10:00 +0200167 <bean id="layerMapper" class="de.ids_mannheim.korap.rewrite.LayerMapper" />
margaretha4fa4b062019-01-28 19:43:30 +0100168 <bean id="foundryInject" class="de.ids_mannheim.korap.rewrite.FoundryInject" />
169
170 <util:list id="rewriteTasks" value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
171 <ref bean="foundryInject" />
172 </util:list>
173
margaretha398f4722019-01-09 19:07:20 +0100174 <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
margaretha4fa4b062019-01-28 19:43:30 +0100175 <constructor-arg ref="rewriteTasks" />
margaretha2df06602018-11-14 19:10:30 +0100176 </bean>
margaretha2df06602018-11-14 19:10:30 +0100177</beans>