## ---------------------------------------------------------------------------
## JOnAS: Java(TM) Open Application Server
## Copyright (C) 1999 Bull S.A.
## Contact: jonas-team@objectweb.org
## 
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or any later version.
## 
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## Lesser General Public License for more details.
## 
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
## USA
##
## Initial developer(s): Adriana Danes
## Contributor(s): Philippe Durieux
##
## ---------------------------------------------------------------------------
## $Id$
## ---------------------------------------------------------------------------

#set ( $currentService = "SECURITY" )
#set ( $currentServlet = "SecurityService" )

#parse ("defs.vm")
#set ( $bannerLink = "${currentServlet}" )
#parse ("header.vm")

#TableCellOpen ($no_color $cell_color "0" "0" "5" "100%")
   <tr>
     <td>
        $!alertException
        ## The Main Cell is a Table of elements
        #TABLE ( $no_color "0" "3" "3" "100%")
	#if ( $existsServer )
          ############################
          #AreaTitle ( "JOnAS Server" )
	  #AreaOpen ()
          <tr>
            <td width="240" align="right" nowrap>Server Name:</td>
            <td width="750" align="left"><b>${serverName}</b></td>
          </tr>
	  #AreaClose ()
          #if ( $existsSecurityService )
            #if ( $info_error.equals("") )
              #AreaTitle ( "Security service" )
              #AreaOpen ()
		#if ( $mapping.isEmpty() )
                  <tr><td><i>No mapping between principal and role.</i></td></tr>
                #else 
                  #foreach ($key in $mapping.keys())
                    #set ( $roles = $mapping.get($key) )
                    <tr>
                      <td width="240" align="right" nowrap>$key</td>
                      <td width="750" align="left">
                      <b>
                        #foreach ( $role in $roles )
		          $role &nbsp;
                        #end
                      </b>
                      </td>
                    </tr>
                  #end
                #end
              #AreaClose ()
            #else
              <tr>
                <td colspan="2"><b>Error while getting attribute: </b><br>$info_error</td>
              </tr>
            #end
          #else
            <tr>
              <td>Service not available.</td>
            </tr>
          #end
        #else
           #AreaTitle ( "Server not manageable." )
           #AreaOpen ()
             <tr>
               <td><a href="ManagementService">Choose another registry</a></td>
             </tr>
           #AreaClose ()
	#end
        </TABLE>
      </td>
    </tr>   
    #TableCellClose ()
 ## End Big table

#parse ("footer.vm")
