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" |
| 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 |
margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame] | 6 | http://www.springframework.org/schema/beans/spring-beans.xsd |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 7 | http://www.springframework.org/schema/tx |
| 8 | http://www.springframework.org/schema/tx/spring-tx.xsd |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 9 | http://www.springframework.org/schema/context |
margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame] | 10 | http://www.springframework.org/schema/context/spring-context.xsd |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 11 | http://www.springframework.org/schema/util |
margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame] | 12 | http://www.springframework.org/schema/util/spring-util.xsd"> |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 13 | |
margaretha | 92ad2ec | 2023-05-15 14:10:00 +0200 | [diff] [blame] | 14 | <context:component-scan base-package=" |
| 15 | de.ids_mannheim.korap.core.service, |
| 16 | de.ids_mannheim.korap.core.web, |
| 17 | de.ids_mannheim.korap.web.filter, |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 18 | de.ids_mannheim.korap.web.utils, |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 19 | de.ids_mannheim.korap.authentication.http" /> |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 20 | <context:annotation-config /> |
| 21 | |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 22 | <bean id="placeholders" |
| 23 | class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"> |
| 24 | <property name="ignoreResourceNotFound" value="true" /> |
| 25 | <property name="locations"> |
| 26 | <array> |
margaretha | 92ad2ec | 2023-05-15 14:10:00 +0200 | [diff] [blame] | 27 | <value>classpath:properties/lite-jdbc.properties</value> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 28 | <value>file:./lite-jdbc.properties</value> |
margaretha | 92ad2ec | 2023-05-15 14:10:00 +0200 | [diff] [blame] | 29 | <value>classpath:properties/hibernate.properties</value> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 30 | <value>classpath:kustvakt-lite.conf</value> |
| 31 | <value>file:./kustvakt-lite.conf</value> |
| 32 | </array> |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 33 | </property> |
| 34 | </bean> |
| 35 | |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 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> |
margaretha | 56e8e55 | 2017-12-05 16:31:21 +0100 | [diff] [blame] | 45 | </bean> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 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> |
| 70 | <!--<property name="initialSize" value="2"/> --> |
| 71 | <!--<property name="poolPreparedStatements" value="true"/> --> |
| 72 | </bean> |
margaretha | fcf8bd9 | 2021-01-14 10:55:53 +0100 | [diff] [blame] | 73 | <bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration"> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 74 | <property name="baselineOnMigrate" value="true" /> |
| 75 | <!-- <property name="validateOnMigrate" value="false" /> --> |
| 76 | <!-- <property name="cleanOnValidationError" value="true" /> --> |
margaretha | fcf8bd9 | 2021-01-14 10:55:53 +0100 | [diff] [blame] | 77 | <property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 78 | <property name="dataSource" ref="sqliteDataSource" /> |
margaretha | d66a683 | 2022-03-03 08:47:13 +0100 | [diff] [blame] | 79 | <property name="outOfOrder" value="true" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 80 | </bean> |
margaretha | fcf8bd9 | 2021-01-14 10:55:53 +0100 | [diff] [blame] | 81 | |
| 82 | <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate"> |
| 83 | <constructor-arg ref="flywayConfig"/> |
| 84 | </bean> |
| 85 | |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 86 | |
| 87 | <bean id="entityManagerFactory" |
| 88 | class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> |
| 89 | <property name="dataSource" ref="sqliteDataSource" /> |
| 90 | |
| 91 | <property name="packagesToScan"> |
| 92 | <array> |
margaretha | 5b70879 | 2023-05-12 16:55:29 +0200 | [diff] [blame] | 93 | <value>de.ids_mannheim.korap.core.entity</value> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 94 | </array> |
| 95 | </property> |
| 96 | <property name="jpaVendorAdapter"> |
| 97 | <bean id="jpaVendorAdapter" |
| 98 | class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> |
| 99 | <property name="databasePlatform" value="${hibernate.dialect}" /> |
| 100 | </bean> |
| 101 | </property> |
| 102 | <property name="jpaProperties"> |
| 103 | <props> |
| 104 | <prop key="hibernate.dialect">${hibernate.dialect}</prop> |
| 105 | <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> |
| 106 | <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> |
| 107 | <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> |
| 108 | <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache} |
| 109 | </prop> |
| 110 | <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop> |
| 111 | <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop> |
| 112 | <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop> |
| 113 | </props> |
| 114 | </property> |
| 115 | </bean> |
| 116 | <tx:annotation-driven proxy-target-class="true" |
| 117 | transaction-manager="transactionManager" /> |
| 118 | |
| 119 | <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> |
| 120 | <property name="entityManagerFactory" ref="entityManagerFactory" /> |
| 121 | </bean> |
| 122 | |
| 123 | <bean id="transactionTemplate" |
| 124 | class="org.springframework.transaction.support.TransactionTemplate"> |
| 125 | <constructor-arg ref="transactionManager" /> |
| 126 | </bean> |
| 127 | <bean id="txManager" |
| 128 | class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> |
| 129 | <property name="dataSource" ref="sqliteDataSource" /> |
| 130 | </bean> |
| 131 | |
| 132 | <!-- Initialization --> |
margaretha | 93bfbea | 2023-11-06 21:09:21 +0100 | [diff] [blame^] | 133 | <!-- |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 134 | <bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser" |
| 135 | scope="singleton" /> |
margaretha | 6a925fe | 2023-05-15 16:50:32 +0200 | [diff] [blame] | 136 | --> |
margaretha | 4dee07a | 2022-05-27 11:45:28 +0200 | [diff] [blame] | 137 | <!-- Search Engine --> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 138 | <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill"> |
| 139 | <constructor-arg value="${krill.indexDir}" /> |
| 140 | </bean> |
margaretha | 92ad2ec | 2023-05-15 14:10:00 +0200 | [diff] [blame] | 141 | |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 142 | |
| 143 | <!-- Filters --> |
margaretha | 398f472 | 2019-01-09 19:07:20 +0100 | [diff] [blame] | 144 | <!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter" |
| 145 | scope="singleton" /> --> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 146 | |
| 147 | <!-- Authentication --> |
| 148 | <bean id="authenticationManager" |
| 149 | class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" /> |
| 150 | |
| 151 | <!-- Response handler --> |
| 152 | <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler"> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 153 | </bean> |
| 154 | |
| 155 | <!-- Controllers --> |
margaretha | ac92c82 | 2023-05-15 11:43:22 +0200 | [diff] [blame] | 156 | <!-- added via component-scan |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 157 | <bean id="annotationController" |
| 158 | class="de.ids_mannheim.korap.web.controller.AnnotationController" /> |
| 159 | <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" /> |
| 160 | <bean id="statisticController" |
| 161 | class="de.ids_mannheim.korap.web.controller.StatisticController" /> |
margaretha | 92ad2ec | 2023-05-15 14:10:00 +0200 | [diff] [blame] | 162 | --> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 163 | <!-- Services --> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 164 | <bean id="scopeService" |
| 165 | class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 166 | |
| 167 | <!-- DAO --> |
| 168 | <bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" /> |
| 169 | <bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" /> |
| 170 | |
| 171 | <!-- DTO Converter --> |
| 172 | <bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" /> |
| 173 | |
| 174 | <!-- Rewrite --> |
margaretha | 92ad2ec | 2023-05-15 14:10:00 +0200 | [diff] [blame] | 175 | <bean id="layerMapper" class="de.ids_mannheim.korap.rewrite.LayerMapper" /> |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 176 | <bean id="foundryInject" class="de.ids_mannheim.korap.rewrite.FoundryInject" /> |
margaretha | 92ad2ec | 2023-05-15 14:10:00 +0200 | [diff] [blame] | 177 | |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 178 | <util:list id="rewriteTasks" value-type="de.ids_mannheim.korap.rewrite.RewriteTask"> |
margaretha | 92ad2ec | 2023-05-15 14:10:00 +0200 | [diff] [blame] | 179 | <ref bean="foundryInject" /> |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 180 | </util:list> |
| 181 | |
margaretha | 398f472 | 2019-01-09 19:07:20 +0100 | [diff] [blame] | 182 | <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler"> |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 183 | <constructor-arg ref="rewriteTasks" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 184 | </bean> |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 185 | </beans> |