 <%-- 
 Copyright : All Rights Reserved. Copyright (C) 2006, Hitachi, Ltd. 
 Title     : ServerConductor WebConsole 
 Version   : 08-00 
 Name      : machineAddMain.jsp 
 Date      : 2006/04/11 
 Author    : John Paulose 
 --%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 

<%@ page errorPage = "errorDialog.jsp"%>
<%@ page language = "java"%>  
<%@ page contentType = "text/html; charset = UTF-8" pageEncoding = "UTF-8" %> 
<%@ 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.common.MessageConstant" %>
<%@ page import = "java.util.ArrayList" %>
<%@ page import = "java.util.StringTokenizer"%>                                 <%-- 800WA_WEBCONSOLE342 --%>  
<%@ page import = "JP.co.Hitachi.soft.System_Manager.webconsole.common.Const" %> 
<% response.addHeader("Cache-Control","no-cache"); %>
<util:checkURL/>

<jsp:useBean scope = "session" id = "MachineListBean"  class = 
 "JP.co.Hitachi.soft.System_Manager.webconsole.model.bean.MachineListBean" />
 
<html:html locale = "true">
	<head>
		<link rel = stylesheet type = text/css href = css/common.css> 
		<link rel = stylesheet type = text/css href = css/header.css> 
		<script src = "js/group.js">
		</script> 
		<script src = "js/header.js">
		</script>
                <script src = "js/common.js"></script>
	</head>
<%-- <body onload = "document.forms[0]['machineTerminate'].focus()"> --%>       <%-- 800WA_WEBCONSOLE295 --%>
<%--<body onload = "document.forms[0]['nodeIdList'].focus()"> --%>              <%-- 800WA_WEBCONSOLE295 --%>
<%--<body onload = "document.forms[0]['nodeIdList'].focus()" 
	                            onunload = "focusTextLost()"> --%>              <%-- 800WA_WEBCONSOLE353 --%>	<%-- 800WA_WEBCONSOLE367 --%>
    <body onload = "document.forms[0]['nodeIdList'].focus()">	                <%-- 800WA_WEBCONSOLE367 --%>
	<%--    onunload = "focusTextLost()" --%>                                   <%-- 800WA_WEBCONSOLE353 --%> 
        <% String l_stClimbTrailFormatted = MachineListBean.                    // 800WA_WEBCONSOLE273
                         getClimbTrailFormatted().replaceAll(" ","&nbsp;"); %>  <%-- 800WA_WEBCONSOLE273 --%>
        <%StringTokenizer l_stkTokenCt =                                          // 800WA_WEBCONSOLE342
		new StringTokenizer(l_stClimbTrailFormatted,Const.SYMBOL_GREATER_THAN );// 800WA_WEBCONSOLE342
			 int l_iToken = 0;                                                  // 800WA_WEBCONSOLE342
		  StringBuffer l_sbClimbTrail = new StringBuffer();                     // 800WA_WEBCONSOLE342
		  while(l_stkTokenCt.hasMoreTokens()){                                  // 800WA_WEBCONSOLE342
// 	         l_sbClimbTrail.append(l_stkTokenCt.nextToken());                   // 800WA_WEBCONSOLE342 // 800WA_WEBCONSOLE347
//	         if(l_iToken < l_stkTokenCt.countTokens()){                         // 800WA_WEBCONSOLE342 // 800WA_WEBCONSOLE347
             if(l_iToken != 0){                                                 // 800WA_WEBCONSOLE347
	         l_sbClimbTrail.append("<b>");                                      // 800WA_WEBCONSOLE342
	         l_sbClimbTrail.append(" > ");                                      // 800WA_WEBCONSOLE342
	         l_sbClimbTrail.append("</b>");                                     // 800WA_WEBCONSOLE342
	         }                                                                  // 800WA_WEBCONSOLE342
             l_sbClimbTrail.append(l_stkTokenCt.nextToken());                   // 800WA_WEBCONSOLE347
	         l_iToken++;                                                        // 800WA_WEBCONSOLE342

          }	 %>                                                                 <%-- 800WA_WEBCONSOLE342 --%>
                         
 	    
		<span class = "small">
