<%--
  /**
   * Copyright (c) 2003 by Sun Microsystems, Inc. All rights reserved.
   * Use is subject to license terms.
   *
   * "@(#)sm_addprofilewiz_selecttrays.jsp    1.8    03/06/04     SMI"
   * 
   */
 --%>
<%@ include file="/layout/toptags.jsp"%>
<html:html>

<head>
<%@include file="/layout/page_head_section.jsp"%>
</head>

<%@ include file="/layout/wizard_body_tag.jsp" %>
<html:form action="/AddProfileWizard.do">
<%@ include file="/wizard/wizard_framework_fields.jsp"%>

<div class="content-layout">

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr class="wizard-content-title-row">
    <td>
      <div class="wizard-content-title-text">
        <bean:message key="storage.mgmt.system.profile.wizard.toc.2"/>
      </div>
    </td>
  </tr>
  <tr>
    <td class="wizard-content-divider"><img alt width="1" height="1" src="/image
s/general/dot.gif" border="0"></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="20" width="1" src="images/general/dot.gif"></td>
  </tr>
</table>

  <!-- spacer between two sections -->
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <%
       String profile = 
        ((T4Interface)session.getAttribute(
           Constants.HttpSessionFields.CURRENT_T4)).getProfile().getName();
       MessageResources messages = 
            (MessageResources) application.getAttribute(Action.MESSAGES_KEY);
       String localizedProfileName =
         "<b>" + messages.getMessage(request.getLocale(), profile) + "</b>";
    %>
    <td><bean:message key="storage.mgmt.system.addprofile.wizard.traydirections" arg0="<%=localizedProfileName%>" arg1='<bean:write name="CurrentT4" property="name"/>'/>
    </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="20" width="1" src="images/general/dot.gif"></td>
  </tr>
</table>

<!-- BEGIN SECTION:  variable length table populated with items contained in major
                     object displayed on this page -->
<!-- OPTIONAL section, dependig on purpose of page -->
<!-- NOTE:  the buttons above the table are optional.  They exist on pages where
            they are required.  If the buttons are not there, then the first column
            with the checkboxes also has to be removed -->
  <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.system.profile.wizard.tray.section" arg0='<bean:write name="CurrentT4" property="name"/>'/>
                <bean:write name="CurrentT4" property="name"/>
              </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>
  </table>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    
    <tr>
      <td><img alt border="0" height="5" src="/images/general/dot.gif" width="1"></td>

    </tr>
  </table>
  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td nowrap>
        <table border="0" cellspacing="0" cellpadding="0">          
          <tr>
            <td><img alt width="1" height="2" border="0" src="images/general/dot.gif"></td>
          </tr>
          <tr>
            <td nowrap>
              <table class="back-table" border="0" cellspacing="0" cellpadding="1">
               
                <tr>
                  <td>
                    <table class="front-table" border="0" cellspacing="0" cellpadding="0">
                      <tr class="header-row">
                        <td></td>
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.id"/>
                          </div>
                        </td>                        
                        <td nowrap>
                          <div class="table-header-text">
                           <bean:message key="tray.table.hotspare"/> 
                          </div>
                        </td>
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.drivenum"/> 
                          </div>
                        </td>
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.drivecapacity"/> 
                          </div>
                        </td>
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.drivetoadd"/> 
                          </div>
                        </td>
                      </tr>
                      <!-- Begin tray row listing(s) -->   
                      <logic:present name="Profile" property="traysWithSpace">                                                                                                               
                      <%@ page import="com.sun.netstorage.array.mgmt.cfg.ui.forms.ProfileForm" %>
                      <%@ page import="com.sun.netstorage.array.mgmt.cfg.ui.business.TrayWrapper" %>
                      <%                         
                         ProfileForm form = (ProfileForm)session.getAttribute("Profile");
                         List traysWithSpace = null;
                         if (form != null) {
	                        traysWithSpace = form.getTraysWithSpace();
	                        if (traysWithSpace != null) {
                               	for(int i = 0; i < traysWithSpace.size(); i++) {
                               	   TrayWrapper trayWrapper = (TrayWrapper)traysWithSpace.get(i);
                               	   TrayInterface tray = trayWrapper.getTray();
                      %>
                               	<tr>           
                      		      <td>
                            		  <input type="checkbox" name="tray<%=i%>" value="<%=i%>">
	                              </td>                  
      		                      <td align="center">                         
            		                    <%=tray.getId()%>
                    		      </td>                             
                            	  <td align="center">                         
		                                <%=tray.getNumberOfHotSpare()%>
                                  </td> 
                                  <td align="center">                         
                                        <%= tray.getNumberOfDrives() %>
                                  </td> 
                                  <td align="center">                         
                                       <%= tray.getDriveCapacity()%>
                                  </td>                              
                                  <td align="center">   
                            
                                  <select name="numdrives<%=i%>">    
                                  <%
                                      List possibleDrives = trayWrapper.getPossibleDrivesToAdd();
                                      for(int j = 0; j < possibleDrives.size(); j++) {
                                      	int drive = ((Integer)possibleDrives.get(j)).intValue();                                      	
                                  %>                            	                            	  
 	    	                           <option ><%=drive%>
 	    	                      <%
                                      }
 	    	                      %>
                                  <select>  
        	                                                       
                            </td>
                         </tr>
                      <%
                               	}
	                        }
                         }
                      %>
                      
 				 	    
                       </logic:present>                                                          
                    </table>
                  </td>
                </tr>                 
              </table>
            </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="20" width="1" src="images/general/dot.gif"></td>
  </tr>
</table>


</div>

</html:form>
</body>

</html:html>
