<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<!--  Built in deployment server target -->

<beans>

     <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="ignoreUnresolvablePlaceholders">
            <value>true</value>
        </property>
        <property name="locations">
            <list>
                <value>classpath:alfresco/deployment/filesystem.properties</value>
            </list>
        </property>
    </bean>
 
    <!--  This is the common configuration for all file system receivers -->
    <bean id="fileSystemReceiverService" class="org.alfresco.deployment.impl.fsr.FileSystemReceiverServiceImpl"
          init-method="init">
          
        <!-- Will an error be thrown if the FSR overwrites files outside its control -->
        <property name="errorOnOverwrite"><value>${deployment.filesystem.errorOnOverwrite}</value></property>
        
        <!--  Where to store temporary data -->  
        <property name="dataDirectory">
            <value>${deployment.filesystem.datadir}</value>
        </property>
        
        <!--  Where to log information -->
        <property name="logDirectory">
            <value>${deployment.filesystem.logdir}</value>
        </property>
        

        
        <property name="commandQueue"><ref bean="deploymentReceiverCommandQueue" /></property>      
    </bean>
    	
	<!--  
	
	Defines and registers the deployment target with the name "default" 
	Which is a FileSystemDeploymentTarget with the "deploymentReceiverEngine"
	-->
	
	<bean class="org.alfresco.deployment.impl.server.DeploymentTargetRegistrationBean"
		init-method="register" >
		
		<property name="name"><value>${deployment.filesystem.default.name}</value></property>
		<property name="registry"><ref bean="deploymentReceiverEngine" /></property>
		
		<property name="target">
		    <bean class="org.alfresco.deployment.impl.fsr.FileSystemDeploymentTarget" init-method="init">
                	    <property name="rootDirectory"><value>${deployment.filesystem.default.rootdir}</value></property>
            	    	
            	    	 <!--  where to store meta data -->
        				<property name="metaDataDirectory">
            				<value>${deployment.filesystem.default.metadatadir}</value>
        				</property>
            	    	
            	    	<property name="autoFix"><value>${deployment.filesystem.autofix}</value></property> 
            	    	<property name="fileSystemReceiverService"><ref bean="fileSystemReceiverService"/></property> 
            	    	
            	    	<!--  how to authenticate for this particular target -->
						<property name="authenticator">
						<bean class="org.alfresco.repo.deploy.DeploymentReceiverAuthenticatorAuthenticationService"
							init-method="init">
							<property name="authenticationService">
								<ref bean="AuthenticationService" />
							</property>
						</bean>
						</property>
            	    	
        				<!-- Target Event Handlers
        				<property name="prepare">
                        	<list>
     							<bean class="org.alfresco.deployment.SampleRunnable"/>
                         	</list>
                     	</property>
                     	
                     	<property name="postCommit">
                        	<list>
     							<bean class="org.alfresco.deployment.SampleRunnable"/>
                         	</list>
                     	</property>
        				-->			
    	    </bean>
       </property>
   </bean>
    
</beans>