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 |
| 16 | base-package="de.ids_mannheim.korap.web.filter, de.ids_mannheim.korap.web.utils, |
| 17 | de.ids_mannheim.korap.authentication.http" /> |
| 18 | <context:annotation-config /> |
| 19 | |
| 20 | <bean id="placeholders" |
| 21 | class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"> |
| 22 | <property name="ignoreResourceNotFound" value="true" /> |
| 23 | <property name="locations"> |
| 24 | <array> |
| 25 | <value>classpath:test-jdbc.properties</value> |
| 26 | <value>file:./test-jdbc.properties</value> |
| 27 | <value>classpath:hibernate.properties</value> |
| 28 | <value>classpath:kustvakt-lite.conf</value> |
| 29 | <value>file:./kustvakt-lite.conf</value> |
| 30 | </array> |
| 31 | </property> |
| 32 | </bean> |
| 33 | |
| 34 | <bean id="properties" |
| 35 | class="org.springframework.beans.factory.config.PropertiesFactoryBean"> |
| 36 | <property name="ignoreResourceNotFound" value="true" /> |
| 37 | <property name="locations"> |
| 38 | <array> |
| 39 | <value>classpath:kustvakt-lite.conf</value> |
| 40 | <value>file:./kustvakt-lite.conf</value> |
| 41 | </array> |
| 42 | </property> |
| 43 | </bean> |
| 44 | |
| 45 | <bean id="config" class="de.ids_mannheim.korap.config.KustvaktConfiguration"> |
| 46 | <constructor-arg index="0" name="properties" ref="properties" /> |
| 47 | </bean> |
| 48 | |
| 49 | <!-- Database --> |
| 50 | |
| 51 | <bean id="sqliteDataSource" |
| 52 | class="org.springframework.jdbc.datasource.SingleConnectionDataSource" |
| 53 | lazy-init="true"> |
| 54 | <property name="driverClassName" value="${jdbc.driverClassName}" /> |
| 55 | <property name="url" value="${jdbc.url}" /> |
| 56 | <property name="username" value="${jdbc.username}" /> |
| 57 | <property name="password" value="${jdbc.password}" /> |
| 58 | <property name="connectionProperties"> |
| 59 | <props> |
| 60 | <prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop> |
| 61 | </props> |
| 62 | </property> |
| 63 | |
| 64 | <!-- relevant for single connection datasource and sqlite --> |
| 65 | <property name="suppressClose"> |
| 66 | <value>true</value> |
| 67 | </property> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 68 | </bean> |
| 69 | |
| 70 | <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate"> |
| 71 | <property name="baselineOnMigrate" value="true" /> |
| 72 | <!-- <property name="validateOnMigrate" value="false" /> --> |
| 73 | <!-- <property name="cleanOnValidationError" value="true" /> --> |
| 74 | <property name="locations" value="${jdbc.schemaPath}" /> |
| 75 | <property name="dataSource" ref="sqliteDataSource" /> |
| 76 | </bean> |
| 77 | |
| 78 | <bean id="entityManagerFactory" |
| 79 | class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> |
| 80 | <property name="dataSource" ref="sqliteDataSource" /> |
| 81 | |
| 82 | <property name="packagesToScan"> |
| 83 | <array> |
| 84 | <value>de.ids_mannheim.korap.entity</value> |
| 85 | </array> |
| 86 | </property> |
| 87 | <property name="jpaVendorAdapter"> |
| 88 | <bean id="jpaVendorAdapter" |
| 89 | class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> |
| 90 | <property name="databasePlatform" value="${hibernate.dialect}" /> |
| 91 | </bean> |
| 92 | </property> |
| 93 | <property name="jpaProperties"> |
| 94 | <props> |
| 95 | <prop key="hibernate.dialect">${hibernate.dialect}</prop> |
| 96 | <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> |
| 97 | <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> |
| 98 | <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> |
| 99 | <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache} |
| 100 | </prop> |
| 101 | <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop> |
| 102 | <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop> |
| 103 | <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop> |
| 104 | </props> |
| 105 | </property> |
| 106 | </bean> |
| 107 | <tx:annotation-driven proxy-target-class="true" |
| 108 | transaction-manager="transactionManager" /> |
| 109 | |
| 110 | <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> |
| 111 | <property name="entityManagerFactory" ref="entityManagerFactory" /> |
| 112 | </bean> |
| 113 | |
| 114 | <bean id="transactionTemplate" |
| 115 | class="org.springframework.transaction.support.TransactionTemplate"> |
| 116 | <constructor-arg ref="transactionManager" /> |
| 117 | </bean> |
| 118 | <bean id="txManager" |
| 119 | class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> |
| 120 | <property name="dataSource" ref="sqliteDataSource" /> |
| 121 | </bean> |
| 122 | |
| 123 | <!-- Initialization --> |
| 124 | <bean id="initializator" class="de.ids_mannheim.de.init.LiteInitializatorImpl" |
margaretha | 398f472 | 2019-01-09 19:07:20 +0100 | [diff] [blame^] | 125 | init-method="initTest"> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 126 | </bean> |
| 127 | <bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser" |
| 128 | scope="singleton" /> |
| 129 | |
| 130 | <!-- Krill --> |
| 131 | <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill"> |
| 132 | <constructor-arg value="${krill.indexDir}" /> |
| 133 | </bean> |
| 134 | |
| 135 | <!-- Filters --> |
margaretha | 398f472 | 2019-01-09 19:07:20 +0100 | [diff] [blame^] | 136 | <!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter" |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 137 | scope="singleton" /> |
margaretha | 398f472 | 2019-01-09 19:07:20 +0100 | [diff] [blame^] | 138 | --> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 139 | <!-- Authentication --> |
| 140 | <bean id="authenticationManager" |
| 141 | class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" /> |
| 142 | |
| 143 | <!-- Response handler --> |
| 144 | <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler"> |
| 145 | <constructor-arg index="0" name="iface" ref="kustvakt_auditing" /> |
| 146 | </bean> |
| 147 | |
| 148 | <!-- Controllers --> |
| 149 | <bean id="annotationController" |
| 150 | class="de.ids_mannheim.korap.web.controller.AnnotationController" /> |
| 151 | <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" /> |
| 152 | <bean id="statisticController" |
| 153 | class="de.ids_mannheim.korap.web.controller.StatisticController" /> |
| 154 | |
| 155 | <!-- Services --> |
| 156 | <bean id="annotationService" class="de.ids_mannheim.korap.service.AnnotationService"></bean> |
| 157 | <bean id="scopeService" |
| 158 | class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" /> |
| 159 | <bean id="searchService" class="de.ids_mannheim.korap.service.SearchService"></bean> |
| 160 | |
| 161 | <!-- DAO --> |
| 162 | <bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" /> |
| 163 | <bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" /> |
| 164 | |
| 165 | <!-- DTO Converter --> |
| 166 | <bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" /> |
| 167 | |
| 168 | <!-- Rewrite --> |
margaretha | 398f472 | 2019-01-09 19:07:20 +0100 | [diff] [blame^] | 169 | <bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler"> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame] | 170 | <constructor-arg ref="config" /> |
| 171 | </bean> |
| 172 | |
| 173 | |
| 174 | |
| 175 | <bean id="kustvakt_auditing" |
| 176 | class="de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing"> |
| 177 | </bean> |
| 178 | |
| 179 | </beans> |