<%--		<%= l_stClimbTrailFormatted %>  --%>                                <%-- 800WA_WEBCONSOLE273 --%>	<%-- 800WA_WEBCONSOLE342 --%> 
			<%=  l_sbClimbTrail.toString() %>                                   <%-- 800WA_WEBCONSOLE342 --%> 
		</span> 
		
<%--	<util:set name = "InternalGroupComputarAddHelpUrl">
		 	<bean:message bundle = "<%= Const.MESSAGE_RESOURCES_KEY_INTERNAL%>" 
		 	key = "internal.group.computar.add.help.url"/>
	    </util:set>   --%>                                                      <%-- 800WA_WEBCONSOLE382 --%> 

		<util:set name = "InternalGroupComputarAddHelpUrl">
		 	<bean:message bundle = "<%= Const.MESSAGE_RESOURCES_KEY_INTERNAL%>" 
		 	key = "internal.group.computer.add.help.url"/>
	    </util:set>                                                             <%-- 800WA_WEBCONSOLE382 --%> 
	    
	    <%--
	    <util:set name = "FnOpenHelp">
		    openHelp('<%= response.encodeURL("help.do") %>',
		    '<%= pageContext.getAttribute("InternalGroupComputarAddHelpUrl").
		    													toString()%>',
		    '<%= Const.ATTRIBUTE_REQUEST_HELP_CONTENTS %>');
		</util:set> --%>                                                        <%-- 800WA_WEBCONSOLE395 --%>

	    <util:set name = "FnOpenHelp">
		    openHelp('<util:rewrite action = "help"/>',
		    '<%= pageContext.getAttribute("InternalGroupComputarAddHelpUrl").
		    													toString()%>',
		    '<%= Const.ATTRIBUTE_REQUEST_HELP_CONTENTS %>',
		    '<%= request.getSession().getId() %>help');
		</util:set>                                                             <%-- 800WA_WEBCONSOLE395 --%>
		
		<div align = "right">
		 	<html:link href = "#" styleClass = "small"
     			onclick = "<%= pageContext.getAttribute("FnOpenHelp").
     															toString()%>">
     			<bean:message bundle = "<%= Const.MESSAGE_RESOURCES_KEY_GROUP%>" 
     			key = "group.add.machine.climb.trail.help" />
			</html:link>
		</div>
		<hr></hr>
