<?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:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:task="http://www.springframework.org/schema/task"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
		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-3.0.xsd
		http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd
		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
        
	<context:property-placeholder location="classpath:app.properties"/>
	
	<aop:aspectj-autoproxy proxy-target-class="true"/>
    
    <mvc:annotation-driven />
    <context:component-scan base-package="com.mindink"/>
    <tx:annotation-driven transaction-manager="txManager" />
    
    <mvc:resources mapping="/img/**" location="/img/"/>
    <mvc:resources mapping="/css/**" location="/css/"/>    
    <mvc:resources mapping="/fonts/**" location="/fonts/"/>
    <mvc:resources mapping="/js/**" location="/js/"/>    
    <mvc:resources mapping="/html/**" location="/html/"/>
    <mvc:resources mapping="/views/**" location="/views/"/>
    <mvc:resources mapping="/partials/**" location="/partials/"/>

	<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
	        <!-- Example: a logical view name of 'showMessage' is mapped to '/WEB-INF/jsp/showMessage.jsp' -->
	        <property name="prefix" value="/WEB-INF/view/"/>
	        <property name="suffix" value=".jsp"/>
	</bean>

	<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
    	<!-- one of the properties available; the maximum file size in bytes -->
		<property name="maxUploadSize" value="${upload.maxfilesize}"/> 
	</bean>

    <task:annotation-driven executor="mindinkTaskExecutor" scheduler="mindinkTaskScheduler"/>

	<task:executor id="mindinkTaskExecutor" 
               pool-size="${task.executor.pool_size}"
               queue-capacity="${task.executor.queue_size}"
               rejection-policy="DISCARD"/>
               
    <task:scheduler id="mindinkTaskScheduler" pool-size="${task.scheduler.pool_size}"/>
    
    <bean class="org.springframework.social.connect.web.ProviderSignInController">
		<constructor-arg ref="connectionFactoryLocator" />
		<constructor-arg ref="mindinkJdbcUsersConnectionRepository" />		
		<constructor-arg ref="mindinkSocialSignInAdapter"/>
		<property name="postSignInUrl" value="${mindink.hostname}"/>
		<property name="applicationUrl" value="${mindink.hostname}"/>
	</bean>

</beans>
