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

<head>
<%@include file="/layout/page_head_section.jsp"%>
<script language="JavaScript">
	function changeProfileFilter() {
       parent.setPage(0, "Page");
	}
</script>
</head>

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

<div class="content-layout">

<%@ include file="/layout/user_messages.jsp"%>
<%@ page import="com.sun.netstorage.array.mgmt.cfg.ui.forms.ProfileForm"%>
<% 
    ProfileForm form = (ProfileForm)session.getAttribute("Profile");
    T4Interface currentT4 = (T4Interface)session.getAttribute("CurrentT4");
%>

<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.chgprofile.wizard.profilesection"/>
      </div>
    </td>
  </tr>
  <tr>
    <td class="wizard-content-divider"><img alt width="1" height="1" src="/images/general/dot.gif" border="0"></td>
  </tr>
  <tr>
      <td><img alt border="0" height="5" src="/images/general/dot.gif" width="1"></td>
  </tr>

</table>


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

<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="storage.mgmt.system.chgprofile.wizard.current"/>
            </div>
          </td>
        </tr>
        <tr height="1">
          <td class="line-row" colspan="2" height="1"><img src="images/general/dot.gif" border="0" width="1" height="1"></td>
        </tr>
        <tr>
          <td nowrap>
            <div class="table-normal-text">
                <bean:message key="storage.mgmt.system.chgprofile.wizard.profilename"/>
            </div>
          </td>
          <td nowrap>
            <div class="table-normal-text">
                <bean:message key="<%=form.getCurrentProfile().getName()%>"/>
            </div>
          </td>
        </tr>
        <tr>
          <td align="left" nowrap>
            <div class="table-normal-text">
              <bean:message key="storage.mgmt.system.profileinfo.table.raid" />
            </div>
          </td>
          <td align="left" nowrap>
            <div class="table-normal-text">
               <bean:message key='<%="array.raid." + form.getCurrentProfile().getRaidLevel()%>'/>
            </div>
          </td>
        </tr>  
        <tr>
          <td align="left" nowrap>
             <div class="table-normal-text">
               <bean:message key="storage.mgmt.system.profileinfo.table.segmentsize" />
             </div>
          </td>
          <td align="left" nowrap>
             <div class="table-normal-text">
               <bean:message key='<%="array.segmentSize." + form.getCurrentProfile().getSegmentSize()%>'/>
             </div>
          </td>
        </tr>  
        <tr>
          <td align="left" nowrap>
            <div class="table-normal-text">
              <bean:message key="storage.mgmt.system.profileinfo.table.readahead" />
            </div>
          </td>
          <td align="left" nowrap>
             <div class="table-normal-text">
               <% int readaheadmode = 0;
                  if(form.getCurrentProfile().getReadaheadMode() > 0) {
                      readaheadmode = 1;
                  }
                  String raMode = "array.readahead." + readaheadmode;
               %>
               <bean:message key="<%=raMode%>"/>
             </div>
          </td>
        </tr>  
      </table>
    </td>
  </tr>
</table>

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

<!-- new Profile Section header and instructions table -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr class="wizard-content-title-row">
    <td>
        <b>
        <bean:message key="storage.mgmt.system.chgprofile.wizard.new.header"/>
        </b>
    </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.system.chgprofile.wizard.new.instr"/>
       </td>
  </tr>
  <tr>
      <td><img alt border="0" height="5" src="/images/general/dot.gif" width="1"></td>
  </tr>
<!-- end New Profile Section header and instructions table -->
</table>

<table class="back-table" border="0" cellspacing="0" cellpadding="1" width="100%">
<tr>
 <td>
   <table class="front-table" border="0" cellspacing="0" cellpadding="0">
     <!-- header row -->
     <tr class="header-row">
       <td valign="top"> 
          <div class="table-header-text">
            <bean:message key="storage.mgmt.system.chgprofile.wizard.profilelist"/> 
          </div>
       </td>
       <td>
         <div class="table-header-text">
            <bean:message key="storage.mgmt.system.chgprofile.wizard.profilelistdetails"/> 
         </div>
      </td>
    </tr> <!-- end header row -->
    <!-- data row with select box and details-->
    <tr>
      <td>
        <%
          String currentProfileName = "";
          try {
            currentProfileName = currentT4.getProfile().getName();
          }catch(Exception e) {}
        %>
        <logic:present name="Profile" property="allProfiles">
        <html:select size="10" name="Profile" property="newProfileName" onchange="javascript:changeProfileFilter()">
          <logic:iterate id="profile" name="Profile" property="allProfiles" type="StorageProfile" indexId="idx">
             <!-- don't show the current profile in the list -->
             <logic:notEqual name="profile" property="name" value="<%=currentProfileName%>">
             <html:option key="<%=profile.getName()%>" value="<%=profile.getName()%>"/>
             </logic:notEqual>
          </logic:iterate>
        </html:select>
        </logic:present>
      </td>
      <logic:present name="Profile" property="newProfileObject">
      <%
        StorageProfile newProfile = form.getNewProfileObject();
      %>
      <td width="100%" valign="top"> <!-- td for profile details -->
        <table>
          <tr>
            <td align="left" nowrap>
              <div class="table-normal-text">
               <bean:message key="storage.mgmt.system.profileinfo.table.name" />
              </div>
            </td>                        
            <td align="left" nowrap>
              <div class="table-normal-text"> 
                 <bean:message key="<%=newProfile.getName()%>"/>
              </div>
            </td>
          </tr>                        
          <tr>
            <td align="left" nowrap>
              <div class="table-normal-text">
                <bean:message key="storage.mgmt.system.profileinfo.table.raid" />
              </div>
            </td>
            <td align="left" nowrap>
              <div class="table-normal-text">
                 <% String raid = "array.raid." + newProfile.getRaidLevel();%>
                 <bean:message key="<%=raid%>"/>
              </div>
            </td>
          </tr>  
          <tr>
            <td align="left" nowrap>
              <div class="table-normal-text">
                <bean:message key="storage.mgmt.system.profileinfo.table.segmentsize" />
              </div>
            </td>
            <td align="left" nowrap>
              <div class="table-normal-text">                                                   
                 <% String segSize = "array.segmentSize." + newProfile.getSegmentSize();%>
                 <bean:message key="<%=segSize%>"/>
              </div>
            </td>
          </tr>  
          <tr>
            <td align="left" nowrap>
              <div class="table-normal-text">
                <bean:message key="storage.mgmt.system.profileinfo.table.readahead" />
              </div>
            </td>
            <td align="left" nowrap>
              <div class="table-normal-text">                                                   
               <% String ra = "array.readahead." + newProfile.getReadaheadMode();%>
               <bean:message key="<%=ra%>"/>
              </div>
            </td>
          </tr>  
        </table>
      </td> <!-- end td for profile details -->
      </logic:present>
    </tr> <!-- end data row-->
  </table><!-- end front-table-->
 </td>
</tr>
</table>

</div>

</html:form>
</body>

</html:html>
