<!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>editrulesettemplate.jsp</TITLE>
</HEAD>
<BODY>
<H1>Create RuleSet from Template</H1>
<jsp:useBean id="theRuleSetTemplate" class="com.ibm.able.rules.AbleRuleSetTemplate" scope="request"/>
<%@ include file="DemoBase.jspf" %>
<BR>Template Description <INPUT type="text" name="TemplateDescripton" size="60" value="<%=theRuleSetTemplate.getComment()%>" readonly>
 
<FORM action="AbleWebActions">
<HR>
<TABLE COLS="2">

<%
  if (rs != null) {
    theRuleSetTemplate.resetTemplateVars();
    Object[] variables = theRuleSetTemplate.getTemplateVars();
    for (int i=0 ; i < variables.length ; i++) {
       AbleVariable var = (AbleVariable)variables[i];
       Vector labels = null ;
%>
<TR>
<TD><%=var.getPromptString()%></TD>

 
<%   if (var instanceof AbleCategoricalVariable) {
        labels = ((AbleCategoricalVariable)var).getValueList();
     } else if (var instanceof AbleDiscreteVariable) {
        labels = ((AbleDiscreteVariable)var).getValueList();
     } else if (var instanceof AbleBooleanVariable) {
       Vector lclValueList = new Vector() ;
       lclValueList.add("true");
       lclValueList.add("false") ; 
       labels = lclValueList ;	
     }
%>

<%   if ( labels != null) { 
       String selectedValue = var.getStringValue(); 
%>
<TD><SELECT name="<%=var.getName()%>"> 
	<%@ include file="listelements.jspf" %>
</SELECT></TD>
</TR>
<%  } else { 
%> 
 
<TD><INPUT type="text" name="<%=var.getName()%>" size="30" value="<%=var.getStringValue()%>"></TD> 
</TR>

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

<INPUT type="submit" name="CreateRuleSet" value="Create a new RuleSet instance"><INPUT type="hidden"
	name="option" value="createruleset"><BR>
</FORM>
<BR>
Rule text<BR>
<TEXTAREA rows="5" cols="80" name="RuleText" readonly>
	<%=theRuleSetTemplate.getArlString().trim()%></TEXTAREA>

<p><a href=index.jsp>Back to Main Page</a></p>
</BODY>
</HTML>
