<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<h1><bean:message key="prompt.jobScheduleViewForm.title"/></h1>
<logic:messagesPresent>
	<ul>
	<bean:message key="errors.header"/>
	<html:messages id="error">
		<li><bean:write name="error"/></li>
	</html:messages>
	</ul>
	<hr>
</logic:messagesPresent>

<div id="COMMANDTAG">
	<table border="0" cellpadding="0" cellspacing="0" valign="top" width="100%">
		<tr>
			<td colspan="8" height="1"><hr/></td>
		</tr>
		<tr>
			<td align="center" height="20" width="5%">
				<html:link href="jobEdit.do" name="jobViewForm" property="paramMap">
					<bean:message key="prompt.jobScheduleViewForm.jobEdit"/>
				</html:link>
			</td>
			<td align="center" height="20" width="5%">
				<html:link href="jobDelete.do" name="jobViewForm" property="paramMap" onclick="javascript:return confirm('Delete Scheduled Job');">
					<bean:message key="prompt.jobScheduleViewForm.jobDelete"/>
				</html:link>
			</td>
			<td align="center" height="20" width="5%">
				<html:link href="jobExecute.do" name="jobViewForm" property="paramMap">
					<bean:message key="prompt.jobScheduleViewForm.jobExecute"/>
				</html:link>
			</td>
			<td align="center" height="20" width="10%">
				<html:link href="jobScheduleList.do">
					<bean:message key="prompt.jobScheduleViewForm.jobList"/>
				</html:link>
			</td>
			<td align="center" height="20" width="12%">
				<html:link href="jobTriggerCreate.do" name="jobViewForm" property="paramMap">
					<bean:message key="prompt.jobScheduleViewForm.jobSchedule"/>
				</html:link>
			</td>
			<td align="center" height="20" width="15%">
				<html:link href="jobCronTriggerCreate.do" name="jobViewForm" property="paramMap">
					<bean:message key="prompt.jobScheduleViewForm.jobCronSchedule"/>
				</html:link>
			</td>
			<td align="center" height="20" width="15%">
				<html:link href="jobUITriggerCreate.do" name="jobViewForm" property="paramMap">
					<bean:message key="prompt.jobScheduleViewForm.jobUISchedule"/>
				</html:link>
			</td>
			<td height="20">&nbsp;</td>
		</tr>
		<tr>
			<td colspan="8" height="1"><hr/></td>
		</tr>
	</table>
</div>

<div id="EDITTAG" align="left">

    <table width="100%">
    	<tr>
			<td width="30%" class="title"><bean:message key="prompt.jobScheduleViewForm.groupName"/></strong><img src="images/4_dot.gif"/></td>
			<td>
				<bean:write name="jobViewForm" property="groupName"/>&nbsp;
			</td>
		</tr>
		<tr>
			<td width="30%" class="title"><bean:message key="prompt.jobScheduleViewForm.jobName"/></strong><img src="images/4_dot.gif"/></td>
			<td>
				<bean:write name="jobViewForm" property="name"/>&nbsp;
			</td>
		</tr>
		<tr>
			<td class="title"><bean:message key="prompt.jobScheduleViewForm.className"/></strong><img src="images/4_dot.gif"/></td>
			<td>
				<bean:write name="jobViewForm" property="jobClass"/>&nbsp;
			</td>
		</tr>
		<tr>
			<td class="title"><bean:message key="prompt.jobScheduleViewForm.jobDescription"/></strong><img src="images/4_dot.gif"/></td>
			<td>
				<bean:write name="jobViewForm" property="description"/>&nbsp;
			</td>
		</tr>
		<tr>
			<td class="title"><bean:message key="prompt.jobScheduleViewForm.recovery"/></strong><img src="images/4_dot.gif"/></td>
			<td>
				<html:checkbox name="jobViewForm" property="volatility"/>
			</td>
		</tr>
		<tr>
			<td class="title">&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
	</table>
</div>

