admin@glassfish.java.net

Diff: Factor out AMX functionality in the templates

From: Jason Lee <jasondlee_at_sun.com>
Date: Sat, 23 Aug 2008 15:34:14 -0500

Here are the diffs for the resolution to issue 5584, factor out the
AMX portions of the template. As part of the template work, we moved
all of the AMX Handlers to their own class, as CommonHandlers was
getting very large and jumped the cohesiveness tracks a long time
ago. :) Per Anissa's request, we moved this new class and MiscUtil
from core/ to common/. I also modified the web monitoring
configuration page to use the new AMX templates. You can see at the
bottom of the diffs how significantly smaller the new page is.

Index: core/src/main/java/org/glassfish/admingui/handlers/
CommonHandlers.java
===================================================================
--- core/src/main/java/org/glassfish/admingui/handlers/
CommonHandlers.java (revision 22036)
+++ core/src/main/java/org/glassfish/admingui/handlers/
CommonHandlers.java (working copy)
@@ -82,7 +82,7 @@
  import javax.faces.context.FacesContext;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.Cookie;
-import org.glassfish.admingui.util.MiscUtil;
+import org.glassfish.admingui.common.util.MiscUtil;
  import org.glassfish.admingui.util.HtmlAdaptor;


@@ -710,159 +710,8 @@
              handlerCtx.setOutputValue("supportHADB", false);
      }

