<!--
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 
 Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
 
 The contents of this file are subject to the terms of either the GNU
 General Public License Version 2 only ("GPL") or the Common Development
 and Distribution License("CDDL") (collectively, the "License").  You
 may not use this file except in compliance with the License. You can obtain
 a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
 or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific
 language governing permissions and limitations under the License.
 
 When distributing the software, include this License Header Notice in each
 file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
 Sun designates this particular file as subject to the "Classpath" exception
 as provided by Sun in the GPL Version 2 section of the License file that
 accompanied this code.  If applicable, add the following below the License
 Header, with the fields enclosed by brackets [] replaced by your own
 identifying information: "Portions Copyrighted [year]
 [name of copyright owner]"
 
 Contributor(s):
 
 If you wish your version of this file to be governed by only the CDDL or
 only the GPL Version 2, indicate your decision by adding "[Contributor]
 elects to include this software in this distribution under the [CDDL or GPL
 Version 2] license."  If you don't indicate a single choice of license, a
 recipient has the option to distribute your version of this file under
 either the CDDL, the GPL Version 2 or to extend the choice of license to
 its licensees as provided above.  However, if you add GPL Version 2 code
 and therefore, elected the GPL Version 2 license, then the option applies
 only if the new code is made subject to such option by the copyright
 holder.
-->

<sun:page id="page1">
    <!beforeCreate
        setResourceBundle(key="i18n" bundle="org.glassfish.admingui.core.Strings")
        setResourceBundle(key="i18nSecurity" bundle="org.glassfish.security.admingui.Strings")
        setResourceBundle(key="help" bundle="org.glassfish.admingui.core.Helplinks")
    />     
   <event>
        <!beforeCreate
        setPageSessionAttribute(key="configName", value="$requestParameter{configName}");
        getSecuritySettings(ConfigName="#{configName}", Audit=>$attribute{audit}, Principal=>$attribute{principal}, Password=>$attribute{password}, RoleMapping=>$attribute{roleMapping}, Mapped=>$attribute{mapped}, Realm=>$attribute{realm}, Module=>$attribute{module}, Jacc=>$attribute{jacc}, Properties=>$page{props});
        getTableList(Properties="#{props}", TableList=>$attribute{tableList});
        />   
    </event>   
    #include "/shared/restart.inc"
    <sun:html id="html2">
        <sun:head id="propertyhead" title="$resource{i18nSecurity.security.Security}" parseOnLoad="false">
            <sun:script url="/resource/js/restart.js" />
        </sun:head>
        <sun:body id="body3" onLoad="javascript: synchronizeRestartRequired('#{requestScope.restartRequired}', '#{sessionScope.restartRequired}')">
            <sun:form id="propertyForm">
#include "/shared/treeBreadcrumbs.inc"
#include "/shared/alertMsg.inc"
                <!-- Page Title -->
                <sun:title id="propertyContentPage" title="$resource{i18nSecurity.security.Security}" 
                helpText="$resource{i18nSecurity.security.SecurityPageHelp}">
                    <sun:button id="loadDefaults" rendered="#{false}" style="margin-left: 8pt"  primary="#{false}"  text="$resource{i18n.button.LoadDefaults}" >    
                        <!command
                            getSecurityDefaultAttributes(
                                ConfigName="#{configName}", 
                                Audit=>$attribute{audit}, 
                                Principal=>$attribute{principal}, 
                                Password=>$attribute{password}, 
                                RoleMapping=>$attribute{roleMapping}, 
                                Mapped=>$attribute{mapped}, 
                                Realms=>$attribute{realm}, 
                                Modules=>$attribute{module},
                                Jaccs=>$attribute{jacc}); 
                                />
                    </sun:button>
                    <!-- Buttons  -->                    
                    <!facet pageButtonsTop>
