<?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:jee="http://www.springframework.org/schema/jee"
		xmlns:jaxws="http://cxf.apache.org/jaxws"
		xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
				http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
				http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd 
				http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
				http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd" >

	<!-- ========================= DAO DEFINITIONS: IBATIS IMPLEMENTATIONS ========================= -->

	<bean id="bandiDao"
		class="it.maggioli.eldasoft.sil.gare.db.dao.ibatis.SqlMapBandiDao">
		<property name="dataSource" ref="dataSource" />
		<property name="sqlMapClient" ref="sqlMapClient" />
		<property name="dbms">
			<bean factory-bean="dbmsSpecs" factory-method="getInternalDbmsCode" />
		</property>
	</bean>

	<bean id="esitiDao"
		class="it.maggioli.eldasoft.sil.gare.db.dao.ibatis.SqlMapEsitiDao">
		<property name="dataSource" ref="dataSource" />
		<property name="sqlMapClient" ref="sqlMapClient" />
		<property name="dbms">
			<bean factory-bean="dbmsSpecs" factory-method="getInternalDbmsCode" />
		</property>
	</bean>

	<bean id="avvisiDao"
		class="it.maggioli.eldasoft.sil.gare.db.dao.ibatis.SqlMapAvvisiDao">
		<property name="dataSource" ref="dataSource" />
		<property name="sqlMapClient" ref="sqlMapClient" />
		<property name="dbms">
			<bean factory-bean="dbmsSpecs" factory-method="getInternalDbmsCode" />
		</property>
	</bean>

	<bean id="impreseGaraDao"
		class="it.maggioli.eldasoft.sil.gare.db.dao.ibatis.SqlMapImpreseDao">
		<property name="dataSource" ref="dataSource" />
		<property name="sqlMapClient" ref="sqlMapClient" />
	</bean>

	<bean id="cataloghiDao"
		class="it.maggioli.eldasoft.sil.gare.db.dao.ibatis.SqlMapCataloghiDao">
		<property name="dataSource" ref="dataSource" />
		<property name="sqlMapClient" ref="sqlMapClient" />
		<property name="dbms">
			<bean factory-bean="dbmsSpecs" factory-method="getInternalDbmsCode" />
		</property>
	</bean>

	<bean id="contrattiDao"
		class="it.maggioli.eldasoft.sil.gare.db.dao.ibatis.SqlMapContrattiDao">
		<property name="dataSource" ref="dataSource" />
		<property name="sqlMapClient" ref="sqlMapClient" />
		<property name="dbms">
			<bean factory-bean="dbmsSpecs" factory-method="getInternalDbmsCode" />
		</property>
	</bean>

	<!-- ========================= BEAN DEFINITIONS ========================= -->	
	<bean id="bandiManager" parent="defaultTransactionProxy">
		<property name="target">
			<bean class="it.maggioli.eldasoft.sil.gare.bl.BandiManager">
				<property name="bandiDao" ref="bandiDao" />
			</bean>
		</property>
	</bean>
	
	<bean id="esitiManager" parent="defaultTransactionProxy">
		<property name="target">
			<bean class="it.maggioli.eldasoft.sil.gare.bl.EsitiManager">
				<property name="esitiDao" ref="esitiDao" />
			</bean>
		</property>
	</bean>
	
	<bean id="avvisiManager" parent="defaultTransactionProxy">
		<property name="target">
			<bean class="it.maggioli.eldasoft.sil.gare.bl.AvvisiManager">
				<property name="avvisiDao" ref="avvisiDao" />
			</bean>
		</property>
	</bean>
	
	<bean id="impreseGaraManager" parent="defaultTransactionProxy">
		<property name="target">
			<bean class="it.maggioli.eldasoft.sil.gare.bl.ImpreseManager">
				<property name="impreseGaraDao" ref="impreseGaraDao" />
			</bean>
		</property>
	</bean>
	
	<bean id="cataloghiManager" parent="defaultTransactionProxy">
		<property name="target">
			<bean class="it.maggioli.eldasoft.sil.gare.bl.CataloghiManager">
				<property name="cataloghiDao" ref="cataloghiDao" />
				<property name="bandiDao" ref="bandiDao" />
			</bean>
		</property>
	</bean>

	<bean id="contrattiManager" parent="defaultTransactionProxy">
		<property name="target">
			<bean class="it.maggioli.eldasoft.sil.gare.bl.ContrattiManager">
				<property name="contrattiDao" ref="contrattiDao" />
			</bean>
		</property>
	</bean>

 	<!-- implementazione del web service WSGareAppalto
 	     (precedentemente noto come gareAppaltoFacade) -->
	<bean id="WSGareAppalto"
		class="it.maggioli.eldasoft.sil.gare.ws.WSGareAppaltoSoapImpl">		
		<property name="bandiManager" ref="bandiManager" />
		<property name="esitiManager" ref="esitiManager" />
		<property name="avvisiManager" ref="avvisiManager" />
		<property name="impreseGaraManager" ref="impreseGaraManager" />
		<property name="cataloghiManager" ref="cataloghiManager" />
		<property name="contrattiManager" ref="contrattiManager" />
		<property name="datiCodificatiManager" ref="datiCodificatiManager" />
	</bean>
	
	<!-- ========================= WEB SERVICE DEFINITIONS ========================= -->

	<!-- ATTENZIONE: il wizard per la generazione bottom-up genera un <jaxws:endpoint ...>
		con il parametro xmlns:tns="http://www.eldasoft.it/WSOperazioniGenerali/"
		non corretto. E' necessario quindi sostituire il valore dal POM.XML
		altrimenti la webapp va in errore all'avvio.		
		implementor="#WSGareAppalto" indica quale bean è collegato allo
		endpoint del servizio.
		NB: per eseguire il servizio senza WSDL è necessario omettere il 
		    parametro wsdlLocation qui e nell'annotazione dell'implementazione
		    del servizio.
	-->
	<jaxws:endpoint 
		xmlns:tns="http://www.eldasoft.it/sil/WSGareAppalto/"
		id="wsgareappaltosoap" 
		implementor="#WSGareAppalto"
		endpointName="tns:WSGareAppaltoSOAP"
		serviceName="tns:WSGareAppaltoSoap" 
		address="/WSGareAppaltoSOAP">
		<jaxws:features>
			<!-- Enable/Disable message payload logging -->
			<!--  <bean class="org.apache.cxf.feature.LoggingFeature" />   -->
		</jaxws:features>
	</jaxws:endpoint>	
	
</beans>