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

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


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

<jsp:useBean scope = "session" id = "GroupCreateOrEditBean" class = 
 "JP.co.Hitachi.soft.System_Manager.webconsole.model.bean.GroupCreateOrEditBean" 
 />                                                                             <%-- 800WA_WEBCONSOLE243 --%>

<%-- Get group name label from the group properties file and 
     set it into the pageContext implicit object as an attribute" --%>
<util:set name = "CreateNameLabel">
	<bean:message 
     bundle = '<%= Const.MESSAGE_RESOURCES_KEY_GROUP %>' 
	 key = "group.create.set.group.name" />
</util:set>

<%-- Get "Group name" from the Const file and 
     set it into the pageContext implicit object as an attribute" --%>
<util:set name = "CreateGroupNameMsg">
	<%= Const.GROUP_NAME %>
</util:set>                                                                     <%-- 800WA_WEBCONSOLE305 --%>
	    	    
<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/header.js">
		</script>
		<script src = "js/group.js">
		</script>
		<script src = "js/common.js">
		</script>
 	</head>
 	 
	<%-- <body onload = "Close.focus()"> --%>                                   <%-- 800WA_WEBCONSOLE295 --%> 
<%--<body onload = "document.forms[0]['groupName'].focus()">  --%>              <%-- 800WA_WEBCONSOLE295 --%> <%-- 800WA_WEBCONSOLE353 --%>
<%--<body onload = "document.forms[0]['groupName'].focus()" 
	                            onunload = "focusTextLost()" > --%>             <%-- 800WA_WEBCONSOLE353 --%>	<%-- 800WA_WEBCONSOLE367 --%>
    <body onload = "document.forms[0]['groupName'].focus()">                    <%-- 800WA_WEBCONSOLE367 --%>
        <% String l_stClimbTrailFormatted = GroupCreateOrEditBean.              // 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_WEBCONSOLE243 --%>	<%-- 800WA_WEBCONSOLE273 --%>	<%-- 800WA_WEBCONSOLE342 --%>
	       <%=  l_sbClimbTrail.toString() %>                                    <%-- 800WA_WEBCONSOLE342 --%> 
		</span>
		 
		<%-- Get help url from the group properties file and 
		      set it into the pageContext implicit object as an attribute" --%>
		<util:set name = "GroupCreateHelpURL">
			<bean:message 
			 bundle = "<%= Const.MESSAGE_RESOURCES_KEY_INTERNAL %>" 
		 	 key = "internal.group.create.help.url"/>
	    </util:set>
        
        <%-- Get data from the javascript function  file and 
             set it into the pageContext implicit object as an attribute" --%> 
        <%--
	    <util:set name = "FnOpenHelp">
		    openHelp('<util:rewrite action = "help"/>',
		    '<%= pageContext.getAttribute("GroupCreateHelpURL").toString() %>',
		    '<%= Const.ATTRIBUTE_REQUEST_HELP_CONTENTS %>');
	    </util:set> --%>                                                        <%-- 800WA_WEBCONSOLE395 --%>

	    <util:set name = "FnOpenHelp">
		    openHelp('<util:rewrite action = "help"/>',
		    '<%= pageContext.getAttribute("GroupCreateHelpURL").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.create.climb.trail.help" />
		    </html:link>
		</div><hr/>
		
		<div class = "box small"><br/>
			<bean:message bundle = "<%= Const.MESSAGE_RESOURCES_KEY_GROUP %>" 
			 key = "group.create.explain.no1" />
		</div>
		
		<div class = "box small"><br/>
<%--		<html:form action = "GroupCreateSetAction"> --%>                    <%-- 800WA_WEBCONSOLE344 --%>
            <html:form action = "GroupCreateSetAction"
                                      onsubmit = "return textInputCheck()">     <%-- 800WA_WEBCONSOLE344 --%>
		    	<%= pageContext.getAttribute("CreateNameLabel").toString() %>
                <html:hidden property = "groupId" 
                 value = 
                 "<%= String.valueOf(GroupCreateOrEditBean.getGroupId()) %>" /> <%-- 800WA_WEBCONSOLE243 --%>
                 
			   <%-- <html:text property = "groupName" /> --%>                   <%-- 800WA_WEBCONSOLE297 --%>
			   <html:text property = "groupName" size = "30" maxlength = "259"/><%-- 800WA_WEBCONSOLE297 --%>
			    
			    <html:hidden property = "climbTrail" 
			     value = "<%= GroupCreateOrEditBean.getClimbTrail() %>"/>       <%-- 800WA_WEBCONSOLE243 --%>
			     
			    <html:hidden property = "climbTrailFormatted" 
			     value = "<%= GroupCreateOrEditBean.getClimbTrailFormatted() %>"
			     />                                                             <%-- 800WA_WEBCONSOLE243 --%>
			     
<%--	   </html:form>     --%>                                                <%-- 800WA_WEBCONSOLE451 --%>
		</div>
		
		<div align = "right" class = "small">
		     
		    <%-- Get the name for create button from the GroupProperties file 
		         and set it into the pageContext implicit object as an attribute
		     " --%>  
			<util:set name = "create">
				<bean:message 
				 bundle = '<%= Const.MESSAGE_RESOURCES_KEY_GROUP %>' 
				 key = "group.create.climb.trail.create" />
			</util:set>
			
			<%-- Get the name for close button from the GroupProperties file and
			     set it into the pageContext implicit object as an attribute" 
			 --%>
			<util:set name = "terminate">
				<bean:message 
				 bundle = "<%= Const.MESSAGE_RESOURCES_KEY_GROUP %>" 
				 key = "group.create.climb.trail.terminate" />
			</util:set>
				
	<%--    <html:button property = "createbut" 
		        value = '<%= pageContext.getAttribute("create").toString()%>' 
		     	onclick = "textInputCheck()"/> --%>                             <%-- 800WA_WEBCONSOLE306 --%>
		     	
	<%--	<html:button property = "Close" 
	 			value = '<%= pageContext.getAttribute("terminate").toString()%>' 
	 			onclick = "parent.close()"/> --%>                               <%-- 800WA_WEBCONSOLE306 --%>
	 			
	 		<html:button property = "createbut" styleClass = "small"
		        value = '<%= pageContext.getAttribute("create").toString()%>' 
		     	onclick = "textInputCheck()"/>                                  <%-- 800WA_WEBCONSOLE306 --%>
		     	
<%-- 		<html:button property = "Close" styleClass = "small"
	 			value = '<%= pageContext.getAttribute("terminate").toString()%>' 
	 			onclick = "parent.close();"/> --%>                              <%-- 800WA_WEBCONSOLE306 --%>	<%-- 800WA_WEBCONSOLE353 --%>
	 			
<%-- 		<html:button property = "Close" styleClass = "small"
	 			value = '<%= pageContext.getAttribute("terminate").toString()%>' 
	 			onclick = "focusTextLost();parent.close();"/> --%>              <%-- 800WA_WEBCONSOLE353 --%>	<%-- 800WA_WEBCONSOLE367 --%>

            <html:button property = "Close" styleClass = "small"
	 			value = '<%= pageContext.getAttribute("terminate").toString()%>' 
	 			onclick = "parent.close();"/>                                   <%-- 800WA_WEBCONSOLE367 --%>	 				
		</div>
		</html:form>                                                            <%-- 800WA_WEBCONSOLE451 --%>
	</body>
	
	<%-- Get the array of error message from the message constant and 
	     set it into the pageContext implicit object as an attribute" --%>
<%-- <util:set name = "ErrorArray">
				
		var MSG_GROUP_CHECK = 
			"<%= MessageConstant.MSG_GROUP_CHECK %>";
		var MSG_GROUP_CHARACTER_CHECK =
			"<%= MessageConstant.MSG_GROUP_CHARACTER_CHECK %>";
		var MSG_COMMON_RANGE_CHARACTER_CHECK =
			"<%= MessageConstant.MSG_COMMON_RANGE_CHARACTER_CHECK %>";
			
		errorMsg[MSG_GROUP_CHECK] =
			'<bean:message bundle = 
			  "<%= Const.MESSAGE_RESOURCES_KEY_ERRMESSAGE %>" 
			  key = "<%= MessageConstant.MSG_GROUP_CHECK %>"/>'; 
         			
   		errorMsg[MSG_GROUP_CHARACTER_CHECK] =
			'<bean:message bundle = 
			  "<%= Const.MESSAGE_RESOURCES_KEY_ERRMESSAGE %>" 
			  key = "<%= MessageConstant.MSG_GROUP_CHARACTER_CHECK %>" 
			  arg0 = '<%= pageContext.getAttribute(
			                             "CreateNameLabel").toString() %>' />'; 
         		
   		errorMsg[MSG_COMMON_RANGE_CHARACTER_CHECK] =
			'<bean:message bundle = 
			  "<%= Const.MESSAGE_RESOURCES_KEY_ERRMESSAGE %>" 
			  key = "<%= 
			  MessageConstant.MSG_COMMON_RANGE_CHARACTER_CHECK %>" 
			  arg0 = '<%= pageContext.getAttribute("CreateNameLabel").toString()
			           %>'
			  arg1 ='<%= String.valueOf(Const.LENGTH_MAXIMUM_GROUP_NAME) %>' />'; 	  		
	</util:set> --%>                                                            <%-- 800WA_WEBCONSOLE305 --%>
		
	<util:set name = "ErrorArray">
				
		var MSG_GROUP_CHECK = 
			"<%= MessageConstant.MSG_GROUP_CHECK %>";
		var MSG_GROUP_CHARACTER_CHECK =
			"<%= MessageConstant.MSG_GROUP_CHARACTER_CHECK %>";
		var MSG_COMMON_RANGE_CHARACTER_CHECK =
			"<%= MessageConstant.MSG_COMMON_RANGE_CHARACTER_CHECK %>";
			
		errorMsg[MSG_GROUP_CHECK] =
			'<bean:message bundle = 
			  "<%= Const.MESSAGE_RESOURCES_KEY_ERRMESSAGE %>" 
			  key = "<%= MessageConstant.MSG_GROUP_CHECK %>"/>'; 
         			
   		errorMsg[MSG_GROUP_CHARACTER_CHECK] =
			'<bean:message bundle = 
			  "<%= Const.MESSAGE_RESOURCES_KEY_ERRMESSAGE %>" 
			  key = "<%= MessageConstant.MSG_GROUP_CHARACTER_CHECK %>" 
			  arg0 = '<%= pageContext.getAttribute(
			                             "CreateGroupNameMsg").toString() %>' />'; 
         		
   		errorMsg[MSG_COMMON_RANGE_CHARACTER_CHECK] =
			'<bean:message bundle = 
			  "<%= Const.MESSAGE_RESOURCES_KEY_ERRMESSAGE %>" 
			  key = "<%= 
			  MessageConstant.MSG_COMMON_RANGE_CHARACTER_CHECK %>" 
			  arg0 = '<%= pageContext.getAttribute("CreateGroupNameMsg").toString()
			           %>'
			  arg1 ='<%= String.valueOf(Const.LENGTH_MAXIMUM_GROUP_NAME) %>' />'; 	  		
	</util:set>                                                                 <%-- 800WA_WEBCONSOLE305 --%>
	
	<%-- Get the charater specification from the Const file and 
	     set it into the pageContext implicit object as an attribute" --%>
	<util:set name = "CreateTextInputCheck">
		var LENGTH_MAXIMUM_GROUP_NAME = 
		                 '<%= Const.LENGTH_MAXIMUM_GROUP_NAME %>';
		var GROUP_TEXT_CHARACTER_ASCII_LOWER_LIMIT = 
		                 '<%= Const.GROUP_TEXT_CHARACTER_ASCII_LOWER_LIMIT %>';
		var GROUP_TEXT_CHARACTER_ASCII_UPPER_LIMIT = 
		                 '<%= Const.GROUP_TEXT_CHARACTER_ASCII_UPPER_LIMIT %>';
    </util:set>	
    		
	<script>
		var errorMsg = new Array();
		<%= pageContext.getAttribute("ErrorArray").toString() %>
		<%= pageContext.getAttribute("CreateTextInputCheck").toString() %>
	</script>

</html:html>
