<%--
  /**
   * Copyright (c) 2003 by Sun Microsystems, Inc. All rights reserved.
   * Use is subject to license terms.
   *
   * "@(#)sa_inigrs_for_volgrp.jsp    1.16    03/05/30     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="storage.access.assoc.inigrp"/>
    </title>
</head>

<%@include file="/layout/bodytag.jsp"%>
<%@include file="/layout/top.jsp"%>
<%@include file="/layout/breadcrumb.jsp"%>
<%@include file="/layout/spacer.jsp"%>
<!-- override the selected sub item for the paging mechanism-->
<% selectedSubItem = "root.menu.item1.item0inigrpsforvg"; %>
<html:form action="root.menu.item1.item0inigrpsforvg.do">

<!-- hidden element which specifies the action for this form -->
<input type="hidden" name="request_action" value="<%=request.getAttribute("request_action")%>">
<input type="hidden" name="grouppath" value="volumeGroup">
<% boolean hasList = true; %>
<logic:notPresent name="Binding" property="bindingsList">
<% hasList = false; %>
</logic:notPresent>
<div class="content-layout">
  <%@ include file="/layout/user_messages.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">
                <% com.sun.netstorage.array.mgmt.cfg.ui.forms.BindingForm form = 
                     (com.sun.netstorage.array.mgmt.cfg.ui.forms.BindingForm)session.getAttribute("Binding");
                   String name = "";
                   if(form != null) {
                   	name = form.getVolGroupName();
                   }
               %>                   	                    
                <bean:message key="storage.access.assoc.inigrp.header" arg0="<%=name%>"/>                
              </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>
  <% if(!hasList) { %>
    <tr>
      <td><bean:message key="storage.access.add.ig.none"/></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 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.add" href="javascript:document.forms[0].action='root.menu.item1.item0addinigrps.do';document.forms[0].submit();" title="button.add" 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>
            
            <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.remove" href="javascript:submitForm('remove');" title="button.remove" 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.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="javascript:document.forms[0].action='root.menu.item1.item0volgrps.do';document.forms[0].submit();" title="button.cancel" 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>
      </td>
    </tr>
  </table>
  
  <table border="0" cellspacing="0" cellpadding="0">
    <%@ include file="/layout/prevnext.jsp"%>
    <tr>
      <td nowrap>
        <table border="0" cellspacing="0" cellpadding="0">         
          <tr>
            <td><img alt border="0" src="images/general/dot.gif" width="1" height="5"></td>
          </tr>
          <tr>
            <td nowrap>
              <table class="back-table" border="0" cellspacing="0" cellpadding="1" width="50%">
                <tr>
                  <td>
                    <table class="front-table" border="0" cellspacing="0" cellpadding="0" width="100%">
                      <tr class="header-row">
                        <td align="center" valign="middle" nowrap><a href="javascript:checkAll(document.forms[0])"><img src="images/icons/select-all-small.gif" alt='<bean:message key="table.select.all"/>' vspace="2" border="0" width="11" height="13"></a><a href="javascript:unCheckAll(document.forms[0])"><img src="images/icons/deselect-all-small.gif" alt='<bean:message key="table.deselect.all"/>' vspace="2" border="0" width="11" height="13"></a></td>
                        <td>
                          <div class="table-header-text">
                            <bean:message key="storage.mgmt.volumes.name"/>
                          </div>
                        </td>
                        <td>
                          <div class="table-header-text">
                            <bean:message key="storage.access.volume.group.table.access"/>
                          </div>
                        </td>                       
                      </tr>                      
                      <logic:present name="Binding" property="bindingsList">
                        <%@ include file="/layout/listingCalc.jsp"%>
                                              
                        <logic:iterate id="bind" name="Binding" property="bindingsList" type="BindingInterface" indexId="index" offset='<%=offsetStr%>' length='<%=lengthStr%>'>
                           <tr>
                             <td align="left" nowrap>
                               <div class="table-normal-text">
                               
                               <input type="checkbox" name="selectedIndices" value=<%=index%> <%if(readOnly){%>disabled<%}%> />
                               <!--
                                 <html:multibox name="Binding" property="selectedIndices" disabled="<%=readOnly%>">
                                   <%=index%>
                                 </html:multibox>
                                 -->
                               </div>
                             </td>
                             <td nowrap>
                               <div class="table-normal-text">
				<%
                                   String encodedName = 
                                     URLEncoder.encode(bind.getInitiatorGroup().getName());
				   %>

			       <a href="root.menu.item1.item0editig.do?name=<%=encodedName%>" >
                                 <bean:write name="bind" property="initiatorGroup.name"/>
				 </a>
                               </div>
                            </td>  
                            <td>
                            
                               <div class="table-normal-text">
                                 <select name="access<%=index%>" <%=(readOnly ? "disabled" : "")%>>
                                 <%                                     
			                          String access = bind.getAccess();                                                                  	
                                 %>
                                   <option value="<%=Constants.StorageVolumeProperties.READWRITE%>">
                                      <bean:message key="selectlist.volumepermissions.readwrite"/>
                                   <option <% if(access != null && access.equals("Read-only")){%>selected<%}%> value="<%=Constants.StorageVolumeProperties.READONLY%>">
                                      <bean:message key="selectlist.volumepermissions.readonly"/>
                                 </select>
                                 
                               </div>
                             </td>  
                           </tr>
                        </logic:iterate>
                      </logic:present>
                                             
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <%@ include file="/layout/prevnext.jsp"%>
  </table>
</div>
<!-- END SECTION:  fixed/static data section -->

<!-- spacer between two sections -->
<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>

<!-- spacer between two sections -->
<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>
