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