- /**
- * <p> This handler returns the ConfigConfig object for the
specified configuration name.</p>
- * <p> Input value: "ConfigName" -- Type:
<code>java.lang.String</code></p>
- * <p> Output value: "configConfig" -- Type:
<code>com.sun.appserv.management.config.ConfigConfig</code></p>
- */
- @Handler(id = "getConfigConfig",
- input = {
- @HandlerInput(name = "configName", type = String.class,
required = true)
- },
- output = {
- @HandlerOutput(name="configConfig",
type=ConfigConfig.class)
- })
- public static void getConfigConfig(HandlerContext handlerCtx) {
- String configName = ((String)
handlerCtx.getInputValue("configName"));
- handlerCtx.setOutputValue("configConfig",
AMXRoot.getInstance().getConfig(configName));
- }
-
- /**
- * This Handler will save the contents of a property sheet to the
specified configuration
- * bean. A typical usage will look something like this:
- *
- * <code>insert example here</code>
- */
- @Handler(id="savePropertiesMap",
- input={
- @HandlerInput(name="destination",
type=PropertiesAccess.class, required=true),
- @HandlerInput(name="values", type=Map.class, required=true)
- })
- public static void savePropertiesMap(HandlerContext handlerCtx) {
- final PropertiesAccess propertiesAccess = (PropertiesAccess)
handlerCtx.getInputValue("destination");
- if (propertiesAccess == null) {
- throw new IllegalArgumentException("savePropertiesMap:
destination can not be null");
- }
- AMXUtil.updateProperties( propertiesAccess,
(Map)handlerCtx.getInputValue("values"));
- }

      /**
- * This handler gets the default value for a configuration
property for the given
- * module config
- */
- @Handler(id="getDefaultConfigurationValue",
- input={
- @HandlerInput(name="moduleConfig",
type=AMXConfig.class,required=true),
- @HandlerInput(name="key", type=String.class,
required=true)},
- output={
- @HandlerOutput(name="defaultValue", type=String.class)
- })
- public static void getDefaultConfgurationValue(HandlerContext
handlerCtx) {
- AMXConfig amxConfig =
(AMXConfig)handlerCtx.getInputValue("moduleConfig");
- if (amxConfig == null) {
- throw new
IllegalArgumentException("getDefaultConfigurationValue: moduleConfig
can not be null");
- }
- handlerCtx.setOutputValue("defaultValue",
amxConfig.getDefaultValue((String)handlerCtx.getInputValue("key")));
- }
-
- /**
- * This handler will take an AMXConfig object, and create a Map
of values based
- * on the fields specified in the array
- * @param handlerCtx
- */
- @Handler(id="createAmxConfigMap",
- input={
- @HandlerInput(name="moduleConfig",
type=AMXConfig.class,required=true),
- @HandlerInput(name="properties",
type=List.class,required=true)
- },
- output={
- @HandlerOutput(name="configMap", type=Map.class)
- }
- )
- public static void createAmxConfigMap(HandlerContext handlerCtx) {
- Map<String, Object> map = new HashMap<String, Object>();
- List<String> properties =
(List<String>)handlerCtx.getInputValue("properties");
- AMXConfig amxConfig =
(AMXConfig)handlerCtx.getInputValue("moduleConfig");
- if (amxConfig == null) {
- throw new IllegalArgumentException("createAmxConfigMap:
moduleConfig can not be null");
- }
- if ((properties == null) || (properties.size() == 0)) {
- throw new IllegalArgumentException("createAmxConfigMap:
properties can not be null or empty");
- }
- ValueExpression ve =
MiscUtil.setValueExpression("#{amxConfigMap}", amxConfig);
-
- final FacesContext facesContext =
FacesContext.getCurrentInstance();
- final ELContext elContext = facesContext.getELContext();
- for (String prop : properties) {
- ValueExpression propVE =
facesContext.getApplication().getExpressionFactory().
- createValueExpression(elContext,
"#{amxConfigMap."+prop+"}", Object.class);
- //ve.setValue(facesContext.getELContext(), value);
- Object value = propVE.getValue(elContext);
- map.put(prop, value);
- }
-
- handlerCtx.setOutputValue("configMap", map);
- }
-
- /**
- * This handler will take an AMXConfig object, and create a Map
of values based
- * on the fields specified in the array
- * @param handlerCtx
- */
- @Handler(id="updateAmxConfig",
- input={
- @HandlerInput(name="moduleConfig",
type=AMXConfig.class,required=true),
- @HandlerInput(name="properties",
type=List.class,required=true),
- @HandlerInput(name="configMap", type=Map.class)
- }
- )
- public static void updateAmxConfig(HandlerContext handlerCtx) {
- List<String> properties =
(List<String>)handlerCtx.getInputValue("properties");
- AMXConfig amxConfig =
(AMXConfig)handlerCtx.getInputValue("moduleConfig");
- Map<String, Object> map = (Map<String,
Object>)handlerCtx.getInputValue("configMap");
-
- ValueExpression ve =
MiscUtil.setValueExpression("#{amxConfig}", amxConfig);
-
- final FacesContext facesContext =
FacesContext.getCurrentInstance();
- final ELContext elContext = facesContext.getELContext();
- for (String prop : properties) {
- ValueExpression propVE =
facesContext.getApplication().getExpressionFactory().
- createValueExpression(elContext, "#{amxConfig."+prop
+"}", Object.class);
- propVE.setValue(elContext, map.get(prop));
- }
- }
-
- @Handler(id="loadDefaultAmxConfigAttributes",
- input={
- @HandlerInput(name="amxConfig",
type=AMXConfig.class,required=true),
- @HandlerInput(name="properties",
type=List.class,required=true)
- }
- )
- public static void loadDefaultAmxConfigAttributes(HandlerContext
handlerCtx) {
- AMXConfig amxConfig =
(AMXConfig)handlerCtx.getInputValue("amxConfig");
- List<String> properties =
(List<String>)handlerCtx.getInputValue("properties");
- if (amxConfig == null) {
- throw new
IllegalArgumentException("getDefaultConfigurationValue: amxConfig can
not be null");
- }
-
- for (String prop : properties) {
- MiscUtil.setValueExpression("#{configMap." + prop + "}",
-
amxConfig.getDefaultValue((String)handlerCtx.getInputValue("key")));
- }
- }
-
- /**
- *
- */
- @Handler(id="getAmxRoot",
- output={
- @HandlerOutput(name="amxRoot", type=AMXRoot.class)
- })
- public static void getAmxRootInstance(HandlerContext handlerCtx) {
- handlerCtx.setOutputValue("amxRoot", AMXRoot.getInstance());
- }
-
- /**
       * This handler will return the contents of the specified
deployment
       * descriptor as a String.
       * @param handlerCtx
Index: core/src/main/java/org/glassfish/admingui/handlers/
SSLHandlers.java
===================================================================
--- core/src/main/java/org/glassfish/admingui/handlers/
SSLHandlers.java (revision 22036)
+++ core/src/main/java/org/glassfish/admingui/handlers/
SSLHandlers.java (working copy)
@@ -66,7 +66,7 @@
  import com.sun.appserv.management.config.VirtualServerConfig;
  import org.glassfish.admingui.common.util.AMXRoot;
  import org.glassfish.admingui.common.util.GuiUtil;
-import org.glassfish.admingui.util.MiscUtil;
+import org.glassfish.admingui.common.util.MiscUtil;
  import org.glassfish.admingui.common.util.AMXUtil;

  import com.sun.enterprise.security.ssl.SSLUtils;
Index: core/src/main/java/org/glassfish/admingui/util/MiscUtil.java
===================================================================
--- core/src/main/java/org/glassfish/admingui/util/MiscUtil.java
(revision 22036)
+++ core/src/main/java/org/glassfish/admingui/util/MiscUtil.java
(working copy)
@@ -1,151 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common
Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You
can obtain
- * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
- * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the
specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice
in each
- * file and include the License file at glassfish/bootstrap/legal/
LICENSE.txt.
- * Sun designates this particular file as subject to the "Classpath"
exception
- * as provided by Sun in the GPL Version 2 section of the License
file that
- * accompanied this code. If applicable, add the following below the
License
- * Header, with the fields enclosed by brackets [] replaced by your own
- * identifying information: "Portions Copyrighted [year]
- * [name of copyright owner]"
- *
- * Contributor(s):
- *
- * If you wish your version of this file to be governed by only the
CDDL or
- * only the GPL Version 2, indicate your decision by adding
"[Contributor]
- * elects to include this software in this distribution under the
[CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of
license, a
- * recipient has the option to distribute your version of this file
under
- * either the CDDL, the GPL Version 2 or to extend the choice of
license to
- * its licensees as provided above. However, if you add GPL Version
2 code
- * and therefore, elected the GPL Version 2 license, then the option
applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.glassfish.admingui.util;
-
-import javax.faces.model.SelectItem;
-import java.lang.reflect.Array;
-import java.lang.reflect.Constructor;
-import javax.el.ValueExpression;
-import javax.faces.context.FacesContext;
-import javax.swing.text.html.Option;
-
-
-/**
- *
- * @author anilam
- */
-public class MiscUtil {
-
-
- public static SelectItem[] getOptions(String[] values){
- if (values == null){
- SelectItem[] options = (SelectItem [])
Array.newInstance(SUN_OPTION_CLASS, 0);
- return options;
- }
- SelectItem[] options =
- (SelectItem []) Array.newInstance(SUN_OPTION_CLASS,
values.length);
- for (int i =0; i < values.length; i++) {
- SelectItem option = getSunOption(values[i], values[i]);
- options[i] = option;
- }
- return options;
- }
-
- public static Option[] getOptionsArray(String[] values){
- Option[] options =
- (Option []) Array.newInstance(SUN_OPTION_CLASS,
values.length);
- for (int i =0; i < values.length; i++) {
- Option option = getOption(values[i], values[i]);
- options[i] = option;
- }
- return options;
- }
-
- public static Option getOption(String value, String label) {
- try {
- return (Option) SUN_OPTION_CONSTRUCTOR.newInstance(value, label);
- } catch (Exception ex) {
- return null;
- }
- }
-
- public static SelectItem[] getOptions(String[] values, String[]
labels){
- SelectItem[] options =
- (SelectItem []) Array.newInstance(SUN_OPTION_CLASS,
values.length);
- for (int i =0; i < values.length; i++) {
- SelectItem option = getSunOption(values[i], labels[i]);
- options[i] = option;
- }
- return options;
- }
-
- public static SelectItem[] getModOptions(String[] values){
- int size = (values == null)? 1 : values.length +1;
- SelectItem[] options =
- (SelectItem []) Array.newInstance(SUN_OPTION_CLASS, size);
- options[0] = getSunOption("", "");
- for (int i = 0; i < values.length; i++) {
- SelectItem option = getSunOption(values[i], values[i]);
- options[i+1] = option;
- }
- return options;
- }
-
- public static SelectItem getSunOption(String value, String label) {
- try {
- return (SelectItem) SUN_OPTION_CONSTRUCTOR.newInstance(value,
label);
- } catch (Exception ex) {
- return null;
- }
- }
-
- /**
- * <p>This utility method can be used to create a ValueExpression
and set its value.
- * An example usage might look like this:</p>
- * <code>
- * ValueExpression ve =
MiscUtil.setValueExpression("#{myMap}", new HashMap());
- * </code>
- * @param expression The expression to create. Note that this
requires the #{ and } wrappers.
- * @param value The value to which to set the ValueExpression
- * @return The newly created ValueExpression
- */
- public static ValueExpression setValueExpression(String
expression, Object value) {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ValueExpression ve =
facesContext.getApplication().getExpressionFactory().
- createValueExpression(facesContext.getELContext(),
expression, Object.class);
- ve.setValue(facesContext.getELContext(), value);
-
- return ve;
- }
-
- private static Class SUN_OPTION_CLASS = null;
- private static Constructor SUN_OPTION_CONSTRUCTOR = null;
-
- static {
- try {
- SUN_OPTION_CLASS =
- Class.forName("com.sun.webui.jsf.model.Option");
- SUN_OPTION_CONSTRUCTOR = SUN_OPTION_CLASS.
- getConstructor(new Class[] {Object.class, String.class});
- } catch (Exception ex) {
- // Ignore exception here, NPE will be thrown when attempting to
- // use SUN_OPTION_CONSTRUCTOR.
- }
- }
-
-
-}
Index: core/src/main/resources/templates/table.inc
===================================================================
--- core/src/main/resources/templates/table.inc (revision 22036)
+++ core/src/main/resources/templates/table.inc (working copy)
@@ -1,7 +1,3 @@
-<!initPage
- setAttribute(key="tableInUse" value="#{true}");
- getTableList(Properties="#{amxConfig.propertyConfigMap}",
TableList=>$attribute{tableList});
-/>
  <!-- Table .... -->
  <sun:table id="basicTable" style="padding: 10pt"
title="$resource{i18n.common.AdditionalProperties}"
              deselectMultipleButton="$boolean{true}"
@@ -10,7 +6,7 @@
               
selectMultipleButtonOnClick="setTimeout('changeOneTableButton()', 0)" >
      <!afterCreate
              getClientId(component="$this{component}" clientId=>
$page{tableId});
-/>
+ />
  <!-- Actions (Top) -->
      <!facet actionsTop>
      <sun:panelGroup id="topActionsGroup1">
Index: core/src/main/resources/templates/sheet.inc
===================================================================
--- core/src/main/resources/templates/sheet.inc (revision 22036)
+++ core/src/main/resources/templates/sheet.inc (working copy)
@@ -1,5 +1,7 @@
  <sun:propertySheet>
+<!insert name="propertySheets">
      <sun:propertySheetSection>
      <!insert name="properties" />
      </sun:propertySheetSection >
-</sun:propertySheet>
+</insert>
+</sun:propertySheet>
\ No newline at end of file
Index: core/src/main/resources/templates/adminConsolePageButtonsTop.inc
===================================================================
--- core/src/main/resources/templates/adminConsolePageButtonsTop.inc
(revision 0)
+++ core/src/main/resources/templates/adminConsolePageButtonsTop.inc
(revision 0)
@@ -0,0 +1,11 @@
+<sun:button id="saveButton" text="$resource{i18n.button.Save}" >
+ <!command
+ if (#{tableInUse}) {
+
getUIComponent(clientId="$pageSession{propertyTableRowGroupId}",
component=>$attribute{tableRowGroup});
+
getAllSingleMapRows(TableRowGroup="$attribute{tableRowGroup}", Rows=>
$attribute{newList});
+ convertRowsToProperties(NewList="#{newList}", AddProps=>
$attribute{newProps});
+ savePropertiesMap(destination="#{amxConfig}",
values="#{newProps}");
+ }
+ updateAmxConfig(moduleConfig="#{amxConfig}",
configMap="$pageSession{configMap}");
+ />
+</sun:button>
\ No newline at end of file
Index: core/src/main/resources/templates/baseTemplate.tpl
===================================================================
--- core/src/main/resources/templates/baseTemplate.tpl (revision 22036)
+++ core/src/main/resources/templates/baseTemplate.tpl (working copy)
@@ -1,141 +1,41 @@
  <!initPage
- setResourceBundle(key="i18n" bundle="core.Strings")
+ if (#{i18nBundle}) {
+ setResourceBundle(key="i18n" bundle="#{i18nBundle}")
+ }
      if (#{helpBundle}) {
          setResourceBundle(key="help" bundle="#{helpBundle}")
      }
- if (!#{pageSession.configName}) {
- getRequestValue(key="configName" value=>$page{configName});
- }
- if (#{pageSession.configName}) {
- getConfigConfig(configName="#{configName}" configConfig=>
$attribute{config});
- setAttribute(key="amxConfigName", value="#{amxConfigName}");
- setPageSessionAttribute(key="amxConfig" value="#{config.
$attribute{amxConfigName}}");
- // This probably needs to move to table.inc
- if (#{amxConfigAttributes}) {
- setPageSessionAttribute(key="amxConfigAttributes"
value="#{amxConfigAttributes}");
- createAmxConfigMap(moduleConfig="#{amxConfig}",
properties="#{amxConfigAttributes}", configMap=>
$pageSession{configMap});
- }
- }
  />
  <sun:page>
- <!beforeCreate
- compare(obj1="$pageSession{configName}" obj2="server-config"
objEqual=>$attribute{isServerConfig});
- setPageSessionAttribute(key="showIt" value="$boolean{false}");
- if ($session{supportCluster} & !${isServerConfig}){
- setPageSessionAttribute(key="showIt"
value="$boolean{true}");
- }
- />
-<!-- #include "/shared/restart.inc" -->
-<!--
-<event>
- <!beforeEncode
- if(! $session{supportCluster}){
- checkRestart(RestartRequired=>$attribute{restartRequired});
- }
- if($session{supportCluster}){
- setAttribute(key="restartRequired"
value="$boolean{false}");
- }
- />
-</event>
--->
+#include "/shared/restart.inc"

  <sun:html>
- <!insert name="head">
- <sun:head title="#{pageTitle}">
- <!insert name="headExtra" />
- </sun:head>
- </insert>
- <sun:body onLoad="javascript:
synchronizeRestartRequired('#{requestScope.restartRequired}',
'#{sessionScope.restartRequired}')">
+<!insert name="head">
+ <sun:head title="#{pageTitle}">
+ <!insert name="headExtra" />
+ </sun:head>
+</insert>
+ <sun:body>

- <sun:form id="form">
- "<div id="breadcrumbs" style="border: 1px solid #E5E9ED;
background-color: #E5E9ED">
- <!-- Make sure we have the scripts loaded -->
- <sun:script url="/resource/js/adminjsf.js" />
- <!-- start the breadcrumbs -->
- <sun:breadcrumbs id="boom"
pages="#{pageSession.breadCrumbs}"style="background-color: #E5E9ED">
- <!beforeCreate
- dummyHyperlinkArray(links=>$pageSession{breadCrumbs});
- />
- <!afterCreate
- setPageSessionAttribute(key="boom"
value="$this{clientId}");
- setPageSessionAttribute(key="hasPageURL",
value="#{false}");
- if ("#{pageSession.pageURLForBreadCrumb}"){
- setPageSessionAttribute(key="pageURL",
value="#{pageSession.pageURLForBreadCrumb}");
- setPageSessionAttribute(key="hasPageURL",
value="#{true}");
- }
- if ("!#{pageSession.hasPageURL}"){
- setPageSessionAttribute(key="pageURL"
value="#{facesContext.externalContext.request.queryString}");
- if ("#{pageSession.pageURL}") {
- setPageSessionAttribute(key="pageURL"
value
=
"#{facesContext
.externalContext
.requestServletPath}#{facesContext.externalContext.requestPathInfo}?
#{pageSession.pageURL}");
- }
- if ("!#{pageSession.pageURL}") {
- setPageSessionAttribute(key="pageURL"
value
=
"#{facesContext
.externalContext
.requestServletPath}#{facesContext.externalContext.requestPathInfo}");
- }
- }
- />
- </sun:breadcrumbs>
-
- <!-- Make an invisible button to handle the Ajax action -->
- <sun:button id="button" visible="#{false}">
- <!afterCreate
- setPageSessionAttribute(key="ajaxButton"
value="$this{clientId}");
- />
- <!command
- createHyperlinkArray(links=>$pageSession{breadCrumbs});
- />
- </sun:button>
-
- <!-- Fire this during the onload of the page -->
- <f:verbatim>
- <script type="text/javascript">
- var myonload = new Object();
- myonload.oldonload = window.onload;
- myonload.newonload = function() {
- if ('#{pageSession.pageURL}' != '') {
-
admingui.nav.selectTreeNodeWithURL('#{pageSession.pageURL}');
- }
-
admingui
.nav
.calculateBreadCrumbs
(document.getElementById('#{pageSession.ajaxButton}'),
'#{pageSession.boom}', 0);
- if (myonload.oldonload) {
- myonload.oldonload();
- }
- };
- window.onload = myonload.newonload;
- </script>
- </f:verbatim>
-
- "</div>
- <sun:title title="#{pageTitle}" helpText="#{helpText}">
- <!insert name="titleExtra" />
- <sun:button id="loadDefaults" rendered="$
{amxConfigAttributes}" style="margin-left: 8pt" primary="#{false}"
text="$resource{i18n.button.LoadDefaults}" >
- <!command
-
loadDefaultAmxConfigAttributes(amxConfig="#{amxConfig}",
properties="#{amxConfigAttributes}");
- />
- </sun:button>
+ <sun:form id="form">
+#include "/shared/treeBreadcrumbs.inc"
+ <sun:title title="#{pageTitle}" helpText="#{helpText}">
+ <!insert name="titleExtra" />

- <!-- Buttons -->
- <!facet pageButtonsTop>
- <sun:panelGroup id="topButtons">
- <sun:button id="saveButton"
text="$resource{i18n.button.Save}" >
- <!command
- #{pageButtonsTopHandlers}
- if (#{tableInUse}) {
-
getUIComponent(clientId="$pageSession{propertyTableRowGroupId}",
component=>$attribute{tableRowGroup});
-
getAllSingleMapRows(TableRowGroup="$attribute{tableRowGroup}", Rows=>
$attribute{newList});
-
convertRowsToProperties(NewList="#{newList}", AddProps=>
$attribute{newProps});
-
savePropertiesMap(destination="#{amxConfig}", values="#{newProps}");
- }
- />
- </sun:button>
- </sun:panelGroup>
- </facet>
- </sun:title>
+ <!-- Buttons -->
+ <!facet pageButtonsTop>
+ <sun:panelGroup id="topButtons">
+ <!insert name="pageButtonsTop" />
+ </sun:panelGroup>
+ </facet>
+ </sun:title>

- <!insert name="content">
- "Content Goes Here
- </insert>
+ <!insert name="content">
+ "Content Goes Here
+ </insert>

- <!insert name="helpkey" />
- </sun:form>
+ <!insert name="helpkey" />
+ </sun:form>
      </sun:body>
  </sun:html>
  </sun:page>
Index: core/src/main/resources/templates/propertyTableTemplate.tpl
===================================================================
--- core/src/main/resources/templates/propertyTableTemplate.tpl
(revision 22036)
+++ core/src/main/resources/templates/propertyTableTemplate.tpl
(working copy)
@@ -1,3 +1,6 @@
+<!initPage
+ setAttribute(key="tableInUse" value="#{true}");
+/>
  <!composition template="/templates/baseTemplate.tpl">
      <!define name="content">
  #include "/templates/table.inc"
Index: core/src/main/resources/templates/adminConsolePropertyTable.tpl
===================================================================
--- core/src/main/resources/templates/adminConsolePropertyTable.tpl
(revision 0)
+++ core/src/main/resources/templates/adminConsolePropertyTable.tpl
(revision 0)
@@ -0,0 +1,6 @@
+<!initPage
+#include "/templates/adminConsoleInit.inc"
+ getTableList(Properties="#{amxConfig.propertyConfigMap}",
TableList=>$attribute{tableList});
+/>
+<!composition template="/templates/properyTableTemplate.tpl">
+</composition>
\ No newline at end of file
Index: core/src/main/resources/templates/propertySheetTemplate.tpl
===================================================================
--- core/src/main/resources/templates/propertySheetTemplate.tpl
(revision 22036)
+++ core/src/main/resources/templates/propertySheetTemplate.tpl
(working copy)
@@ -1,5 +1,5 @@
  <!composition template="/templates/baseTemplate.tpl">
- <!define name="content">
+ <!define name="content">
  #include "/templates/sheet.inc"
- </define>
+ </define>
  </composition>
\ No newline at end of file
Index: core/src/main/resources/templates/adminConsoleInit.inc
===================================================================
--- core/src/main/resources/templates/adminConsoleInit.inc (revision 0)
+++ core/src/main/resources/templates/adminConsoleInit.inc (revision 0)
@@ -0,0 +1,16 @@
+if (!#{pageSession.configName}) {
+ getRequestValue(key="configName" value=>$page{configName});
+}
+if (#{pageSession.configName}) {
+ getConfigConfig(configName="#{configName}" configConfig=>
$attribute{config});
+ setAttribute(key="amxConfigName", value="#{amxConfigName}");
+ setPageSessionAttribute(key="amxConfig" value="#{config.
$attribute{amxConfigName}}");
+ // This probably needs to move to table.inc
+ if (#{amxConfigAttributes}) {
+ if (!#{pageSession.amxConfigAttributes}) {
+ setPageSessionAttribute(key="amxConfigAttributes"
value="#{amxConfigAttributes}");
+ }
+ createAmxConfigMap(moduleConfig="#{amxConfig}",
properties="#{amxConfigAttributes}", configMap=>
$pageSession{configMap});
+ }
+}
+setAttribute(key="i18nBundle", value="core.Strings");
\ No newline at end of file
Index: core/src/main/resources/templates/adminConsolePropertySheet.tpl
===================================================================
--- core/src/main/resources/templates/adminConsolePropertySheet.tpl
(revision 0)
+++ core/src/main/resources/templates/adminConsolePropertySheet.tpl
(revision 0)
@@ -0,0 +1,15 @@
+<!initPage
+#include "/templates/adminConsoleInit.inc"
+/>
+<!composition template="/templates/propertySheetTemplate.tpl">
+ <!define name="titleExtra">
+ <sun:button id="loadDefaults" style="margin-left: 8pt"
primary="#{false}" text="$resource{i18n.button.LoadDefaults}" >
+ <!command
+
loadDefaultAmxConfigAttributes(amxConfig="#{amxConfig}",
configMap="$pageSession{configMap}");
+ />
+ </sun:button>
+ </define>
+ <!define name="pageButtonsTop">
+#include "/templates/adminConsolePageButtonsTop.inc"
+ </define>
+</composition>
\ No newline at end of file
Index: core/src/main/resources/templates/sheetTableTemplate.tpl
===================================================================
--- core/src/main/resources/templates/sheetTableTemplate.tpl (revision
22036)
+++ core/src/main/resources/templates/sheetTableTemplate.tpl (working
copy)
@@ -1,3 +1,6 @@
+<!initPage
+ setAttribute(key="tableInUse" value="#{true}");
+/>
  <!composition template="/templates/baseTemplate.tpl">
      <!define name="content">
  #include "/templates/sheet.inc"
Index: core/src/main/resources/templates/adminConsoleSheetTable.tpl
===================================================================
--- core/src/main/resources/templates/adminConsoleSheetTable.tpl
(revision 0)
+++ core/src/main/resources/templates/adminConsoleSheetTable.tpl
(revision 0)
@@ -0,0 +1,10 @@
+<!initPage
+#include "/templates/adminConsoleInit.inc"
+ getTableList(Properties="#{amxConfig.propertyConfigMap}",
TableList=>$attribute{tableList});
+/>
+<!composition template="/templates/sheetTableTemplate.tpl">
+ <!define name="content">
+#include "/templates/sheet.inc"
+#include "/templates/table.inc"
+ </define>
+</composition>
\ No newline at end of file
Index: common/src/main/java/org/glassfish/admingui/common/handlers/
AmxHandlers.java
===================================================================
--- common/src/main/java/org/glassfish/admingui/common/handlers/
AmxHandlers.java (revision 0)
+++ common/src/main/java/org/glassfish/admingui/common/handlers/
AmxHandlers.java (revision 0)
@@ -0,0 +1,185 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.glassfish.admingui.common.handlers;
+
+import com.sun.appserv.management.config.AMXConfig;
+import com.sun.appserv.management.config.ConfigConfig;
+import com.sun.appserv.management.config.PropertiesAccess;
+import com.sun.jsftemplating.annotation.Handler;
+import com.sun.jsftemplating.annotation.HandlerInput;
+import com.sun.jsftemplating.annotation.HandlerOutput;
+import com.sun.jsftemplating.layout.descriptors.handler.HandlerContext;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.el.ELContext;
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+import org.glassfish.admingui.common.util.AMXRoot;
+import org.glassfish.admingui.common.util.AMXUtil;
+import org.glassfish.admingui.common.util.MiscUtil;
+
+/**
+ *
+ * @author jasonlee
+ */
+public class AmxHandlers {
+
+ /**
+ * <p> This handler returns the ConfigConfig object for the
specified configuration name.</p>
+ * <p> Input value: "ConfigName" -- Type:
<code>java.lang.String</code></p>
+ * <p> Output value: "configConfig" -- Type:
<code>com.sun.appserv.management.config.ConfigConfig</code></p>
+ */
+ @Handler(id = "getConfigConfig",
+ input = {
+ @HandlerInput(name = "configName", type = String.class,
required = true)
+ },
+ output = {
+ @HandlerOutput(name = "configConfig", type =
ConfigConfig.class)
+ })
+ public static void getConfigConfig(HandlerContext handlerCtx) {
+ String configName = ((String)
handlerCtx.getInputValue("configName"));
+ handlerCtx.setOutputValue("configConfig",
AMXRoot.getInstance().getConfig(configName));
+ }
+
+ /**
+ * This Handler will save the contents of a property sheet to the
specified configuration
+ * bean. A typical usage will look something like this:
+ *
+ * <code>insert example here</code>
+ */
+ @Handler(id = "savePropertiesMap",
+ input = {
+ @HandlerInput(name = "destination", type =
PropertiesAccess.class, required = true),
+ @HandlerInput(name = "values", type = Map.class, required =
true)
+ })
+ public static void savePropertiesMap(HandlerContext handlerCtx) {
+ final PropertiesAccess propertiesAccess = (PropertiesAccess)
handlerCtx.getInputValue("destination");
+ if (propertiesAccess == null) {
+ throw new IllegalArgumentException("savePropertiesMap:
destination can not be null");
+ }
+ AMXUtil.updateProperties(propertiesAccess, (Map)
handlerCtx.getInputValue("values"));
+ }
+
+ /**
+ * This handler gets the default value for a configuration
property for the given
+ * module config
+ */
+ @Handler(id = "getDefaultConfigurationValue",
+ input = {
+ @HandlerInput(name = "moduleConfig", type = AMXConfig.class,
required = true),
+ @HandlerInput(name = "key", type = String.class, required =
true)
+ },
+ output = {
+ @HandlerOutput(name = "defaultValue", type = String.class)
+ })
+ public static void getDefaultConfgurationValue(HandlerContext
handlerCtx) {
+ AMXConfig amxConfig = (AMXConfig)
handlerCtx.getInputValue("moduleConfig");
+ if (amxConfig == null) {
+ throw new
IllegalArgumentException("getDefaultConfigurationValue: moduleConfig
can not be null");
+ }
+ System.out.println("***** The amxConfig object is " +
amxConfig.toString());
+ System.out.println("***** The default value for '" + (String)
handlerCtx.getInputValue("key") +
+ "' is '" + amxConfig.getDefaultValue((String)
handlerCtx.getInputValue("key")) + "'");
+ handlerCtx.setOutputValue("defaultValue",
amxConfig.getDefaultValue((String) handlerCtx.getInputValue("key")));
+ }
+
+ /**
+ * This handler will take an AMXConfig object, and create a Map
of values based
+ * on the fields specified in the array
+ * @param handlerCtx
+ */
+ @Handler(id = "createAmxConfigMap",
+ input = {
+ @HandlerInput(name = "moduleConfig", type = AMXConfig.class,
required = true),
+ @HandlerInput(name = "properties", type = List.class,
required = true)
+ },
+ output = {
+ @HandlerOutput(name = "configMap", type = Map.class)
+ })
+ public static void createAmxConfigMap(HandlerContext handlerCtx) {
+ Map<String, Object> map = new HashMap<String, Object>();
+ List<String> properties = (List<String>)
handlerCtx.getInputValue("properties");
+ AMXConfig amxConfig = (AMXConfig)
handlerCtx.getInputValue("moduleConfig");
+ if (amxConfig == null) {
+ throw new IllegalArgumentException("createAmxConfigMap:
moduleConfig can not be null");
+ }
+ if ((properties == null) || (properties.size() == 0)) {
+ throw new IllegalArgumentException("createAmxConfigMap:
properties can not be null or empty");
+ }
+ ValueExpression ve =
MiscUtil.setValueExpression("#{amxConfigMap}", amxConfig);
+
+ final FacesContext facesContext =
FacesContext.getCurrentInstance();
+ final ELContext elContext = facesContext.getELContext();
+ for (String prop : properties) {
+ ValueExpression propVE =
facesContext.getApplication().getExpressionFactory().
+ createValueExpression(elContext,
"#{amxConfigMap." + prop + "}", Object.class);
+ //ve.setValue(facesContext.getELContext(), value);
+ Object value = propVE.getValue(elContext);
+ map.put(prop, value);
+ }
+
+ handlerCtx.setOutputValue("configMap", map);
+ }
+
+ /**
+ * This handler will take an AMXConfig object, and create a Map
of values based
+ * on the fields specified in the array
+ * @param handlerCtx
+ */
+ @Handler(id = "updateAmxConfig",
+ input = {
+ @HandlerInput(name = "moduleConfig", type = AMXConfig.class,
required = true),
+ @HandlerInput(name = "properties", type = List.class), // So
things don't break, for now
+ @HandlerInput(name = "configMap", type = Map.class)
+ })
+ public static void updateAmxConfig(HandlerContext handlerCtx) {
+ AMXConfig amxConfig = (AMXConfig)
handlerCtx.getInputValue("moduleConfig");
+ Map<String, Object> map = (Map<String, Object>)
handlerCtx.getInputValue("configMap");
+
+ MiscUtil.setValueExpression("#{amxConfig}", amxConfig);
+
+ final FacesContext facesContext =
FacesContext.getCurrentInstance();
+ final ELContext elContext = facesContext.getELContext();
+ //for (String prop : properties) {
+ for (Map.Entry<String, Object> entry : map.entrySet()) {
+ ValueExpression propVE =
facesContext.getApplication().getExpressionFactory().
+ createValueExpression(elContext, "#{amxConfig." +
entry.getKey() + "}", Object.class);
+ propVE.setValue(elContext, entry.getValue());
+ }
+ }
+
+ @Handler(id = "loadDefaultAmxConfigAttributes",
+ input = {
+ @HandlerInput(name = "amxConfig", type = AMXConfig.class,
required = true),
+ @HandlerInput(name = "configMap", type = Map.class, required
= true)
+ })
+ public static void loadDefaultAmxConfigAttributes(HandlerContext
handlerCtx) {
+ AMXConfig amxConfig = (AMXConfig)
handlerCtx.getInputValue("amxConfig");
+ Map<String, Object> entries = (Map<String, Object>)
handlerCtx.getInputValue("configMap");
+ if (amxConfig == null) {
+ throw new
IllegalArgumentException("getDefaultConfigurationValue: amxConfig can
not be null");
+ }
+ System.out.println("******************************** " +
entries.toString());
+ for (Map.Entry<String, Object> entry : entries.entrySet()) {
+ System.out.println("***** amxConfig = " + amxConfig);
+ System.out.println("***** default for " + entry.getKey()
+ " = " + amxConfig.getDefaultValue(entry.getKey()));
+ //MiscUtil.setValueExpression("#{configMap." + prop +
"}", amxConfig.getDefaultValue(prop));
+ entries.put(entry.getKey(),
amxConfig.getDefaultValue(entry.getKey()));
+ }
+ System.out.println("******************************** " +
entries.toString());
+ }
+
+ /**
+ *
+ */
+ @Handler(id = "getAmxRoot",
+ output = {
+ @HandlerOutput(name = "amxRoot", type = AMXRoot.class)
+ })
+ public static void getAmxRootInstance(HandlerContext handlerCtx) {
+ handlerCtx.setOutputValue("amxRoot", AMXRoot.getInstance());
+ }
+}
Index: common/src/main/java/org/glassfish/admingui/common/util/
MiscUtil.java
===================================================================
--- common/src/main/java/org/glassfish/admingui/common/util/
MiscUtil.java (revision 22000)
+++ common/src/main/java/org/glassfish/admingui/common/util/
MiscUtil.java (working copy)
@@ -33,9 +33,8 @@
   * only if the new code is made subject to such option by the
copyright
   * holder.
   */
+package org.glassfish.admingui.common.util;

-package org.glassfish.admingui.util;
-
  import javax.faces.model.SelectItem;
  import java.lang.reflect.Array;
  import java.lang.reflect.Constructor;
@@ -43,76 +42,74 @@
  import javax.faces.context.FacesContext;
  import javax.swing.text.html.Option;

-
  /**
   *
   * @author anilam
   */
  public class MiscUtil {

-
- public static SelectItem[] getOptions(String[] values){
- if (values == null){
- SelectItem[] options = (SelectItem [])
Array.newInstance(SUN_OPTION_CLASS, 0);
- return options;
+ public static SelectItem[] getOptions(String[] values) {
+ if (values == null) {
+ SelectItem[] options = (SelectItem[])
Array.newInstance(SUN_OPTION_CLASS, 0);
+ return options;
          }
          SelectItem[] options =
- (SelectItem []) Array.newInstance(SUN_OPTION_CLASS,
values.length);
- for (int i =0; i < values.length; i++) {
+ (SelectItem[]) Array.newInstance(SUN_OPTION_CLASS,
values.length);
+ for (int i = 0; i < values.length; i++) {
              SelectItem option = getSunOption(values[i], values[i]);
              options[i] = option;
          }
          return options;
      }
-
- public static Option[] getOptionsArray(String[] values){
+
+ public static Option[] getOptionsArray(String[] values) {
          Option[] options =
- (Option []) Array.newInstance(SUN_OPTION_CLASS,
values.length);
- for (int i =0; i < values.length; i++) {
+ (Option[]) Array.newInstance(SUN_OPTION_CLASS,
values.length);
+ for (int i = 0; i < values.length; i++) {
              Option option = getOption(values[i], values[i]);
              options[i] = option;
          }
          return options;
      }
-
+
      public static Option getOption(String value, String label) {
- try {
- return (Option) SUN_OPTION_CONSTRUCTOR.newInstance(value, label);
- } catch (Exception ex) {
- return null;
- }
- }
-
- public static SelectItem[] getOptions(String[] values, String[]
labels){
+ try {
+ return (Option) SUN_OPTION_CONSTRUCTOR.newInstance(value,
label);
+ } catch (Exception ex) {
+ return null;
+ }
+ }
+
+ public static SelectItem[] getOptions(String[] values, String[]
labels) {
          SelectItem[] options =
- (SelectItem []) Array.newInstance(SUN_OPTION_CLASS,
values.length);
- for (int i =0; i < values.length; i++) {
+ (SelectItem[]) Array.newInstance(SUN_OPTION_CLASS,
values.length);
+ for (int i = 0; i < values.length; i++) {
              SelectItem option = getSunOption(values[i], labels[i]);
              options[i] = option;
          }
          return options;
      }
-
- public static SelectItem[] getModOptions(String[] values){
- int size = (values == null)? 1 : values.length +1;
+
+ public static SelectItem[] getModOptions(String[] values) {
+ int size = (values == null) ? 1 : values.length + 1;
          SelectItem[] options =
- (SelectItem []) Array.newInstance(SUN_OPTION_CLASS, size);
+ (SelectItem[]) Array.newInstance(SUN_OPTION_CLASS,
size);
          options[0] = getSunOption("", "");
- for (int i = 0; i < values.length; i++) {
- SelectItem option = getSunOption(values[i], values[i]);
- options[i+1] = option;
- }
+ for (int i = 0; i < values.length; i++) {
+ SelectItem option = getSunOption(values[i], values[i]);
+ options[i + 1] = option;
+ }
          return options;
      }
-
+
      public static SelectItem getSunOption(String value, String
label) {
- try {
- return (SelectItem) SUN_OPTION_CONSTRUCTOR.newInstance(value,
label);
- } catch (Exception ex) {
- return null;
- }
+ try {
+ return (SelectItem)
SUN_OPTION_CONSTRUCTOR.newInstance(value, label);
+ } catch (Exception ex) {
+ return null;
+ }
      }
-
+
      /**
       * <p>This utility method can be used to create a
ValueExpression and set its value.
       * An example usage might look like this:</p>
@@ -126,26 +123,23 @@
      public static ValueExpression setValueExpression(String
expression, Object value) {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          ValueExpression ve =
facesContext.getApplication().getExpressionFactory().
- createValueExpression(facesContext.getELContext(),
expression, Object.class);
+ createValueExpression(facesContext.getELContext(),
expression, Object.class);
          ve.setValue(facesContext.getELContext(), value);
-
+
          return ve;
      }
-
- private static Class SUN_OPTION_CLASS = null;
+ private static Class SUN_OPTION_CLASS = null;
      private static Constructor SUN_OPTION_CONSTRUCTOR = null;
+

      static {
- try {
- SUN_OPTION_CLASS =
- Class.forName("com.sun.webui.jsf.model.Option");
- SUN_OPTION_CONSTRUCTOR = SUN_OPTION_CLASS.
- getConstructor(new Class[] {Object.class, String.class});
- } catch (Exception ex) {
- // Ignore exception here, NPE will be thrown when attempting to
- // use SUN_OPTION_CONSTRUCTOR.
- }
+ try {
+ // TODO: Class.forName can cause problems under OSGi
+ SUN_OPTION_CLASS =
Class.forName("com.sun.webui.jsf.model.Option");
+ SUN_OPTION_CONSTRUCTOR =
SUN_OPTION_CLASS.getConstructor(new Class[]{Object.class,
String.class});
+ } catch (Exception ex) {
+ // Ignore exception here, NPE will be thrown when
attempting to
+ // use SUN_OPTION_CONSTRUCTOR.
+ }
      }
-
-
  }

Property changes on: common/src/main/java/org/glassfish/admingui/
common/util/MiscUtil.java
___________________________________________________________________
Added: svn:mergeinfo

Index: web/src/main/resources/monitor/monitoringPage.jsf
===================================================================
--- web/src/main/resources/monitor/monitoringPage.jsf (revision 22036)
+++ web/src/main/resources/monitor/monitoringPage.jsf (working copy)
@@ -34,94 +34,28 @@
   holder.
  -->
  <!-- monitoring/monitoringPage.jsf -->
-<!initPage
- if (!#{pageSession.configName}) {
- getRequestValue(key="configName" value=>$page{configName});
- }
- getConfigConfig(configName="#{configName}" configConfig=>
$attribute{config});
- setAttribute(key="mmlConfig"
value="#{config.monitoringServiceConfig.moduleMonitoringLevelsConfig}");
- createAmxConfigMap(moduleConfig="#{mmlConfig}",
properties={"HTTPService","webContainer", "JVM", "threadPool"},
configMap=>$pageSession{configMap});
- //getTableList(Properties="#{mmlConfig.propertyConfigMap}",
TableList=>$attribute{tableList});
+<!initPage
+ setResourceBundle(key="web" bundle="org.glassfish.web.admingui.Strings
")
  />
-<sun:page>
- <!beforeCreate
- setResourceBundle(key="web" bundle="org.glassfish.web.admingui.Strings
")
- setResourceBundle(key="i18n" bundle="core.Strings")
- setResourceBundle(key="help" bundle="org.glassfish.web.admingui.Helplinks
")
- compare(obj1="$pageSession{configName}" obj2="server-config"
objEqual=>$attribute{isServerConfig});
- setPageSessionAttribute(key="showIt" value="$boolean{false}");
- if ($session{supportCluster} & !${isServerConfig}){
- setPageSessionAttribute(key="showIt"
value="$boolean{true}");
- }
- />
-#include "/shared/restart.inc"
- <sun:html>
- <sun:head id="configHead" title="$resource{web.monitoring}">
- <sun:script url="/resource/js/adminjsf.js" />
- </sun:head>
- <sun:body onLoad="javascript:
synchronizeRestartRequired('#{requestScope.restartRequired}',
'#{sessionScope.restartRequired}')">
- <sun:form id="configForm">
-#include "/shared/treeBreadcrumbs.inc"
-#include "/shared/alertMsg.inc"
- <sun:title id="configPageTitle" title="$resource{web.monitoring.Title
}"
- helpText="$resource{web.monitoring.PageHelp}">
- <sun:button id="loadDefaults" style="margin-left:
8pt" primary="#{false}" text="$resource{i18n.button.LoadDefaults}" >
- <!command
-
getDefaultConfigurationValue(moduleConfig="#{mmlConfig}",
key="HTTPService", defaultValue=>$attribute{httpService});
-
getDefaultConfigurationValue(moduleConfig="#{mmlConfig}",
key="WebContainer", defaultValue=>$attribute{webContainer});
-
getDefaultConfigurationValue(moduleConfig="#{mmlConfig}", key="JVM",
defaultValue=>$attribute{jvm});
-
getDefaultConfigurationValue(moduleConfig="#{mmlConfig}",
key="threadPool", defaultValue=>$attribute{threadPool});
-
-
setValueExpression(expression="#{configMap.HTTPService}",
value="$attribute{httpService}");
-
setValueExpression(expression="#{configMap.webContainer}",
value="$attribute{webContainer}");
-
setValueExpression(expression="#{configMap.JVM}",
value="$attribute{jvm}");
-
setValueExpression(expression="#{configMap.threadPool}",
value="$attribute{threadPool}");
- />
- </sun:button>
- <!-- Buttons -->
- <!facet pageButtonsTop>
- <sun:panelGroup id="topButtons">
- <sun:button id="saveButton"
text="$resource{i18n.button.Save}" >
- <!command
- prepareSuccessfulMsg();
-
- /*
-
getUIComponent(clientId="$pageSession{propertyTableRowGroupId}",
component=>$attribute{tableRowGroup});
-
getAllSingleMapRows(TableRowGroup="$attribute{tableRowGroup}", Rows=>
$attribute{newList});
-
convertRowsToProperties(NewList="#{newList}", AddProps=>
$attribute{newProps});
-
savePropertiesMap(destination="#{mmlConfig}", values="#{newProps}");
- */
-
- setAttribute(key="configName"
value="#{configName}");
-
updateAmxConfig(moduleConfig="#{mmlConfig}",
properties={"HTTPService","webContainer", "JVM", "threadPool"},
configMap="#{configMap}");
- />
- </sun:button>
- </sun:panelGroup>
- </facet>
- </sun:title>
- <!-- PropertySheet .... -->
- <sun:propertySheet id="propertySheet">
- <!-- Text Field section -->
- <sun:propertySheetSection
id="propertSectionTextField">
- <sun:property id="httpProp"
labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{web.monitoring.Http}">
- <sun:dropDown id="Http"
selected="#{configMap['HTTPService']}" labels={"$resource{web.monitoring.Low
}" "$resource{web.monitoring.High}" "$resource{web.monitoring.Off}"}
values={"LOW" "HIGH" "OFF"} />
- </sun:property>
- <sun:property id="webProp" labelAlign="left"
noWrap="#{true}" overlapLabel="#{false}" label="$resource{web.monitoring.Web
}">
- <sun:dropDown id="Web"
selected="#{configMap['webContainer']}" labels={"$resource{web.monitoring.Low
}" "$resource{web.monitoring.High}" "$resource{web.monitoring.Off}"}
values={"LOW" "HIGH" "OFF"} />
- </sun:property>
- <sun:property id="jvm" labelAlign="left"
noWrap="#{true}" overlapLabel="#{false}" label="$resource{web.monitoring.Jvm
}">
- <sun:dropDown id="Http"
selected="#{configMap['JVM']}" labels={"$resource{web.monitoring.Low}"
"$resource{web.monitoring.High}" "$resource{web.monitoring.Off}"}
values={"LOW" "HIGH" "OFF"} />
- </sun:property>
- <sun:property id="threadPool"
labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{web.monitoring.ThreadPool}">
- <sun:dropDown id="Web"
selected="#{configMap['threadPool']}" labels={"$resource{web.monitoring.Low
}" "$resource{web.monitoring.High}" "$resource{web.monitoring.Off}"}
values={"LOW" "HIGH" "OFF"} />
- </sun:property>
- "<br /><br />
- </sun:propertySheetSection>
-
- </sun:propertySheet>
-<!--#include "/propertyTable.inc"-->
- <sun:hidden id="helpKey"
value="$resource{help.monitoringService}" />
- </sun:form>
- </sun:body>
- </sun:html>
-</sun:page>
\ No newline at end of file
+<!composition template="/templates/adminConsolePropertySheet.tpl"
+ pageTitle="$resource{web.monitoring.Title}"
+ helpText="$resource{web.monitoring.PageHelp}"
+ helpBundle="org.glassfish.web.admingui.Helplinks"
+
amxConfigName="monitoringServiceConfig.moduleMonitoringLevelsConfig"
+ amxConfigAttributes={"HTTPService","webContainer",
"JVM", "threadPool"}>
+ <!define name="properties">
+ <sun:property id="httpProp" labelAlign="left"
noWrap="#{true}" overlapLabel="#{false}" label="$resource{web.monitoring.Http
}">
+ <sun:dropDown id="Http"
selected="#{configMap['HTTPService']}" labels={"$resource{web.monitoring.Low
}" "$resource{web.monitoring.High}" "$resource{web.monitoring.Off}"}
values={"LOW" "HIGH" "OFF"} />
+ </sun:property>
+ <sun:property id="webProp" labelAlign="left"
noWrap="#{true}" overlapLabel="#{false}" label="$resource{web.monitoring.Web
}">
+ <sun:dropDown id="Web"
selected="#{configMap['webContainer']}" labels={"$resource{web.monitoring.Low
}" "$resource{web.monitoring.High}" "$resource{web.monitoring.Off}"}
values={"LOW" "HIGH" "OFF"} />
+ </sun:property>
+ <sun:property id="jvm" labelAlign="left" noWrap="#{true}"
overlapLabel="#{false}" label="$resource{web.monitoring.Jvm}">
+ <sun:dropDown id="Http" selected="#{configMap['JVM']}"
labels={"$resource{web.monitoring.Low}"
"$resource{web.monitoring.High}" "$resource{web.monitoring.Off}"}
values={"LOW" "HIGH" "OFF"} />
+ </sun:property>
+ <sun:property id="threadPool" labelAlign="left"
noWrap="#{true}" overlapLabel="#{false}" label="$resource{web.monitoring.ThreadPool
}">
+ <sun:dropDown id="Web"
selected="#{configMap['threadPool']}" labels={"$resource{web.monitoring.Low
}" "$resource{web.monitoring.High}" "$resource{web.monitoring.Off}"}
values={"LOW" "HIGH" "OFF"} />
+ </sun:property>
+ "<br /><br />
+ </define>
+</composition>
\ No newline at end of file

Jason Lee - x31197
Senior Java Developer, Sun Microsystems
GlassFish Admin Console Team
Email: jasondlee_at_sun.com