<%--
  /**
   * Copyright (c) 2003 by Sun Microsystems, Inc. All rights reserved.
   * Use is subject to license terms.
   *
   * "@(#)sm_trays_include.jsp    1.2    03/07/29     SMI"
   * 
   */
 --%>
<%
  String nameForm = Constants.HttpSessionFields.T4FORM_NAME;
  if(request.getAttribute(Constants.HttpRequestFields.FORM_NAME) != null ) {
  	nameForm = (String)request.getAttribute(Constants.HttpRequestFields.FORM_NAME);
  }
  T4Interface array =
    ((T4Interface)session.getAttribute(
      Constants.HttpSessionFields.CURRENT_T4));

%>
<!-- tray section instructions --> 
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
   <td nowrap>
       <bean:message key="express.subreports.tray.instructions"/>
  </td>
  </tr>
  <tr>
    <td align="left" valign="middle">
              <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td>
                    <table>
                      <tr>
                        <td>
                          <table>
                            <tr>
                              <td align="center" valign="middle" nowrap>
                                <component:button text="storage.mgmt.system.expert.tray.button" href="javascript:cloneTrayWizard();" title="storage.mgmt.system.expert.tray.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>
  </tr>
</table>

<!-- 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 class="major-category-text">
                <bean:message key="storage.mgmt.system.expert.tray.section" arg0='<%=((T4Form)session.getAttribute(nameForm)).getName()%>'/> 
              </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" 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>
                          <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.type"/>
                          </div>
                        </td>                                               
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.role"/>
                          </div>
                        </td>                                               
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.state"/>
                          </div>
                        </td>                                               
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.status"/>
                          </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>
                        <% 
                          int numOfColumns = 7;
                          if(array.isFeatureSupported(
                             Constants.SupportedFeature.FEATURE_ARRAY_HOT_SPARE)) {
                            numOfColumns = 8;
                        %>
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.ahs"/> 
                          </div>
                        </td>
                        <% } %>
                      </tr>
                      <logic:notPresent name="<%=nameForm%>" property="trays">
                        <tr>
                          <td colspan="<%=numOfColumns%>">
                             <bean:message key="pools.table.nopools"/>
                          </td>
                        </tr>
                      </logic:notPresent>

                      <!-- Begin tray row listing(s) -->                                                    
                      <logic:present name="<%=nameForm%>" property="trays">   
                                           
 				 	    <logic:iterate id="tray" name="<%=nameForm%>" property="trays" type="TrayInterface" indexId="index">
                          <tr>                             
                            <td align="center">            
                                <html:link href="root.menu.item0.item0trayedit.do" paramId="index" paramName="index">             
                                <bean:write name="tray" property="id"/></html:link>
                            </td> 
                           
                            <td align="center">
                              <%
                                String typeStr = "tray.type." + tray.getTrayType();                                
                              %>
                              <bean:message key="<%=typeStr%>"/>
                            </td>
                            <td align="center">
                              <%
                                String roleStr = "tray.role." + tray.getRole();                                
                              %>
                              <bean:message key="<%=roleStr%>"/>
                            </td>
                            <td align="center">
                              <%
                                String stateStr = "tray.state." + tray.getState();                                
                              %>
                              <bean:message key="<%=stateStr%>"/>
                            </td>
                            <td align="center">
                              <%
                                String statusStr = "tray.status." + tray.getStatus();                                
                              %>
                              <bean:message key="<%=statusStr%>"/>
                            </td>
                            <td align="center">                         
                                <bean:write name="tray" property="numberOfDrives"/>
                            </td> 
                            <td align="center">                         
                                <%=nf.format(nf.parse(Convert.bytesToGB(tray.getDriveCapacity())))%>
                                <bean:message key="size.GB"/>
                            </td> 
                            <% if(array.isFeatureSupported(
                                Constants.SupportedFeature.FEATURE_ARRAY_HOT_SPARE)) {
                            %>
                            <td align="center">                         
                               <%=tray.getNumberOfDisksInRole(Constants.Disks.ROLE_ARRAY_SPARE)%>
                            </td> 
                            <% } %>
                         </tr>
                        </logic:iterate>
                        
                      </logic:present>                 
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>          
        </table>
      </td>
    </tr>
  </table>

