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" |
| 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"> |
| 13 | |
| 14 | |
| 15 | <context:component-scan |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 16 | base-package="de.ids_mannheim.korap.rewrite, |
margaretha | 5b70879 | 2023-05-12 16:55:29 +0200 | [diff] [blame] | 17 | de.ids_mannheim.korap.core.service, |
margaretha | ac92c82 | 2023-05-15 11:43:22 +0200 | [diff] [blame^] | 18 | de.ids_mannheim.korap.core.web, |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 19 | de.ids_mannheim.korap.web.filter, |
| 20 | de.ids_mannheim.korap.web.utils, |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 21 | de.ids_mannheim.korap.authentication.http" /> |
| 22 | <context:annotation-config /> |
| 23 | |
| 24 | <bean id="placeholders" |
| 25 | class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"> |
| 26 | <property name="ignoreResourceNotFound" value="true" /> |
| 27 | <property name="locations"> |
| 28 | <array> |
| 29 | <value>classpath:test-jdbc.properties</value> |
| 30 | <value>file:./test-jdbc.properties</value> |
| 31 | <value>classpath:hibernate.properties</value> |
| 32 | <value>classpath:kustvakt-lite.conf</value> |
| 33 | <value>file:./kustvakt-lite.conf</value> |
| 34 | </array> |
| 35 | </property> |
| 36 | </bean> |
| 37 | |
| 38 | <bean id="properties" |
| 39 | class="org.springframework.beans.factory.config.PropertiesFactoryBean"> |
| 40 | <property name="ignoreResourceNotFound" value="true" /> |
| 41 | <property name="locations"> |
| 42 | <array> |
| 43 | <value>classpath:kustvakt-lite.conf</value> |
| 44 | <value>file:./kustvakt-lite.conf</value> |
| 45 | </array> |
| 46 | </property> |
| 47 | </bean> |
| 48 | |
| 49 | <bean id="config" class="de.ids_mannheim.korap.config.KustvaktConfiguration"> |
| 50 | <constructor-arg index="0" name="properties" ref="properties" /> |
| 51 | </bean> |
| 52 | |
| 53 | <!-- Database --> |
| 54 | |
| 55 | <bean id="sqliteDataSource" |
| 56 | class="org.springframework.jdbc.datasource.SingleConnectionDataSource" |
| 57 | lazy-init="true"> |
| 58 | <property name="driverClassName" value="${jdbc.driverClassName}" /> |
| 59 | <property name="url" value="${jdbc.url}" /> |
| 60 | <property name="username" value="${jdbc.username}" /> |
| 61 | <property name="password" value="${jdbc.password}" /> |
| 62 | <property name="connectionProperties"> |
| 63 | <props> |
| 64 | <prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop> |
| 65 | </props> |
| 66 | </property> |
| 67 | |
| 68 | <!-- relevant for single connection datasource and sqlite --> |
| 69 | <property name="suppressClose"> |
| 70 | <value>true</value> |
| 71 | </property> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 72 | </bean> |
| 73 | |
margaretha | fcf8bd9 | 2021-01-14 10:55:53 +0100 | [diff] [blame] | 74 | <bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration"> |
| 75 | <property name="baselineOnMigrate" value="true" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 76 | <!-- <property name="validateOnMigrate" value="false" /> --> |
| 77 | <!-- <property name="cleanOnValidationError" value="true" /> --> |
margaretha | fcf8bd9 | 2021-01-14 10:55:53 +0100 | [diff] [blame] | 78 | <property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 79 | <property name="dataSource" ref="sqliteDataSource" /> |
margaretha | d66a683 | 2022-03-03 08:47:13 +0100 | [diff] [blame] | 80 | <property name="outOfOrder" value="true" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 81 | </bean> |
margaretha | fcf8bd9 | 2021-01-14 10:55:53 +0100 | [diff] [blame] | 82 | |
| 83 | <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate"> |
| 84 | <constructor-arg ref="flywayConfig"/> |
| 85 | </bean> |
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 | |
margaretha | 4dee07a | 2022-05-27 11:45:28 +0200 | [diff] [blame] | 132 | <!-- Search Engine --> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 133 | <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill"> |
| 134 | <constructor-arg value="${krill.indexDir}" /> |
| 135 | </bean> |
| 136 | |
| 137 | <!-- Filters --> |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 138 | <!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter" |
| 139 | scope="singleton" /> --> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 140 | <!-- Authentication --> |
| 141 | <bean id="authenticationManager" |
| 142 | class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" /> |
| 143 | |
| 144 | <!-- Response handler --> |
| 145 | <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler"> |
| 146 | <constructor-arg index="0" name="iface" ref="kustvakt_auditing" /> |
| 147 | </bean> |
| 148 | |
| 149 | <!-- Controllers --> |
margaretha | ac92c82 | 2023-05-15 11:43:22 +0200 | [diff] [blame^] | 150 | <!-- added via component-scan |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 151 | <bean id="annotationController" |
| 152 | class="de.ids_mannheim.korap.web.controller.AnnotationController" /> |
| 153 | <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" /> |
| 154 | <bean id="statisticController" |
| 155 | class="de.ids_mannheim.korap.web.controller.StatisticController" /> |
margaretha | ac92c82 | 2023-05-15 11:43:22 +0200 | [diff] [blame^] | 156 | --> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 157 | |
| 158 | <!-- Services --> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 159 | <bean id="scopeService" |
| 160 | class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 161 | |
| 162 | <!-- DAO --> |
| 163 | <bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" /> |
| 164 | <bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" /> |
| 165 | |
| 166 | <!-- DTO Converter --> |
| 167 | <bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" /> |
| 168 | |
| 169 | <!-- Rewrite --> |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 170 | <bean id="foundryInject" class="de.ids_mannheim.korap.rewrite.FoundryInject" /> |
| 171 | |
| 172 | <util:list id="rewriteTasks" value-type="de.ids_mannheim.korap.rewrite.RewriteTask"> |
| 173 | <ref bean="foundryInject" /> |
| 174 | </util:list> |
| 175 | |
margaretha | 398f472 | 2019-01-09 19:07:20 +0100 | [diff] [blame] | 176 | <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler"> |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 177 | <constructor-arg ref="rewriteTasks" /> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 178 | </bean> |
| 179 | |
| 180 | |
| 181 | |
margaretha | 4fa4b06 | 2019-01-28 19:43:30 +0100 | [diff] [blame] | 182 | |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 183 | <bean id="kustvakt_auditing" |
| 184 | class="de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing"> |
| 185 | </bean> |
| 186 | |
| 187 | </beans> |