<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<%@ page 
language="java" import="java.lang.*,java.lang.String"
contentType="text/html; charset=WINDOWS-1252"
pageEncoding="WINDOWS-1252"
%>  
<META http-equiv="Content-Type"
	content="text/html; charset=WINDOWS-1252">
<META name="GENERATOR" content="IBM WebSphere Studio">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/Master.css" rel="stylesheet"
	type="text/css">
<TITLE>index.jsp</TITLE>
</HEAD>
<%@ include file="DemoBase.jspf" %>
<BODY>

<H1>ABLE Rule Templates Demo</H1>
<P>Select an ABLE Rule Language file to load:</P>
<FORM action="AbleWebActions" enctype="multi-part/form-data">
<INPUT type="submit" value="Load File"><INPUT type="hidden"
	name="option" value="loadfile">
<SELECT name="filename"> 
	<%@ include file="listrulesets.jspf" %>
</SELECT>	 
</FORM>


<TABLE COLS="3">
<TR>
<TD>
<FORM action="AbleWebActions">
<INPUT type="submit" value="Reset"><INPUT type="hidden"
	name="option" value="reset">
</FORM>
</TD>
<TD>
<FORM action="AbleWebActions">
<INPUT type="submit" value="View Source"><INPUT type="hidden"
	name="option" value="viewsource">
</FORM>
</TD>
<TD>
<FORM action="AbleWebActions">
<INPUT type="submit" value="View XML"><INPUT type="hidden"
	name="option" value="viewxml">
</FORM>
</TD>
</TR>
</TABLE>
<HR>

<FORM action="AbleWebActions">
<H3>Rule Templates</H3>
<TABLE COLS="3">
<%
  if (rs != null) {
    if (!rs.isTemplate()) {
    Vector templates = rs.getRuleTemplates();
    for (int i=0 ; i < templates.size() ; i++) {
       AbleRuleTemplate template = (AbleRuleTemplate)templates.get(i);
%>
<TR>
<TD><%=template.getName()%></TD>
<TD><%=template.getPromptString()%></TD> 
<TD><INPUT type="submit" name="templatename" value="<%=template.getName()%>"> 
<INPUT type="hidden" name="option" value="editruletemplate"></TD>
</TR>
<%
    }
   } else {
       // it is a ruleset template
      AbleRuleSetTemplate ruleTemplate = rs.getRuleSetTemplate();        
%>

<TR>
<TD><%=ruleTemplate.getName()%></TD>
<TD><%=ruleTemplate.getComment()%></TD> 
<TD><INPUT type="submit" name="templatename" value="<%=ruleTemplate.getName()%>"> 
<INPUT type="hidden" name="option" value="editrulesettemplate"></TD>
</TR>

<%  
   }    
  };
%>
</TABLE>
</FORM>

<HR>


<H3>Rules Generated from Templates</H3>
<TABLE COLS="4">
<%
  if (rs != null) {
    if (!rs.isTemplate()) {
    Vector templates = rs.getRuleTemplates();
    for (int i=0 ; i < templates.size() ; i++) {
       AbleRuleTemplate template = (AbleRuleTemplate)templates.get(i);
%>
<TR>
<FORM action="AbleWebActions">
<TD><%=template.getName()%></TD>
<TD><%=template.getPromptString()%></TD> 
<TD><SELECT name="rulename">
<%@ include file="listrules.jspf" %>
</SELECT>
<INPUT type="hidden" name="option" value="editrule"></TD>
<TD><INPUT type="submit" name="EditRule" value="Edit"></TD>
</FORM> 
</TR>
<%
    } 
   }      
  };
%>

</TABLE>


</BODY>
</HTML>
