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