blob: e3b5af6e2c5a85cbf53d5acdf8f7f9f59b2bbd98 [file] [log] [blame]
<!--
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<!initPage
setResourceBundle(key="i18nc" bundle="org.glassfish.common.admingui.Strings")
setResourceBundle(key="help_common" bundle="org.glassfish.common.admingui.Helplinks");
/>
<!composition template="/templates/default.layout" guiTitle="#{pageSession.tableTitle}" >
<!define name="content">
<event>
<!beforeCreate
getRequestValue(key="configName" value=>$page{configName} default="server-config");
getRequestValue(key="name" value=>$page{Name});
urlencode(value="#{pageSession.Name}" encoding="UTF-8" result="#{pageSession.encodedName}");
urlencode(value="#{pageSession.configName}" encoding="UTF-8" result="#{pageSession.encodedConfigName}");
//getFileUsers(Realm="#{Name}", configName="#{pageSession.configName}", result=>$attribute{listOfRows} );
gf.restRequest(endpoint="#{sessionScope.REST_URL}/configs/config/#{pageSession.configName}/security-service/auth-realm/#{Name}/list-users?target=#{pageSession.encodedConfigName}",
method="get", result="#{requestScope.listUsersResult}");
setPageSessionAttribute(key="listOfRows", value="#{requestScope.listUsersResult.data.extraProperties.users}");
gf.restRequest(endpoint="#{sessionScope.REST_URL}/configs/config/#{pageSession.configName}/admin-service/jmx-connector/system.json", method="get", result="#{requestScope.result}");
setPageSessionAttribute(key="AuthRealmName" value="#{requestScope.result.entity['authRealmName']");
if ("#{pageSession.Name}=#{pageSession.authRealm}"){
setPageSessionAttribute(key="tableTitle", value="$resource{i18nc.manageAdminUsers.TableTitle}")
setPageSessionAttribute(key="helpKey", value="$resource{help_common.manageAdminUsers}" )
}
if ("!(#{pageSession.Name}=#{pageSession.authRealm})"){
setPageSessionAttribute(key="tableTitle", value="$resource{i18nc.manageUsers.TableTitle}")
setPageSessionAttribute(key="helpKey", value="$resource{help_common.manageUsers}" )
}
/>
</event>
<sun:form id="propertyForm">
#include "/common/shared/alertMsg.inc"
<sun:title id="propertyContentPage" title="#{pageSession.tableTitle}"
helpText="$resource{i18nc.manageUsers.TablePageHelp}">
<!facet pageButtonsTop>
<sun:panelGroup id="topButtons">
<sun:button id="cancelButton" immediate="#{true}" text="$resource{i18n.button.Back}" primary="#{false}">
<!command
gf.redirect(page="#{request.contextPath}/common/security/realms/realmEdit.jsf?name=#{pageSession.encodedName}&configName=#{pageSession.encodedConfigName}");
/>
</sun:button>
</sun:panelGroup>
</facet>
</sun:title>
<sun:propertySheet id="propertySheet">
#include "/common/shared/configNameSection.inc"
<sun:propertySheetSection id="propertySectionTextField">
<sun:property id="NameProp" rendered="#{edit}" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nc.realm.realmName}" >
<sun:staticText id="NameStatic" text="#{Name}"/>
</sun:property>
</sun:propertySheetSection>
</sun:propertySheet>
"<br /><br />
<sun:table id="users" title="#{pageSession.tableTitle}">
deselectMultipleButton="$boolean{true}"
deselectMultipleButtonOnClick="setTimeout('admingui.table.changeOneTableButton(\\\\\'#{pageSession.topActionGroup}\\\\\', \\\\\'#{pageSession.tableId}\\\\\');', 0)"
selectMultipleButton="$boolean{true}"
selectMultipleButtonOnClick="setTimeout('admingui.table.changeOneTableButton(\\\\\'#{pageSession.topActionGroup}\\\\\', \\\\\'#{pageSession.tableId}\\\\\');', 0)" >
<!afterCreate
getClientId(component="$this{component}" clientId=>$page{tableId});
/>
<!facet actionsTop>
<sun:panelGroup id="topActionsGroup1">
<!afterCreate
getClientId(component="$this{component}" clientId=>$page{topActionGroup});
/>
<sun:button id="newButton" text="$resource{i18n.button.New}" >
<!command
gf.redirect(page="#{request.contextPath}/common/security/realms/manageUserNew.jsf?name=#{pageSession.encodedName}&configName=#{pageSession.encodedConfigName}");
/>
</sun:button>
<sun:button id="button1" text="$resource{i18n.button.Delete}" disabled="#{true}" primary="#{false}"
onClick="if ( getConfirm(this,'$resource{i18nc.msg.JS.confirmDeleteUser}') )
{ return submitAndDisable(this, '$resource{i18n.button.Processing}');}
else {return false;} "
>
<!command
getUIComponent(clientId="$pageSession{tableRowGroupId}", component=>$attribute{tableRowGroup});
getSelectedSingleMapRows(TableRowGroup="${tableRowGroup}" selectedRows=>$attribute{selectedRows});
removeUser(Realm="#{pageSession.Name}", configName="#{pageSession.configName}", selectedRows="${selectedRows}");
gf.redirect(page="#{request.contextPath}/common/security/realms/manageUsers.jsf?name=#{pageSession.encodedName}&configName=#{pageSession.encodedConfigName}&alertType=${alertType}&alertSummary=${alertSummary}&alertDetail=${alertDetail}");
/>
</sun:button>
</sun:panelGroup>
</facet>
<sun:tableRowGroup id="rowGroup1" selected="#{td.value.selected}" data={"$pageSession{listOfRows}", "$pageSession{tableList2}"} sourceVar="td">
<!beforeCreate
// Add extra table properties...
createList(size="0", result="#{pageSession.tableList2}");
foreach(var="row" list="#{pageSession.listOfRows}") {
setAttribute(key="userName", value="#{row.name}");
setAttribute(key="userGroups", value="#{row.groups}");
gf.createAttributeMap(keys={"selected", "users", "groups"},
values={"$boolean{false}", "$attribute{userName}", "$attribute{userGroups}"}, map="#{requestScope.tlMap}");
listAdd(list="#{pageSession.tableList2}", value="#{requestScope.tlMap}");
}
/>
<!afterCreate
getClientId(component="$this{component}" clientId=>$page{tableRowGroupId});
/>
<sun:tableColumn headerText="$resource{i18n.common.SelectHeader}" selectId="select" rowHeader="$boolean{false}" id="col0">
<sun:checkbox id="select"
selected="#{td.value.selected}"
selectedValue="$boolean{true}"
onClick="setTimeout('admingui.table.changeOneTableButton(\\\\\'#{pageSession.topActionGroup}\\\\\', \\\\\'#{pageSession.tableId}\\\\\'); admingui.table.initAllRows(\\\\\'#{pageSession.tableId}\\\\\');', 0);"
/>
</sun:tableColumn>
<sun:tableColumn headerText="$resource{i18nc.manageUsers.UserIdCol}" rowHeader="$boolean{true}" id="col1">
<sun:hyperlink id="link" text="#{td.value.users}"
url="/common/security/realms/manageUserEdit.jsf?user=#{td.value.users}&name=#{pageSession.Name}&configName=#{configName}" />
</sun:tableColumn>
<sun:tableColumn headerText="$resource{i18nc.manageUsers.GroupList}" rowHeader="$boolean{true}" id="col11">
<h:dataTable var="group" value="#{td.value.groups}" border="0">
<h:column>
<h:outputText value="#{group}"/>
</h:column>
</h:dataTable>
</sun:tableColumn>
</sun:tableRowGroup>
</sun:table>
<sun:hidden id="helpKey" value="#{pageSession.helpKey}" />
</sun:form>
#include "/common/shared/changeButtonsJS.inc"
</define>
</composition>