<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/valuelist" prefix="vlh" %>
<%@ taglib uri="/tags/fw" prefix="fw" %>


<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShell" role="presentation">
<html-el:form action="/viewLog4jCurrentLogLevels" method="post">
  <%@ include file="/admin/csrfgentoken.jsp" %>
  <tr>
    <td width="100%">
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableBody" role="presentation">
        <tr>
          <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableHead" role="presentation">
              <tr>
                <td class="moduleBlueBox"><img alt="" src="../images/spacer.gif" width="25" height="17"/></td>
                <td class="moduleHeadline"><bean-el:message key="label.log4jConfiguration" /></td>
              </tr>
            </table>
          </td>
        </tr>        
		<tr>		
		 <table id="tableResult" align="center" width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleTable" role="presentation">		
		 <TR>		 
		 <td width="15%" class="moduleLabel"><fw:label property="loggerFilter" forId="txtLoggerFilter">
             <bean-el:message key="label.admin.loggerFilter"/>:</fw:label>
          </td>
           <td width="30%" class="moduleLabel">
             <c:set var="loggerFilterText"><bean-el:message key="label.admin.loggerFilter"/></c:set>
             <html-el:text title="${loggerFilterText}" property="loggerFilter" styleId="txtLoggerFilter" size="60"/>
           </td>		
			<td style="padding-left:5px"><img alt="" src="../images/buttonEndLeft.gif"/></td>
			<td  width="5%">
			  <html-el:submit property="methodName" style="width:80; vertical-align: top;" styleClass="buttonText">
			 <bean-el:message key="button.contains"/>
            </html-el:submit>
            </td>
            <td style="padding-right:5px"><img alt="" src="../images/buttonEndRight.gif"/></td>
			<td style="padding-left:5px"><img alt="" src="../images/buttonEndLeft.gif"/></td>
			<td width="5%">
			  <html-el:submit property="methodName" style="width:80; vertical-align: top;" styleClass="buttonText">
			 <bean-el:message key="button.refresh"/>
            </html-el:submit>
            </td>
            <td style="padding-right:5px"><img alt="" src="../images/buttonEndRight.gif"/></td>
			<td style="padding-left:5px"><img alt="" src="../images/buttonEndLeft.gif"/></td>
            <td width="5%">
			  <html-el:submit property="methodName" style="width:80; vertical-align: top;" styleClass="buttonText">
			 <bean-el:message key="button.reset"/>
            </html-el:submit>
            </td>
            <td style="padding-right:5px"><img alt="" src="../images/buttonEndRight.gif"/></td>	
            <td width="35%"></td>
            </TR>
            </table>		
		</tr>
		<c:if test="${vlhlist!=null && vlhlist.valueListInfo!=null && vlhlist.valueListInfo.totalNumberOfEntries >0}">		 
        <tr>
          <td class="moduleValue">
            <table id="tableResult" align="center" width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleTable" role="presentation">
              <vlh:root id="log4jTableId" value="vlhlist" url="?" includeParameters="*" configName="valueListConfigBeanLookAndFeel">
              <vlh:addParam name="checkboxName" value="Select" temp="false"/>
              <tr>
                <td>
                  <table class="pagelinks" cellpadding="0" cellspacing="0" border="0">
                    <tr>
                      <td width="45%"><img alt="" src="../images/spacer.gif"></td>
                      <td width="5%" height="21" nowrap="true"><span class="pagebanner"><c:out value="${vlhlist.valueListInfo.totalNumberOfEntries}"/> Total - Page (<c:out value="${vlhlist.valueListInfo.pagingPage}"/> of <c:out value="${vlhlist.valueListInfo.totalNumberOfPages}"/>).&nbsp;</span></td>
                      <td width="5%">                      
                        <c:if test="${vlhlist.valueListInfo.totalNumberOfPages > 1}">
                        <vlh:paging attributes="class=\"pagelinks\"" pages="10"><c:out value="${pagelog4jTableId}"/>&nbsp;</vlh:paging>
                        </c:if>
                      </td>
                      <td width="45%"><img alt="" src="../images/spacer.gif"></td>
                    </tr>
                  </table>
                </td>
              </tr>

              <tr vAlign="top">
                <td vAlign="top" align="center">
                  <table summary="Table for Current Log Levels" rules="all" class="TableDisplay" cellspacing="0" cellpadding="3">
                    <tr>
                      <vlh:row bean="log4jBean">            
                      
                      <c:set var="logger" value="${log4jBean.name}" scope="request"/>                      
                      <c:set var="counter" value="${(vlhlist.valueListInfo.pagingNumberPer * (vlhlist.valueListInfo.pagingPage-1)) + log4jBeanRowNumber + 1}"/>
                      <vlh:column title="#" property="name" attributes="class='valuelistRow1' align='left' scope='col'" default="">
                        <vlh:attribute name="style">white-space: nowrap</vlh:attribute>
                        <vlh:attribute name="scope">row</vlh:attribute>
                        <c:out value="${counter}"/>.
                      </vlh:column>
                      <vlh:column titleKey="label.admin.logger" property="name" sortable="asc" attributes="class='valuelistRow1' align='left' scope='col'" default="">
                        <vlh:attribute name="style">white-space: nowrap</vlh:attribute>
                      </vlh:column>
                      <c:choose>                      
                      <c:when test="${log4jBean.parent!=null}">
                      	<c:set var="parentName" value="${log4jBean.parent.name}" scope="request"/>
                      		<vlh:column titleKey="label.admin.parentLogger" property="parent.name" sortable="asc" attributes="class='valuelistRow1' align='left' scope='col'" default="">
                        	<vlh:attribute name="style">white-space: nowrap</vlh:attribute>
                        	<html-el:link action="viewLog4jCurrentLogLevels.do?methodName=displayCurrentLogLevels" paramId="parentLogFilter" paramName="parentName">
                        		<c:out value="${log4jBean.parent.name}"/>
                        	</html-el:link> 	                      
	                      </vlh:column>
	                  </c:when>
		              <c:otherwise>
		              <!--<td> &nbsp  </td> -->
		             	 <vlh:column titleKey="label.admin.parentLogger" property="parent.name" sortable="asc" attributes="class='valuelistRow1' align='left' scope='col'" default="">
	                        <vlh:attribute name="style">white-space: nowrap</vlh:attribute>
	                        &nbsp                        
	                     </vlh:column>                      
	                   </c:otherwise>
                      </c:choose>
                      <vlh:column titleKey="label.admin.effectiveLevel" property="effectiveLevel" sortable="asc" attributes="class='valuelistRow1' width='100%' align='left' scope='col'" default="" />
                      <c:choose>                      
                      <c:when test="${log4jBean.parent!=null}">
                      <vlh:column titleKey="label.admin.changeLogLevel" property="name" attributes="class='valuelistRow1' align='left' scope='col'" default="">
                        <vlh:attribute name="style">white-space: nowrap</vlh:attribute>
                        <html-el:link action="updateLogLevels.do?methodName=updateLogLevels&operation=changeLogLevel&newLogLevel=debug" paramId="logger" paramName="logger"><bean-el:message key="label.admin.debug" /></html-el:link> |
                        <html-el:link action="updateLogLevels.do?methodName=updateLogLevels&operation=changeLogLevel&newLogLevel=info" paramId="logger" paramName="logger"><bean-el:message key="label.admin.info" /></html-el:link> |
                        <html-el:link action="updateLogLevels.do?methodName=updateLogLevels&operation=changeLogLevel&newLogLevel=warn" paramId="logger" paramName="logger"><bean-el:message key="label.admin.warn" /></html-el:link> |
                        <html-el:link action="updateLogLevels.do?methodName=updateLogLevels&operation=changeLogLevel&newLogLevel=error" paramId="logger" paramName="logger"><bean-el:message key="label.admin.error" /></html-el:link> |
                        <html-el:link action="updateLogLevels.do?methodName=updateLogLevels&operation=changeLogLevel&newLogLevel=fatal" paramId="logger" paramName="logger"><bean-el:message key="label.admin.fatal" /></html-el:link> |
                       <html-el:link action="updateLogLevels.do?methodName=updateLogLevels&operation=changeLogLevel&newLogLevel=off" paramId="logger" paramName="logger"><bean-el:message key="label.admin.off" /></html-el:link> 
                      </vlh:column> 
                      </c:when>
		              <c:otherwise>		              
		              <vlh:column titleKey="label.admin.changeLogLevel" attributes="class='valuelistRow1' scope='col'"/>
		          		</c:otherwise>
                      </c:choose>                                      
                      </vlh:row>
                    </tr>
                  </table>
                </td>
              </tr>
            
                 <table class="pagelinks" cellpadding="0" cellspacing="0" border="0" role="presentation">
                   <tr>
                     <td width="45%"><img alt="" src="../images/spacer.gif"></td>
                     <td width="5%" height="21" nowrap="true"><span class="pagebanner"><c:out value="${vlhlist.valueListInfo.totalNumberOfEntries}"/> Total - Page (<c:out value="${vlhlist.valueListInfo.pagingPage}"/> of <c:out value="${vlhlist.valueListInfo.totalNumberOfPages}"/>).&nbsp;</span></td>
                     <td width="5%">                      
                       <c:if test="${vlhlist.valueListInfo.totalNumberOfPages > 1}">
                       <vlh:paging attributes="class=\"pagelinks\"" pages="10"><c:out value="${pagelog4jTableId}"/>&nbsp;</vlh:paging>
                       </c:if>
                     </td>
                     <td width="45%"><img alt="" src="../images/spacer.gif"></td>
                   </tr>
                 </table>
	              
              </vlh:root>
             </c:if>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <input type="hidden" name="methodName" value="<bean-el:message key="button.refresh"/>">
   </html-el:form>
</table>
