 
 --------------->
 <!--- first, get rid of everything --->
+
+<cfinclude template="/includes/_header.cfm">
+<cfif action is "nothing">
+
+
 <cfobject type="JAVA" action="Create" name="factory" class="coldfusion.server.ServiceFactory">
 <cfset allTasks = factory.CronService.listAll()>
 <cfset numberOtasks = arraylen(allTasks)>

<!---------------

drop table cf_crontab;


	<cfschedule action="delete" task="#allTasks[i].task#">
</cfloop>

<script src="/includes/sorttable.js"></script>


<cfquery name="sched" datasource="uam_god">
	select * from cf_crontab
</cfquery>
<cfoutput>
	Current Scheduled Tasks:
	<table class="sorttable" id="tblls">
		<tr>
			<th>job_name</th>
			<th>path</th>
			<th>timeout</th>
			<th>purpose</th>
			<th>run_interval_desc</th>
			<th>s</th>
			<th>m</th>
			<th>h</th>
			<th>DoM</th>
			<th>M</th>
			<th>DoW</th>
			<th>expr</th>
		</tr>
		<cfloop query="sched">
			<tr>
				<td>#job_name#</td>
				<td>#path#</td>
				<td>#timeout#</td>
				<td>#purpose#</td>
				<td>#run_interval_desc#</td>
				<td>#cron_sec#</td>
				<td>#cron_min#</td>
				<td>#cron_hour#</td>
				<td>#cron_dom#</td>
				<td>#cron_mon#</td>
				<td>#cron_dow#</td>
				<td>#cron_sec# #cron_min# #cron_hour# #cron_dom# #cron_mon# #cron_dow#</td>
			</tr>

			<!--- and actually build the tasks ---->
			<cfschedule action = "update"
			    task = "#job_name#"
			    operation = "HTTPRequest"
			    url = "127.0.0.1/ScheduledTasks/#path#"
			    cronTime="#cron_sec# #cron_min# #cron_hour# #cron_dom# #cron_mon# #cron_dow#"
			    requestTimeOut = "#timeout#">
		</cfloop>
	</table>
	</cfoutput>
	Add a task
	<form method="post" action="scheduler.cfm">
		<input type="hidden" name="action" value="addTask">
		<label for="job_name">job_name</label>
		<input type="text" name="job_name" class="reqdClr">
		<br><input type="submit" value="add task">
	</form>
</cfif>
<cfinclude template="/includes/_footer.cfm">
