<%--
 Copyright : All Rights Reserved. Copyright (C) 2006, Hitachi, Ltd.
 Title     : ServerConductor WebConsole
 Version   : 08-00
 Name      : agentRegistMain.jsp
 Date      : 2006/05/29
 Author    : Sukumaran.R
--%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<%@ page language = "java"%>
<%@ page errorPage = "errorDialog.jsp" %>
<%@ page import = "JP.co.Hitachi.soft.System_Manager.webconsole.common.Const"%>
<%@ page import = "JP.co.Hitachi.soft.System_Manager.webconsole.common.MessageConstant"%>
<%@ 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" %>
<% response.addHeader("Cache-control","NO CACHE"); %>							<% // 800WA_WEBCONSOLE308 %>
<% response.addHeader("Cache-control","no-cache"); %>							<% // 800WA_WEBCONSOLE308 %>
<util:checkURL/>

<%--  Set the help URL for Agent Registration as a page attribute --%>
<util:set name = "AgentRegistHelp">
	<util:sanitize>
	<bean:message 
	    bundle = '<%= Const.MESSAGE_RESOURCES_KEY_INTERNAL %>' 
	    key = "internal.regist.agent.help.url"/>
	</util:sanitize>
</util:set>

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

<%--  Set the script method to invoke 'help' as a page attribute --%>
<util:set name = "FnOpenHelp">
	openHelp(
	'<%= pageContext.getAttribute("HelpActionClass").toString() %>',
    '<%= pageContext.getAttribute("AgentRegistHelp").toString() %>',
    '<%= Const.ATTRIBUTE_REQUEST_HELP_CONTENTS %>',								
    '<%= request.getSession().getId() %>help');
</util:set>

<script src = "js/common.js"></script>

<html:html locale = "true">
	<head>
		<title></title>
 		<script src = "js/header.js"></script>
 		<script src = "js/agentRegist.js"></script>
		<link rel = "stylesheet" type = "text/css" href = "css/common.css">
	</head>

<%--	<body onLoad = "document.forms[0].Close.focus()">		--%>			<% // 800WA_WEBCONSOLE295 %>
	<body onLoad = "document.forms[0].hostData.focus()">						<% // 800WA_WEBCONSOLE295 %>
  	    <%-- Help Link --%>
		<div align="right">
			<html:link href = "#" styleClass = "small" onclick = 
        		     '<%= pageContext.getAttribute("FnOpenHelp").toString() %>'>
				<util:sanitize>
					<bean:message 
						bundle = '<%= Const.MESSAGE_RESOURCES_KEY_RGTAGT %>' 
						key = "regist.agent.operation.help"/>
				</util:sanitize>
			</html:link>
		</div>

		<%-- Horizontal Rule --%>
		<div align = "center">
			<hr></hr>
		</div>
		
		<%-- Explanation text --%>
		<div class = "box small" align = "center">
			<br/><br/>
			<util:sanitize>
				<bean:message 
				    bundle = '<%= Const.MESSAGE_RESOURCES_KEY_RGTAGT %>' 
				    key = "regist.agent.operation.explain"/>
			</util:sanitize>
	    </div>

		<%-- Agent Registration form --%>
		<html:form 
		    action = "ConnMgmtRegistAction"
            onsubmit = "return validateHostData(document.forms[0].hostData.value);">

		    <table class = "box2">
	   			<%-- for text containing IP Address/ Host Name --%>
			    <tr>
<%--	 		   	<td align = "left" class = "small" valign = "bottom"> --%>	<% // 800WA_WEBCONSOLE284 %>
			    	<td class = "small" valign = "bottom"> 						<% // 800WA_WEBCONSOLE284 %>
						<util:sanitize>
							<bean:message 
							    bundle = 
							        '<%= Const.MESSAGE_RESOURCES_KEY_RGTAGT %>' 
							    key = "regist.agent.operation.text"/>
						</util:sanitize>
		        	</td>
			    </tr>

				<%-- for input text box --%>	    
			    <tr>
<%--	    	<td align = "left" class = "small" valign = "top"> ---%> 		<% // 800WA_WEBCONSOLE284 %>
			    	<td class = "small" valign = "top">			 				<% // 800WA_WEBCONSOLE284 %>
		    		<%-- <html:text property = "hostData" size = "30" /> --%>   <% // 800WA_WEBCONSOLE284 %>
			    		<html:text property = "hostData" size = "30" 
			    		           maxlength = "256"/>							<% // 800WA_WEBCONSOLE284 %>
			    	</td>
			    </tr>
		    
	    	    <tr>
<%--   	    	    <td align="right">   --%>                                   <% // 800WA_WEBCONSOLE428 %>
    	    	    <td class = "small" align="right">    	    	            <% // 800WA_WEBCONSOLE428 %>
						<%-- for Register button --%>
				<%--		<html:submit property = "Register">    --%>			<% // 800WA_WEBCONSOLE284 %>
							<html:submit property = "Register" 
							 styleClass = "small">                              <% // 800WA_WEBCONSOLE284 %>
							<util:sanitize>
								<bean:message 
								    bundle = 
  							         '<%= Const.MESSAGE_RESOURCES_KEY_RGTAGT %>' 
								    key = "regist.agent.operation.regist"/>
							</util:sanitize>
						</html:submit>		
	
						<%-- for close button --%>
				<%--	<html:button property = "Close"       
									 onclick = "parent.close()">    --%>		<% // 800WA_WEBCONSOLE284 %>
<%--						<html:button property = "Close" styleClass = "small"	
						             onclick = "parent.close()">				<% // 800WA_WEBCONSOLE284 %>
							<util:sanitize>
								<bean:message bundle = 
								'<%= Const.MESSAGE_RESOURCES_KEY_RGTAGT %>' 
								key = "regist.agent.close"/>
							</util:sanitize>
						</html:button>						--%> 				<% // 800WA_WEBCONSOLE291 %>
						<html:button property = "Close" styleClass = "small"	
						             onclick = "parent.close()">
							<util:sanitize>
								<bean:message bundle = 
								'<%= Const.MESSAGE_RESOURCES_KEY_RGTAGT %>' 
								key = "regist.agent.operation.terminate"/>
							</util:sanitize>
						</html:button>											<% // 800WA_WEBCONSOLE291 %>
		            </td>
	    	    </tr>
	    	</table>
		</html:form>
	</body>

  <%-- Get the error information  from the message resources property file--%>
  <util:set name = "errorArray">
      var MSG_HOST_CHECK = "<%=MessageConstant.MSG_HOST_CHECK %>";
      var MSG_RGTAGT_IP_HOST_NAME_ERROR = 
        "<%=MessageConstant.MSG_RGTAGT_IP_HOST_NAME_ERROR %>";
      errorMsg[MSG_HOST_CHECK] = '<bean:message 
          bundle = "<%= Const.MESSAGE_RESOURCES_KEY_ERRMESSAGE%>"	
          key = "<%=MessageConstant.MSG_HOST_CHECK %>"/>';
      errorMsg[MSG_RGTAGT_IP_HOST_NAME_ERROR] = '<bean:message 
          bundle = "<%= Const.MESSAGE_RESOURCES_KEY_ERRMESSAGE%>"
          key = "<%=MessageConstant.MSG_RGTAGT_IP_HOST_NAME_ERROR %>"/>';
  </util:set>

  <%-- Include the scripts for the error information--%>
  <script>
    <%= pageContext.getAttribute("errorArray").toString()%>
  </script>
</html:html>