<%--
  /**
   * Copyright (c) 2003 by Sun Microsystems, Inc. All rights reserved.
   * Use is subject to license terms.
   *
   * "@(#)sm_createpoolwiz_selectname.jsp     1.2     03/08/07     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="/CreatePoolWizard.do">
<% try { %>
<%@ include file="/wizard/wizard_framework_fields.jsp"%>

<div class="content-layout">

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

<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.pool.createwiz.toc.3"/>
      </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 -->
<%@include file="/layout/spacer.jsp"%>

<!-- instructions -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td>
       <% if(((T4Interface)session.getAttribute(
                Constants.HttpSessionFields.CURRENT_T4)).
                 isFeatureSupported(
                  Constants.SupportedFeature.FEATURE_ARRAY_HOT_SPARE)) { 
       %>    
          <bean:message key="pool.createwiz.selname.instructions"/>
       <% } else { %>
          <bean:message key="pool.createwiz.selname.instructions.noahs"/>
       <% } %>
    </td>
  </tr>
</table>

<%
      PoolCreateForm form = 
        (PoolCreateForm)session.getAttribute(
          Constants.HttpSessionFields.CREATE_POOL_FORM_NAME);
      StorageProfile profile = form.getSelectedProfileObject();

      boolean isVariable = 
        Constants.ProfileProperties.NUMBER_OF_DRIVES_VARIABLE.equals(
          profile.getNumberOfDrives());
%>

<!-- spacer between two sections -->
<%@include file="/layout/spacer.jsp"%>

  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tr>

            <td nowrap>
              <div>
                <bean:message key="configure.storage.selected.profile"/>
                <bean:write name="<%=Constants.HttpSessionFields.CREATE_POOL_FORM_NAME%>" property="newProfileName"/>
              </div>
            </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>
  
  <!-- whole tray listing 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 nowrap colspan="2">
                          <div class="table-header-text">
                            <bean:message key="pool.createwiz.selname.poolsettings"/>
                          </div>
                        </td>      
                      </tr>
                                                              
                     <tr>           
                       <td align="right">     
                         <div class="table-label-text">                    
                            <bean:message key="pool.createwiz.selname.poolname"/>
                         </div>
                        </td>     
                        <td align="left">  
                          <div class="table-label-text">
                            <html:text name="<%=Constants.HttpSessionFields.CREATE_POOL_FORM_NAME%>" property="newPoolName" maxlength='<%="" + Constants.ObjectValidation.MAX_POOL_NAME%>'/>
                          </div>
                        </td>                    
                     </tr>           
                     <tr>           
                        <td align="left">        
                          <div class="table-label-text">                  
                            <bean:message key="pool.createwiz.seldisks"/>
                          </div>
                        </td>      
                        <td>                         
                          <div class="table-label-text"> 
                            <%
                              if(isVariable) {
                            %>
                               <html:select name="<%=Constants.HttpSessionFields.CREATE_POOL_FORM_NAME%>" property="disksToAssign">
                                 <html:options name="<%=Constants.HttpSessionFields.CREATE_POOL_FORM_NAME%>" property="possibleDisksToAssign"/>
                               </html:select>
                            <% } else { %>
                                  <!-- we still have to pass the number of drives 
                                       if it's not variable; so we need a hidden field -->
                                  <html:hidden name="<%=Constants.HttpSessionFields.CREATE_POOL_FORM_NAME%>" property="disksToAssign" value="<%=form.getSelectedProfileObject().getNumberOfDrives()%>"/>
                                  <bean:write name="<%=Constants.HttpSessionFields.CREATE_POOL_FORM_NAME%>" property="selectedProfileObject.numberOfDrives"/>
                            <% } %>
                          </div>
                        </td>
                      </tr>
                      <% 
                         // if the ARRAY hot spare feature is not supported,
                         //  then we show the hot spare selection
                         if(!((T4Interface)session.getAttribute(
                             Constants.HttpSessionFields.CURRENT_T4)).
                              isFeatureSupported(
                               Constants.SupportedFeature.FEATURE_ARRAY_HOT_SPARE)) { 
                      %>
                     <tr>           
                        <td align="left">        
                          <div class="table-label-text">                  
                            <bean:message key="tray.table.hotspare"/>
                          </div>
                        </td>      
                        <td>                         
                          <div class="table-label-text"> 
                               <html:select name="<%=Constants.HttpSessionFields.CREATE_POOL_FORM_NAME%>" property="hotSpare">
                                  <html:option key="0" value="<%="" + Constants.Tray.HOTSPARE_0%>" />
                                  <html:option key="1" value="<%="" + Constants.Tray.HOTSPARE_1%>" />
                                </html:select>
                          </div>
                        </td>
                      </tr>
                      <% } %>
                    </table>
                  </td>
                </tr>             
              </table>
            </td>
          </tr>           
        </table>
      </td>
    </tr>
  </table> <!-- end whole tray table listing -->

</div>

<% } catch(Exception e) {
        e.printStackTrace();
}
%>
</html:form>
</body>

</html:html>
