<commit_before><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:tx="http://www.springframework.org/schema/tx" 
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd"
	default-lazy-init="true"
	default-autowire="byName">
	
	<import resource="classpath:org/openforis/collect/application-context-core.xml"/>
	
	<bean name="messageSource"
		class="org.springframework.context.support.ResourceBundleMessageSource">
		<property name="basenames">
			<list>
				<value>org/openforis/collect/resourcebundles/validation</value>
				<value>org/openforis/collect/resourcebundles/datacleansing</value>
			</list>
		</property>
	</bean>
	
	<!-- Override scope for Collect core sessionRecordFileManager bean, use "session" scope -->
	<bean id="recordSessionManager" class="org.openforis.collect.manager.RecordSessionManager"
		scope="session" />
	<bean id="sessionManager" class="org.openforis.collect.manager.SessionManager" />
	<bean id="sessionRecordFileManager" class="org.openforis.collect.manager.SessionRecordFileManager" 
		init-method="init" />
	<bean id="volatileRecordIndexManager"
		class="org.openforis.collect.remoting.service.recordindex.VolatileRecordIndexManager"
		init-method="init" scope="session" lazy-init="false" autowire="byName" />
<!-- 	<bean id="userManager" class="org.openforis.collect.manager.ClientUserManager" /> -->
<!-- 	<bean id="userGroupManager" class="org.openforis.collect.manager.ClientUserGroupManager" /> -->
	<bean id="userManager" class="org.openforis.collect.manager.LocalUserManager" />
	<bean id="userGroupManager" class="org.openforis.collect.manager.LocalUserGroupManager" />
	
	<!-- ===================================== -->
	<!-- GraniteDs services -->
	<!-- ===================================== -->
	<bean id="codeListSessionService"
		class="org.openforis.collect.remoting.service.CodeListSessionService"
		scope="session" />
	<bean id="codeListImportService"
		class="org.openforis.collect.remoting.service.CodeListImportService"
		autowire="byName" init-method="init" />
	<bean id="collectInfoService"
		class="org.openforis.collect.remoting.service.CollectInfoService"
		autowire="byName" />
	<bean id="configurationService"
		class="org.openforis.collect.remoting.service.ConfigurationService"
		autowire="byName" init-method="init" />
	<bean id="csvDataImportService"
		class="org.openforis.collect.remoting.service.CSVDataImportService"
		autowire="byName" init-method="init" scope="session" />
	<bean id="dataService" class="org.openforis.collect.remoting.service.DataService"
		autowire="byName" scope="session" />
	<bean id="dataExportService"
		class="org.openforis.collect.remoting.service.DataExportService"
		autowire="byName" scope="session" />
	<bean id="dataImportService"
		class="org.openforis.collect.remoting.service.DataImportService"
		autowire="byName" scope="session" />
	<bean id="logoService" class="org.openforis.collect.remoting.service.LogoService"
		autowire="byName" />
	<bean id="modelService" class="org.openforis.collect.remoting.service.ModelService"
		autowire="byName" />
	<bean id="recordIndexService"
		class="org.openforis.collect.remoting.service.recordindex.RecordIndexService"
		autowire="byName" scope="session" />
	<bean id="samplingDesignService"
		class="org.openforis.collect.remoting.service.SamplingDesignService"
		autowire="byName" />
	<bean id="samplingDesignImportService"
		class="org.openforis.collect.remoting.service.SamplingDesignImportService"
		autowire="byName" init-method="init" />
	<bean id="collectSessionService" class="org.openforis.collect.remoting.service.SessionService"
		autowire="byName" />
	<bean id="speciesService" class="org.openforis.collect.remoting.service.SpeciesService"
		autowire="byName" />
	<bean id="speciesImportService"
		class="org.openforis.collect.remoting.service.SpeciesImportService"
		autowire="byName" init-method="init" />
	<bean id="userService" class="org.openforis.collect.remoting.service.UserService"
		autowire="byName" />
	<bean id="userSessionService" class="org.openforis.collect.remoting.service.UserSessionService"
		autowire="byName" scope="session" />
		
<!-- 	<bean id="dataRestoreService" class="org.openforis.collect.remoting.service.io.data.restore.DataRestoreServiceImpl" /> -->
	