#include "/security/securityButtons.inc"
                    </facet>  
                    </sun:title>
                    <!-- PropertySheet .... -->
                    <sun:propertySheet id="propertySheet">			 
                        <!-- Text Field section -->               
                        <sun:propertySheetSection id="propertSectionTextField">
                            <event>
                              <!beforeCreate
                                getSecurityManagerStatus(ConfigName="#{configName}", securityManagerEnabled=>$attribute{securityManagerStatus});
                                getRealms(ConfigName="#{configName}", Realms=>$attribute{realms}); 
                                <!-- getJaccs(ConfigName="#{configName}", Jacc=>$attribute{jaccs}); -->
                                getAuditModules(ConfigName="#{configName}", AuditModules=>$attribute{aModules});
                              />   
                            </event>
                            <sun:property id="securityManagerProp"  labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nSecurity.security.SecurityManager}">                           
                                <sun:checkbox label="$resource{i18n.common.Enabled}" selected="#{requestScope.securityManagerStatus}" > 
                               </sun:checkbox>
                            </sun:property>                       
                            <sun:property id="auditLoggingProp"  labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nSecurity.security.AuditLogging}" helpText="$resource{i18nSecurity.security.AuditLoggingHelp}">                           
                                <sun:checkbox label="$resource{i18n.common.Enabled}" selected="#{requestScope.audit}" /> 
                            </sun:property>                        
                          <sun:property id="defaultRealmProp"  labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nSecurity.security.DefaultRealm}" helpText="$resource{i18nSecurity.security.DefaultRealmHelp}">
                                <sun:dropDown id="DefaultRealm" labels="$attribute{realms}" selected="#{requestScope.realm}">
                                </sun:dropDown>
                            </sun:property>
                            <sun:property id="defaultPrincipalProp"  labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nSecurity.security.DefaultPrincipal}" helpText="$resource{i18nSecurity.security.DefaultPrincipalHelp}">
                                <sun:textField id="DefaultPrincipal" columns="$int{55}" text="#{requestScope.principal}"/> 
                            </sun:property>    
                            <sun:property id="defaultPrincipalPasswordProp"  labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nSecurity.security.DefaultPrincipalPassword}" helpText="$resource{i18nSecurity.security.DefaultPrincipalPasswordHelp}">
                                <sun:textField id="DefaultPrincipalPassword" columns="$int{55}" text="#{requestScope.password}"/> 
                            </sun:property>
                            <!--
                          <sun:property id="jaccProp"  labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nSecurity.security.Jacc}" helpText="$resource{i18nSecurity.security.JaccHelp}">
                                <sun:dropDown id="Jacc" items="$attribute{jaccs}" selected="#{requestScope.jacc}">
                                </sun:dropDown>
                            </sun:property> 
                            -->
                         <sun:property id="auditModulesProp"  labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nSecurity.security.AuditModules}" helpText="$resource{i18nSecurity.security.AuditModulesHelp}">
                                <sun:listbox id="AuditModules" labels="$attribute{aModules}" selected="#{requestScope.module}" rows="$int{4}">
                                </sun:listbox>
                            </sun:property>   
                           <sun:property id="roleMappingProp"  labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nSecurity.security.RoleMapping}" helpText="$resource{i18nSecurity.security.RoleMappingHelp}">                           
                                <sun:checkbox label="$resource{i18n.common.Enabled}" selected="#{requestScope.roleMapping}" /> 
                            </sun:property>                        
                            <sun:property id="mappedPrincipalClassProp"  labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nSecurity.security.MappedPrincipalClass}" helpText="$resource{i18nSecurity.security.MappedPrincipalClassHelp}">
                                <sun:textField id="MappedPrincipalClass" columns="$int{55}" text="#{requestScope.mapped}"/> 
                            </sun:property>    
                                        
                            "<br /><br />
                        </sun:propertySheetSection>

                    </sun:propertySheet>    
#include "/shared/propertyTable.inc"
                <sun:title id="propertyContentPage2">     
                    <!facet pageButtonsBottom>
#include "/security/securityButtons.inc"
                    </facet>  
                </sun:title>
	<sun:hidden id="helpKey" value="$resource{help.security}" />
            </sun:form>
        </sun:body>
#include "/shared/changeButtonsJS.inc"         
    </sun:html>
</sun:page>
