[jboss-cvs] JBossAS SVN: r111661 - in branches/JBPAPP_5_1/console/src: resources/webconsole.war and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jun 23 11:36:23 EDT 2011


Author: dmondega
Date: 2011-06-23 11:36:22 -0400 (Thu, 23 Jun 2011)
New Revision: 111661

Modified:
   branches/JBPAPP_5_1/console/src/main/org/jboss/console/plugins/monitor/CreateSnapshotServlet.java
   branches/JBPAPP_5_1/console/src/main/org/jboss/console/plugins/monitor/CreateThresholdMonitorServlet.java
   branches/JBPAPP_5_1/console/src/resources/webconsole.war/createSnapshot.jsp
   branches/JBPAPP_5_1/console/src/resources/webconsole.war/createThresholdMonitor.jsp
Log:
Resolves JBPAPP-6682 and JBPAPP-6683

Modified: branches/JBPAPP_5_1/console/src/main/org/jboss/console/plugins/monitor/CreateSnapshotServlet.java
===================================================================
--- branches/JBPAPP_5_1/console/src/main/org/jboss/console/plugins/monitor/CreateSnapshotServlet.java	2011-06-23 13:11:56 UTC (rev 111660)
+++ branches/JBPAPP_5_1/console/src/main/org/jboss/console/plugins/monitor/CreateSnapshotServlet.java	2011-06-23 15:36:22 UTC (rev 111661)
@@ -69,7 +69,8 @@
    protected void doit(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException
    {
-
+      if (req.getParameter("submit")==null)
+        return;
       String monitorName = req.getParameter("monitorName").trim();
       log.debug(monitorName);
       String objectName = req.getParameter("objectName").trim();

Modified: branches/JBPAPP_5_1/console/src/main/org/jboss/console/plugins/monitor/CreateThresholdMonitorServlet.java
===================================================================
--- branches/JBPAPP_5_1/console/src/main/org/jboss/console/plugins/monitor/CreateThresholdMonitorServlet.java	2011-06-23 13:11:56 UTC (rev 111660)
+++ branches/JBPAPP_5_1/console/src/main/org/jboss/console/plugins/monitor/CreateThresholdMonitorServlet.java	2011-06-23 15:36:22 UTC (rev 111661)
@@ -70,7 +70,8 @@
    protected void doit(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException
    {
-
+      if (req.getParameter("submit")==null)
+        return;
       String monitorName = req.getParameter("monitorName").trim();
       log.debug(monitorName);
       String objectName = req.getParameter("objectName").trim();

Modified: branches/JBPAPP_5_1/console/src/resources/webconsole.war/createSnapshot.jsp
===================================================================
--- branches/JBPAPP_5_1/console/src/resources/webconsole.war/createSnapshot.jsp	2011-06-23 13:11:56 UTC (rev 111660)
+++ branches/JBPAPP_5_1/console/src/resources/webconsole.war/createSnapshot.jsp	2011-06-23 15:36:22 UTC (rev 111661)
@@ -33,7 +33,13 @@
 %>
  
 <%
+   String disabled = "disabled";
    String error = (String)request.getAttribute("error");
+   if (MBeanServerLocator.locateJBoss().isRegistered(new ObjectName("jboss.admin:service=DeploymentFileRepository"))){
+       disabled = "";
+   }else{
+       error = "jboss.admin:service=DeploymentFileRepository is not running";
+   }
    String attribute = request.getParameter("attribute");
    if (attribute == null) attribute = "";
    String monitorName = request.getParameter("monitorName");
@@ -79,26 +85,26 @@
 <table cellspacing="2" cellpadding="2" border="0">
 <tr>
     <td><b>Monitor Name</b></td>
-    <td><input type="text" name="monitorName" size="35" value="<%=translateMetaCharacters(monitorName)%>"></td>
+    <td><input <%=disabled%> type="text" name="monitorName" size="35" value="<%=translateMetaCharacters(monitorName)%>"></td>
     <td><i>The name of the monitor and how it will be references within web console</i></td>
 </tr>
 <tr>
     <td><b>Object Name</b></td>
-    <td><input type="text" name="objectName" value="<%=translateMetaCharacters(objectName)%>" size="35"></td>
+    <td><input <%=disabled%> type="text" name="objectName" value="<%=translateMetaCharacters(objectName)%>" size="35"></td>
     <td><i>The MBean javax.management.ObjectName of the MBean you are monitoring</i></td>
 </tr>
 <tr>
     <td><b>Attribute</b></td>
-    <td><input type="text" name="attribute" value="<%=translateMetaCharacters(attribute)%>"  size="35"></td>
+    <td><input <%=disabled%> type="text" name="attribute" value="<%=translateMetaCharacters(attribute)%>"  size="35"></td>
     <td><i>The MBean Attribute you are monitoring</i></td>
 </tr>
 <tr>
     <td><b>Time Period</b></td>
-    <td><input type="text" name="period" size="35" value="<%=translateMetaCharacters(period)%>"></td>
+    <td><input <%=disabled%> type="text" name="period" size="35" value="<%=translateMetaCharacters(period)%>"></td>
     <td><i>How often should threshold be tested.</i></td>
 </tr>
 </table>
-<input type="submit" value="Create">
+<input name="submit" <%=disabled%> type="submit" value="Create">
 </form>
 		</div>
 		<div class="spacer"><hr/></div>

Modified: branches/JBPAPP_5_1/console/src/resources/webconsole.war/createThresholdMonitor.jsp
===================================================================
--- branches/JBPAPP_5_1/console/src/resources/webconsole.war/createThresholdMonitor.jsp	2011-06-23 13:11:56 UTC (rev 111660)
+++ branches/JBPAPP_5_1/console/src/resources/webconsole.war/createThresholdMonitor.jsp	2011-06-23 15:36:22 UTC (rev 111661)
@@ -33,7 +33,13 @@
 %>
  
 <%
+   String disabled = "disabled";
    String error = (String)request.getAttribute("error");
+   if (MBeanServerLocator.locateJBoss().isRegistered(new ObjectName("jboss.admin:service=DeploymentFileRepository"))){
+       disabled = "";
+   }else{
+       error = "jboss.admin:service=DeploymentFileRepository is not running";
+   }
    String monitorName = request.getParameter("monitorName");
    if (monitorName == null) monitorName = "";
    String objectName = request.getParameter("objectName");
@@ -96,32 +102,32 @@
 <table cellspacing="2" cellpadding="2" border="0">
 <tr>
     <td><b>Monitor Name</b></td>
-    <td><input type="text" name="monitorName" size="35" value="<%=translateMetaCharacters(monitorName)%>"></td>
+    <td><input <%=disabled%> type="text" name="monitorName" size="35" value="<%=translateMetaCharacters(monitorName)%>"></td>
     <td><i>The name of the monitor and how it will be references within web console</i></td>
 </tr>
 <tr>
     <td><b>Object Name</b></td>
-    <td><input type="text" name="objectName" value="<%=translateMetaCharacters(objectName)%>" size="35"></td>
+    <td><input <%=disabled%> type="text" name="objectName" value="<%=translateMetaCharacters(objectName)%>" size="35"></td>
     <td><i>The MBean javax.management.ObjectName of the MBean you are monitoring</i></td>
 </tr>
 <tr>
     <td><b>Attribute</b></td>
-    <td><input type="text" name="attribute" value="<%=translateMetaCharacters(attribute)%>"  size="35"></td>
+    <td><input <%=disabled%> type="text" name="attribute" value="<%=translateMetaCharacters(attribute)%>"  size="35"></td>
     <td><i>The MBean Attribute you are monitoring</i></td>
 </tr>
 <tr>
     <td><b>Threshold</b></td>
-    <td><input type="text" name="threshold" size="35" value="<%=translateMetaCharacters(threshold)%>"></td>
+    <td><input <%=disabled%> type="text" name="threshold" size="35" value="<%=translateMetaCharacters(threshold)%>"></td>
     <td><i>The value that will trigger an alert when the Comparison Equation is reached for the attribute value</i></td>
 </tr>
 <tr>
     <td><b>Time Period</b></td>
-    <td><input type="text" name="period" size="35" value="<%=translateMetaCharacters(period)%>"></td>
+    <td><input <%=disabled%> type="text" name="period" size="35" value="<%=translateMetaCharacters(period)%>"></td>
     <td><i>How often should threshold be tested.</i></td>
 </tr>
 <tr>
     <td><b>Comparison Equation</b></td>
-    <td><select name="compare" id="compare" size="1">
+    <td><select <%=disabled%> name="compare" id="compare" size="1">
         <option value="gt" <%=compare.equals("gt") ? "SELECTED" : ""%>>&gt;</option>
         <option value="lt" <%=compare.equals("lt") ? "SELECTED" : ""%>>&lt;</option>
         <option value="eq" <%=compare.equals("eq") ? "SELECTED" : ""%>>=</option>
@@ -131,12 +137,12 @@
 </tr>
 <tr>
     <td><b>Persisted</b></td>
-    <td><input type="checkbox" name="persisted" value="" checked></td>
+    <td><input <%=disabled%> type="checkbox" name="persisted" value="" checked></td>
     <td><i>Should this monitor be created for next JBoss reboot?</i></td>
 </tr>
 <tr>
     <td><b>Enable Monitor</b></td>
-    <td><input type="checkbox" name="enabled" value="" <%=enabled%>></td>
+    <td><input <%=disabled%> type="checkbox" name="enabled" value="" <%=enabled%>></td>
     <td><i>Should this monitor be enabled.</i></td>
 </tr>
 <tr>
@@ -150,7 +156,7 @@
    if (alerts.size() > 0)
    {
 %>
-   <select name="alerts" id="alerts" size="<%=Integer.toString(alerts.size())%>" multiple>
+   <select <%=disabled%> name="alerts" id="alerts" size="<%=Integer.toString(alerts.size())%>" multiple>
 <%
       Iterator it = alerts.iterator();
       while (it.hasNext())
@@ -171,7 +177,7 @@
     <td><i>Alert Listeners to trigger.</i></td>
 </tr>
 </table>
-<input type="submit" value="Create">
+<input name="submit" <%=disabled%> type="submit" value="Create">
 </form>
 		</div>
 		<div class="spacer"><hr/></div>



More information about the jboss-cvs-commits mailing list