<!-- 	<bean class="org.springframework.remoting.rmi.RmiServiceExporter"> -->
<!-- 		<property name="serviceName" value="dataRestoreService" /> -->
<!-- 		<property name="service" ref="dataRestoreService" /> -->
<!-- 		<property name="serviceInterface" value="org.openforis.collect.remoting.service.io.data.restore.RestoreService"/> -->
<!-- 		<property name="registryPort" value="1099" /> -->
<!-- 	</bean> -->
		
	<!-- ===================================== -->
	<!-- Security -->
	<!-- ===================================== -->
	
	<bean id="userDetailsService"	class="org.openforis.collect.security.CollectUserDetailsService" />
	
	<!-- Survey Context -->
	<bean id="coordinateOperations" class="org.openforis.collect.geospatial.GeoToolsCoordinateOperations"
		init-method="initialize" />
	
	<bean id="collectSurveyContext" class="org.openforis.collect.model.CollectSurveyContext">
	    <constructor-arg ref="expressionFactory" />
	    <constructor-arg ref="validator" />
	    <property name="externalCodeListProvider" ref="externalCodeListProvider" />
   		<property name="codeListService" ref="codeListService" />
   		<property name="speciesListService" ref="speciesListService" />
   		<property name="coordinateOperations" ref="coordinateOperations" />
	</bean>
	
	<!-- ===================================== -->
	<!-- =============== RDB ================= -->
	<!-- ===================================== -->
	
	<!-- deprecated -->
	<bean id="rdbPublisher" class="org.openforis.collect.relational.CollectRDBPublisher" />
	
    <bean id="messageBroker" class="org.openforis.collect.event.ConfiguredMessageBroker" 
    		init-method="start" destroy-method="stop">
        <constructor-arg ref="dataSource" />
    </bean>

	<bean id="eventQueue" class="org.openforis.collect.event.EventBrokerEventQueue">
		<constructor-arg>
			 <bean class="org.openforis.rmb.spring.SpringMessageQueue">
		        <constructor-arg ref="messageBroker"/>
		        <constructor-arg value="collect_events"/>
		        <constructor-arg>
		            <list>
		                <bean class="org.openforis.rmb.spring.SpringMessageConsumer">
		                    <constructor-arg value="collect_reporting_repository_event_consumer"/>
		                    <constructor-arg>
								<bean class="org.openforis.collect.event.RepositoryEventHandler">
									<constructor-arg ref="reportingRepositories" />
								</bean>
		                    </constructor-arg>
		                    <property name="messagesHandledInParallel" value="1"/>
		                </bean>
		            </list>
		        </constructor-arg>
		    </bean>
		</constructor-arg>
		<!-- Event Queue DISABLED by default -->
		<property name="enabled" value="false" />
	</bean>
	
	<bean id="reportingRepositories" class="org.openforis.collect.relational.RDBReportingRepositories"
			lazy-init="false" init-method="init">
		<constructor-arg ref="surveyManager" />
		<constructor-arg ref="recordManager" />
		<constructor-arg ref="collectLocalRDBStorageManager" />
		<constructor-arg ref="mondrianSchemaStorageManager" />
		<constructor-arg ref="saikuDatasourceStorageManager" />
	</bean>
	
	<bean id="rdbMonitor" class="org.openforis.collect.relational.CollectRDBMonitor"
			lazy-init="false" init-method="init" />

	<bean id="sessionEventDispatcher" class="org.openforis.collect.manager.SessionEventDispatcher"
		scope="session">
		<constructor-arg ref="eventQueue" />
	</bean>

<!-- 	<bean id="recordEventBatchPublisher" class="org.openforis.collect.io.data.RecordEventBatchPublisher" -->
<!-- 		scope="prototype"> -->
<!-- 		<constructor-arg ref="eventQueue" /> -->
<!-- 	</bean> -->
	
	<bean id="commandDispatcher" class="org.openforis.collect.command.SpringCommandDispatcher" 
		init-method="init" />
