<%--
 Copyright : All Rights Reserved. Copyright (C) 2006, Hitachi, Ltd.
 Title     : ServerConductor WebConsole
 Version   : 08-00
 Name      : hostListSC.jsp
 Date      : 2006/04/10
 Author    : LakshmiNarayanan.S
 --%>

<%@ page errorPage = "errorDialog.jsp" %>
<%@ 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" %>
<% response.addHeader("Cache-Control","no-cache"); %>
<%@ page import = "JP.co.Hitachi.soft.System_Manager
.webconsole.model.bean.DisplayBean"%>
<%@ page import = "JP.co.Hitachi.soft.System_Manager
.webconsole.common.Const"%>
<%@ page import = "java.util.Vector"%>
<%@ page import = "java.util.HashMap"%>
<%@ page contentType = "text/html; charset = UTF-8" pageEncoding = "UTF-8" %>   <% // 800WA_WEBCONSOLE241 %>
<script src= "js/common.js"></script>


<html:html locale = "true">
<head>
<title>
	<bean:message bundle = "<%=  Const.MESSAGE_RESOURCES_KEY_HOST%>" 
	 key = "host.menu.display.service"/>
</title>
<link rel = "stylesheet" type = "text/css" href = "css/common.css">				<% // 800WA_WEBCONSOLE081 %>
</head>


<jsp:useBean id="DisplayBean" scope = "request"
class="JP.co.Hitachi.soft.System_Manager.webconsole.model.bean.DisplayBean"/>

<%-- Get tree data vector using instance of DisplayBean and set it into 
the pageContext implicit object as an attribute --%>


<%-- <!-- <body> --> --%>														<% // 800WA_WEBCONSOLE228 %> <% // 800WA_WEBCONSOLE300 %>
<%-- <body onload='javascript:setDefaultPage();'> --%>							<% // 800WA_WEBCONSOLE228 %> <% // 800WA_WEBCONSOLE398 %>
<%-- <body onload='javascript:setDefaultPage();' class = "nowrap"> --%>  	    <% // 800WA_WEBCONSOLE398 %><% // 800WA_WEBCONSOLE445 %>
<body onload='javascript:setDefaultPage();' class = "nowrap"
      onclick = "releaseSelection()">                                           <% // 800WA_WEBCONSOLE445 %>
<% // <center>    %> 															<% // 800WA_WEBCONSOLE081 %>
<div class = "al_center" >														<% // 800WA_WEBCONSOLE081 %>
    <bean:message bundle = "<%=  Const.MESSAGE_RESOURCES_KEY_HOST%>" 
     key ="host.menu.display.service"/>
</div>																			<% // 800WA_WEBCONSOLE081 %>			
<% // </center>    %> 															<% // 800WA_WEBCONSOLE081 %>

<%-- <br> --%>																	<% // 800WA_WEBCONSOLE168 %>
<%-- <br> --%>																	<% // 800WA_WEBCONSOLE168 %>

<% Vector l_vtTreeData = null;
 l_vtTreeData = DisplayBean.getNChildNodes(); 
      HashMap l_hmClimbTrail = new HashMap(); %>

<table>

<% 
 
for(int l_iCnt = 0; l_iCnt <  l_vtTreeData.size(); l_iCnt ++) { %>
<tr>
	<%-- <td> --%>																<% // 800WA_WEBCONSOLE398 %>
	<td  class = "nowrap">														<% // 800WA_WEBCONSOLE398 %>
<%	//if(l_iCnt > 2) 															// 800WA_WEBCONSOLE049   // 800WA_WEBCONSOLE177
	//{ %>																		<% // 800WA_WEBCONSOLE049 %>	<% // 800WA_WEBCONSOLE177 %>
      <%-- <img src = '<%= ((Vector)l_vtTreeData.get(l_iCnt)).get(2)%>' alt='
      <%= ((Vector)l_vtTreeData.get(l_iCnt)).get(3)%>'>                --%>     <% // 800WA_WEBCONSOLE153 %>  
	  <img src = '<%= ((Vector)l_vtTreeData.get(l_iCnt)).get(2)%>'
		alt='<%= ((Vector)l_vtTreeData.get(l_iCnt)).get(3)%>'>					<% // 800WA_WEBCONSOLE153 %>  

<%	// The climbTrail is passed to the detailed DisplayAction class %>
      <util:set name = "displayDetailAction">
      		displayDetailAction?climbTrail=<%= ((Vector)l_vtTreeData.
      		get(l_iCnt)).get(0)%>
      </util:set>
  <% //    <html:link  action = %>  											<% // 800WA_WEBCONSOLE081 %>
      <%-- <html:link  styleClass="middle" action = 									
      		"<%= pageContext.getAttribute("displayDetailAction").toString()%>"	
		target  ="hostDetail"> --%>                                             <% // 800WA_WEBCONSOLE081 %><% // 800WA_WEBCONSOLE445 %>
      <html:link  styleClass="middle" action = 									
      		"<%= pageContext.getAttribute("displayDetailAction").toString()%>"	
		target  ="hostDetail" onclick = "linkClicked(this)">                    <% // 800WA_WEBCONSOLE445 %>
	  <%= ((Vector)l_vtTreeData.get(l_iCnt)).get(1)%>
      </html:link>
<%    //  } %>																	<% // 800WA_WEBCONSOLE049 %>	<% // 800WA_WEBCONSOLE177 %>
	</td>
</tr>  

<util:set name = "ClimbTrailValue">												
			<bean:message bundle = "<%=  Const.MESSAGE_RESOURCES_KEY_HOST%>" 
			key="host.menu.display.service"/>
			<%= Const.SYMBOL_BLANK_SPACE %><%= Const.SYMBOL_GREATER_THAN %>
			<%= Const.SYMBOL_BLANK_SPACE %>
			<%= ((Vector)l_vtTreeData.get(l_iCnt)).get(1).toString() %>
</util:set>																		<% // 800WA_WEBCONSOLE142 %>
    
<%	// The climbTrail and Node name in list block are stored as key value pair
	// in HashMap for displaying climbTrail in Inventory detail screen.
	
	 	l_hmClimbTrail.put(((Vector)l_vtTreeData.get(l_iCnt)).get(0).toString(),
	//	 ((Vector)l_vtTreeData.get(l_iCnt)).get(1).toString());					// 800WA_WEBCONSOLE142
		pageContext.getAttribute("ClimbTrailValue").toString());				// 800WA_WEBCONSOLE142
 }
 %>
</table>
<%	 
	// Storing the reference of hashmap in session
	   session.setAttribute(Const.ATTRIBUTE_SESSION_CLIMB_TRAIL_MAP, 
		 	l_hmClimbTrail);
 %>
 
<util:set name = "HostMenuDisplaySite">
		<%--	<bean:message bundle = "<%=  Const.MESSAGE_RESOURCES_KEY_HOST%>" 
			key="host.menu.display.site"/>  --%>								<% // 800WA_WEBCONSOLE141 %>
		<bean:message bundle = "<%=  Const.MESSAGE_RESOURCES_KEY_HOST%>" 
			key="host.menu.display.service"/>									<% // 800WA_WEBCONSOLE141 %>
</util:set>
<form>	
<input  name = "name" type = "hidden" value = "<%= pageContext.
			getAttribute("HostMenuDisplaySite").toString() %>"
</form>

</body>

</html:html>
