<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
	
	<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
		<property name="host" value="${mail.host}"/>
		<property name="port" value="${mail.port}"/>
		<property name="username" value="${mail.username}"/>
		<property name="password" value="${mail.password}"/>
		<property name="defaultEncoding" value="UTF-8"/>
		<property name="javaMailProperties">
			<props>
				<prop key="mail.smtp.auth">${mail.useauth}</prop>
				<prop key="mail.smtp.starttls.enable">${mail.usessl}</prop>
			</props>
		</property>
	</bean>
	
	<bean id="mailer" class="info.bukova.isspst.mail.MailerWithAttachement">
		<constructor-arg ref="mailSender"/>
		<property name="from" value="${mail.from}"/>
		<property name="overrideFrom" value="${mail.overrideFrom}"/>
	</bean>
	
	<bean id="simpleMailer" class="info.bukova.isspst.mail.SimpleMailer">
		<constructor-arg ref="mailSender"/>
		<property name="from" value="${mail.from}"/>
	</bean>
	
	<bean id="messageBuilder" class="info.bukova.isspst.mail.EntityMessageBuilder">
		<property name="html" value="true"/>
		<property name="urlResolverHolder" ref="urlResolverHolder"/>
	</bean>
	
	<bean id="commonUrlResolver" class="info.bukova.isspst.CommonUrlResolver"/>
	
	<bean id="requirementUrlResolver" class="info.bukova.isspst.RequirementUrlResolver"/>
	
	<bean id="urlResolverHolder" class="info.bukova.isspst.UrlResolverHolder">
		<constructor-arg ref="commonUrlResolver"/>
		<property name="resolvers">
			<map>
				<entry key="#{T(info.bukova.isspst.data.Requirement)}" value-ref="requirementUrlResolver"/>
			</map>
		</property>
	</bean>
	
<!-- 	<bean id="mailer" class="info.bukova.rsfaktura.services.mail.ThreadMailer"> -->
<!-- 		<constructor-arg ref="attachementMailer"/> -->
<!-- 	</bean> -->
	
<!-- 	<bean id="attachementMailer" class="info.bukova.rsfaktura.services.mail.AttachementMailer"> -->
<!-- 		<constructor-arg ref="tmpStorage"/> -->
<!-- 		<property name="from" value="josef.rokos@gmail.com"/> -->
<!-- 		<property name="sender" ref="mailSender"/> -->
<!-- 	</bean> -->
	
<!-- 	<bean id="messageBuilder" class="info.bukova.rsfaktura.services.mail.MailMessageBuilder"> -->
<!-- 		<constructor-arg ref="tmpStorage"/> -->
<!-- 	</bean> -->

</beans>