</beans>
<commit_msg>Use remote user/user group services<commit_after><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:tx="http://www.springframework.org/schema/tx" 
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd"
	default-lazy-init="true"
	default-autowire="byName">
	
	<import resource="classpath:org/openforis/collect/application-context-core.xml"/>
	
	<bean name="messageSource"
		class="org.springframework.context.support.ResourceBundleMessageSource">
		<property name="basenames">
			<list>
				<value>org/openforis/collect/resourcebundles/validation</value>
				<value>org/openforis/collect/resourcebundles/datacleansing</value>
			</list>
		</property>
	</bean>
	
	<!-- Override scope for Collect core sessionRecordFileManager bean, use "session" scope -->
	<bean id="recordSessionManager" class="org.openforis.collect.manager.RecordSessionManager"
		scope="session" />
	<bean id="sessionManager" class="org.openforis.collect.manager.SessionManager" />
	<bean id="sessionRecordFileManager" class="org.openforis.collect.manager.SessionRecordFileManager" 
		init-method="init" />
	<bean id="volatileRecordIndexManager"
		class="org.openforis.collect.remoting.service.recordindex.VolatileRecordIndexManager"
		init-method="init" scope="session" lazy-init="false" autowire="byName" />
	<bean id="userManager" class="org.openforis.collect.manager.ClientUserManager" />
	<bean id="userGroupManager" class="org.openforis.collect.manager.ClientUserGroupManager" />
<!-- 	<bean id="userManager" class="org.openforis.collect.manager.LocalUserManager" /> -->
<!-- 	<bean id="userGroupManager" class="org.openforis.collect.manager.LocalUserGroupManager" /> -->
	
	<!-- ===================================== -->
	<!-- GraniteDs services -->
	<!-- ===================================== -->
	<bean id="codeListSessionService"
		class="org.openforis.collect.remoting.service.CodeListSessionService"
		scope="session" />
	<bean id="codeListImportService"
		class="org.openforis.collect.remoting.service.CodeListImportService"
		autowire="byName" init-method="init" />
	<bean id="collectInfoService"
		class="org.openforis.collect.remoting.service.CollectInfoService"
		autowire="byName" />
	<bean id="configurationService"
		class="org.openforis.collect.remoting.service.ConfigurationService"
		autowire="byName" init-method="init" />
	<bean id="csvDataImportService"
		class="org.openforis.collect.remoting.service.CSVDataImportService"
		autowire="byName" init-method="init" scope="session" />
	<bean id="dataService" class="org.openforis.collect.remoting.service.DataService"
		autowire="byName" scope="session" />
	<bean id="dataExportService"
		class="org.openforis.collect.remoting.service.DataExportService"
		autowire="byName" scope="session" />
	<bean id="dataImportService"
		class="org.openforis.collect.remoting.service.DataImportService"
		autowire="byName" scope="session" />
	<bean id="logoService" class="org.openforis.collect.remoting.service.LogoService"
		autowire="byName" />
	<bean id="modelService" class="org.openforis.collect.remoting.service.ModelService"
		autowire="byName" />
	<bean id="recordIndexService"
		class="org.openforis.collect.remoting.service.recordindex.RecordIndexService"
		autowire="byName" scope="session" />
	<bean id="samplingDesignService"
		class="org.openforis.collect.remoting.service.SamplingDesignService"
		autowire="byName" />
	<bean id="samplingDesignImportService"
		class="org.openforis.collect.remoting.service.SamplingDesignImportService"
		autowire="byName" init-method="init" />
	<bean id="collectSessionService" class="org.openforis.collect.remoting.service.SessionService"
		autowire="byName" />
	<bean id="speciesService" class="org.openforis.collect.remoting.service.SpeciesService"
		autowire="byName" />
	<bean id="speciesImportService"
		class="org.openforis.collect.remoting.service.SpeciesImportService"
		autowire="byName" init-method="init" />
	<bean id="userService" class="org.openforis.collect.remoting.service.UserService"
		autowire="byName" />
	<bean id="userSessionService" class="org.openforis.collect.remoting.service.UserSessionService"
		autowire="byName" scope="session" />
		
<!-- 	<bean id="dataRestoreService" class="org.openforis.collect.remoting.service.io.data.restore.DataRestoreServiceImpl" /> -->
	
