<%--
  /**
   * Copyright (c) 2003 by Sun Microsystems, Inc. All rights reserved.
   * Use is subject to license terms.
   *
   * "@(#)sm_array_registration.jsp    1.11    03/06/02     SMI"
   * 
   */
 --%>
<%@ include file="/layout/toptags.jsp"%>
<%@ page import="com.sun.netstorage.array.mgmt.cfg.ui.forms.ArrayRegistrationForm"%>
<!-- locale stuff -->
<html:html locale="true">
<!-- end locale -->

<!-- Place Java Script Here -->
 
<!-- HTML -->
<head>
<%@include file="/layout/page_head_section.jsp"%>
    <title>
        <bean:message  key="storage.mgmt.array.reg.crumb"/>
    </title>
</head>

<%@include file="/layout/bodytag.jsp"%>
<%@include file="/layout/top.jsp"%>
<%@include file="/layout/breadcrumb.jsp"%>
<%@include file="/layout/spacer.jsp"%>
<%@include file="/layout/user_messages.jsp"%>

<html:form action="root.menu.item0arrayreg.do">

<!-- hidden element which specifies the action for this form -->
<input type="hidden" name="request_action" value="<%=request.getAttribute("request_action")%>">

<div class="content-layout">

  <%
    boolean hasList = true;
    ArrayRegistrationForm form = (ArrayRegistrationForm)session.getAttribute("ArrayRegistration");
    List arrays = null;
    if(form != null) {
        arrays = form.getRegisteredArrays();
    }
    int listSize = 0;
    if(arrays != null) {
    	listSize = arrays.size();
    }
    if(arrays == null || arrays.size() == 0) {    	      
    	hasList = false;    
  %>
   <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>
       <table>
         <tr><td>
                <img src="/nsm/images/general/dot.gif" width="1" height="10" border="0">
         </td></tr>
         <tr><td>
           <table border="0" cellspacing="0" cellpadding="2" align="left" bgcolor="#9999CC">
             
             <tr><td>
               <table cellspacing="0" cellpadding="5" border="0"  bgcolor="#FFFFFF">
                 <tr>
                  <td valign="top"><img src="images/icons/warning_16.gif" width="24" height="24" alt='<bean:message key="icon.warning"/>' border="0"></td>
                  <td><div class="error-message-header-text">                                   
                     <b><bean:message key="storage.mgmt.system.noarrays"/></b></div>
                </tr>
              </table>
             </td></tr>
           </table>
         </td></tr>
         <tr><td>
            <img src="/nsm/images/general/dot.gif" width="1" height="10" border="0">
         </td></tr>
       </table>
     </td>
   </tr>
  </table>
  <% } %>

<!-- spacer between two sections -->
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><img alt border="0" height="8" width="1" src="images/general/dot.gif"></td>
  </tr>
</table>

  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tr>
            <td nowrap>
              <div class="major-category-text">
                <bean:message key="storage.mgmt.array.reg.header"/> 
              </div>
            </td>
            <td valign="bottom" width="99%">
              <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                  <td class="property-separator" valign="bottom"><img alt border="0" height="2" src="/images/general/dot.gif" width="1"></td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td><img alt border="0" height="5" src="/images/general/dot.gif" width="1"></td>
    </tr>
    <tr>
      <td><img alt border="0" height="5" src="/images/general/dot.gif" width="1"></td>
    </tr>
     <tr>
                        <td>
                           <bean:message key="storage.mgmt.array.reg.instructions"/>
                        </td>
                      </tr>
  </table>

<!-- spacer between two sections -->
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><img alt border="0" height="8" width="1" src="images/general/dot.gif"></td>
  </tr>
</table>


  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td nowrap>
        <table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left" valign="middle">
              <table border="0" cellpadding="0" cellspacing="0">
                <tr>                  
                  <td>
                    <table border="0" cellpadding="1" cellspacing="0" class="button-link-enabled-text">
                      <tr>
                        <td>
                          <table>
                            <tr>
                              <td align="center" valign="middle" nowrap>                                         
                                 <component:button text="storage.mgmt.array.reg.register.button" href="javascript:document.forms[0].action='root.menu.item0.item3registernew.do';document.forms[0].submit();" title="storage.mgmt.array.reg.register.button" isEnabled="<%=!readOnly%>" />
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>
                  <td width="10"><img alt width="10" height="1" border="0" src="images/general/dot.gif"></td>                  
                </tr>
              </table>
            </td>
            
            <td>
             <table border="0" cellpadding="0" cellspacing="0">
                <tr>                  
                  <td>
                    <table border="0" cellpadding="1" cellspacing="0" class="button-link-enabled-text">
                      <tr>
                        <td>
                          <table>
                            <tr>
                              <td align="center" valign="middle" nowrap>         
                                 <component:button text="storage.mgmt.array.reg.remove.button" href="javascript:document.forms[0].action='root.menu.item0.item3rmvregconfirm.do';document.forms[0].submit();" title="storage.mgmt.array.reg.remove.button" isEnabled="<%=!readOnly && hasList%>" />                                 
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>
                  <td width="10"><img alt width="10" height="1" border="0" src="images/general/dot.gif"></td>                  
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
 
 <% if(hasList) { %>
      <table>      
          <tr>
            <td nowrap>
              <table class="back-table" border="0" cellspacing="0" cellpadding="1" width="100%">
                <tr>
                  <td>
                    <table class="front-table" border="0" cellspacing="0" cellpadding="0" width="100%">
                      <tr class="header-row">
                        <td align="center" valign="middle" nowrap><a href="javascript:checkAll(document.forms[0])"><img src="images/icons/select-all-small.gif" alt='<bean:message key="table.select.all"/>' vspace="2" border="0" width="11" height="13"></a><a href="javascript:unCheckAll(document.forms[0])"><img src="images/icons/deselect-all-small.gif" alt='<bean:message key="table.deselect.all"/>' vspace="2" border="0" width="11" height="13"></a></td>
                        <td>
                          <div class="table-header-text">
                            <bean:message key="storage.mgmt.new.array.reg.table.ip"/>
                          </div>
                        </td>                        
                        <td>
                          <div class="table-header-text">
                            <bean:message key="storage.mgmt.new.array.reg.table.name"/>
                          </div>
                        </td>                      
                      </tr>                                           
                      <!-- Begin Array row listing -->           
                      <logic:present name="ArrayRegistration" property="registeredArrays">         
 				 	    <logic:iterate id="array" name="ArrayRegistration" property="registeredArrays" type="ArrayRegistration" indexId="index"> 
                          <tr>
                            <td align="center">                                                                  
                                <html:multibox name="ArrayRegistration" property="selectedIndices" disabled="<%=readOnly%>">
                                  <%=index%>
                                </html:multibox>
                            </td>   
                            <td>     
                              <div class="table-label-text">                    
                                <a href="root.menu.item0.item3editreg.do?index=<%=index%>">
                                <bean:write name="array" property="IPAddress"/>
                                </a>
                              </div>
                            </td> 
                            <td>              
                              <div class="table-label-text"> 
                                <bean:write name="array" property="hostname"/>
                              </div>
                            </td> 
                         </tr>
                        </logic:iterate>
                      </logic:present>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
<% } // end if(hasList) 
%>      
</div>

<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><img alt border="0" height="20" width="1" src="images/general/dot.gif"></td>
  </tr>
</table>



<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><img alt border="0" height="20" width="1" src="images/general/dot.gif"></td>
  </tr>
</table>

</html:form>
</body>
</html:html>
