<%--
  /**
   * Copyright (c) 2003 by Sun Microsystems, Inc. All rights reserved.
   * Use is subject to license terms.
   *
   * "@(#)sm_systemexpert_confirm.jsp    1.15    03/09/03     SMI"
   * 
   */
 --%>
<%@ page import="com.sun.netstorage.array.mgmt.cfg.ui.forms.T4Form" %>
<%@ 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="system.overview.clone.t4.confirm"/>
    </title>

<script language"javascript">
function changeInput() {
   var selection;
   for(var i = 0; i < document.forms[0].elements.length; i++) {
      // netscape 4.7 uses select-multiple
      if(document.forms[0].elements[i].type == "select-one" ||
         document.forms[0].elements[i].type == "select-multiple") {
         selection = document.forms[0].elements[i].options[document.forms[0].elements[i].selectedIndex].value;
      } else if(document.forms[0].elements[i].type == "text") {
        if(selection != null) {
          document.forms[0].elements[i].value=selection;
          selection = null;
        }
      }
   }
}
</script>

</head>

<div class="content-layout">

<%@include file="/layout/bodytag.jsp"%>
<%@include file="/layout/top.jsp"%>
<%@include file="/layout/breadcrumb.jsp"%>
<%@include file="/layout/spacer.jsp"%>

<html:form action="/root.menu.item0.item1express.do">
<input type="hidden" name="request_action" value="<%=request.getAttribute("request_action")%>">

<%@ include file="/layout/user_messages.jsp"%>
 
<%
boolean isSegmentSizeConfirmation = false;
boolean isDiskScrubbingConfirmation = false;
boolean isReadAheadConfirmation = false;
T4Form form = (T4Form) session.getAttribute("t4Form");
if (form != null) {
    isSegmentSizeConfirmation = form.getDestructiveSave();
    isDiskScrubbingConfirmation = 
          form.isDiskScrubbingChanging() && 
          Constants.T4.DISK_SCRUBBING_OFF.equals(form.getDiskScrubbing()) ;
    isReadAheadConfirmation = form.isReadAheadChanging();
}
%>
<!-- confirm header table -->
<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.confirm"/>
              </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> 
<!-- end confirm header table -->
 
<!-- spacer between two sections -->
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><img alt border="0" height="8" width="1" src="images/general/dot.gif"></td>
  </tr>
</table> 
<!-- end spacer table -->

<!-- diskscrubbing message table -->
<% if(isDiskScrubbingConfirmation ) { %>
<table>
  <tr>
   <td>
    <table border="0" cellspacing="0" cellpadding="2" align="left" bgcolor="#9999CC">
      <tr>
       <td>
        <table cellspacing="0" cellpadding="5" border="0"  bgcolor="#FFFFFF">
          <tr>
            <td valign="top"><img src="images/icons/warning_16.gif" width="16" height="16" alt='<bean:message key="icon.warning"/>' border="0"></td>
            <td><div class="error-message-header-text">
                   <bean:message key="storage.mgmt.system.expert.confirm.diskscrubbingmsg"/>
              </div>
            </td>
          </tr>
        </table>
       </td>
      </tr>
    </table>
   </td>
  </tr>
  <tr><td>
    <img src="/nsm/images/general/dot.gif" width="1" height="10" border="0">
  </td></tr>
</table> 
<!-- end diskscrubbing message table -->
<% } %>

