<?xml version="1.0"?>
<project name="ListSchedule" default="example1">
	
	<path id="classpath">
		<pathelement location="../../classes"/>
		<pathelement location="../../lib/log4j-1.2.8.jar"/>
	</path>
	
	<taskdef name="listsched" classname="org.treesched.examples.ListSchedules">
		<classpath refid="classpath"/>
	</taskdef>

	<target name="example1">

		<listsched from="1-dec-05 00:00" to="2-dec-05 12:00">
			<schedule>
				<!-- 
					This schedule provides intervals of 30 minutes 
					from 11pm until 1am every day. 
				-->
				<time from="22:00" to="02:00">
					<interval interval="00:30"/>
				</time>
			</schedule>
		</listsched>

	</target>

	<target name="example2">

		<listsched from="1-dec-05 00:00" to="1-dec-05 12:00">
			<schedule>
				<!-- 
					This schedule provides 5 intervals of 15 minutes.
				-->
				<count count="5">
					<interval interval="00:15"/>
				</count>
			</schedule>
		</listsched>

	</target>

	<target name="example3">

		<listsched from="1-dec-05 12:00" to="10-dec-05 12:00">
			<schedule>
				<!-- 
					The working week.

					This schedule returns and interval which is every 
					day, Monday to Friday, 9am to 5pm.
				-->
				<day-of-week from="MON" to="FRI">
					<time from="09:00" to="17:00"/>
				</day-of-week>
			</schedule>
		</listsched>

	</target>
	
	<target name="example4">

		<listsched from="22-dec-04 12:00" to="2-jan-05 12:00">
			<schedule>
				<!-- 
					Holidays.
					
					The same as the above with holidays. 
				-->
	
				<broken>
					<schedule>
						<day-of-week from="MON" to="FRI">
							<time from="09:00" to="17:00"/>
						</day-of-week>
					</schedule>
					<breaks>
						<date on="27-DEC-04"/>
						<date on="28-DEC-04"/>
						<date on="03-JAN-05"/>
						<date on="25-MAR-05"/>
						<date on="28-MAR-05"/>
						<date on="02-MAY-05"/>
						<date on="30-MAY-05"/>
						<date on="29-AUG-05"/>
						<date on="26-DEC-05"/>
						<date on="27-DEC-05"/>
					</breaks>
				</broken>
			
			</schedule>
		</listsched>

	</target>
	
	<target name="example5">

		<listsched from="10-jul-04 12:00" to="10-jul-05 12:00">
			<schedule>		
				<!-- 
					The last working day of the month 
				-->
				<day-of-month from="-3" to="0">
					<last>
						<broken>
							<schedule>
								<daily/>
							</schedule>
							<breaks>
								<day-of-week on="SAT"/>
								<day-of-week on="SUN"/>
							</breaks>
						</broken>
					</last>
				</day-of-month>
			</schedule>
		</listsched>

	</target>
		
</project>
