<%-- 
 Copyright : All Rights Reserved. Copyright (C) 2006, Hitachi, Ltd. 
 Title     : ServerConductor WebConsole 
 Version   : 08-00 
 Name      : basicSystemPower.jsp 
 Date      : 2006/06/03 
 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 = "UPSBattery">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.power.ups.battery' />												
</util:set>

<util:set name = "UPSBatteryState">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.power.ups.state' />												
</util:set>

<util:set name = "UPSBatteryReminder">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.power.battery.remainder' />												
</util:set>

<util:set name = "UPSBatteryChargeStatus">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.power.battery.state' />												
</util:set>

<util:set name = "PowerStatus">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.power.supply.unit.title' />												
</util:set>

<util:set name = "PowerUnit">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.power.supply.unit' />												
</util:set>

<util:set name = "Voltage">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.power.voltage.title' />												
</util:set>

<util:set name = "OfficialVoltage">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.power.official.value' />												
</util:set>

<util:set name = "ActualVoltage">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.power.voltage' />												
</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>
			<%-- Print the ups sub title --%> 								
			<td align = "left" class = "middle">
				<%= pageContext.getAttribute("UPSBattery").toString() %>
			</td>
		</tr>
		<tr><td>
			<%-- Display the first table with ups battery status data --%> 				
			<% Vector l_vtUPS = null; %>
			<table border = "1" width = "100%">
				<tr>
					<td align = "left" class = "middle" 
						style = "padding-top:10px">
						<%= pageContext.getAttribute("UPSBatteryState").
							toString() %>
					</td>
					<%-- Getting the UPS information from vector --%>
					<% 	
					if(l_vtDetailInfo.size() >= 3) {							// 800WA_WEBCONSOLE253
					l_vtUPS = (Vector) l_vtDetailInfo.get(2); %>
					<td align = "left">
						<% if((String) l_vtUPS.get(0) != Const.NOT_ACQUIRED){%>								
							<html:img src = '<%= (String) l_vtUPS.get(0) %>' 
										alt = '<%= (String) l_vtUPS.get(1) %>'/>
						<% }														
							else { %>												
									<%= (String) l_vtUPS.get(0) %>
						<% } %>						 								
					</td>
					<% } 						 								// 800WA_WEBCONSOLE253 
					else {	%>													<% // 800WA_WEBCONSOLE253 %>
						<td>&nbsp;</td>											<% // 800WA_WEBCONSOLE253 %>
					<% } %>														<% // 800WA_WEBCONSOLE253 %>			
				</tr>
				<tr>
					<td align = "left" class = "middle" 
						style = "padding-top:10px">
						<%= pageContext.getAttribute("UPSBatteryReminder").
							toString() %>
					</td>
					<% if(l_vtDetailInfo.size() >= 3) {%>						<% // 800WA_WEBCONSOLE253 %>
					<td align = "left">
						<% if((String) l_vtUPS.get(2) != Const.NOT_ACQUIRED){%>								
							<html:img src = '<%= (String) l_vtUPS.get(2) %>' 
										alt = '<%= (String) l_vtUPS.get(3) %>'/>
						<% }													
							else { %>												
									<%= (String) l_vtUPS.get(2) %>
						<% } %>						 								
					</td>
					<% } 						 								// 800WA_WEBCONSOLE253 
					else {	%>													<% // 800WA_WEBCONSOLE253 %>
						<td>&nbsp;</td>											<% // 800WA_WEBCONSOLE253 %>
					<% } %>														<% // 800WA_WEBCONSOLE253 %>					
				</tr>
				<tr>
					<td align = "left" class = "middle" 
						style = "padding-top:10px">
						<%= pageContext.getAttribute("UPSBatteryChargeStatus").
							toString() %>
					</td>
					<% if(l_vtDetailInfo.size() >= 3) {%>						<% // 800WA_WEBCONSOLE253 %>					
					<td align = "left">
						<% if((String) l_vtUPS.get(4) != Const.NOT_ACQUIRED){%>								
							<html:img src = '<%= (String) l_vtUPS.get(4) %>' 
										alt = '<%= (String) l_vtUPS.get(5) %>'/>
						<% }														
							else { %>												
									<%= (String) l_vtUPS.get(4) %>
						<% } %>						 								
					</td>
					<% } 						 								// 800WA_WEBCONSOLE253 
					else {	%>													<% // 800WA_WEBCONSOLE253 %>
						<td>&nbsp;</td>											<% // 800WA_WEBCONSOLE253 %>
					<% } %>														<% // 800WA_WEBCONSOLE253 %>
				</tr>
			</table>
		</td></tr>
		<tr>
			<%-- Print the power unit sub title --%> 								
			<td align = "left" class = "middle" align = "left" 
				style = "padding-top:10px">
				<%= pageContext.getAttribute("PowerStatus").toString() %>
			</td>
		</tr>
		<tr><td>
			<table border = "1" width = "100%">
			<tr>
			<%-- Display the first table with power unit data --%> 				
			<td align = "left" class = "small" style = "padding-bottom:10px">
				<%= pageContext.getAttribute("PowerUnit").toString() %>
			</td>
			</tr>
			<%-- Getting the Power information from vector --%>
			<%  Vector l_vtEachUnit = null; %>
			<tr><td>
				<table border = "1" width = "100%">
				<%  if(l_vtDetailInfo.size() >= 4) {
					Vector l_vtPower = (Vector) l_vtDetailInfo.get(3);
				    for(int l_iCount = 0;l_iCount < l_vtPower.size(); l_iCount++) 
					{	l_vtEachUnit = (Vector) l_vtPower.get(l_iCount);  %>
						<tr class = "small">
	    					<td>
						<%-- <% if(((Integer) l_vtEachUnit.get(0)) != null) --%> <% // 800WA_WEBCONSOLE430 %> 
						<% if(l_vtEachUnit.get(0) != null)                      // 800WA_WEBCONSOLE430
							 { %>								
								 <%= ((Integer) l_vtEachUnit.get(0)).intValue()%>
	    				  	 <% }														
								else 
						      { %>													
						 		&nbsp;													
			    	  		 <% } %>						 								
				 			</td>
							<td align = "left">
							 <html:img src = '<%= (String)l_vtEachUnit.get(1)%>' 
								  alt = '<%= (String) l_vtEachUnit.get(2) %>'/>
							</td>			 								
						</tr>
				<% } %>
			<% } 
			else {
			%>
			<tr><td>&nbsp;</td><td>&nbsp;</td>
			</tr>
			<% } %>
		</table>
		</td></tr>
		<tr>
			<td align = "left" class = "small" style = "padding-bottom:10px">
				<%= pageContext.getAttribute("Voltage").toString() %>
			</td>
		</tr>
	<%-- <tr> --%>																<% // 800WA_WEBCONSOLE298 %>
	   	<tr><td>																<% // 800WA_WEBCONSOLE298 %>
			<table border = "1" width = "100%">
			<th align = "left" class = "small">
				<%= pageContext.getAttribute("OfficialVoltage").toString() %>			
			</th>
			<th align = "left" class = "small">
				<%= pageContext.getAttribute("ActualVoltage").toString() %>			
			</th>
			
			<%-- Getting the Voltage information from vector --%>
			<%  if(l_vtDetailInfo.size() >= 5) {
					Vector l_vtVoltage = (Vector) l_vtDetailInfo.get(4);
					for(int l_iCount = 0;l_iCount < l_vtVoltage.size();
						l_iCount++) {
						l_vtEachUnit = (Vector) l_vtVoltage.get(l_iCount); 
			%>
						<tr class = "small">
							<td align = "left">
						<%-- <% if(((String) l_vtEachUnit.get(0)).length() != 0) --%> <% // 800WA_WEBCONSOLE430 %>
					<% if(((String) l_vtEachUnit.get(0)).trim().length() != 0)  // 800WA_WEBCONSOLE430
							 { %>								
							 <%= ((String) l_vtEachUnit.get(0)) %>
		    			  	 <% }														
								else 
						      { %>													
						 		&nbsp;													
				      		 <% } %>						 								
					 		 </td>
							 <td align = "left">
						<%-- <% if(((String) l_vtEachUnit.get(1)).length() != 0) --%> <% // 800WA_WEBCONSOLE430 %>
					<% if(((String) l_vtEachUnit.get(1)).trim().length() != 0)  // 800WA_WEBCONSOLE430
							 { %>								
							 <%= ((String) l_vtEachUnit.get(1)) %>
		    			  	 <% }														
								else 
						      { %>													
						 		&nbsp;													
				      		 <% } %>						 								
							</td>			 								
						</tr>
					<% } %>
				<% } %>
		  	</table>
			<%-- </tr> --%>														<% // 800WA_WEBCONSOLE298 %>
		  </td></tr>															<% // 800WA_WEBCONSOLE298 %>
      	</table>
	<%-- </tr> --%>																<% // 800WA_WEBCONSOLE298 %>
	  </td></tr>
	  </table>
	</body>
</html:html>