blob: e723845c71e416e8bbee029a1ed4d65faa85a968 [file] [log] [blame]
<!--
Copyright (c) 2011, 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="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.configuration.httpListenersPageTitle}"
guiTemplateOnLoad="
admingui.nav.refreshTree('treeForm:tree:configurations:#{pageSession.encodedConfigName}:networkConfig:protocols');
admingui.nav.refreshTree('treeForm:tree:configurations:#{pageSession.encodedConfigName}:networkConfig:networkListeners');
admingui.nav.refreshTree('treeForm:tree:configurations:#{pageSession.encodedConfigName}:httpService:httpListeners');"
>
<!define name="listTableDeleteButton">
<sun:button id="button1" text="$resource{i18n.button.Delete}" disabled="#{true}" primary="#{false}"
onClick="if (getConfirm(this,'$pageSession{confirmDeleteMsg}')) {submitAndDisable(this, '$resource{i18n.button.Processing}');}; return false;" >
<!command
getUIComponent(clientId="$pageSession{tableRowGroupId}", component=>$attribute{tableRowGroup});
getSelectedSingleMapRows(TableRowGroup="${tableRowGroup}" selectedRows=>$attribute{selectedRows});
foreach (var="row" list="${selectedRows}") {
setPageSessionAttribute(key="networkListenerName" value="#{row['name']}");
setPageSessionAttribute(key="networkListenerUrl", value="#{sessionScope.REST_URL}/configs/config/#{pageSession.encodedConfigName}/network-config/network-listeners/network-listener");
gf.restRequest(endpoint="#{pageSession.networkListenerUrl}/#{pageSession.networkListenerName}", method="get", result="#{pageSession.networkListAttrs}");
setPageSessionAttribute(key="protocolName" value="#{pageSession.networkListAttrs.data.extraProperties.entity['protocol']}");
setPageSessionAttribute(key="protocolUrl", value="#{sessionScope.REST_URL}/configs/config/#{pageSession.encodedConfigName}/network-config/protocols/protocol/#{pageSession.protocolName}");
setPageSessionAttribute(key="protocolHttpUrl", value="#{sessionScope.REST_URL}/configs/config/#{pageSession.encodedConfigName}/network-config/protocols/protocol/#{pageSession.protocolName}/http");
setPageSessionAttribute(key="virtualServerUrl", value="#{sessionScope.REST_URL}/configs/config/#{pageSession.encodedConfigName}/http-service/virtual-server");
gf.checkIfEndPointExist(endpoint="#{pageSession.protocolHttpUrl}", exists="#{pageSession.protocolHttpExist}");
// check if there is no listener exists for this protocol and it was created by GUI, then delete
gf.getChildrenNamesList(endpoint="#{pageSession.networkListenerUrl}", id="name", result="#{pageSession.networkListeners}");
createList(size="0" result="#{pageSession.listenerList}");
foreach (var="listener" list="#{pageSession.networkListeners}") {
gf.restRequest(endpoint="#{pageSession.networkListenerUrl}/#{listener}.json", method="get", result="#{pageSession.networkListenerAttrs}");
if ("#{pageSession.networkListenerAttrs.data.extraProperties.entity['protocol']}=#{pageSession.protocolName}"){
listAdd(value="#{pageSession.networkListAttrs.data.extraProperties.entity['name']}" list="#{pageSession.listenerList}");
}
setPageSessionAttribute(key="listSize" value="#{pageSession.listenerList.size()}");
setPageSessionAttribute(key="protocolExtn" value="$resource{i18n_web.grizzly.protocolExtension}");
setPageSessionAttribute(key="deleteProcotol" value="#{false}");
if ("#{pageSession.listSize}=1") {
if ("#{pageSession.protocolName}=#{pageSession.networkListenerName}$resource{i18n_web.grizzly.protocolExtension}") {
setPageSessionAttribute(key="deleteProcotol" value="#{true}");
}
}
}
if (#{pageSession.protocolHttpExist}) {
gf.restRequest(endpoint="#{pageSession.protocolHttpUrl}", method="get", result="#{pageSession.protocolAttrHttp}");
setPageSessionAttribute(key="vsName" value="#{pageSession.protocolAttrHttp.data.extraProperties.entity['defaultVirtualServer']}");
gf.restRequest(endpoint="#{pageSession.virtualServerUrl}/#{vsName}", method="get", result="#{pageSession.vsAttrs}");
changeNetworkListenersInVS(vsAttrs="#{pageSession.vsAttrs.data.extraProperties.entity}", listenerName="#{pageSession.networkListAttrs.data.extraProperties.entity['name']}", addFlag="{#false}", result="#{pageSession.vsAttrModified}");
gf.restRequest(endpoint="#{pageSession.virtualServerUrl}/#{vsName}", attrs="#{pageSession.vsAttrModified}", method="post");
}
gf.restRequest(endpoint="#{pageSession.networkListenerUrl}/#{pageSession.networkListenerName}?target=#{pageSession.valueMap['target']}", method="delete");
if (#{pageSession.deleteProcotol}) {
gf.restRequest(endpoint="#{pageSession.protocolUrl}?target=#{pageSession.valueMap['target']}", method="delete");
}
}
gf.redirect(page="#{pageSession.listLink}");
/>
</sun:button>
</define>
<!define name="content">
<event>
<!beforeCreate
getRequestValue(key="configName" value=>$page{configName} );
urlencode(value="#{pageSession.configName}" encoding="UTF-8" result="#{pageSession.encodedConfigName}");
setPageSessionAttribute(key="childType" value="network-listener");
setPageSessionAttribute(key="parentUrl", value="#{sessionScope.REST_URL}/configs/config/#{pageSession.encodedConfigName}/network-config/network-listeners");
setPageSessionAttribute(key="selfUrl", value="#{pageSession.parentUrl}/#{pageSession.childType}");
setPageSessionAttribute(key="rest-api" value="true");
gf.getChildList(parentEndpoint="#{pageSession.parentUrl}", childType="#{pageSession.childType}", result="#{requestScope.listOfRows}");
createMap(result="#{pageSession.valueMap}");
mapPut(map="#{pageSession.valueMap}" key="target" value="#{pageSession.configName}");
setPageSessionAttribute(key="confirmDeleteMsg" value="$resource{i18n_web.msg.JS.confirmDeleteNL}");
setPageSessionAttribute(key="createLink" value="#{request.contextPath}/web/configuration/httpListenerNew.jsf?configName=#{configName}");
setPageSessionAttribute(key="listLink" value="#{request.contextPath}/web/configuration/httpListeners.jsf?configName=#{configName}");
setPageSessionAttribute(key="editLink" value="#{request.contextPath}/web/configuration/httpListenerEdit.jsf?configName=#{configName}");
setPageSessionAttribute(key="tableTitle" value="$resource{i18n_web.grizzly.networkListeners.tableName}");
/>
</event>
" <script type="text/javascript">admingui.nav.selectTreeNodeById(admingui.nav.TREE_ID+":configurations:#{pageSession.encodedConfigName}:httpService:httpListeners");</script>
<sun:form id="propertyForm">
#include "/common/shared/alertMsg.inc"
<sun:title id="propertyContentPage" title="$resource{i18n_web.configuration.httpListenersPageTitle}"
helpText="$resource{i18n_web.configuration.httpListenersPageTitleHelp}" />
#include "/common/shared/configNameSection.inc"
<sun:table id="configs" title="HTTP Listeners"
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});
/>
#include "/common/shared/listTableConfigButtons.inc"
<sun:tableRowGroup id="rowGroup1" selected="#{td.value.selected}" data={"$attribute{listOfRows}"} sourceVar="td">
<!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{i18n_web.grizzly.table.nameCol}" sort="name" rowHeader="$boolean{true}" id="col1">
<sun:hyperlink id="link" text="#{td.value.name}"
url="#{pageSession.editLink}&name=#{td.value.name}" />
</sun:tableColumn>
<sun:tableColumn headerText="$resource{i18n_web.grizzly.table.portCol}" sort="port" rowHeader="$boolean{true}" id="col3">
<sun:staticText id="port" value="#{td.value.port}" />
</sun:tableColumn>
<sun:tableColumn headerText="$resource{i18n_web.httpListener.table.addressCol}" sort="port" rowHeader="$boolean{true}" id="col4">
<sun:staticText id="address" value="#{td.value.address}" />
</sun:tableColumn>
<sun:tableColumn headerText="$resource{i18n_web.grizzly.table.enabledCol}" sort="enabled" rowHeader="$boolean{true}" id="col22">
<sun:staticText id="enCol" text="#{td.value.enabled}" />
</sun:tableColumn>
</sun:tableRowGroup>
</sun:table>
<sun:hidden id="helpKey" value="$resource{help_web.httpListeners}" />
</sun:form>
#include "/common/shared/changeButtonsJS.inc"
</define>
</composition>