<!-- readahead or segment size message table -->
<% if (isSegmentSizeConfirmation || isReadAheadConfirmation) { %>
<table>
  <tr>
   <td>
    <table border="0" cellspacing="0" cellpadding="2" align="left" bgcolor="#9999CC">
      <tr>
       <td>
        <table cellspacing="0" cellpadding="5" border="0"  bgcolor="#FFFFFF">
          <tr>
            <td valign="top"><img src="images/icons/warning_16.gif" width="16" height="16" alt='<bean:message key="icon.warning"/>' border="0"></td>
            <td><div class="error-message-header-text">
                <% 
                   // if we're changing the segment size, show the segment
                   //  size change warning; otherwise show the readahead change warning
                   if(isSegmentSizeConfirmation) { %>
                     <bean:message key="storage.mgmt.system.expert.confirm.msg"/>
                <% } else { %>
                     <!-- if this is a read ahead change and no pools, show no pools
                           message -->
                     <logic:notPresent name="t4Form" property="affectedPools">   
                        <bean:message key="storage.mgmt.system.expert.confirm.readahead.nopoolsmsg"/>
                     </logic:notPresent>
                     <logic:present name="t4Form" property="affectedPools">   
                        <bean:message key="storage.mgmt.system.expert.confirm.readahead.poolsmsg"/>
                     </logic:present>
                <% } %>
              </div>
            </td>
          </tr>
        </table>
       </td>
      </tr>
    </table>
   </td>
  </tr>
  <tr><td>
    <img src="/nsm/images/general/dot.gif" width="1" height="10" border="0">
  </td></tr>
</table> 
<% } %>
<!-- end readahed or segment size message table -->
<!-- button table -->
<table border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td>
    <table>
    <!-- buttons row -->
    <tr>
      <td align="center" valign="middle">
       <!-- outer confirm button table -->
       <table border="0" cellpadding="0" cellspacing="0" align="center">
          <tr>
             <td>
                <table border="0" cellpadding="1" cellspacing="0" class="button-link-enabled-text">
                  <tr>
                     <td>
                        <!-- confirm button table -->
                        <table> 
                          <tr>
                            <td align="center" valign="middle" nowrap>
                              <component:button text="storage.mgmt.system.expert.confirmbutton" href="javascript:submitForm('confirm_save');" title="storage.mgmt.system.expert.confirmbutton" isEnabled="true" />
                            </td>
                          </tr>
                        </table> <!-- end confirm button table -->
                      </td>
                    </tr>
                 </table>
              </td>                 
           </tr>
        </table> <!--end outer confirm button table -->
      </td>

      <td align="left" valign="middle">
         <!-- outer cancel button table -->
         <table border="0" cellpadding="0" cellspacing="0">
           <tr>
             <td>
               <table border="0" cellpadding="1" cellspacing="0" class="button-link-enabled-text">
                 <tr>
                    <td>
                      <!-- cancel button table -->
                      <table>
                        <tr>
                           <td align="center" valign="middle" nowrap>
                              <component:button text="button.cancel" href="root.menu.item0.item1express.do" title="button.cancel" isEnabled="true" />
                           </td>
                         </tr>
                       </table> <!-- end cancel button table -->
                    </td>
                 </tr>
               </table>
             </td>                 
           </tr>
         </table> <!-- outer cancel button table -->
       </td>
     </tr> <!-- end button row -->    
    </table>
   </td>
</tr>
</table>
<!-- end button table -->

<%@ include file="/layout/spacer.jsp"%>
<% if (isSegmentSizeConfirmation || isReadAheadConfirmation) { %>

<!-- table to show affected pools -->

<logic:present name="t4Form" property="affectedPools">   
  <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.confirm.affectedpools"/>
              </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> 

  <!-- affected pools listing for segment size change -->
  <% if(isSegmentSizeConfirmation) { %>
  <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="pools.table.name"/>
               </div>
            </td>           
          </tr>     
          <% if(form.getAffectedPools() == null ||
                form.getAffectedPools().isEmpty()) {
          %>
          <tr>
            <td align="left" nowrap>
               <div class="table-normal-text">
                  <bean:message key="storage.mgmt.system.expert.confirm.affectedpools.none"/>
               </div>
            </td> 
          </tr>
          <% } %>
          <logic:present name="t4Form" property="affectedPools">
          <logic:iterate id="pool" name="t4Form" property="affectedPools" type="RaidGroupInterface">
          <tr>
            <td align="left" nowrap>
               <div class="table-normal-text">
                  <bean:write name="pool" property="name"/>
               </div>
            </td> 
          </tr>
          </logic:iterate>
          </logic:present>
        </table>
      </td>
    </tr>
  </table>
  <% } else {
     // otherwise, show the list of pools and form to enter new profile
     //  for each pool
  %>
  <%@include file="/storage_management/sm_chgreadahead_withpools_include.jsp"%>
  <% } %>
</logic:present> 
<% 
  // only show the affected volumes if
  //  this is a segment size change
if(isSegmentSizeConfirmation) { %>
  <!-- spacer between two sections -->
  <table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
       <td> 
          <img alt border="0" height="8" width="1" src="images/general/dot.gif">       </td>
    </tr>
  </table>

  <!-- affected volumes -->
  <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.confirm.affectedvolumes"/>
              </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>
     <%@include file="/layout/prevnext.jsp"%>
     <tr>
        <td>
          <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="storage.mgmt.system.expert.pools.volume.name"/>
                           </div>
                        </td>           
                    </tr>     
                    <logic:notPresent name="affectedVolsDestructiveSave">
                    <tr>
                       <td align="left" nowrap>
                          <div class="table-normal-text">
                             <bean:message key="storage.mgmt.system.expert.confirm.affectedvolumes.none"/>
                          </div>
                      </td> 
                    </tr>
                    </logic:notPresent> 
                    <logic:present name="affectedVolsDestructiveSave">
                    <logic:iterate id="vol" indexId="index" name="affectedVolsDestructiveSave" type="StorageVolumeInterface" offset='<%=((Integer)request.getAttribute("beginIndex")).toString()%>' length='<%=((Integer)request.getAttribute("maxRowsPerListing")).toString()%>'>

                    <tr>
                       <td align="left" nowrap>
                          <div class="table-normal-text">
                             <bean:write name="vol" property="name"/>
                          </div>
                       </td> 
                    </tr>
                    </logic:iterate>
                    </logic:present>
                 </table>
             </td>
          </tr>
       </table>
       <%@include file="/layout/prevnext.jsp"%>
    </td>
  </tr>
</table>
<% } %>  
<% } %>  
</html:form>
</body>
</div>
</html:html>
