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 | |
| 14 | |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame^] | 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" /> |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 18 | <context:annotation-config /> |
| 19 | |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame^] | 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:lite-jdbc.properties</value> |
| 26 | <value>file:./lite-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> |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 31 | </property> |
| 32 | </bean> |
| 33 | |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame^] | 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> |
margaretha | 56e8e55 | 2017-12-05 16:31:21 +0100 | [diff] [blame] | 43 | </bean> |
margaretha | 2df0660 | 2018-11-14 19:10:30 +0100 | [diff] [blame^] | 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> |
| 68 | <!--<property name="initialSize" value="2"/> --> |
| 69 | <!--<property name="poolPreparedStatements" value="true"/> --> |
| 70 | </bean> |
| 71 | |
| 72 | <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate"> |
| 73 | <property name="baselineOnMigrate" value="true" /> |
| 74 | <!-- <property name="validateOnMigrate" value="false" /> --> |
| 75 | <!-- <property name="cleanOnValidationError" value="true" /> --> |
| 76 | <property name="locations" value="${jdbc.schemaPath}" /> |
| 77 | <property name="dataSource" ref="sqliteDataSource" /> |
| 78 | </bean> |
| 79 | |
| 80 | <bean id="entityManagerFactory" |
| 81 | class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> |
| 82 | <property name="dataSource" ref="sqliteDataSource" /> |
| 83 | |
| 84 | <property name="packagesToScan"> |
| 85 | <array> |
| 86 | <value>de.ids_mannheim.korap.entity</value> |
| 87 | </array> |
| 88 | </property> |
| 89 | <property name="jpaVendorAdapter"> |
| 90 | <bean id="jpaVendorAdapter" |
| 91 | class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> |
| 92 | <property name="databasePlatform" value="${hibernate.dialect}" /> |
| 93 | </bean> |
| 94 | </property> |
| 95 | <property name="jpaProperties"> |
| 96 | <props> |
| 97 | <prop key="hibernate.dialect">${hibernate.dialect}</prop> |
| 98 | <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> |
| 99 | <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> |
| 100 | <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> |
| 101 | <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache} |
| 102 | </prop> |
| 103 | <prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop> |
| 104 | <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop> |
| 105 | <prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop> |
| 106 | </props> |
| 107 | </property> |
| 108 | </bean> |
| 109 | <tx:annotation-driven proxy-target-class="true" |
| 110 | transaction-manager="transactionManager" /> |
| 111 | |
| 112 | <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> |
| 113 | <property name="entityManagerFactory" ref="entityManagerFactory" /> |
| 114 | </bean> |
| 115 | |
| 116 | <bean id="transactionTemplate" |
| 117 | class="org.springframework.transaction.support.TransactionTemplate"> |
| 118 | <constructor-arg ref="transactionManager" /> |
| 119 | </bean> |
| 120 | <bean id="txManager" |
| 121 | class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> |
| 122 | <property name="dataSource" ref="sqliteDataSource" /> |
| 123 | </bean> |
| 124 | |
| 125 | <!-- Initialization --> |
| 126 | <bean id="initializator" class="de.ids_mannheim.de.init.LiteInitializatorImpl" |
| 127 | init-method="init"> |
| 128 | </bean> |
| 129 | <bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser" |
| 130 | scope="singleton" /> |
| 131 | |
| 132 | <!-- Krill --> |
| 133 | <bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill"> |
| 134 | <constructor-arg value="${krill.indexDir}" /> |
| 135 | </bean> |
| 136 | |
| 137 | <!-- Filters --> |
| 138 | <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter" |
| 139 | scope="singleton" /> |
| 140 | |
| 141 | <!-- Authentication --> |
| 142 | <bean id="authenticationManager" |
| 143 | class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" /> |
| 144 | |
| 145 | <!-- Response handler --> |
| 146 | <bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler"> |
| 147 | <constructor-arg index="0" name="iface" ref="kustvakt_auditing" /> |
| 148 | </bean> |
| 149 | |
| 150 | <!-- Controllers --> |
| 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" /> |
| 156 | |
| 157 | <!-- Services --> |
| 158 | <bean id="annotationService" class="de.ids_mannheim.korap.service.AnnotationService"></bean> |
| 159 | <bean id="scopeService" |
| 160 | class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" /> |
| 161 | <bean id="searchService" class="de.ids_mannheim.korap.service.SearchService"></bean> |
| 162 | |
| 163 | <!-- DAO --> |
| 164 | <bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" /> |
| 165 | <bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" /> |
| 166 | |
| 167 | <!-- DTO Converter --> |
| 168 | <bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" /> |
| 169 | |
| 170 | <!-- Rewrite --> |
| 171 | <bean id="rewriteHandler" class="de.ids_mannheim.korap.resource.rewrite.RewriteHandler"> |
| 172 | <constructor-arg ref="config" /> |
| 173 | </bean> |
| 174 | |
| 175 | |
| 176 | |
| 177 | <bean id="kustvakt_auditing" |
| 178 | class="de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing"> |
| 179 | </bean> |
| 180 | |
margaretha | f92485a | 2017-11-14 17:12:36 +0100 | [diff] [blame] | 181 | </beans> |