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

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

<util:set name = "TotalSize">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.memory.all.size' />												
</util:set>

<util:set name = "PageFileSize">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.memory.max.filesize' />												
</util:set>

<util:set name = "EccBitError">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.memory.error.times' />												
</util:set>

<util:set name = "CanCorrect">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.memory.able.error.address' />												
</util:set>

<util:set name = "CannotCorrect">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.memory.unable.error.address' />												
</util:set>

<util:set name = "Slot1">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.memory.column1' />												
</util:set>

<util:set name = "Slot2">
	<bean:message bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INVENTORY %>' 
		key = 'inventory.detail.memory.column2' />												
</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">
		<%-- Display the memory slot status table --%>
		<tr><td>
		<table border = "0" width = "63%" align = "center">
		<tr class = "middle">
			<%-- Print the column 1 sub title --%> 								
			<td align = "left"> 
				<%= pageContext.getAttribute("Slot1").toString() %>
			</td>
		</tr>
		<tr><td>
			<table border = "1" width = "100%" align = "center">
			<tr class = "small">
				<th> &nbsp; </th>		
				<th> &nbsp; </th>		
				<th align = "left">
					<%= pageContext.getAttribute("MemorySize").toString() %>
				</th>		
				<th align = "left">
					<%= pageContext.getAttribute("MemoryState").toString() %>
				</th>		
			</tr>
			<%-- Getting the memory slot information from vector --%>
			<%	Vector l_vtEachSocket = null;
				int l_iIndex = 0;
				int l_iSlotNo = 0;
				Vector l_vtSlotSize = (Vector) l_vtDetailInfo.get(2);
				if(l_vtDetailInfo.size() >= 5) {
				l_vtEachSocket = (Vector) l_vtDetailInfo.get(4); 
				l_iSlotNo = Integer.parseInt((String) l_vtSlotSize.get(0));
				for(int l_iCount = 0;l_iCount < l_iSlotNo;l_iCount++,l_iIndex++)
				{
				Vector l_vtEachSlot = (Vector) l_vtEachSocket.get(l_iIndex);
				%>
				<tr class = "small"> 
					<td align = "left"> 							 
				<%-- <% if(((Integer) l_vtEachSlot.get(1)) != null) --%>        <% // 800WA_WEBCONSOLE430 %>
				<% if(l_vtEachSlot.get(1) != null)                              // 800WA_WEBCONSOLE430
					{ %>								
						<%// = ((Integer) l_vtEachSlot.get(1)).intValue() %>    <% // 800WA_WEBCONSOLE497 %>
						<%= l_iCount %>                                         <% // 800WA_WEBCONSOLE497 %>
		    		<% }														
					   else 
					{ %>													
					 	&nbsp;													
					<% } %>						 								
					</td>
					<td align = "left">
					<html:img src = '<%= (String) l_vtEachSlot.get(2) %>' 
							  alt = '<%= (String) l_vtEachSlot.get(3) %>'/>
					</td>
					<td align = "left">
					<%-- <% if(((String) l_vtEachSlot.get(4)).length() != 0) --%> <% // 800WA_WEBCONSOLE430 %>
					<% if(((String) l_vtEachSlot.get(4)).trim().length() != 0)  // 800WA_WEBCONSOLE430
					{ %>								
						<%= ((String) l_vtEachSlot.get(4)) %>
		    		<% }														
					   else 
					{ %>													
					 	&nbsp;													
					<% } %>						 								
					</td>
					<td align = "left">
					<%-- <% if(((String) l_vtEachSlot.get(5)).length() != 0) --%> <% // 800WA_WEBCONSOLE430 %>
					<% if(((String) l_vtEachSlot.get(5)).trim().length() != 0)  // 800WA_WEBCONSOLE430
					{ %>								
						<%= ((String) l_vtEachSlot.get(5)) %>
		    		<% }														
					   else 
					{ %>													
					 	&nbsp;													
					<% } %>						 								
					</td>
				</tr>
				<% } %>
				<% } %>
				</table>
			</tr></td>
			<tr class = "middle">
				<%-- Print the column 2 sub title --%> 								
				<td align = "left"> 
					<%= pageContext.getAttribute("Slot2").toString() %>
				</td>
			</tr>
			<tr><td>
			<table border = "1" width = "100%" align = "center">			
				<tr class = "small">
				<th> &nbsp; </th>		
				<th> &nbsp; </th>		
				<th align = "left">
					<%= pageContext.getAttribute("MemorySize").toString() %>
				</th>		
				<th align = "left">
					<%= pageContext.getAttribute("MemoryState").toString() %>
				</th>		
				</tr>
		
			<%  if(l_vtDetailInfo.size() >= 5) {
				l_iSlotNo = Integer.parseInt((String) l_vtSlotSize.get(1));
				// for(int l_iCount = 0;l_iCount < l_iSlotNo;					// 800WA_WEBCONSOLE309
				for(int l_iCount = 0;l_iCount < l_iSlotNo						// 800WA_WEBCONSOLE309
					&& l_iIndex < Const.INVENTORY_MAX_MEMORY;					// 800WA_WEBCONSOLE309
					l_iCount++,l_iIndex++) {
				Vector l_vtEachSlot = (Vector) l_vtEachSocket.get(l_iIndex);
			%>
				<tr class = "small"> 
					<td align = "left"> 							 
				<%-- <% if(((Integer) l_vtEachSlot.get(1)) != null) --%>        <% // 800WA_WEBCONSOLE430 %>
				<% if(l_vtEachSlot.get(1) != null)                              // 800WA_WEBCONSOLE430

					{ %>								
						<%// = ((Integer) l_vtEachSlot.get(1)).intValue() %>    <% // 800WA_WEBCONSOLE497 %>
						<%= l_iIndex %>                                         <% // 800WA_WEBCONSOLE497 %>
		    		<% }														
					   else 
					{ %>													
					 	&nbsp;													
					<% } %>						 								
					</td>
					<td align = "left">
					<html:img src = '<%= (String) l_vtEachSlot.get(2) %>' 
							  alt = '<%= (String) l_vtEachSlot.get(3) %>'/>
					</td>
					<td align = "left">
				<%-- <% if(((String) l_vtEachSlot.get(4)).length() != 0) --%>   <% // 800WA_WEBCONSOLE430 %>
				<% if(((String) l_vtEachSlot.get(4)).trim().length() != 0)      // 800WA_WEBCONSOLE430
					{ %>								
						<%= ((String) l_vtEachSlot.get(4)) %>
		    		<% }														
					   else 
					{ %>													
					 	&nbsp;													
					<% } %>						 								
					</td>
					<td align = "left">
				<%-- <% if(((String) l_vtEachSlot.get(5)).length() != 0) --%>   <% // 800WA_WEBCONSOLE430 %>
				<% if(((String) l_vtEachSlot.get(5)).trim().length() != 0)      // 800WA_WEBCONSOLE430
					{ %>								
						<%= ((String) l_vtEachSlot.get(5)) %>
		    		<% }														
					   else 
					{ %>													
					 	&nbsp;													
					<% } %>						 								
					</td>
				</tr>
				<% } %>
			<% } %>				
			</table>
			</tr></td>
		</table>
		</tr></td>		
		
		<tr class = "middle">
			<%-- Print the total memory size sub title --%> 								
			<td align = "left" style = "padding-top:10px"> 
				<%= pageContext.getAttribute("TotalSize").toString() %>
			</td>
		</tr>
		<tr><td>
		<table border = "1" width = "100%">
		<tr class = "small">
		<%-- Getting the memory size information from vector --%>
		<% 	Vector l_vtMemSize = null;
		if(l_vtDetailInfo.size() >= 4) {										// 800WA_WEBCONSOLE253
			l_vtMemSize = (Vector) l_vtDetailInfo.get(3); %>
			<td align = "left">
				<%-- <% if(((String) l_vtMemSize.get(0)).length() != 0) { %> --%> <% // 800WA_WEBCONSOLE430 %>
				<% if(((String) l_vtMemSize.get(0)).trim().length() != 0) { %>  <% // 800WA_WEBCONSOLE430 %>
					<%= ((String) l_vtMemSize.get(0)) %>
					<% }
					else {%>
						&nbsp;
					<% } %>
			</td>
			<% } 								 								// 800WA_WEBCONSOLE253 
			else {	%>															<% // 800WA_WEBCONSOLE253 %>
				<td>&nbsp;</td>													<% // 800WA_WEBCONSOLE253 %>
			<% } %>																<% // 800WA_WEBCONSOLE253 %>			
		</tr>
		</table>
		</td></tr>

		<tr class = "middle">
			<%-- Print the maximum page file size sub title --%> 								
			<td align = "left" style = "padding-top:10px">
				<%= pageContext.getAttribute("PageFileSize").toString() %>
			</td>
		</tr>
		<tr><td>
		<table border = "1" width = "100%">
		<tr class = "small">
		<% if(l_vtDetailInfo.size() >= 4) { %>									<% // 800WA_WEBCONSOLE253 %>
			<td align = "left">
				<%-- <% if(((String) l_vtMemSize.get(1)).length() != 0) { %> --%> <% // 800WA_WEBCONSOLE430 %>
				<% if(((String) l_vtMemSize.get(1)).trim().length() != 0) { %>  <% // 800WA_WEBCONSOLE430 %>
					<%= ((String) l_vtMemSize.get(1)) %>
					<% }
					else {%>
						&nbsp;
					<% } %>
			</td>
			<% } 								 								// 800WA_WEBCONSOLE253 
			else {	%>															<% // 800WA_WEBCONSOLE253 %>
				<td>&nbsp;</td>													<% // 800WA_WEBCONSOLE253 %>
			<% } %>																<% // 800WA_WEBCONSOLE253 %>						
		</tr>
		</table>
		</td></tr>

		<tr class = "middle">
			<%-- Print the ECC Bit Error sub title --%> 								
			<td align = "left" style = "padding-top:10px">
				<%= pageContext.getAttribute("EccBitError").toString() %>
			</td>
		</tr>
		<tr><td>
		<table border = "1" width = "100%">
		<tr class = "small">
		<% if(l_vtDetailInfo.size() >= 4) { %>									<% // 800WA_WEBCONSOLE253 %>		
			<td align = "left">
				<%-- <% if(((String) l_vtMemSize.get(2)).length() != 0) { %> --%> <% // 800WA_WEBCONSOLE430 %>
				<% if(((String) l_vtMemSize.get(2)).trim().length() != 0) { %>  <% // 800WA_WEBCONSOLE430 %>
					<%= ((String) l_vtMemSize.get(2)) %>
					<% }
					else {%>
						&nbsp;
					<% } %>
			</td>
			<% } 								 								// 800WA_WEBCONSOLE253 
			else {	%>															<% // 800WA_WEBCONSOLE253 %>
				<td>&nbsp;</td>													<% // 800WA_WEBCONSOLE253 %>
			<% } %>																<% // 800WA_WEBCONSOLE253 %>						
		</tr>
		</table>
		</td></tr>
			
		<tr class = "middle">
			<%-- Print the Can Correct ECC Bit Error sub title --%> 								
			<td align = "left" style = "padding-top:10px">
				<%= pageContext.getAttribute("CanCorrect").toString() %>
			</td>
		</tr>
		<tr><td>
		<table border = "1" width = "100%">
		<tr class = "small">
		<% if(l_vtDetailInfo.size() >= 4) { %>									<% // 800WA_WEBCONSOLE253 %>		
			<td align = "left">
				<%-- <% if(((String) l_vtMemSize.get(3)).length() != 0) { %> --%> <% // 800WA_WEBCONSOLE430 %>
				<% if(((String) l_vtMemSize.get(3)).trim().length() != 0) { %>  <% // 800WA_WEBCONSOLE430 %>
					<%= ((String) l_vtMemSize.get(3)) %>
					<% }
					else {%>
						&nbsp;
					<% } %>
			</td>
			<% } 								 								// 800WA_WEBCONSOLE253 
			else {	%>															<% // 800WA_WEBCONSOLE253 %>
				<td>&nbsp;</td>													<% // 800WA_WEBCONSOLE253 %>
			<% } %>																<% // 800WA_WEBCONSOLE253 %>					
		</tr>
		</table>
		</td></tr>

		<tr class = "middle">
			<%-- Print the Cannot Correct ECC Bit Error sub title --%> 								
			<td align = "left" style = "padding-top:10px">
				<%= pageContext.getAttribute("CannotCorrect").toString() %>
			</td>
		</tr>
		<tr><td>
		<table border = "1" width = "100%">
		<tr class = "small">
		<% if(l_vtDetailInfo.size() >= 4) { %>									<% // 800WA_WEBCONSOLE253 %>		
			<td align = "left">
				<%-- <% if(((String) l_vtMemSize.get(4)).length() != 0) { %> --%> <% // 800WA_WEBCONSOLE430 %>
				<% if(((String) l_vtMemSize.get(4)).trim().length() != 0) { %>  <% // 800WA_WEBCONSOLE430 %>
					<%= ((String) l_vtMemSize.get(4)) %>
					<% }
					else {%>
						&nbsp;
					<% } %>
			</td>
			<% } 								 								// 800WA_WEBCONSOLE253 
			else {	%>															<% // 800WA_WEBCONSOLE253 %>
				<td>&nbsp;</td>													<% // 800WA_WEBCONSOLE253 %>
			<% } %>																<% // 800WA_WEBCONSOLE253 %>						
		</tr>
		</table>
		</td></tr>
	  </table>
	</body>
</html:html>