<%-- 
 Copyright : All Rights Reserved. Copyright (C) 2006, Hitachi, Ltd. 
 Title     : ServerConductor WebConsole 
 Version   : 08-00 
 Name      : basicSystemCase.jsp 
 Date      : 2006/05/31 
 Author    : Dharini N
--%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<%@ page language = "java" %>
<%@ page session = "false" %>
<%@ page errorPage = "errorDialog.jsp" %>
<%@ page import = "JP.co.Hitachi.soft.System_Manager.webconsole.common.Const"%>
<%@ page contentType = "text/html; charset = UTF-8" pageEncoding = "UTF-8" %> 
<%@ page import = "java.util.Vector" %>
<%@ taglib prefix = "bean"  uri = "/WEB-INF/struts-bean.tld" %>
<%@ taglib prefix = "html"  uri = "/WEB-INF/struts-html.tld" %>
<%@ taglib prefix = "util"  uri = "/WEB-INF/common-tags.tld" %>
<%@ page import = 
"JP.co.Hitachi.soft.System_Manager.webconsole.model.bean.InventoryDetailListBean"%>
<%@ page import = 
"JP.co.Hitachi.soft.System_Manager.data.HsmConst" %>
<%-- <% response.addHeader("Cache-control","NO CACHE"); %> --%>					<% // 800WA_WEBCONSOLE308 %>
<% response.addHeader("Cache-control","no-cache"); %> 							<% // 800WA_WEBCONSOLE308 %>
<util:checkURL/>

<%-- Get instance of InventoryDetailListBean in request scope--%>
<jsp:useBean id = "InventoryDetailListBean"
class = 
"JP.co.Hitachi.soft.System_Manager.webconsole.model.bean.InventoryDetailListBean" 
scope = "request"/>

<%-- Declaring a vector to store the table data --%>
<%! Vector l_vtDetailInfo = new Vector(); %>

<%-- Get table data vector using instance of InventoryDetailListBean --%>
<% l_vtDetailInfo = InventoryDetailListBean.getDetailInfo(); %>

<%-- Get help string and help url from InventoryDetailListBean --%>
<%
String l_stHelp = (String) l_vtDetailInfo.get(0);
String l_stUrl = (String) l_vtDetailInfo.get(1);
%>

<%-- Get url of help in inventory detail block from the InventoryProperties file
 and set it into the pageContext implicit object as an attribute --%>
<util:set name = "InventoryDetailHelp">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = '<%= l_stUrl %>' />												
</util:set>

<util:set name = "HelpActionClass">
	<util:rewrite action = "help" />
</util:set>

<util:set name = "FnOpenHelp">
	openHelp('<%= pageContext.getAttribute("HelpActionClass").toString() %>',
    '<%= pageContext.getAttribute("InventoryDetailHelp").toString() %>',
    '<%= Const.ATTRIBUTE_REQUEST_HELP_CONTENTS %>',								
    '<%= request.getSession().getId() %>help');									
</util:set>

<util:set name = "TempStatus">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.case.temp' />												
</util:set>

<util:set name = "FanStatus">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.case.fan' />												
</util:set>

