<%@ page language="java" contentType="text/html" %>
<%@ taglib uri="/WEB-INF/tlds/app.tld" prefix="app" %>
<%@ taglib uri="/WEB-INF/tlds/component.tld" prefix="component" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/component.tld" prefix="component" %>
<%@ page import="com.sun.jade.web.util.BreadCrumbBean" %>

<html:html locale="true">

<%
  String sortRule = request.getParameter("sortRule");
  String sortedProperty = request.getParameter("sortedProperty");
  String category = com.sun.jade.web.util.ElementFinder.getCategory(request);
%>

<script language="JavaScript1.2" src="../js/util.js">
</script>
<script language="JavaScript">

  function LinkUp(theForm) {
   for (var i = 0; i < theForm.mode.options.length; i++) {
          if (theForm.mode.options[i].selected)
		if (theForm.mode.options[i].text != "<bean:message key="option.otherViews"/>")                
                	  window.location = theForm.mode.options[i].value;
   }  
 }

</script>

<app:contentState/>
<app:healthInfo/>

<app:healthSummary2/>

<app:sortOption/>
<jsp:setProperty name="sortOption" property="beanListName" value="healthItem"/>
<jsp:setProperty name="sortOption" property="beanClassName" value="com.sun.jade.logic.health.HealthItem"/>
<jsp:setProperty name="sortOption" property="propertyList" value="name,value"/>
<jsp:setProperty name="sortOption" property="sortedProperty" value="<%=sortedProperty%>"/>
<jsp:setProperty name="sortOption" property="sortRule" value="<%=sortRule%>"/>
<app:sort/>

<jsp:include page="header.jsp"/>

<body bgcolor="#FFFFFF" leftmargin="0" marginwidth="0" marginheight="0" topmargin="0">

  <% String subCategory = com.sun.jade.web.util.ElementFinder.getCategory(request); %>

  <jsp:include page="masthead.jsp">
    <jsp:param name="category"    value="assets"/>
    <jsp:param name="subCategory" value="<%=subCategory%>"/>
  </jsp:include>

<app:breadCrumb/>

<%
    java.util.ArrayList breadCrumb = new java.util.ArrayList();
    BreadCrumbBean bcb1 = new BreadCrumbBean();	
    BreadCrumbBean bcb2 = new BreadCrumbBean();		
    bcb1.setDisplayName("assetsSummary");
    bcb1.setLink("/jade/jsp/healthSummary.jsp?mode=Summary");
    breadCrumb.add(bcb1);
    bcb2.setDisplayName(category);
    bcb2.setLink("/jade/jsp/assetDeviceType.jsp?mode=Category&category=" + category);
    breadCrumb.add(bcb2);

    
    java.util.ArrayList breadCrumb_dev = (java.util.ArrayList) pageContext.getAttribute("BreadCrumbBeanList");
    for( int i = 0; i < breadCrumb_dev.size() - 1; i ++ ) {
       BreadCrumbBean bcb_dev = (BreadCrumbBean)breadCrumb_dev.get(i);
       bcb_dev.setLink("/jade/jsp/asset.jsp?mode=Device&OID=" + bcb_dev.getOidName());
       breadCrumb.add(bcb_dev);
    }

    breadCrumb.add(breadCrumb_dev.get(breadCrumb_dev.size()-1));

    pageContext.setAttribute("breadCrumbBeanList",breadCrumb);
%>

<component:breadCrumb beanListName = "breadCrumbBeanList" />

 
      
<% 
  String OID = com.sun.jade.web.util.ElementFinder.getOID(request);
  String encodedOID = java.net.URLEncoder.encode(OID);
%>                      

<DIV class="content-layout">
<table cellspacing="0" cellpadding="0" border="0">
<tr><td>

<component:bigHorizontalSpacer />

<form> 
<TABLE border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>         
                   <TD Align="right">
                      <select size="1" name="mode" onChange="javascript:LinkUp(this.form)">
                        <option><bean:message key="option.otherViews"/></option>
			<option value="/jade/jsp/asset.jsp?OID=<%=encodedOID%>"><bean:message key="option.assetProperties"/></option>  
                        <logic:notEqual name="isMSE" value="true"> 
			<option value="/jade/jsp/testList.jsp?OID=<%=encodedOID%>"><bean:message key="option.testsList"/></option>	
                        </logic:notEqual>	
                      </select>
                   </TD>			               
</tr>
</TABLE>
</form>

<component:bigHorizontalSpacer />   

<DIV class="table-title-text"><bean:message key="title.healthSummary"/></DIV>
    
<component:smallHorizontalSpacer /> 

<%-- Health information table entries. --%>
                                  
<component:table propertyList="name,value" categoryList="header.property,header.value" beanListName="healthItem"
                 beanClassName="com.sun.jade.logic.health.HealthItem" hasSort="yes" 
                 hasCheckbox="no" checkboxName="null" checkboxValue="null" width="100%" 
                 formName="null" sourcePage="healthContent.jsp" />  

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

</BODY>

</html:html>
