<%-- $Id: trapParserConfig.jsp,v 1.1.2.4 2004/02/19 13:42:27 prabhukm Exp $ --%>

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><fmt:message key='webclient.fault.trapparser.title'/></title>
</head>

<script language="Javascript" SRC="/webclient/common/js/listrowselection.js" type="text/javascript"></script>
<%@include file="/webclient/admin/jspf/trapParserAdmin.jspf" %>

<body class="bgNone" <c:if test="${param.actionToPerform == 'saveParsers'}"> onload="javascript:CheckAll(document.TrapParser)" </c:if>>

<form name="TrapParser" action="/admin/TrapParserOperations.do">

    <input type="hidden" name="toPerform" value="">
    
      <table width="80%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="10">&nbsp;</td>
            <td height="30" valign="bottom"><span class="header1"><fmt:message key='webclient.fault.trapparser.title'/></span></td>
          </tr>
          <tr> 
            <td height="1"><img src="/webclient/common/images/trans.gif" width="1" height="1"></td>
            <td height="1" class="hline"><img src="/webclient/common/images/trans.gif" width="1" height="1"></td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td valign="top">
                <table width="100%" border="0" align="left" cellpadding="2" cellspacing="0" class="botBorder">
                 <tr align="left" class="greyBg"> 
                  <td height="30" colspan="4"><c:if test="${setTrapParsers == true}"><a href="/admin/TrapParserForm.do?toPerform=addTPForm" class="textSmall"><fmt:message key='webclient.fault.trapparser.link.add'/></a> <span class="textSmall">|</span> </c:if> <c:if test="${getTrapParsers == true}"><a href="/admin/TrapParserOperations.do?toPerform=loadParsers" class="textSmall"><fmt:message key='webclient.fault.trapparser.link.loadparsers'/></a> <span class="textSmall">|</span> </c:if> 

                      <c:choose>
                        <c:when test="${setTrapParsers == true && param.actionToPerform != 'saveParsers'}"> 
                           <a href="/admin/TrapParser.do?actionToPerform=saveParsers#saveParser" class="textSmall"><fmt:message key='webclient.fault.trapparser.link.savefile'/></a>
                       </c:when>
                       <c:otherwise>
                          <fmt:message key='webclient.fault.trapparser.link.savefile'/>
                      </c:otherwise>
                      </c:choose>
                      </td>
                </tr>

       <c:if test="${!empty successMsg}">

          <tr align="center">  
              <td>&nbsp;</td>
              <td class="responseText" colspan="3"><img src="/webclient/common/images/tick.gif" hspace="4"><c:out value="${successMsg}"/></td>
          </tr>

       </c:if>

       <c:if test="${!empty failureMsg}">

          <tr align="center">  
              <td>&nbsp;</td>
              <td class="errorText" colspan="3"><c:out value="${failureMsg}"/></td>
          </tr>

       </c:if>


                <tr> 
                  <td height="25" colspan="4" class="header2Bg"><span class="header2"><fmt:message key='webclient.fault.trapparser.configuredlist'/></span></td>
                </tr>
              <c:if test="${setTrapParsers == true}">        
                <tr>
                  <td align="center" class="text">&nbsp;</td>
                  <td height="35" colspan="3">
                      <input name="Enable" type="button" class="button" value="<fmt:message key='webclient.fault.trapparser.button.enable'/>" onclick="javascript:enable()">
                      <input name="Disable" type="button" class="button" value="<fmt:message key='webclient.fault.trapparser.button.disable'/>" onclick="disable()">
                      <input name="Delete" type="button" class="button" value="<fmt:message key='webclient.fault.trapparser.button.delete'/>" onclick="deleteParsers()">
                  </td>
                </tr>
              </c:if>       
                <tr> 
                  <td width="4%" align="center" class="text"> <input type="checkbox" name="toggleAll" onclick="javascript:ToggleAll(this,this.form)">                   </td>
                  <td width="23%" height="35" class="boldText"><fmt:message key='webclient.fault.trapparser.parsername'/></td>
                  <td width="17%" align="center" class="boldText"><fmt:message key='webclient.fault.trapparser.enabled'/></td>
                  <td width="56%" align="left">&nbsp; </td>
                </tr>

                <c:forEach var="parser" items="${parsersList}">
                <c:forEach var="list" items="${parser}">

                <tr> 
                  <td align="center" class="text"><input type="checkbox" name="rowSelection" value="<c:out value='${list.key}'/>" onclick="Toggle(this,this.form)"></td>
                  <td height="25" class="text">
                      <c:choose>
                       <c:when test="${setTrapParsers == true}">
                        <a href="/admin/TrapParserForm.do?toPerform=modifyTPForm&parserName=<c:out value='${list.key}'/>"><c:out value='${list.key}'/></a>
                       </c:when>
                       <c:otherwise>
                         <c:out value='${list.key}'/>
                       </c:otherwise>
                      </c:choose>
                      </td>
                  <td align="center" class="text">
                  <c:choose>
                   <c:when test="${list.value == true}">
                          <img src="/webclient/common/images/tick.gif" name="tick" border="0" id="Image1">
                   </c:when>
                   <c:otherwise>
                          <img src="/webclient/common/images/del.gif" name="del" border="0" id="Image1">
                   </c:otherwise>
                  </c:choose>

                </td>
                  <td align="left" class="text">&nbsp;</td>
                </tr>

                </c:forEach>
                </c:forEach>

            </table></td>
           </tr>

           <c:if test="${param.actionToPerform == 'saveParsers'}">           
               <tr> 
                  <td>&nbsp;</td>
                  <td>
                    <table width="100%" border="0" align="left" cellpadding="2" cellspacing="0">
                     <tr> 
                      <td height="25" colspan="2" class="header2Bg"><span class="header2">
                      <a name="saveParser"></a><fmt:message key='webclient.fault.trapparser.savetofile.title'/></span></td>
                     </tr>
                     <tr> 
                      <td align="left" class="text" colspan="2" height="25"> 
                      <fmt:message key='webclient.fault.trapparser.savetofile.message'/></td>
                     </tr>  
                     <tr align="left">
                      <td height="30" width="20%">
                       <input name="fileName" type="text" class="formStyle" value="conf/trap.parsers">
                      </td>
                      <td>
                       <input name="Submit" type="submit" class="button" value="<fmt:message key='webclient.fault.trapparser.link.savefile'/>" onclick="saveParsers()"> 
                       <input name="Cancel" type="button" class="button" value="<fmt:message key='webclient.fault.event.customview.button.cancel'/>" onclick="javascript:history.back();"></td>
                      </td>
                    </tr>  
                    <tr> 
                     <td colspan="2">&nbsp;</td>
                   </tr>       
                  </table>
                 </td>
                </tr>
          </c:if>
               
       </table>
  </form>
</body>
</html>
