geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r798442 - in /geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main: java/org/apache/geronimo/monitoring/console/ java/org/apache/geronimo/monitoring/console/data/ resources/
Date Tue, 28 Jul 2009 08:39:02 GMT
Author: xuhaihong
Date: Tue Jul 28 08:39:02 2009
New Revision: 798442

URL: http://svn.apache.org/viewvc?rev=798442&view=rev
Log:
GERONIMO-4732 click monitoring and delete the server localhost and there is an Error rendering
portlet.(Patch from Rex Wang)

Modified:
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/data/Graph.java
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/resources/portletinfo.properties
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/resources/portletinfo_zh.properties

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java?rev=798442&r1=798441&r2=798442&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
(original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
Tue Jul 28 08:39:02 2009
@@ -679,7 +679,13 @@
         try {
             userTransaction.begin();
             try {
-                Node node = entityManager.find(Node.class, server_id);
+            	Node node = entityManager.find(Node.class, server_id);
+            	// check if there is any graph created against the node before delete it.
+            	List<Graph> graphs = entityManager.createNamedQuery("graphsByNode").setParameter("name",
node.getName()).getResultList();
+            	if (!(graphs == null || graphs.isEmpty())) {
+            		addErrorMessage(actionRequest, getLocalizedString(actionRequest, "mconsole.errorMsg20"));
+            		return;
+            	} 
                 entityManager.remove(node);
             } finally {
                 userTransaction.commit();

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/data/Graph.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/data/Graph.java?rev=798442&r1=798441&r2=798442&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/data/Graph.java
(original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/data/Graph.java
Tue Jul 28 08:39:02 2009
@@ -42,7 +42,8 @@
 @NamedQueries(
  { 
     @NamedQuery(name = "allGraphs", query = "SELECT a FROM graph a"), 
-    @NamedQuery(name = "graphById", query = "SELECT g FROM graph g WHERE g.id = :id")
+    @NamedQuery(name = "graphById", query = "SELECT g FROM graph g WHERE g.id = :id"),
+    @NamedQuery(name = "graphsByNode", query = "SELECT g FROM graph g WHERE g.node.name =
:name")
  }
  )
 public class Graph {

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/resources/portletinfo.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/resources/portletinfo.properties?rev=798442&r1=798441&r2=798442&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/resources/portletinfo.properties
(original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/resources/portletinfo.properties
Tue Jul 28 08:39:02 2009
@@ -36,6 +36,7 @@
 mconsole.errorMsg17 = Error encountered while adding graph.
 mconsole.errorMsg18 = Error encountered while updating graph.
 mconsole.errorMsg19 = Error encountered while deleting graph.
+mconsole.errorMsg20 = Please delete all the graphs belongs to the server before deleting
it.
 mconsole.infoMsg01  = Connection was successfully established.
 mconsole.infoMsg02  = Server <b>{0}</b> was successfully enabled.
 mconsole.infoMsg03  = Server <b>{0}</b> was successfully disabled.

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/resources/portletinfo_zh.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/resources/portletinfo_zh.properties?rev=798442&r1=798441&r2=798442&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/resources/portletinfo_zh.properties
(original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/resources/portletinfo_zh.properties
Tue Jul 28 08:39:02 2009
@@ -36,6 +36,7 @@
 mconsole.errorMsg17 = \u6DFB\u52A0\u56FE\u5F62\u65F6\u9047\u5230\u9519\u8BEF\u3002
 mconsole.errorMsg18 = \u66F4\u65B0\u56FE\u5F62\u65F6\u9047\u5230\u9519\u8BEF\u3002
 mconsole.errorMsg19 = \u5220\u9664\u56FE\u5F62\u65F6\u9047\u5230\u9519\u8BEF\u3002
+mconsole.errorMsg20 = \u8bf7\u5148\u5220\u9664\u6240\u6709\u5c5e\u4e8e\u8fd9\u4e2aServer\u7684Graph\uff0c\u518d\u5220\u9664\u8fd9\u4e2aServer\u3002
 mconsole.infoMsg01  = \u6210\u529F\u5EFA\u7ACB\u8FDE\u63A5\u3002
 mconsole.infoMsg02  = \u6210\u529F\u542F\u7528\u670D\u52A1\u5668<b>{0}</b>\u3002
 mconsole.infoMsg03  = \u6210\u529F\u7981\u7528\u670D\u52A1\u5668<b>{0}</b>\u3002



Mime
View raw message