blob: e212e2dab8370f9b9a38ffc38d25e2112a456d7c [file] [log] [blame]
<!--
Copyright (c) 2009, 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
-->
<!-- grizzly/protocolEdit.jsf -->
<!initPage
setResourceBundle(key="i18n_web" bundle="org.glassfish.web.admingui.Strings");
setResourceBundle(key="help_web" bundle="org.glassfish.web.admingui.Helplinks");
/>
<!composition template="/templates/default.layout" guiTitle="$resource{i18n_web.grizzly.protocolEditPageTitle}" >
<!define name="content">
<event>
<!beforeCreate
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}");
getRequestValue(key="cancelTo" value="#{pageSession.cancelTo}" default="web/grizzly/protocols.jsf");
setPageSessionAttribute(key="parentPage" value="#{request.contextPath}/#{pageSession.cancelTo}");
setPageSessionAttribute(key="selfPage" value="#{request.contextPath}/web/grizzly/protocolEdit.jsf?name=#{pageSession.encodedName}&cancelTo=#{pageSession.cancelTo}&configName=#{pageSession.configName}");
setPageSessionAttribute(key="childType" value="protocol");
setPageSessionAttribute(key="parentUrl", value="#{sessionScope.REST_URL}/configs/config/#{pageSession.configName}/network-config/protocols");
setPageSessionAttribute(key="selfUrl", value="#{pageSession.parentUrl}/#{pageSession.childType}/#{pageSession.Name}");
setPageSessionAttribute(key="rest-api" value="true");
gf.getEntityAttrs(endpoint="#{pageSession.selfUrl}", valueMap="#{pageSession.valueMap}");
setPageSessionAttribute(key="convertToFalseList" value={"securityEnabled"});
setSessionAttribute(key="protocolTabs" value="protocolGeneral");
//set the following for including buttons.inc
setPageSessionAttribute(key="edit" value="#{true}" );
setPageSessionAttribute(key="showDefaultButton" value="#{true}" );
setPageSessionAttribute(key="showCancelButton" value="#{true}" );
setPageSessionAttribute(key="hasPropertySheet" value="#{true}" );
setPageSessionAttribute(key="hasPropertyTable" value="#{false}" );
setSessionAttribute(key="secureCancelUrl" value="#{pageSession.selfPage}")
//If secure admin is enabled, we will not show the other tabs since GUI doesn't have support for handling low level grizzly config yet.
setPageSessionAttribute(key="showSSLTab" value="#{true}");
setPageSessionAttribute(key="showHttpTab" value="#{true}");
setPageSessionAttribute(key="showFileCacheTab" value="#{true}");
if (#{sessionScope.secureAdminEnabled}){
gf.getEntityAttrs(endpoint="#{sessionScope.REST_URL}/configs/config/#{pageSession.configName}/http-service/virtual-server/__asadmin" valueMap="#{requestScope.tvp}");
setAttribute(key="listenerName" value="#{requestScope.tvp['networkListeners']}");
gf.getEntityAttrs(endpoint="#{sessionScope.REST_URL}/configs/config/#{pageSession.configName}/network-config/network-listeners/network-listener/#{requestScope.listenerName}" valueMap="#{requestScope.tmpVP}");
if("#{pageSession.Name}=#{requestScope.tmpVP.protocol}"){
setPageSessionAttribute(key="showSSLTab" value="#{false}");
setPageSessionAttribute(key="showHttpTab" value="#{false}");
setPageSessionAttribute(key="showFileCacheTab" value="#{false}");
}
//TODO: hardcoding this 2 protocol name. Should obtain through the protocol-finder.
if (" (#{pageSession.Name}=sec-admin-listener) || (#{pageSession.Name}=admin-http-redirect)"){
setPageSessionAttribute(key="showSSLTab" value="#{false}");
setPageSessionAttribute(key="showHttpTab" value="#{false}");
setPageSessionAttribute(key="showFileCacheTab" value="#{false}");
}
}
// If protocol is sec-admin-listener or admin-listener, then save button and security enabled checkbox is disabled
setPageSessionAttribute(key="readOnly" value="#{false}" );
setPageSessionAttribute(key="disableSaveButton" value="#{false}");
if (" (#{pageSession.Name}=$constant{com.sun.enterprise.config.serverbeans.ServerTags.SEC_ADMIN_LISTENER_PROTOCOL_NAME})
|| (#{pageSession.Name}=$constant{com.sun.enterprise.config.serverbeans.ServerTags.ADMIN_LISTENER_ID})"){
setPageSessionAttribute(key="disableSaveButton" value="#{true}");
setPageSessionAttribute(key="readOnly" value="#{true}" );
}
/>
</event>
<sun:form id="propertyForm">
#include "/web/grizzly/protocolTabs.inc"
#include "/common/shared/alertMsg.inc"
<!-- Page Title -->
<sun:title id="propertyContentPage" title="$resource{i18n_web.grizzly.protocolEditPageTitle}" helpText="$resource{i18n_web.grizzly.protocolEditPageTitleHelp}">
<!facet pageButtonsTop>
<sun:panelGroup id="topButtons">
<sun:button id="saveButton" disabled="#{disableSaveButton}" text="$resource{i18n.button.Save}"
onClick="if (guiValidate('#{reqMsg}','#{reqInt}','#{reqPort}')) {submitAndDisable(this, '$resource{i18n.button.Processing}');}; return false;" >
<!command
prepareSuccessfulMsg();
gf.createEntity(endpoint="#{pageSession.selfUrl}"
attrs="#{pageSession.valueMap}"
convertToFalse="#{pageSession.convertToFalseList}"
);
gf.redirect(page="#{pageSession.selfPage}&alertType=${alertType}&alertSummary=${alertSummary}&alertDetail=${alertDetail}");
/>
</sun:button>
<sun:button id="cancelButton" immediate="#{true}" primary="#{false}" rendered="#{pageSession.showCancelButton}" text="$resource{i18n.button.Cancel}" >
<!command
gf.redirect(page="#{parentPage}?configName=#{configName}");
/>
</sun:button>
</sun:panelGroup>
</facet>
</sun:title>
<sun:propertySheet id="propertySheet">
#include "/common/shared/configNameSection.inc"
<sun:propertySheetSection id="propertSectionTextField">
<sun:property id="nameNew" rendered="#{!edit}" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.common.name}" helpText="$resource{i18n_web.common.nameHelp}">
<sun:textField id="name" styleClass="required" required="#{true}" columns="$int{50}" maxLength="#{sessionScope.fieldLengths['maxLength.common.Name']}" text="#{pageSession.valueMap['Name']}" />
</sun:property>
<sun:property id="name" rendered="#{edit}" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.common.name}">
<sun:staticText id="name" text="#{pageSession.Name}" rendered="#{Edit}" />
</sun:property>
<sun:property id="statusWithHelp" rendered="#{readOnly}" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.grizzly.protocol.securityEnabled}" helpText="$resource{i18n_web.common.secureAdminHelp}" >
<sun:checkbox disabled="#{readOnly}" selected="#{pageSession.valueMap['securityEnabled']}" selectedValue="true" />
</sun:property>
<sun:property id="status" rendered="#{!readOnly}" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.grizzly.protocol.securityEnabled}" >
<sun:checkbox selected="#{pageSession.valueMap['securityEnabled']}" selectedValue="true" />
</sun:property>
</sun:propertySheetSection>
</sun:propertySheet>
"<br><br>
<sun:hidden id="helpKey" value="$resource{help_web.protocolEdit}" />
</sun:form>
</define>
</composition>