<div id="DISPLAYTAG">

    <h2><bean:message key="prompt.jobScheduleViewForm.parameter"/></h2>
	<table width="100%">
	  <thead>
		<tr>
			<th width="25%"><bean:message key="prompt.jobScheduleViewForm.parameterName"/></th>
			<th width="50%"><bean:message key="prompt.jobScheduleViewForm.parameterValue"/></th>
			<th align="center">&nbsp;</th>
		</tr>
	  </thead>
	  <tbody>
		<logic:present name="jobViewForm" property="jobParameters">
			<logic:iterate id="parameter" name="jobViewForm" property="jobParameters">
			    <tr class="even">
					<td align="center">
						<bean:write name="parameter" property="parameterName"/>
					</td>
					<td>
						<bean:write name="parameter" property="parameterValue"/>
					</td>
					<td align="center">&nbsp;</td>
			    </tr>
			</logic:iterate>
		</logic:present>
	  </tbody>
	</table>

    <h2><bean:message key="prompt.jobScheduleViewForm.jobListener"/></h2>
	<table width="100%">
	  <thead>
		<tr>
			<th width="25%">&nbsp;</th>
			<th width="50%">&nbsp;</th>
			<th align="center">&nbsp;</th>
		</tr>
	  </thead>
	</table>

    <h2><bean:message key="prompt.jobScheduleViewForm.jobTrigger"/></h2>
	<table width="100%">
	  <thead>
		<tr>
			<th><bean:message key="prompt.jobScheduleViewForm.triggerGroupName"/></th>
			<th><bean:message key="prompt.jobScheduleViewForm.triggerName"/></th>
			<th><bean:message key="prompt.jobScheduleViewForm.triggerTypeName"/></th>
			<th><bean:message key="prompt.jobScheduleViewForm.triggerDescription"/></th>
			<th><bean:message key="prompt.jobScheduleViewForm.firesNext"/></th>
			<th><bean:message key="prompt.jobScheduleViewForm.firesLast"/></th>
			<th><bean:message key="prompt.jobScheduleViewForm.startTime"/></th>
			<th><bean:message key="prompt.jobScheduleViewForm.endTime"/></th>
			<th><bean:message key="prompt.jobScheduleViewForm.misfireCount"/></th>
			<th><bean:message key="prompt.jobScheduleViewForm.triggerDelete"/></th>
		</tr>
	  </thead>
	  <tbody>
		<logic:present name="jobViewForm" property="jobTriggers">
			<logic:iterate id="oneTrigger" name="jobViewForm" property="jobTriggers">
			    <tr class="even">
					<td align="center">
						<bean:write name="oneTrigger" property="triggerGroup"/>
					</td>
					<td>
						<bean:write name="oneTrigger" property="triggerName"/>
					</td>
					<td>
						<bean:write name="oneTrigger" property="type"/>
					</td>
					<td>
						<bean:write name="oneTrigger" property="description"/>
					</td>
					<td>
						<bean:write name="oneTrigger" property="nextFireTime"/>
					</td>
					<td>
						<bean:write name="oneTrigger" property="previousFireTime"/>
					</td>
					<td>
						<bean:write name="oneTrigger" property="startTime"/>
					</td>
					<td>
						<bean:write name="oneTrigger" property="stopTime"/>
					</td>
					<td>
						<bean:write name="oneTrigger" property="misFireInstruction"/>
					</td>
					<td>
						<html:link href="jobTriggerDelete.do" name="oneTrigger"  property="paramMap">
							<bean:message key="prompt.jobScheduleViewForm.triggerDelete"/>
						</html:link>		
					</td>
			    </tr>
			</logic:iterate>
		</logic:present>
	  </tbody>
	</table>
</div>

<div id="COMMANDTAG">
	<table border="0" cellpadding="0" cellspacing="0" valign="top" width="100%">
		<tr>
			<td colspan="8" height="1"><hr/></td>
		</tr>
		<tr>
			<td align="center" height="20" width="5%">
				<html:link href="jobEdit.do" name="jobViewForm" property="paramMap">
					<bean:message key="prompt.jobScheduleViewForm.jobEdit"/>
				</html:link>
			</td>
			<td align="center" height="20" width="5%">
				<html:link href="jobDelete.do" name="jobViewForm" property="paramMap" onclick="javascript:return confirm('Delete Scheduled Job');">
					<bean:message key="prompt.jobScheduleViewForm.jobDelete"/>
				</html:link>
			</td>
			<td align="center" height="20" width="5%">
				<html:link href="jobExecute.do" name="jobViewForm" property="paramMap">
					<bean:message key="prompt.jobScheduleViewForm.jobExecute"/>
				</html:link>
			</td>
			<td align="center" height="20" width="10%">
				<html:link href="jobScheduleList.do">
					<bean:message key="prompt.jobScheduleViewForm.jobList"/>
				</html:link>
			</td>
			<td align="center" height="20" width="12%">
				<html:link href="jobTriggerCreate.do" name="jobViewForm" property="paramMap">
					<bean:message key="prompt.jobScheduleViewForm.jobSchedule"/>
				</html:link>
			</td>
			<td align="center" height="20" width="15%">
				<html:link href="jobCronTriggerCreate.do" name="jobViewForm" property="paramMap">
					<bean:message key="prompt.jobScheduleViewForm.jobCronSchedule"/>
				</html:link>
			</td>
			<td align="center" height="20" width="15%">
				<html:link href="jobUITriggerCreate.do" name="jobViewForm" property="paramMap">
					<bean:message key="prompt.jobScheduleViewForm.jobUISchedule"/>
				</html:link>
			</td>
			<td height="20">&nbsp;</td>
		</tr>
		<tr>
			<td colspan="8" height="1"><hr/></td>
		</tr>
	</table>
</div>