<%--	<br/>   --%>                                                            <%-- 800WA_WEBCONSOLE428 --%>
		 
		<div class = "box small"> 
			<br/> 
			<bean:message bundle = "<%= Const.MESSAGE_RESOURCES_KEY_GROUP%>" 
			key = "group.add.machine.explain.no1"/> 
		</div> 
		
		<div class = "box2 small"> 
			<br/> 
		<%--<div class = "rightTurn small">
				<bean:message bundle = "<%= Const.MESSAGE_RESOURCES_KEY_GROUP%>" 
				key = "group.add.machine.set.machine"/>                      
			</div> --%>                                                         <%-- 800WA_WEBCONSOLE349 --%>
						
			<html:form action = "MachineAdditionSetAction">
			<div class = "small">                  
			<table>                                                             <%-- 800WA_WEBCONSOLE349 --%>             
			<tr>                                                                <%-- 800WA_WEBCONSOLE349 --%>
			<td valign = "top">                                                 <%-- 800WA_WEBCONSOLE349 --%>     
			   <bean:message bundle = "<%= Const.MESSAGE_RESOURCES_KEY_GROUP%>" 
				key = "group.add.machine.set.machine"/>                         <%-- 800WA_WEBCONSOLE349 --%>
			</td>                                                               <%-- 800WA_WEBCONSOLE349 --%>
			<td>	                                                            <%-- 800WA_WEBCONSOLE349 --%>
			    <html:hidden property = 'groupId' 
		         value = "<%= 
		                String.valueOf(MachineListBean.getGroupId()) %>" /> 
				
				<html:hidden property = 'climbTrail' 
				 value = "<%= 
				            String.valueOf(MachineListBean.getClimbTrail()) 
				          %>" />
			    <html:hidden property = 'climbTrailFormatted' value = 
			     "<%= 
			       String.valueOf(MachineListBean.getClimbTrailFormatted()) 
			      %>" /> 
				<html:select property = "nodeIdList" size = "10" 
												multiple = "multiple"> 
				<% ArrayList nodeName = MachineListBean.getNodeNameList();
				   int[] nodeId =  MachineListBean.getNodeIdList();
				     for(int l_iCnt=0 ; l_iCnt<nodeName.size() ; l_iCnt++){
						String l_stNodeId=String.valueOf(nodeId[l_iCnt]);
						%>
				      	<html:option value ='<%=l_stNodeId%>'>
				      		<%= nodeName.get(l_iCnt)%>
				      	</html:option>	
				    <%  }%>
				</html:select> 
			</td>                                                               <%-- 800WA_WEBCONSOLE349 --%>
			</tr>                                                               <%-- 800WA_WEBCONSOLE349 --%>
			</table>                                                            <%-- 800WA_WEBCONSOLE349 --%>	
			</div> 
		</div> 
		
		<div align = "right" class = "small" id = "divButton"> 
			<util:set name = "GroupAddMachineclimbTrailAdd">
			<bean:message bundle = "<%= Const.MESSAGE_RESOURCES_KEY_GROUP%>" 
			key = "group.add.machine.climb.trail.add" />
			</util:set>
			
			<util:set name = "GroupAddMachineclimbTrailTerminate">
			<bean:message bundle = "<%= Const.MESSAGE_RESOURCES_KEY_GROUP%>" 
			key = "group.add.machine.climb.trail.terminate" />
			</util:set>
			
		
	<%--	<html:button property = "machineAdd" 
				value = '<%= pageContext.getAttribute
					("GroupAddMachineclimbTrailAdd").toString()%>'
				onclick = 'computerSelectCheck()'/> --%>                        <%-- 800WA_WEBCONSOLE306 --%>
	<%--	<html:button property = "machineTerminate" 
			value = '<%= pageContext.getAttribute
				("GroupAddMachineclimbTrailTerminate").toString()%>'
                        onclick = 'parent.close()' /> --%>                      <%-- 800WA_WEBCONSOLE306 --%>
                        
            <html:button property = "machineAdd" styleClass = "small"
				value = '<%= pageContext.getAttribute
					("GroupAddMachineclimbTrailAdd").toString()%>'
				onclick = 'computerSelectCheck()'/>                             <%-- 800WA_WEBCONSOLE306 --%>
	<%--	<html:button property = "machineTerminate" styleClass = "small" 
			value = '<%= pageContext.getAttribute
				("GroupAddMachineclimbTrailTerminate").toString()%>'
                        onclick = 'parent.close()' />--%>                       <%-- 800WA_WEBCONSOLE306 --%>	<%-- 800WA_WEBCONSOLE353 --%>
                        
    <%--    <html:button property = "machineTerminate" styleClass = "small" 
			value = '<%= pageContext.getAttribute
				("GroupAddMachineclimbTrailTerminate").toString()%>'
                        onclick = 'focusTextLost();parent.close()' />--%>       <%-- 800WA_WEBCONSOLE353 --%>	<%-- 800WA_WEBCONSOLE367 --%>
                        
            <html:button property = "machineTerminate" styleClass = "small" 
			value = '<%= pageContext.getAttribute
				("GroupAddMachineclimbTrailTerminate").toString()%>'
                        onclick = 'parent.close()' />                           <%-- 800WA_WEBCONSOLE367 --%>
                                    
			</html:form>
		</div> 
	
	</body> 
	
	<%-- Get the error message information  from the message resources 
	property file--%>
	
	<util:set name = "errorArray">
		var MSG_COMPUTER_SELECT_CHECK =
			"<%= MessageConstant.MSG_COMPUTER_SELECT_CHECK%>"; 
		
		errorMsg[MSG_COMPUTER_SELECT_CHECK] = '<bean:message 
		           bundle="<%=Const.MESSAGE_RESOURCES_KEY_ERRMESSAGE %>" 
		           key = "<%= MessageConstant.MSG_COMPUTER_SELECT_CHECK %>" />';
		
	</util:set>
	
<script>
	var errorMsg = new Array();
		<%= pageContext.getAttribute("errorArray").toString() %>

</script>
</html:html>

