| <!-- | |
| Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. | |
| Copyright (c) 2021 Contributors to the Eclipse Foundation | |
| 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" bundle="org.glassfish.admingui.core.Strings") | |
| 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="$resource{i18n.instanceValues.PageTitle, $pageSession{propName}}" > | |
| <!define name="content"> | |
| <event> | |
| <!beforeCreate | |
| getRequestValue(key="configName" value="#{pageSession.configName}"); | |
| getRequestValue(key="propName" value="#{pageSession.propName}"); | |
| setPageSessionAttribute(key="parentPage", value="#{request.contextPath}/common/configuration/configurationSystemProperties.jsf?configName=#{pageSession.configName}"); | |
| setPageSessionAttribute(key="selfPage", value="#{request.contextPath}/common/configuration/sysInstanceValues.jsf?configName=#{pageSession.configName}"); | |
| setPageSessionAttribute(key="parentUrl", value="#{sessionScope.REST_URL}/configs/config/#{pageSession.configName}"); | |
| setPageSessionAttribute(key="selfUrl", value="#{pageSession.parentUrl}/system-properties"); | |
| gf.restRequest(endpoint="#{sessionScope.REST_URL}/configs/config/#{pageSession.configName}/system-property/#{pageSession.propName}", method="get", | |
| result="#{requestScope.result}"); | |
| setPageSessionAttribute(key="defaultValue", value="#{requestScope.result.data.extraProperties.entity.value}"); | |
| // Get instance to cluster mapping | |
| createMap(result="#{requestScope.instanceMapping}"); | |
| gf.restRequest(endpoint="#{sessionScope.REST_URL}/clusters/cluster", method="get", result="#{requestScope.clusterResult}"); | |
| gf.getMapKeys(Map="#{requestScope.clusterResult.data.extraProperties.childResources}", Keys="#{requestScope.clusters}"); | |
| foreach (var="cluster", list="#{requestScope.clusters}") { | |
| gf.restRequest(endpoint="#{sessionScope.REST_URL}/clusters/cluster/#{cluster}/server-ref", method="get", result="#{requestScope.serverRefResults}"); | |
| gf.getMapKeys(Map="#{requestScope.serverRefResults.data.extraProperties.childResources}", Keys="#{requestScope.serverRefs}"); | |
| foreach (var="serverRef", list="#{requestScope.serverRefs}") { | |
| mapPut(map="#{requestScope.instanceMapping}", key="#{serverRef}", value="#{cluster}"); | |
| } | |
| } | |
| createList(result="#{pageSession.tableList}" size="0"); | |
| gf.restRequest(endpoint="#{sessionScope.REST_URL}/servers/server", method="get", result="#{requestScope.result}"); | |
| gf.getMapKeys(Map="#{requestScope.result.data.extraProperties.childResources}", Keys="#{requestScope.instances}"); | |
| foreach (var="instance", list="#{requestScope.instances}") { | |
| gf.restRequest(endpoint="#{sessionScope.REST_URL}/servers/server/#{instance}", method="get", result="#{requestScope.instanceResults}"); | |
| if ("#{requestScope.instanceResults.data.extraProperties.entity.configRef}=#{pageSession.configName}") { | |
| createMap(result="#{requestScope.instanceMap}"); | |
| gf.restRequest(endpoint="#{sessionScope.REST_URL}/servers/server/#{instance}/system-properties", method="get", result="#{requestScope.result}"); | |
| mapPut(map="#{requestScope.instanceMap}", key="instance", value="#{instance}"); | |
| mapPut(map="#{requestScope.instanceMap}", key="currentOverrideValue", value=""); | |
| mapPut(map="#{requestScope.instanceMap}", key="overrideValue", value=""); | |
| mapPut(map="#{requestScope.instanceMap}", key="cluster", value=""); | |
| foreach(var="sysprop", list="#{requestScope.result.data.extraProperties.systemProperties}") { | |
| if ("#{sysprop.name}=#{propName}") { | |
| if ("#{sysprop.value}") { | |
| mapPut(map="#{requestScope.instanceMap}", key="currentOverrideValue", value="#{sysprop.value}"); | |
| mapPut(map="#{requestScope.instanceMap}", key="overrideValue", value="#{sysprop.value}"); | |
| } | |
| } | |
| } | |
| setAttribute(key="tmp" value="#{instance}"); | |
| if ("!empty #{requestScope.instanceMapping['$attribute{tmp}']}") { | |
| mapPut(map="#{requestScope.instanceMap}", key="cluster", value="#{requestScope.instanceMapping['$attribute{tmp}']}"); | |
| } | |
| listAdd(list="#{pageSession.tableList}", value="#{requestScope.instanceMap}"); | |
| } | |
| } | |
| /> | |
| </event> | |
| <sun:form id="propertyForm"> | |
| <sun:title id="propertyContentPage" title="$resource{i18n.instanceValues.PageTitle,$pageSession{propName}}" > | |
| <!facet pageButtonsTop> | |
| <sun:panelGroup id="topButtons"> | |
| <sun:button id="saveButton" text="$resource{i18n.button.Save}" > | |
| <!command | |
| foreach (var="row" list="#{pageSession.tableList}") { | |
| createMap(result="#{requestScope.attrs}"); | |
| mapPut(map="#{requestScope.attrs}", key="value", value="#{row.overrideValue}"); | |
| if ("!(#{row.overrideValue}=#{row.currentOverrideValue})") { | |
| if ("#{row.overrideValue}") { | |
| gf.restRequest(endpoint="#{sessionScope.REST_URL}/servers/server/#{row.instance}/system-properties/#{pageSession.propName}", method="POST", | |
| data="#{requestScope.attrs}", contentType="application/x-www-form-urlencoded", result="#{requestScope.restResponse}"); | |
| } | |
| if ("!#{row.overrideValue}") { | |
| gf.restRequest(endpoint="#{sessionScope.REST_URL}/servers/server/#{row.instance}/system-properties/#{pageSession.propName}", method="DELETE", | |
| result="#{requestScope.restResponse}"); | |
| } | |
| } | |
| } | |
| prepareSuccessfulMsg(); | |
| gf.redirect(page="#{request.contextPath}#{pageSession.selfPage}&propName=#{pageSession.propName}&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}"); | |
| /> | |
| </sun:button> | |
| </sun:panelGroup> | |
| </facet> | |
| </sun:title> | |
| #include "/common/shared/alertMsg.inc" | |
| #include "/common/shared/configNameSection.inc" | |
| <sun:table id="basicTable" style="padding: 10pt" title="$resource{i18n.common.AdditionalProperties}"> | |
| <!afterCreate | |
| getClientId(component="$this{component}" clientId=>$page{tableId}); | |
| /> | |
| <sun:tableRowGroup id="rowGroup1" data={"$pageSession{tableList}"} sourceVar="td"> | |
| <ui:event type="afterCreate"> | |
| getClientId(component="$this{component}" clientId=>$page{propertyTableRowGroupId}); | |
| </ui:event> | |
| <sun:tableColumn id="nameCol" headerText="$resource{i18n.instanceValues.colInstanceName}" sort="name" rowHeader="$boolean{false}" > | |
| <sun:hyperlink id="saLink" url="/cluster/cluster/clusterInstanceEdit.jsf?clusterName=#{td.value.cluster}&instanceName=#{td.value.instance}" | |
| rendered="#{!empty td.value.cluster}" text="#{td.value.instance}"/> | |
| <h:outputText rendered="#{empty td.value.cluster}" value="#{td.value.instance}"/> | |
| </sun:tableColumn> | |
| <sun:tableColumn id="clusterCol" headerText="$resource{i18n.instanceValues.colClusterName}" sort="value" rendered="#{!empty td.value.cluster}" rowHeader="$boolean{false}"> | |
| "#{td.value.cluster} | |
| </sun:tableColumn> | |
| <sun:tableColumn id="defValCol" headerText="$resource{i18n.systemProps.colDefaultValue}" sort="value" rowHeader="$boolean{false}"> | |
| "#{pageSession.defaultValue} | |
| </sun:tableColumn> | |
| <sun:tableColumn id="overrideValCol" headerText="$resource{i18n.inst.ColOverrideValue}" sort="value" rowHeader="$boolean{false}"> | |
| <sun:textField id="overrideVal" columns="$int{40}" maxLength="#{sessionScope.fieldLengths['maxLength.common.PropertyValue']}" value="#{td.value.overrideValue}" /> | |
| </sun:tableColumn> | |
| "<br/> | |
| </sun:tableRowGroup> | |
| </sun:table> | |
| <sun:hidden id="helpKey" value="$resource{help_common.sysInstanceValues}" /> | |
| </sun:form> | |
| #include "/common/shared/changeButtonsJS.inc" | |
| </define> | |
| </composition> |