<html:html locale = "true">
	<head>
		<link rel = "stylesheet" type = "text/css" href = "css/common.css">
		<script src = "js/header.js"></script>
		<script src = "js/common.js"></script>
	</head>
	<%-- <body> --%>                                                            <% // 800WA_WEBCONSOLE445 %>
	<body onclick = "releaseSelection()">                                       <% // 800WA_WEBCONSOLE445 %>
		<span class = "middle">
			<%-- Get the value of climb trail --%> 				
			<jsp:getProperty name = "InventoryDetailListBean" 
				property = "climbTrail"/>
		</span>
		<div align = "right">
			<html:link href = "#" styleClass = "small" onclick = 
				"<%= pageContext.getAttribute("FnOpenHelp").toString()%>">
	            <bean:message bundle = 
                	'<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
	                key = '<%= l_stHelp %>' />			 						
			</html:link>
		</div>
		<hr>

		<%-- Heading of the detail block	--%>
		<div class = "middle" align = "center" style = "margin-bottom:10px">
			<%= request.getParameter("nodeName").toString().trim() %>
		</div>
		<table border = "0" width = "80%" align = "center">
		<tr>
			<td align = "left">
			<%-- Print the temperature sub title --%> 								
			<span class = "middle">
				<%= pageContext.getAttribute("TempStatus").toString() %>
			</span>
			</td>
		</tr>
		<tr>
			<td>
			<%-- Display the first table with temperature status data --%> 				
			<table border = "1" width = "100%">
			<%	if(l_vtDetailInfo.size() >= 3) {								// 800WA_WEBCONSOLE253
				Vector l_vtTemp = (Vector) l_vtDetailInfo.get(2); %>
				<tr class = "small">
					<td align = "left">
						<html:img src = '<%= (String) l_vtTemp.get(0) %>' 
						alt = '<%= (String) l_vtTemp.get(1) %>'/>
					</td>
					<td align = "left">
					<%-- <% if(((String) l_vtTemp.get(2)).length() != 0) {%> --%> <% // 800WA_WEBCONSOLE430 %>							
					<% if(((String) l_vtTemp.get(2)).trim().length() != 0) {%>  <% // 800WA_WEBCONSOLE430 %>					
							<%= (String) l_vtTemp.get(2) %>
						<% }														
							else { %>												
							 &nbsp;													
						<% } %>						 								
					</td>
				</tr>
			<%	}																// 800WA_WEBCONSOLE253
			else {	%>															<% // 800WA_WEBCONSOLE253 %>
				<tr>															<% // 800WA_WEBCONSOLE253 %>
					<td>&nbsp;</td>												<% // 800WA_WEBCONSOLE253 %>
					<td>&nbsp;</td>												<% // 800WA_WEBCONSOLE253 %>
				</tr>															<% // 800WA_WEBCONSOLE253 %>
			<% } %>																<% // 800WA_WEBCONSOLE253 %>
			</table>
			</td>
		</tr>
		<tr>
			<td align = "left"  style = "padding-top:10px">
				<%-- Print the fan sub title --%> 										
				<span class = "middle">
					<%= pageContext.getAttribute("FanStatus").toString() %>
				</span>
			</td>
		</tr>
		<tr>
			<td>
				<table border = "1" width = "100%">						
				<%	if(l_vtDetailInfo.size() >= 4) {							// 800WA_WEBCONSOLE253
					Vector l_vtFan = (Vector) l_vtDetailInfo.get(3); 
					Vector l_vtEachFan = null;		%>
				
					<%-- <tr class = "small"> --%>								<%-- 800WA_WEBCONSOLE298 --%>
						<%-- Get the fan status values from vector --%>
						<% for(int l_iCount = 0;l_iCount < l_vtFan.size();
							l_iCount++) {
							l_vtEachFan = (Vector) l_vtFan.get(l_iCount); %>
							<tr class = "small">
							 <td>
						<%-- <% if(((Integer) l_vtEachFan.get(0)) != null) --%> <% // 800WA_WEBCONSOLE430 %>
							<% if(l_vtEachFan.get(0) != null)                   //  800WA_WEBCONSOLE430
							 { %>								
							<%// = ((Integer) l_vtEachFan.get(0)).intValue() %> <% // 800WA_WEBCONSOLE497 %>
							<%= l_iCount %>                                     <% // 800WA_WEBCONSOLE497 %>
		    			  <% }														
							else 
						     { %>													
						 	&nbsp;													
					      <% } %>						 								
					 		</td>
							<td align = "left">
							<html:img src = '<%= (String) l_vtEachFan.get(1) %>' 
								  alt = '<%= (String) l_vtEachFan.get(2) %>'/>
							</td>			 								
							</tr>
						<% } %>
				<% } 															// 800WA_WEBCONSOLE253
			else {	%>															<% // 800WA_WEBCONSOLE253 %>
				<tr>															<% // 800WA_WEBCONSOLE253 %>
					<td>&nbsp;</td>												<% // 800WA_WEBCONSOLE253 %>
					<td>&nbsp;</td>												<% // 800WA_WEBCONSOLE253 %>
				</tr>															<% // 800WA_WEBCONSOLE253 %>
			<% } %>																<% // 800WA_WEBCONSOLE253 %>
				</table>
			</td>
		</tr>
		</table>
	</body>
</html:html>