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

<!-- 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="main.menu.title"/>
    </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.item0.item2applydiffprofile.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">

<%
 com.sun.netstorage.array.mgmt.cfg.ui.forms.PoolForm form = 
  (com.sun.netstorage.array.mgmt.cfg.ui.forms.PoolForm)
   session.getAttribute(Constants.HttpSessionFields.POOLFORM_NAME);

 boolean hasList = false;
 List profileList = (List)request.getSession().getAttribute(
    Constants.HttpSessionFields.NON_DESTRUCTIVE_PROFILES_LIST);
 if(profileList != null && !profileList.isEmpty()) {
    hasList = true;
 }

 // set the cancel link to be the current page by default
 //  this should be overwritten unless an exception occurs
 //   or if the crumb is not found
 String cancelLink = "root.menu.item0.item2applydiffprofile.do";
 try {
   if(crumbs != null) {
     // get the cancel button link from the previous breadcrumb
     //  so it's the second to the last link (-2)
     crumb = 
      (com.sun.netstorage.array.mgmt.cfg.ui.core.action.Crumb)crumbs.get(crumbs.size() - 2);
     if(crumb != null) {
        cancelLink = crumb.getLink();
     }
   }
 } catch(Exception ex) {}
 
%>

<input type="hidden" name="name" value="<%=form.getDetailedPool().getName()%>">
<!-- 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="pool.details.applydiff.header" arg0="<%=form.getDetailedPool().getName()%>"/> 
              </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="pool.details.applydiff.currentprofile" arg0="<%=form.getDetailedPool().getProfileName()%>"/>
      </td>
    </tr>
    <tr>
      <td><img alt border="0" height="5" src="/images/general/dot.gif" width="1"></td>
    </tr>
    <tr>
       <td>
         <bean:message key="pool.details.applydiff.instructions"/>
       </td>
    </tr>
  </table>

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

  <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="button.save" href="javascript:submitForm('save');" title="button.save" 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>
            
            <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="button.cancel" href="<%=cancelLink%>" title="button.cancel" isEnabled="true" />
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
 
      <table>      
         <%@include file="/layout/prevnext.jsp"%>   
          <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> </td>
                        
                        <td>
                          <div class="table-header-text">
                            <bean:message key="storage.mgmt.system.profileinfo.table.name"/>
                          </div>
                        </td>                        
                        
                        <td>
                          <div class="table-header-text">
                            <bean:message key="storage.mgmt.system.profileinfo.table.raid"/>
                          </div>
                        </td>   
                        <td>
                          <div class="table-header-text">
                            <bean:message key="storage.mgmt.system.profileinfo.table.segmentsize"/>
                          </div>
                        </td>                      
                        <td>
                          <div class="table-header-text">
                            <bean:message key="storage.mgmt.system.profileinfo.table.readahead"/>
                          </div>
                        </td>                      
                        <td>
                          <div class="table-header-text">
                            <bean:message key="storage.mgmt.system.profileinfo.table.arraytype"/>
                          </div>
                        </td>                      
                      </tr>                                           
                      <logic:notPresent name="<%=Constants.HttpSessionFields.NON_DESTRUCTIVE_PROFILES_LIST%>">         
                         <tr>
                           <td colspan="6">
                              <bean:message key="pool.details.applydiff.noprofiles"/>
                           </td>
                         </tr>
                      </logic:notPresent>
                      <!-- Begin Profile row listing -->           
                      <logic:present name="<%=Constants.HttpSessionFields.NON_DESTRUCTIVE_PROFILES_LIST%>">         
                        <%@include file="/layout/listingCalc.jsp"%>
 				 	    <logic:iterate id="profile" name="<%=Constants.HttpSessionFields.NON_DESTRUCTIVE_PROFILES_LIST%>" type="StorageProfile" indexId="index" offset='<%=offsetStr%>' length='<%=lengthStr%>'>

                          <tr>
                            <td align="center"> 
                              <% 
                                // select the first one by default
                                if(index.intValue() == 0) { %>
                                 <input checked type="radio" name="profileindex" value="<%=index%>">
                              <% } else { %>
                                 <input type="radio" name="profileindex" value="<%=index%>">
                              <% } %>
                            </td>   
                            <td>     
                              <div class="table-label-text">                    
                                 <html:link href="root.menu.item0.item3profiledetails.do"
              	                   paramId="profileName" paramName="profile" paramProperty="name">
                                  <bean:write name="profile" property="name"/>
                                 </html:link>
                              </div>
                            </td> 
                            <td align="right">              
                              <div class="table-label-text">                 
                                 <bean:write name="profile" property="raidLevel"/>
                              </div>
                            </td>                                                
                            <td align="right">              
                              <div class="table-label-text">                 
                                <% String segSize = "array.segmentSize." + 
                                    profile.getSegmentSize();%>
                                <bean:message key="<%=segSize%>"/>

                              </div>
                            </td>                                                
                            <td align="left">              
                              <div class="table-label-text">                 
                               <% String ra = "array.readahead." + 
                                  ((profile.getReadaheadMode() != 0) ? "1" : "0") ;%>
                                <bean:message key="<%=ra%>"/>
                              </div>
                            </td>                                                
                            <td align="left">              
                              <div class="table-label-text">                 
                                 <% String at = "array.type." + profile.getArrayType();%>
                                 <bean:message key="<%=at%>"/>
                              </div>
                            </td>                                                
                         </tr>
                        </logic:iterate>
                      </logic:present>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
         <%@include file="/layout/prevnext.jsp"%>   
        </table>
</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>
