# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /Users/anilam/Awork/V3/v3/admingui # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: common/src/main/java/org/glassfish/admingui/common/util/GuiUtil.java --- common/src/main/java/org/glassfish/admingui/common/util/GuiUtil.java Base (BASE) +++ common/src/main/java/org/glassfish/admingui/common/util/GuiUtil.java Locally Modified (Based On LOCAL) @@ -185,6 +185,17 @@ sessionMap.put("debugInfo", GuiUtil.getMessage("inst.notEnabled")); } + try{ + Map secureAdminAttrs = RestUtil.getAttributesMap(sessionMap.get("REST_URL")+"/secure-admin"); + if ( (secureAdminAttrs != null) && ("true".equals(secureAdminAttrs.get("enabled")))){ + sessionMap.put("secureAdminEnabled", "true"); + }else{ + sessionMap.put("secureAdminEnabled", "false"); + } + }catch(Exception ex){ + sessionMap.put("secureAdminEnabled", "false"); + } + sessionMap.put("reqMsg", GuiUtil.getMessage("msg.JS.enterValue")); sessionMap.put("reqMsgSelect", GuiUtil.getMessage("msg.JS.selectValue")); sessionMap.put("reqInt", GuiUtil.getMessage("msg.JS.enterIntegerValue")); Index: web/src/main/resources/grizzly/listenerTabs.inc --- web/src/main/resources/grizzly/listenerTabs.inc Base (BASE) +++ web/src/main/resources/grizzly/listenerTabs.inc Locally Modified (Based On LOCAL) @@ -49,23 +49,24 @@ gf.redirect(page="#{request.contextPath}/web/grizzly/networkListenerEdit.jsf?configName=#{configName}&name=#{pageSession.encodedListenerName}&cancelTo=#{pageSession.cancelTo}"); /> - + - + - + + Index: web/src/main/resources/grizzly/networkListenerEdit.jsf --- web/src/main/resources/grizzly/networkListenerEdit.jsf Base (BASE) +++ web/src/main/resources/grizzly/networkListenerEdit.jsf Locally Modified (Based On LOCAL) @@ -83,6 +83,21 @@ setPageSessionAttribute(key="showCancelButton" value="#{true}" ); setPageSessionAttribute(key="hasPropertySheet" value="#{true}" ); setPageSessionAttribute(key="hasPropertyTable" value="#{false}" ); + + + //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}"); + //TODO: do we need to handle the case where more than 1 listener is setup for __asadmin ?? + if ("#{requestScope.tvp['networkListeners']}=#{pageSession.listenerName}") { + setPageSessionAttribute(key="showSSLTab" value="#{false}"); + setPageSessionAttribute(key="showHttpTab" value="#{false}"); + setPageSessionAttribute(key="showFileCacheTab" value="#{false}"); + } + } /> @@ -103,7 +118,8 @@ - + // + @@ -138,15 +154,13 @@ - + - + - - Index: web/src/main/resources/grizzly/protocolEdit.jsf --- web/src/main/resources/grizzly/protocolEdit.jsf Base (BASE) +++ web/src/main/resources/grizzly/protocolEdit.jsf Locally Modified (Based On LOCAL) @@ -70,6 +70,32 @@ setPageSessionAttribute(key="showCancelButton" value="#{true}" ); setPageSessionAttribute(key="hasPropertySheet" value="#{true}" ); setPageSessionAttribute(key="hasPropertyTable" value="#{false}" ); + + + //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}"); + setPageSessionAttribute(key="disableSaveButton" value="#{false}"); + 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}"); + setPageSessionAttribute(key="disableSaveButton" value="#{true}"); + } + //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}"); + setPageSessionAttribute(key="disableSaveButton" value="#{true}"); + } + } + /> @@ -77,7 +103,27 @@ #include "/common/shared/alertMsg.inc" -#include "/common/shared/editPageButtons.inc" + + + + + + + + + + + #include "/common/shared/configNameSection.inc" Index: web/src/main/resources/grizzly/protocolTabs.inc --- web/src/main/resources/grizzly/protocolTabs.inc Base (BASE) +++ web/src/main/resources/grizzly/protocolTabs.inc Locally Modified (Based On LOCAL) @@ -49,19 +49,19 @@ gf.redirect(page="#{request.contextPath}/web/grizzly/protocolEdit.jsf?configName=#{configName}&name=#{pageSession.encodedName}&cancelTo=#{pageSession.cancelTo}"); /> - + - + - +