<!-- 	<bean class="org.springframework.remoting.rmi.RmiServiceExporter"> -->
<!-- 		<property name="serviceName" value="dataRestoreService" /> -->
<!-- 		<property name="service" ref="dataRestoreService" /> -->
<!-- 		<property name="serviceInterface" value="org.openforis.collect.remoting.service.io.data.restore.RestoreService"/> -->
<!-- 		<property name="registryPort" value="1099" /> -->
<!-- 	</bean> -->
		
	<!-- ===================================== -->
	<!-- Security -->
	<!-- ===================================== -->
	
	<bean id="userDetailsService"	class="org.openforis.collect.security.CollectUserDetailsService" />
	
	<!-- Survey Context -->
	<bean id="coordinateOperations" class="org.openforis.collect.geospatial.GeoToolsCoordinateOperations"
		init-method="initialize" />
	
	<bean id="collectSurveyContext" class="org.openforis.collect.model.CollectSurveyContext">
	    <constructor-arg ref="expressionFactory" />
	    <constructor-arg ref="validator" />
	    <property name="externalCodeListProvider" ref="externalCodeListProvider" />
   		<property name="codeListService" ref="codeListService" />
   		<property name="speciesListService" ref="speciesListService" />
   		<property name="coordinateOperations" ref="coordinateOperations" />
	</bean>
	
	<!-- ===================================== -->
	<!-- =============== RDB ================= -->
	<!-- ===================================== -->
	
	<!-- deprecated -->
	<bean id="rdbPublisher" class="org.openforis.collect.relational.CollectRDBPublisher" />
	
    <bean id="messageBroker" class="org.openforis.collect.event.ConfiguredMessageBroker" 
    		init-method="start" destroy-method="stop">
        <constructor-arg ref="dataSource" />
    </bean>

	<bean id="eventQueue" class="org.openforis.collect.event.EventBrokerEventQueue">
		<constructor-arg>
			 <bean class="org.openforis.rmb.spring.SpringMessageQueue">
		        <constructor-arg ref="messageBroker"/>
		        <constructor-arg value="collect_events"/>
		        <constructor-arg>
		            <list>
		                <bean class="org.openforis.rmb.spring.SpringMessageConsumer">
		                    <constructor-arg value="collect_reporting_repository_event_consumer"/>
		                    <constructor-arg>
								<bean class="org.openforis.collect.event.RepositoryEventHandler">
									<constructor-arg ref="reportingRepositories" />
								</bean>
		                    </constructor-arg>
		                    <property name="messagesHandledInParallel" value="1"/>
		                </bean>
		            </list>
		        </constructor-arg>
		    </bean>
		</constructor-arg>
		<!-- Event Queue DISABLED by default -->
		<property name="enabled" value="false" />
	</bean>
	
	<bean id="reportingRepositories" class="org.openforis.collect.relational.RDBReportingRepositories"
			lazy-init="false" init-method="init">
		<constructor-arg ref="surveyManager" />
		<constructor-arg ref="recordManager" />
		<constructor-arg ref="collectLocalRDBStorageManager" />
		<constructor-arg ref="mondrianSchemaStorageManager" />
		<constructor-arg ref="saikuDatasourceStorageManager" />
	</bean>
	
	<bean id="rdbMonitor" class="org.openforis.collect.relational.CollectRDBMonitor"
			lazy-init="false" init-method="init" />

	<bean id="sessionEventDispatcher" class="org.openforis.collect.manager.SessionEventDispatcher"
		scope="session">
		<constructor-arg ref="eventQueue" />
	</bean>

<!-- 	<bean id="recordEventBatchPublisher" class="org.openforis.collect.io.data.RecordEventBatchPublisher" -->
<!-- 		scope="prototype"> -->
<!-- 		<constructor-arg ref="eventQueue" /> -->
<!-- 	</bean> -->
	
	<bean id="commandDispatcher" class="org.openforis.collect.command.SpringCommandDispatcher" 
		init-method="init" />
</beans>

{'fraction_non_alphanumeric': 0.1865466223190733, 'fraction_numerical': 0.002408533088656956, 'mean_word_length': 4.832441471571906, 'pattern_counts': {'":': 0, '<': 251, '<?xml version=': 2, '>': 251, 'https://': 0, 'lorem ipsum': 0, 'www.': 28, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1569927', 'n_tokens_mistral': 5671, 'n_tokens_neox': 5262, 'n_words': 604}