<?xml version="1.0"?>
<!--

-->
<project name="deploy_controller" default="import_ear" basedir=".">
	
	<property file="./cfg/ant.properties"/>
	<property name="cpath" value="${ant_lib.dir}/tc~je~dc_ant.jar: 
								${client_lib.dir}/sap.com~tc~exception~impl.jar:
								${client_lib.dir}/sap.com~tc~je~clientlib~impl.jar:
								${client_lib.dir}/sap.com~tc~logging~java~impl.jar:
								${jee5_lib.dir}/sap.com~tc~je~deployment14~impl.jar"/>
	

	<taskdef name="sapdeploy" 
					 classname="com.sap.engine.services.dc.ant.deploy.SAPDeploy" 
					 classpath="${cpath}"/>
	<taskdef name="sapundeploy" 
					 classname="com.sap.engine.services.dc.ant.undeploy.SAPUndeploy" 
					 classpath="${cpath}"/>
	<taskdef name="sapparams" 
					 classname="com.sap.engine.services.dc.ant.params.SAPParams" 
					 classpath="${cpath}"/>
			
	<target name="import_ear">
		<sapimportear>
			<fileset dir="c:/temp">
			</fileset>
		</sapimportear>	
	</target>
	
	<target name="deploy">
    <!-- versionrule: "all" | "same_and_lower" | "lower" -->
		<sapdeploy versionrule="all">
			<!-- erroraction:   "prerequisites" | "deploy" | "undeploy" -->
			<!-- errorstrategy: "stop" | "skip" -->
			<saperrorhandling erroraction="prerequisites" errorstrategy="stop"/>
			<saperrorhandling erroraction="deploy" errorstrategy="stop"/>
			
			<!-- specify absolute path to the archives -->
			<fileset dir="c:/temp">
			</fileset>

			<sapj2eeengine
				serverhost="localhost"
				serverport="50004"
				username="administrator"
				userpassword="*****"
			/>
		</sapdeploy>
	</target>
	
	<target name="undeploy">
            <!-- undeploy strategy: "IfDependingStop" | "UndeployDepending" -->
		<sapundeploy undeploystrategy="IfDependingStop">
			<!-- erroraction:   "prerequisites" | "deploy" | "undeploy" -->
			<!-- errorstrategy: "stop" | "skip" -->
			<saperrorhandling erroraction="prerequisites" errorstrategy="stop"/>
			<saperrorhandling erroraction="undeploy" errorstrategy="stop"/>
			
			<!-- specify absolute path to the file containing list with components for undeploy -->
			<sapundeploylist listfilepath="c:/temp/UndeployList.txt"/>
			
			<sapj2eeengine
				serverhost="localhost"
				serverport="51104"
				username="administrator"
				userpassword="*****"
			/>
		</sapundeploy>
	</target>
	
	<target name="params">
	    <!-- remove: "yes" | "no" -->
		<sapparams remove="no">
			
			<!-- specify absolute path to the file with params list -->
			<sapparamslist listfilepath="c:/temp/ParamsList.txt"/>
			
			<sapj2eeengine
				serverhost="localhost"
				serverport="51104"
				username="administrator"
				userpassword="*****"
			/>
		</sapparams>
	</target>
	
</project>