blob: 60133601cba42a7e9f6eef25a15734ab734f1af9 [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
-->
<!-- security/realms/realmEdit.jsf -->
#include "/security/realms/realmEditInitPage.inc"
<!composition template="/templates/default.layout" guiTitle="$resource{i18nc.realm.EditPageTitle}"
guiOnLoad="initClassname('#{myOption}', false);">
<!define name="content">
<event>
<!beforeCreate
setPageSessionAttribute(key="pageTitle" value="$resource{i18nc.realm.EditPageTitle}");
setPageSessionAttribute(key="pageTitleHelp" value="$resource{i18nc.realm.EditPageTitleHelp}");
setPageSessionAttribute(key="helpKey" value="$resource{help_common.realmEdit}");
setPageSessionAttribute(key="edit" value="#{true}" )
getRequestValue(key="configName" value=>$page{configName} default="server-config");
getRequestValue(key="name" value="#{pageSession.Name}");
urlencode(value="#{pageSession.Name}" encoding="UTF-8" result="#{pageSession.encodedName}");
urlencode(value="#{pageSession.configName}" encoding="UTF-8" result="#{pageSession.encodedConfigName}");
setPageSessionAttribute(key="parentPage" value="#{request.contextPath}/common/security/realms/realms.jsf");
setPageSessionAttribute(key="selfPage" value="#{request.contextPath}/common/security/realms/realmEdit.jsf?name=#{pageSession.encodedName}&configName=#{pageSession.encodedConfigName}");
setPageSessionAttribute(key="parentUrl", value="#{sessionScope.REST_URL}/configs/config/#{pageSession.encodedConfigName}/security-service/auth-realm/#{pageSession.encodedName}");
setPageSessionAttribute(key="rest-api" value="true");
getRealmAttrForEdit(endpoint="#{parentUrl}" attrMap=>$page{attrMap}, classnameOption=>$page{classnameOption}, realmClasses=>$page{realmClasses}, properties="#{pageSession.tableList}" );
createMap(result="#{pageSession.valueMap}");
mapPut(map="#{pageSession.valueMap}" key="target" value="#{pageSession.configName}");
mapPut(map="#{pageSession.attrMap}" key="target" value="#{pageSession.valueMap['target']}");
setPageSessionAttribute(key="myOption" value="$pageSession{classnameOption}");
gf.restRequest(endpoint="#{sessionScope.REST_URL}/configs/config/#{pageSession.encodedConfigName}/security-service/auth-realm/#{pageSession.encodedName}/supports-user-management.json?target=#{pageSession.encodedConfigName}", method="get", result="#{requestScope.result}");
setPageSessionAttribute(key="showUserButton" value="#{false}");
if ("#{requestScope.result.data['message']}=true") {
setPageSessionAttribute(key="showUserButton" value="#{true}");
}
/>
</event>
#include "/common/security/realms/realm.inc"
</define>
</composition>