margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 2 | <beans xmlns="http://www.springframework.org/schema/beans" |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 4 | xmlns:util="http://www.springframework.org/schema/util" |
| 5 | xmlns:context="http://www.springframework.org/schema/context" |
| 6 | xmlns:tx="http://www.springframework.org/schema/tx" |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 7 | xsi:schemaLocation="http://www.springframework.org/schema/beans |
margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame] | 8 | http://www.springframework.org/schema/beans/spring-beans.xsd |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 9 | http://www.springframework.org/schema/tx |
| 10 | http://www.springframework.org/schema/tx/spring-tx.xsd |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 11 | http://www.springframework.org/schema/context |
margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame] | 12 | http://www.springframework.org/schema/context/spring-context.xsd |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 13 | http://www.springframework.org/schema/util |
margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame] | 14 | http://www.springframework.org/schema/util/spring-util.xsd"> |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 15 | |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 16 | <context:component-scan |
| 17 | base-package=" |
margaretha | 92ad2ec | 2023-05-15 14:10:00 +0200 | [diff] [blame] | 18 | de.ids_mannheim.korap.core.service, |
| 19 | de.ids_mannheim.korap.core.web, |
| 20 | de.ids_mannheim.korap.web.filter, |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 21 | de.ids_mannheim.korap.web.utils, |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 22 | de.ids_mannheim.korap.authentication.http" /> |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 23 | <context:annotation-config /> |
| 24 | |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 25 | <bean id="placeholders" |
| 26 | class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"> |
| 27 | <property name="ignoreResourceNotFound" value="true" /> |
| 28 | <property name="locations"> |
| 29 | <array> |
margaretha | 92ad2ec | 2023-05-15 14:10:00 +0200 | [diff] [blame] | 30 | <value>classpath:properties/lite-jdbc.properties</value> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 31 | <value>file:./lite-jdbc.properties</value> |
margaretha | 390f37d | 2024-04-22 12:07:34 +0200 | [diff] [blame^] | 32 | <value>file:./data/lite-jdbc.properties</value> |
margaretha | 92ad2ec | 2023-05-15 14:10:00 +0200 | [diff] [blame] | 33 | <value>classpath:properties/hibernate.properties</value> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 34 | <value>classpath:kustvakt-lite.conf</value> |
| 35 | <value>file:./kustvakt-lite.conf</value> |
margaretha | 390f37d | 2024-04-22 12:07:34 +0200 | [diff] [blame^] | 36 | <value>file:./data/kustvakt-lite.conf</value> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 37 | </array> |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 38 | </property> |
| 39 | </bean> |
| 40 | |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 41 | <bean id="properties" |
| 42 | class="org.springframework.beans.factory.config.PropertiesFactoryBean"> |
| 43 | <property name="ignoreResourceNotFound" value="true" /> |
| 44 | <property name="locations"> |
| 45 | <array> |
| 46 | <value>classpath:kustvakt-lite.conf</value> |
| 47 | <value>file:./kustvakt-lite.conf</value> |
margaretha | 390f37d | 2024-04-22 12:07:34 +0200 | [diff] [blame^] | 48 | <value>file:./data/kustvakt-lite.conf</value> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 49 | </array> |
| 50 | </property> |
margaretha | 56e8e55 | 2017-12-05 16:31:21 +0100 | [diff] [blame] | 51 | </bean> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 52 | |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 53 | <bean id="config" |
| 54 | class="de.ids_mannheim.korap.config.KustvaktConfiguration"> |
| 55 | <constructor-arg index="0" name="properties" |
| 56 | ref="properties" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 57 | </bean> |
| 58 | |
| 59 | <!-- Database --> |
| 60 | |
| 61 | <bean id="sqliteDataSource" |
| 62 | class="org.springframework.jdbc.datasource.SingleConnectionDataSource" |
| 63 | lazy-init="true"> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 64 | <property name="driverClassName" |
| 65 | value="${jdbc.driverClassName}" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 66 | <property name="url" value="${jdbc.url}" /> |
| 67 | <property name="username" value="${jdbc.username}" /> |
| 68 | <property name="password" value="${jdbc.password}" /> |
| 69 | <property name="connectionProperties"> |
| 70 | <props> |
| 71 | <prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop> |
| 72 | </props> |
| 73 | </property> |
| 74 | |
| 75 | <!-- relevant for single connection datasource and sqlite --> |
| 76 | <property name="suppressClose"> |
| 77 | <value>true</value> |
| 78 | </property> |
| 79 | <!--<property name="initialSize" value="2"/> --> |
| 80 | <!--<property name="poolPreparedStatements" value="true"/> --> |
| 81 | </bean> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 82 | <bean id="flywayConfig" |
| 83 | class="org.flywaydb.core.api.configuration.ClassicConfiguration"> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 84 | <property name="baselineOnMigrate" value="true" /> |
| 85 | <!-- <property name="validateOnMigrate" value="false" /> --> |
| 86 | <!-- <property name="cleanOnValidationError" value="true" /> --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 87 | <property name="locations" |
| 88 | value="#{'${jdbc.schemaPath}'.split(',')}" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 89 | <property name="dataSource" ref="sqliteDataSource" /> |
margaretha | d66a683 | 2022-03-03 08:47:13 +0100 | [diff] [blame] | 90 | <property name="outOfOrder" value="true" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 91 | </bean> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 92 | |
| 93 | <bean id="flyway" class="org.flywaydb.core.Flyway" |
| 94 | init-method="migrate"> |
| 95 | <constructor-arg ref="flywayConfig" /> |
margaretha | fcf8bd9 | 2021-01-14 10:55:53 +0100 | [diff] [blame] | 96 | </bean> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 97 | |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 98 | |
| 99 | <bean id="entityManagerFactory" |
| 100 | class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> |
| 101 | <property name="dataSource" ref="sqliteDataSource" /> |
| 102 | |
| 103 | <property name="packagesToScan"> |
| 104 | <array> |
margaretha | 5b70879 | 2023-05-12 16:55:29 +0200 | [diff] [blame] | 105 | <value>de.ids_mannheim.korap.core.entity</value> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 106 | </array> |
| 107 | </property> |
| 108 | <property name="jpaVendorAdapter"> |
| 109 | <bean id="jpaVendorAdapter" |
| 110 | class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 111 | <property name="databasePlatform" |
| 112 | value="${hibernate.dialect}" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 113 | </bean> |
| 114 | </property> |
| 115 | <property name="jpaProperties"> |
| 116 | <props> |
| 117 | <prop key="hibernate.dialect">${hibernate.dialect}</prop> |
| 118 | <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> |
| 119 | <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> |
| 120 | <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> |
| 121 | <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache} |
| 122 | </prop> |
| 123 | <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop> |
| 124 | <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop> |
| 125 | <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop> |
| 126 | </props> |
| 127 | </property> |
| 128 | </bean> |
| 129 | <tx:annotation-driven proxy-target-class="true" |
| 130 | transaction-manager="transactionManager" /> |
| 131 | |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 132 | <bean id="transactionManager" |
| 133 | class="org.springframework.orm.jpa.JpaTransactionManager"> |
| 134 | <property name="entityManagerFactory" |
| 135 | ref="entityManagerFactory" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 136 | </bean> |
| 137 | |
| 138 | <bean id="transactionTemplate" |
| 139 | class="org.springframework.transaction.support.TransactionTemplate"> |
| 140 | <constructor-arg ref="transactionManager" /> |
| 141 | </bean> |
| 142 | <bean id="txManager" |
| 143 | class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> |
| 144 | <property name="dataSource" ref="sqliteDataSource" /> |
| 145 | </bean> |
| 146 | |
| 147 | <!-- Initialization --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 148 | <!-- <bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser" |
| 149 | scope="singleton" /> --> |
margaretha | 4dee07a | 2022-05-27 11:45:28 +0200 | [diff] [blame] | 150 | <!-- Search Engine --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 151 | <bean id="search_krill" |
| 152 | class="de.ids_mannheim.korap.web.SearchKrill"> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 153 | <constructor-arg value="${krill.indexDir}" /> |
| 154 | </bean> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 155 | |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 156 | |
| 157 | <!-- Filters --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 158 | <!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter" |
margaretha | 398f472 | 2019-01-09 19:07:20 +0100 | [diff] [blame] | 159 | scope="singleton" /> --> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 160 | |
| 161 | <!-- Authentication --> |
| 162 | <bean id="authenticationManager" |
| 163 | class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" /> |
| 164 | |
| 165 | <!-- Response handler --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 166 | <bean id="kustvaktResponseHandler" |
| 167 | class="de.ids_mannheim.korap.web.KustvaktResponseHandler"> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 168 | </bean> |
| 169 | |
| 170 | <!-- Controllers --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 171 | <!-- added via component-scan <bean id="annotationController" class="de.ids_mannheim.korap.web.controller.AnnotationController" |
| 172 | /> <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" |
| 173 | /> <bean id="statisticController" class="de.ids_mannheim.korap.web.controller.StatisticController" |
| 174 | /> --> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 175 | <!-- Services --> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 176 | <bean id="scopeService" |
| 177 | class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 178 | |
| 179 | <!-- DAO --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 180 | <bean id="adminDao" |
| 181 | class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" /> |
| 182 | <bean id="annotationDao" |
| 183 | class="de.ids_mannheim.korap.dao.AnnotationDao" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 184 | |
| 185 | <!-- DTO Converter --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 186 | <bean id="annotationConverter" |
| 187 | class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 188 | |
| 189 | <!-- Rewrite --> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 190 | <bean id="layerMapper" |
| 191 | class="de.ids_mannheim.korap.rewrite.LayerMapper" /> |
| 192 | <bean id="foundryInject" |
| 193 | class="de.ids_mannheim.korap.rewrite.FoundryInject" /> |
margaretha | 92ad2ec | 2023-05-15 14:10:00 +0200 | [diff] [blame] | 194 | |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 195 | <util:list id="rewriteTasks" |
| 196 | value-type="de.ids_mannheim.korap.rewrite.RewriteTask"> |
margaretha | 92ad2ec | 2023-05-15 14:10:00 +0200 | [diff] [blame] | 197 | <ref bean="foundryInject" /> |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 198 | </util:list> |
margaretha | 35e1ca2 | 2023-11-16 22:00:01 +0100 | [diff] [blame] | 199 | |
| 200 | <bean id="rewriteHandler" |
| 201 | class="de.ids_mannheim.korap.rewrite.RewriteHandler"> |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 202 | <constructor-arg ref="rewriteTasks" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 203 | </bean> |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 204 | </beans> |