geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r732432 - in /geronimo/server/trunk/plugins/monitoring/mconsole-war: ./ src/main/java/org/apache/geronimo/monitoring/console/ src/main/resources/ src/main/webapp/WEB-INF/ src/main/webapp/WEB-INF/view/
Date Wed, 07 Jan 2009 18:50:27 GMT
Author: dwoods
Date: Wed Jan  7 10:50:27 2009
New Revision: 732432

URL: http://svn.apache.org/viewvc?rev=732432&view=rev
Log:
GERONIMO-4484 Extraction, localization and display of messages generated in portlets.  Applied common-message-monotor.patch from Gang Yin.

Added:
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/CommonMsg.tld   (with props)
Modified:
    geronimo/server/trunk/plugins/monitoring/mconsole-war/pom.xml
    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/resources/portletinfo.properties
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/resources/portletinfo_zh.properties
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/portlet.xml
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddServer.jsp
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddView.jsp
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditView.jsp
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringGraphs.jsp
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringServers.jsp
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViews.jsp

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/pom.xml?rev=732432&r1=732431&r2=732432&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/pom.xml (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/pom.xml Wed Jan  7 10:50:27 2009
@@ -63,6 +63,13 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.geronimo.plugins</groupId>
+            <artifactId>console-core</artifactId>
+            <version>${version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.geronimo.plugins.monitoring</groupId>
             <artifactId>agent-ejb</artifactId>
             <version>${pom.version}</version>

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=732432&r1=732431&r2=732432&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 Wed Jan  7 10:50:27 2009
@@ -19,6 +19,7 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.text.MessageFormat;
 
 import javax.annotation.Resource;
 import javax.naming.Context;
@@ -26,9 +27,9 @@
 import javax.naming.NamingException;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
+import javax.portlet.PortletRequest;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
@@ -36,6 +37,7 @@
 import javax.portlet.RenderResponse;
 import javax.transaction.UserTransaction;
 
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.crypto.EncryptionManager;
 import org.apache.geronimo.monitoring.console.data.Graph;
 import org.apache.geronimo.monitoring.console.data.Node;
@@ -46,7 +48,7 @@
 /**
  * STATS
  */
-public class MonitoringPortlet extends GenericPortlet {
+public class MonitoringPortlet extends BasePortlet {
     Logger log = LoggerFactory.getLogger(MonitoringPortlet.class);
 
     private static final String NORMALVIEW_JSP = "/WEB-INF/view/monitoringNormal.jsp";
@@ -185,28 +187,24 @@
         } else if (action.equals("stopThread")
                 || action.equals("disableServerViewQuery")) {
             String server_id = actionRequest.getParameter("server_id");
-            String message = stopThread(server_id);
+            stopThread(server_id, actionRequest);
             actionResponse.setRenderParameter("server_id", server_id);
-            actionResponse.setRenderParameter("message", message);
         } else if (action.equals("startThread")
                 || action.equals("enableServerViewQuery")) {
             String server_id = actionRequest.getParameter("server_id");
             String snapshotDuration = actionRequest.getParameter("snapshotDuration");
-            String message = startThread(server_id, new Long(snapshotDuration));
-            actionResponse.setRenderParameter("message", message);
+            startThread(server_id, new Long(snapshotDuration), actionRequest);
             actionResponse.setRenderParameter("server_id", server_id);
             actionResponse.setRenderParameter("snapshotDuration", snapshotDuration);
         } else if (action.equals("disableServer")
                 || action.equals("disableEditServer")) {
             String server_id = actionRequest.getParameter("server_id");
             actionResponse.setRenderParameter("server_id", server_id);
-            actionResponse.setRenderParameter("message", alterServerState(
-                    server_id, false));
+            alterServerState(server_id, false, actionRequest);
         } else if (action.equals("enableServer")
                 || action.equals("enableEditServer")) {
             String server_id = actionRequest.getParameter("server_id");
-            actionResponse.setRenderParameter("message", alterServerState(
-                    server_id, true));
+            alterServerState(server_id, true, actionRequest);
             actionResponse.setRenderParameter("server_id", server_id);
         } else if (action.equals("testAddServerConnection")) {
             String name = actionRequest.getParameter("name");
@@ -216,8 +214,7 @@
             String password2 = actionRequest.getParameter("password2");
             Integer port = Integer.parseInt(actionRequest.getParameter("port"));
             String protocol = actionRequest.getParameter("protocol");
-            String message = testConnection(ip, username, password, port, protocol);
-            actionResponse.setRenderParameter("message", message);
+            testConnection(ip, username, password, port, protocol, actionRequest);
             actionResponse.setRenderParameter("name", name);
             actionResponse.setRenderParameter("username", username);
             actionResponse.setRenderParameter("ip", ip);
@@ -242,8 +239,7 @@
             if (retention == null) {
                 retention = "";
             }
-            String message = testConnection(ip, username, password, port, protocol);
-            actionResponse.setRenderParameter("message", message);
+            testConnection(ip, username, password, port, protocol, actionRequest);
             actionResponse.setRenderParameter("name", name);
             actionResponse.setRenderParameter("username", username);
             actionResponse.setRenderParameter("ip", ip);
@@ -257,18 +253,17 @@
         }
     }
 
-    private String testConnection(String ip, String username,
-                                  String password, int port, String protocol) {
+    private void testConnection(String ip, String username,
+                                  String password, int port, String protocol, PortletRequest request) {
         try {
             new MRCConnector(ip, username, password, port, protocol);
-
-            return "<font color=\"green\"><strong><li>Connection was successfully established.</li></strong></font>";
+            addInfoMessage(request, getLocalizedString("infoMsg01", request));
         } catch (Exception e) {
-            return "<font color=\"red\"><strong><li>Failed to create a connection to server.</li></strong></font>";
+            addInfoMessage(request, getLocalizedString("errorMsg01", request), e.getMessage());
         }
     }
 
-    private String alterServerState(String server_id, boolean enable) {
+    private void alterServerState(String server_id, boolean enable, PortletRequest request) {
         try {
             userTransaction.begin();
             try {
@@ -277,12 +272,19 @@
             } finally {
                 userTransaction.commit();
             }
-            return "<font color=\"green\"><strong><li>Server " + server_id
-                    + " was successfully " + (enable? "enabled":"disabled") + ".</li></strong></font>";
+            if (enable) {
+                addInfoMessage(request, MessageFormat.format(getLocalizedString("infoMsg02", request), server_id));
+            }
+            else {
+                addInfoMessage(request, MessageFormat.format(getLocalizedString("infoMsg03", request), server_id));
+            }
         } catch (Exception e) {
-            return "<font color=\"red\"><strong><li>[ERROR] Server with server_id = "
-                    + server_id
-                    + " could not be " + (enable? "enabled":"disabled") + ".</li></strong></font>";
+            if (enable) {
+                addErrorMessage(request, MessageFormat.format(getLocalizedString("errorMsg02", request), server_id), e.getMessage());
+            }
+            else {
+            	addErrorMessage(request, MessageFormat.format(getLocalizedString("errorMsg03", request), server_id), e.getMessage());
+            }
         }
     }
 
@@ -296,15 +298,12 @@
             addViewAttribute(request, true);
             pageView.include(request, response);
         } else if (action.equals("showAllViews")) {
-            request.setAttribute("message", "");
             addAllViewsAttribute(request);
             viewViews.include(request, response);
         } else if (action.equals("showAllServers")) {
-            request.setAttribute("message", "");
             addAllNodesAttribute(request);
             viewServers.include(request, response);
         } else if (action.equals("showAllGraphs")) {
-            request.setAttribute("message", "");
             addAllGraphsAttribute(request);
             viewGraphs.include(request, response);
         } else if (action.equals("showServer")) {
@@ -317,8 +316,7 @@
             request.setAttribute("server_id", server_id);
             String mbean = request.getParameter("mbean");
             request.setAttribute("mbean", mbean);
-            String message = startTrackingMbean(server_id, mbean);
-            request.setAttribute("message", message);
+            startTrackingMbean(server_id, mbean, request);
             addNodeAttribute(request);
             viewServer.include(request, response);
         } else if (action.equals("stopTrackingMbean")) {
@@ -326,8 +324,7 @@
             request.setAttribute("server_id", server_id);
             String mbean = request.getParameter("mbean");
             request.setAttribute("mbean", mbean);
-            String message = stopTrackingMbean(server_id, mbean);
-            request.setAttribute("message", message);
+            stopTrackingMbean(server_id, mbean, request);
             addNodeAttribute(request);
             viewServer.include(request, response);
         } else if (action.equals("stopThread")) {
@@ -336,8 +333,6 @@
             normalView(request, response);
         } else if (action.equals("disableServerViewQuery") || action.equals("enableServerViewQuery")) {
             String server_id = request.getParameter("server_id");
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             request.setAttribute("server_id", server_id);
             addNodeAttribute(request);
             viewServer.include(request, response);
@@ -366,8 +361,6 @@
         } else if (action.equals("saveEditView")) {
             String view_id = request.getParameter("view_id");
             request.setAttribute("view_id", view_id);
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             addViewAttribute(request, false);
             editView.include(request, response);
         } else if (action.equals("showAddView")) {
@@ -395,8 +388,6 @@
         } else if (action.equals("saveEditGraph")) {
             String graph_id = request.getParameter("graph_id");
             request.setAttribute("graph_id", graph_id);
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
             addGraphAttribute(request);
             addAllNodesAttribute(request);
             editGraph.include(request, response);
@@ -411,9 +402,7 @@
             editServer.include(request, response);
         } else if (action.equals("saveEditServer")) {
             String server_id = request.getParameter("server_id");
-            request.setAttribute("server_id", server_id);
-            String message = request.getParameter("message");
-            request.setAttribute("message", message);
+            request.setAttribute("server_id", server_id);;
             addNodeAttribute(request);
             editServer.include(request, response);
         } else if (action.equals("showAddServer")) {
@@ -428,7 +417,6 @@
             request.setAttribute("username", request.getParameter("username"));
             request.setAttribute("password", request.getParameter("password"));
             request.setAttribute("password2", request.getParameter("password2"));
-            request.setAttribute("message", request.getParameter("message"));
             request.setAttribute("port", request.getParameter("port"));
             addServer.include(request, response);
         } else if (action.equals("testEditServerConnection")) {
@@ -438,7 +426,6 @@
             request.setAttribute("username", request.getParameter("username"));
             request.setAttribute("password", request.getParameter("password"));
             request.setAttribute("password2", request.getParameter("password2"));
-            request.setAttribute("message", request.getParameter("message"));
             request.setAttribute("server_id", request.getParameter("server_id"));
             request.setAttribute("snapshot", request.getParameter("snapshot"));
             request.setAttribute("retention", request.getParameter("retention"));
@@ -446,7 +433,6 @@
             editServer.include(request, response);
         } else if (action.equals("disableEditServer")
                 || action.equals("enableEditServer")) {
-            request.setAttribute("message", request.getParameter("message"));
             request.setAttribute("server_id", request.getParameter("server_id"));
             addNodeAttribute(request);
             editServer.include(request, response);
@@ -461,8 +447,6 @@
     }
 
     private void normalView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
-        String message = request.getParameter("message");
-        request.setAttribute("message", message);
         addAllViewsAttribute(request);
         addAllNodesAttribute(request);
         addAllGraphsAttribute(request);
@@ -586,13 +570,9 @@
             } finally {
                 userTransaction.commit();
             }
-            actionResponse.setRenderParameter("message",
-                    "<font color=\"green\"><strong><li>View " + actionRequest.getParameter("name")
-                            + " has been updated</li></strong></font>");
-        } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "<font color=\"red\"><strong><li>Error updating View "
-                            + actionRequest.getParameter("name") + "</li></strong></font>" + e.getMessage());
+            addInfoMessage(actionRequest, MessageFormat.format(getLocalizedString("infoMsg08", actionRequest), actionRequest.getParameter("name")));
+        } catch (Exception e) {
+        	addErrorMessage(actionRequest, MessageFormat.format(getLocalizedString("errorMsg11", actionRequest), actionRequest.getParameter("name")), e.getMessage());
         }
 
     }
@@ -619,13 +599,9 @@
             } finally {
                 userTransaction.commit();
             }
-            actionResponse.setRenderParameter("message",
-                    "<font color=\"green\"><strong><li>View " + name
-                            + " has been added</li></strong></font>");
-        } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "<font color=\"red\"><strong><li>Error adding View " + name
-                            + "</li></strong></font>" + e.getMessage());
+            addInfoMessage(actionRequest, MessageFormat.format(getLocalizedString("infoMsg09", actionRequest), name));
+        } catch (Exception e) {
+        	addErrorMessage(actionRequest, MessageFormat.format(getLocalizedString("errorMsg12", actionRequest), name), e.getMessage());
         }
     }
 
@@ -660,13 +636,9 @@
             } finally {
                 userTransaction.commit();
             }
-            actionResponse.setRenderParameter(
-                            "message",
-                            "<font color=\"green\"><strong><li>Server has been updated</li></strong></font>");
-        } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "<font color=\"red\"><strong><li>Error updating server</li></strong></font>"
-                            + e.getMessage());
+            addInfoMessage(actionRequest, getLocalizedString("infoMsg10", actionRequest));
+        } catch (Exception e) {
+        	addErrorMessage(actionRequest, getLocalizedString("errorMsg13", actionRequest), e.getMessage());
         }
     }
 
@@ -692,13 +664,9 @@
             } finally {
                 userTransaction.commit();
             }
-            actionResponse.setRenderParameter("message",
-                    "<font color=\"green\"><strong><li>Server " + name + " at "
-                            + host + " has been added.</li></strong></font>");
-        } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "<font color=\"red\"><strong><li>Error adding server</li></strong></font>"
-                            + e.getMessage());
+            addInfoMessage(actionRequest, MessageFormat.format(getLocalizedString("infoMsg11", actionRequest), name, host));
+        } catch (Exception e) {
+        	addErrorMessage(actionRequest, getLocalizedString("errorMsg14", actionRequest), e.getMessage());
         }
     }
 
@@ -715,13 +683,9 @@
             } finally {
                 userTransaction.commit();
             }
-            actionResponse.setRenderParameter(
-                            "message",
-                            "<font color=\"green\"><strong><li>Server and associated graphs have been deleted</li></strong></font>");
-        } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "<font color=\"red\"><strong><li>Error deleting server</li></strong></font>"
-                            + e.getMessage());
+            addInfoMessage(actionRequest, getLocalizedString("infoMsg12", actionRequest));
+        } catch (Exception e) {
+        	addErrorMessage(actionRequest, getLocalizedString("errorMsg15", actionRequest), e.getMessage());
         }
     }
 
@@ -738,12 +702,9 @@
             } finally {
                 userTransaction.commit();
             }
-            actionResponse.setRenderParameter("message",
-                            "<font color=\"green\"><strong><li>View has been deleted</li></strong></font>");
+            addInfoMessage(actionRequest, getLocalizedString("infoMsg13", actionRequest));
         } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "<font color=\"red\"><strong><li>Error deleting view</li></strong></font>"
-                            + e.getMessage());
+        	addErrorMessage(actionRequest, getLocalizedString("errorMsg16", actionRequest), e.getMessage());
         }
     }
 
@@ -761,14 +722,9 @@
             } finally {
                 userTransaction.commit();
             }
-            actionResponse.setRenderParameter("message",
-                    "<font color=\"green\"><strong><li>Graph " + graph.getGraphName1()
-                            + " has been added.</li></strong></font>");
-
+            addInfoMessage(actionRequest, MessageFormat.format(getLocalizedString("infoMsg14", actionRequest), graph.getGraphName1()));
         } catch (Exception e) {
-            actionResponse.setRenderParameter("message",
-                    "<font color=\"red\"><strong><li>Error adding graph</li></strong></font>"
-                            + e.getMessage());
+        	addErrorMessage(actionRequest, getLocalizedString("errorMsg17", actionRequest), e.getMessage());
         }
     }
 
@@ -805,18 +761,14 @@
                 Node node = entityManager.find(Node.class, actionRequest.getParameter("server_id"));
                 graph.setNode(node);
                 updateGraphFromRequest(actionRequest, graph);
-                actionResponse.setRenderParameter("message",
-                        "<font color=\"green\"><strong><li>Graph " + graph.getGraphName1()
-                                + " has been updated.</li></strong></font>");
+                addInfoMessage(actionRequest, MessageFormat.format(getLocalizedString("infoMsg15", actionRequest), graph.getGraphName1()));
             } finally {
                 userTransaction.commit();
             }
 
         } catch (Exception e) {
             log.info("error updating graph", e);
-            actionResponse.setRenderParameter("message",
-                    "<font color=\"red\"><strong><li>Error updating graph</li></strong></font>"
-                            + e.getMessage());
+            addErrorMessage(actionRequest, getLocalizedString("errorMsg18", actionRequest), e.getMessage());
         }
     }
 
@@ -829,156 +781,116 @@
             try {
                 Graph graph = entityManager.find(Graph.class, Integer.parseInt(graph_id));
                 entityManager.remove(graph);
-                actionResponse.setRenderParameter("message",
-                        "<font color=\"green\"><strong><li>Graph " + graph.getGraphName1()
-                                + " has been deleted.</li></strong></font>");
+                addInfoMessage(actionRequest, MessageFormat.format(getLocalizedString("infoMsg16", actionRequest), graph.getGraphName1()));
             } finally {
                 userTransaction.commit();
             }
 
         } catch (Exception e) {
             log.info("error deleting graph", e);
-            actionResponse.setRenderParameter("message",
-                    "<font color=\"red\"><strong><li>Error deleting graph</li></strong></font>"
-                            + e.getMessage());
+            addErrorMessage(actionRequest, getLocalizedString("errorMsg19", actionRequest), e.getMessage());
         }
     }
 
-    private String startTrackingMbean(String server_id, String mbean) {
+    private void startTrackingMbean(String server_id, String mbean, PortletRequest request) {
         Node node;
         try {
             node = getNodeByName(server_id);
         } catch (PortletException e) {
-            return "<font color=\"red\"><strong><li>DATABASE ERROR: "
-                    + e.getMessage() + "</li></strong></font>";
+            addInfoMessage(request, getLocalizedString("errorMsg04", request), e.getMessage());
+            return;
         }
         MRCConnector mrc;
         try {
             mrc = new MRCConnector(node);
         } catch (Exception e) {
-            return "<font color=\"red\"><strong><li>MRC ERROR: Unable to connect to server "
-                    + node.getHost()
-                    + ": "
-                    + e.getMessage()
-                    + "</li></strong></font>";
-
+            addErrorMessage(request, MessageFormat.format(getLocalizedString("errorMsg05", request), node.getHost()), e.getMessage());
+            return;
         }
 
         // tell the mrc server to start tracking an mbean
         try {
             if (mrc.startTrackingMbean(mbean)) {
                 String mbarr[] = mbean.split("name=");
-                return "<font color=\"green\"><strong><li>MBean " + mbarr[1]
-                        + " tracking on server " + node.getName()
-                        + "</li></strong></font>";
+                addInfoMessage(request, MessageFormat.format(getLocalizedString("infoMsg04", request), mbarr[1], node.getHost()));
             } else {
                 String mbarr[] = mbean.split("name=");
-                return "<font color=\"red\"><strong><li>ERROR: MBean "
-                        + mbarr[1] + " could <b>NOT</b> be tracked on server "
-                        + node.getName() + "</li></strong></font>";
+                addErrorMessage(request, MessageFormat.format(getLocalizedString("errorMsg06", request), mbarr[1], node.getHost()));
             }
         } catch (Exception e) {
-            return "<font color=\"red\"><strong><li>MRC ERROR: MBean " + mbean
-                    + " could <b>NOT</b> be tracked on server " + node.getHost()
-                    + ": " + e.getMessage() + "</li></strong></font>";
+            addErrorMessage(request, MessageFormat.format(getLocalizedString("errorMsg06", request), mbean, node.getHost()), e.getMessage());
         }
     }
 
-    private String stopTrackingMbean(String server_id, String mbean) {
+    private void stopTrackingMbean(String server_id, String mbean, PortletRequest request) {
         Node node;
         try {
             node = getNodeByName(server_id);
         } catch (PortletException e) {
-            return "<font color=\"red\"><strong><li>DATABASE ERROR: "
-                    + e.getMessage() + "</li></strong></font>";
+            addInfoMessage(request, getLocalizedString("errorMsg04", request), e.getMessage());
+            return;
         }
         MRCConnector mrc;
         try {
             mrc = new MRCConnector(node);
         } catch (Exception e) {
-            return "<font color=\"red\"><strong><li>MRC ERROR: Unable to connect to server "
-                    + node.getHost()
-                    + ": "
-                    + e.getMessage()
-                    + "</li></strong></font>";
+            addErrorMessage(request, MessageFormat.format(getLocalizedString("errorMsg05", request), node.getHost()), e.getMessage());
+            return;
 
         }
         // tell the mrc-server to stop tracking some mbean
         try {
             if (mrc.stopTrackingMbean(mbean)) {
                 String mbarr[] = mbean.split("name=");
-                return "<font color=\"green\"><strong><li>MBean " + mbarr[1]
-                        + " removed from tracking on server "
-                        + node.getName() + "</li></strong></font>";
+                addInfoMessage(request, MessageFormat.format(getLocalizedString("infoMsg05", request), mbarr[1], node.getHost()));
             } else {
                 String mbarr[] = mbean.split("name=");
-                return "<font color=\"red\"><strong><li>ERROR: MBean "
-                        + mbarr[1]
-                        + " could <b>NOT</b> be removed from tracking on server "
-                        + node.getName() + "</li></strong></font>";
+                addErrorMessage(request, MessageFormat.format(getLocalizedString("errorMsg06", request), mbarr[1], node.getHost()));
             }
         } catch (Exception e) {
-            return "<font color=\"red\"><strong><li>MRC ERROR: MBean " + mbean
-                    + " could <b>NOT</b> be removed from tracking on server "
-                    + node.getHost() + ": " + e.getMessage()
-                    + "</li></strong></font>";
+            addErrorMessage(request, MessageFormat.format(getLocalizedString("errorMsg06", request), mbean, node.getHost()), e.getMessage());
         }
     }
 
-    private String stopThread(String server_id) {
+    private void stopThread(String server_id, PortletRequest request) {
         Node node;
         try {
             node = getNodeByName(server_id);
         } catch (PortletException e) {
             log.info("error", e);
-            return "<font color=\"red\"><strong><li>DATABASE ERROR: Server id "
-                        + server_id
-                        + " not found in database</li></strong></font>";
+            addErrorMessage(request, MessageFormat.format(getLocalizedString("errorMsg08", request), server_id), e.getMessage());
+            return;
         }
         try {
             MRCConnector mrc = new MRCConnector(node);
             if (mrc.stopSnapshotThread()) {
-                return "<font color=\"green\"><strong><li>Snapshot thread stopped on server "
-                        + server_id + "</li></strong></font>";
+                addInfoMessage(request, MessageFormat.format(getLocalizedString("infoMsg06", request), server_id));
             } else {
-                return "<font color=\"red\"><strong><li>ERROR: Snapshot thread could <b>NOT</b> be stopped on server "
-                        + server_id + "</li></strong></font>";
+            	addErrorMessage(request, MessageFormat.format(getLocalizedString("errorMsg09", request), server_id));
             }
         } catch (Exception e) {
-            return "<font color=\"red\"><strong><li>MRC ERROR: Snapshot thread could <b>NOT</b> be stopped on server "
-                    + server_id
-                    + ": "
-                    + e.getMessage()
-                    + "</li></strong></font>";
-
+        	addErrorMessage(request, MessageFormat.format(getLocalizedString("errorMsg09", request), server_id), e.getMessage());
         }
     }
 
-    private String startThread(String server_id, Long snapshotDuration) {
+    private void startThread(String server_id, Long snapshotDuration, PortletRequest request) {
         Node node;
         try {
             node = getNodeByName(server_id);
         } catch (PortletException e) {
             log.info("error", e);
-            return "<font color=\"red\"><strong><li>DATABASE ERROR: Server id "
-                        + server_id
-                        + " not found in database</li></strong></font>";
+            addErrorMessage(request, MessageFormat.format(getLocalizedString("errorMsg08", request), server_id), e.getMessage());
+            return;
         }
         try {
             MRCConnector mrc = new MRCConnector(node);
             if (mrc.startSnapshotThread(snapshotDuration)) {
-                return "<font color=\"green\"><strong><li>Snapshot thread started on server "
-                        + server_id + "</li></strong></font>";
+                addInfoMessage(request, MessageFormat.format(getLocalizedString("infoMsg07", request), server_id));
             } else {
-                return "<font color=\"red\"><strong><li>ERROR: Snapshot thread could <b>NOT</b> be started on server "
-                        + server_id + "</li></strong></font>";
+            	addErrorMessage(request, MessageFormat.format(getLocalizedString("errorMsg10", request), server_id));
             }
         } catch (Exception e) {
-            return "<font color=\"red\"><strong><li>MRC ERROR: Snapshot thread could <b>NOT</b> be started on server "
-                    + server_id
-                    + ": "
-                    + e.getMessage()
-                    + "</li></strong></font>";
+        	addErrorMessage(request, MessageFormat.format(getLocalizedString("errorMsg10", request), server_id), e.getMessage());
 
         }
     }

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=732432&r1=732431&r2=732432&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 Wed Jan  7 10:50:27 2009
@@ -16,3 +16,73 @@
 #=====================================================================
 
 Monitoring = Monitoring
+
+errorMsg01 = Failed to create a connection to server.
+
+errorMsg02 = Server with server_id = <b>{0}</b> could not be enabled.
+
+errorMsg03 = Server with server_id = <b>{0}</b> could not be disabled.
+
+errorMsg04 = DATABASE ERROR.
+
+errorMsg05 = Unable to connect to server <b>{0}</b>.
+
+errorMsg06 = MBean <b>{0}</b> could <b>NOT</b> be tracked on server <b>{1}</b>.
+
+errorMsg07 = MBean <b>{0}</b> could <b>NOT</b> be removed from tracking on server <b>{1}</b>.
+
+errorMsg08 = Server id <b>{0}</b> not found in database.
+
+errorMsg09 = Snapshot thread could <b>NOT</b> be stopped on server <b>{0}</b>.
+
+errorMsg10 = Snapshot thread could <b>NOT</b> be started on server <b>{0}</b>.
+
+errorMsg11 = Error encountered while updating view <b>{0}</b>.
+
+errorMsg12 = Error encountered while adding view <b>{0}</b>.
+
+errorMsg13 = Error encountered while updating server.
+
+errorMsg14 = Error encountered while adding server.
+
+errorMsg15 = Error encountered while deleting server.
+
+errorMsg16 = Error encountered while deleting view.
+
+errorMsg17 = Error encountered while adding graph.
+
+errorMsg18 = Error encountered while updating graph.
+
+errorMsg19 = Error encountered while deleting graph.
+
+infoMsg01 = Connection was successfully established.
+
+infoMsg02 = Server <b>{0}</b> was successfully enabled.
+
+infoMsg03 = Server <b>{0}</b> was successfully disabled.
+
+infoMsg04 = MBean <b>{0}</b> tracking on server <b>{1}</b>.
+
+infoMsg05 = MBean <b>{0}</b> removed from tracking on server <b>{1}</b>.
+
+infoMsg06 = Snapshot thread stopped on server <b>{0}</b>.
+
+infoMsg07 = Snapshot thread started on server <b>{0}</b>.
+
+infoMsg08 = View <b>{0}</b> has been updated.
+
+infoMsg09 = View <b>{0}</b> has been added.
+
+infoMsg10 = Server has been updated.
+
+infoMsg11 = Server <b>{0}</b> at <b>{1}</b> has been added.
+
+infoMsg12 = Server and associated graphs have been deleted.
+
+infoMsg13 = View has been deleted.
+
+infoMsg14 = Graph <b>{0}</b> has been added.
+
+infoMsg15 = Graph <b>{0}</b> has been updated.
+
+infoMsg16 = Graph <b>{0}</b> has been deleted.

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=732432&r1=732431&r2=732432&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 Wed Jan  7 10:50:27 2009
@@ -16,3 +16,73 @@
 #=====================================================================
 
 Monitoring = \u76D1\u63A7\u5668
+
+errorMsg01 = \u5230\u670D\u52A1\u5668\u7684\u8FDE\u63A5\u521B\u5EFA\u5931\u8D25\u3002
+
+errorMsg02 = server_id\u4E3A<b>{0}</b>\u7684\u670D\u52A1\u5668\u65E0\u6CD5\u542F\u7528\u3002
+
+errorMsg03 = server_id\u4E3A<b>{0}</b>\u7684\u670D\u52A1\u5668\u65E0\u6CD5\u7981\u7528\u3002
+
+errorMsg04 = \u6570\u636E\u5E93\u53D1\u751F\u9519\u8BEF\u3002
+
+errorMsg05 = \u65E0\u6CD5\u8FDE\u63A5\u5230\u670D\u52A1\u5668<b>{0}</b>\u3002
+
+errorMsg06 = \u65E0\u6CD5\u8DDF\u8E2A\u670D\u52A1\u5668<b>{1}</b>\u4E0A\u7684MBean<b>{0}</b>\u3002
+
+errorMsg07 = \u65E0\u6CD5\u505C\u6B62\u8DDF\u8E2A\u670D\u52A1\u5668<b>{1}</b>\u4E0A\u7684MBean<b>{0}</b>\u3002
+
+errorMsg08 = \u6570\u636E\u5E93\u4E2D\u4E0D\u5B58\u5728id\u4E3A<b>{0}</b>\u7684\u670D\u52A1\u5668\u3002
+
+errorMsg09 = \u65E0\u6CD5\u505C\u6B62\u670D\u52A1\u5668<b>{0}</b>\u4E0A\u7684\u5FEB\u7167\u7EBF\u7A0B\u3002
+
+errorMsg10 = \u65E0\u6CD5\u5F00\u542F\u670D\u52A1\u5668<b>{0}</b>\u4E0A\u7684\u5FEB\u7167\u7EBF\u7A0B\u3002
+
+errorMsg11 = \u66F4\u65B0\u89C6\u56FE<b>{0}</b>\u65F6\u9047\u5230\u9519\u8BEF\u3002
+
+errorMsg12 = \u6DFB\u52A0\u89C6\u56FE<b>{0}</b>\u65F6\u9047\u5230\u9519\u8BEF\u3002
+
+errorMsg13 = \u66F4\u65B0\u670D\u52A1\u5668\u65F6\u9047\u5230\u9519\u8BEF\u3002
+
+errorMsg14 = \u6DFB\u52A0\u670D\u52A1\u5668\u65F6\u9047\u5230\u9519\u8BEF\u3002
+
+errorMsg15 = \u5220\u9664\u670D\u52A1\u5668\u65F6\u9047\u5230\u9519\u8BEF\u3002
+
+errorMsg16 = \u5220\u9664\u89C6\u56FE\u65F6\u9047\u5230\u9519\u8BEF\u3002
+
+errorMsg17 = \u6DFB\u52A0\u56FE\u5F62\u65F6\u9047\u5230\u9519\u8BEF\u3002
+
+errorMsg18 = \u66F4\u65B0\u56FE\u5F62\u65F6\u9047\u5230\u9519\u8BEF\u3002
+
+errorMsg19 = \u5220\u9664\u56FE\u5F62\u65F6\u9047\u5230\u9519\u8BEF\u3002
+
+infoMsg01 = \u6210\u529F\u5EFA\u7ACB\u8FDE\u63A5\u3002
+
+infoMsg02 = \u6210\u529F\u542F\u7528\u670D\u52A1\u5668<b>{0}</b>\u3002
+
+infoMsg03 = \u6210\u529F\u7981\u7528\u670D\u52A1\u5668<b>{0}</b>\u3002
+
+infoMsg04 = \u5F00\u59CB\u8DDF\u8E2A\u670D\u52A1\u5668<b>{1}</b>\u4E0A\u7684MBean<b>{0}</b>\u3002
+
+infoMsg05 = \u505C\u6B62\u8DDF\u8E2A\u670D\u52A1\u5668<b>{1}</b>\u4E0A\u7684MBean<b>{0}</b>\u3002
+
+infoMsg06 = \u5DF2\u505C\u6B62\u670D\u52A1\u5668<b>{0}</b>\u4E0A\u7684\u5FEB\u7167\u7EBF\u7A0B\u3002
+
+infoMsg07 = \u5DF2\u5F00\u542F\u670D\u52A1\u5668<b>{0}</b>\u4E0A\u7684\u5FEB\u7167\u7EBF\u7A0B\u3002
+
+infoMsg08 = \u5DF2\u66F4\u65B0\u89C6\u56FE<b>{0}</b>\u3002
+
+infoMsg09 = \u5DF2\u6DFB\u52A0\u89C6\u56FE<b>{0}</b>\u3002
+
+infoMsg10 = \u5DF2\u66F4\u65B0\u670D\u52A1\u5668\u3002
+
+infoMsg11 = \u5DF2\u6DFB\u52A0<b>{1}</b>\u4E0A\u7684\u670D\u52A1\u5668<b>{0}</b>\u3002
+
+infoMsg12 = \u5DF2\u5220\u9664\u670D\u52A1\u5668\u548C\u76F8\u5173\u8054\u7684\u56FE\u5F62\u3002
+
+infoMsg13 = \u5DF2\u5220\u9664\u89C6\u56FE\u3002
+
+infoMsg14 = \u5DF2\u6DFB\u52A0\u56FE\u5F62<b>{0}</b>\u3002
+
+infoMsg15 = \u5DF2\u66F4\u65B0\u56FE\u5F62<b>{0}</b>\u3002
+
+infoMsg16 = \u5DF2\u5220\u9664\u56FE\u5F62<b>{0}</b>\u3002

Added: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/CommonMsg.tld
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/CommonMsg.tld?rev=732432&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/CommonMsg.tld (added)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/CommonMsg.tld Wed Jan  7 10:50:27 2009
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE taglib PUBLIC
+  "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
+  "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at 
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<taglib>
+  
+  <tlibversion>1.0</tlibversion>
+  <jspversion>1.1</jspversion>
+  <shortname>pluto</shortname>
+  <uri>http://portals.apache.org/pluto</uri>
+
+    <tag>
+        <name>commonMsg</name>
+        <tagclass>org.apache.geronimo.console.message.CommonMessageTag</tagclass>
+        <bodycontent>empty</bodycontent>
+    </tag>
+
+</taglib>
+

Propchange: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/CommonMsg.tld
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/portlet.xml?rev=732432&r1=732431&r2=732432&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/portlet.xml (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/portlet.xml Wed Jan  7 10:50:27 2009
@@ -34,6 +34,9 @@
             <portlet-mode>HELP</portlet-mode>
             <portlet-mode>EDIT</portlet-mode>
         </supports>
+        <supported-locale>en</supported-locale>
+        <supported-locale>zh</supported-locale>
+        <resource-bundle>portletinfo</resource-bundle>
         <portlet-info>
             <title>Monitoring</title>
         </portlet-info>

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp?rev=732432&r1=732431&r2=732432&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp Wed Jan  7 10:50:27 2009
@@ -17,6 +17,7 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
 <%@ page import="java.util.ArrayList" %>
 <%@ page import="java.util.List" %>
 <%@ page import="java.util.Map" %>
@@ -28,9 +29,6 @@
 <portlet:defineObjects/>
 
 <%
-    String message = (String) request.getAttribute("message");
-    if (message == null)
-        message = "";
     String mbean = (String) request.getAttribute("mbean");
     if (mbean == null)
         mbean = "";
@@ -382,14 +380,9 @@
 //-->
 </script>
 <!-- </head> -->
-<%
-    if (!message.equals("")) {
-%>
-<div align="left" style="width: 500px"><%=message%><br>
-</div>
-<%
-    }
-%>
+
+<CommonMsg:commonMsg/><br>
+
 <table>
 <tr>
 <!-- Body -->

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddServer.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddServer.jsp?rev=732432&r1=732431&r2=732432&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddServer.jsp (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddServer.jsp Wed Jan  7 10:50:27 2009
@@ -17,13 +17,12 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
 <%@ page import="org.apache.geronimo.monitoring.console.Constants" %>
 <fmt:setBundle basename="monitor-portlet"/>
 <portlet:defineObjects/>
 
 <%
-
-String message = (String) request.getAttribute("message");
 String name = (String) request.getAttribute("name");
 String ip = (String) request.getAttribute("ip");
 String username = (String) request.getAttribute("username");
@@ -32,7 +31,6 @@
 String port = (String) request.getAttribute("port");
 String protocol = (String) request.getAttribute("protocol");
 
-if(message == null)     message = "";
 if(name == null)        name = "";
 if(ip == null)          ip = "";
 if(username == null)    username = "";
@@ -98,14 +96,8 @@
 </script>
 <!-- </head> -->
         
-            <%
- if (!message.equals(""))
- {
- %>
-<div align="left" style="width: 500px">
-<%=message %><br>
-</div>
-<%} %>
+<CommonMsg:commonMsg/><br>
+
 <table>
     <tr>
         <!-- Body -->

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddView.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddView.jsp?rev=732432&r1=732431&r2=732432&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddView.jsp (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddView.jsp Wed Jan  7 10:50:27 2009
@@ -17,6 +17,7 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
 <%@ page import="java.util.List" %>
 <%@ page import="org.apache.geronimo.monitoring.console.Constants" %>
 <%@ page import="org.apache.geronimo.monitoring.console.data.Graph" %>
@@ -24,15 +25,6 @@
 <fmt:setBundle basename="monitor-portlet"/>
 <portlet:defineObjects/>
 
-<%
-
-String message = (String) request.getAttribute("message");
-
-
-if (message == null)
-    message = new String("");
-
-%>
 <!-- <head> -->
     <script type='text/javascript' src='<%=Constants.DOJO_JS%>'>
     </script>
@@ -62,14 +54,8 @@
 </script>
 <!-- </head> -->
         
-            <%
- if (!message.equals(""))
- {
- %>
-<div align="left" style="width: 650px">
-<%=message %><br>
-</div>
-<%} %>
+<CommonMsg:commonMsg/><br>
+
 <table>
     <tr>
         <!-- Body -->

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp?rev=732432&r1=732431&r2=732432&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp Wed Jan  7 10:50:27 2009
@@ -17,6 +17,7 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
 <%@ page import="java.util.ArrayList" %>
 <%@ page import="java.util.Iterator" %>
 <%@ page import="java.util.List" %>
@@ -29,10 +30,6 @@
 <portlet:defineObjects/>
 
 <%
-
-    String message = (String) request.getAttribute("message");
-    if (message == null)
-        message = "";
     Graph graph = (Graph) request.getAttribute("graph");
     List<Node> nodes = (List<Node>) request.getAttribute("nodes");
 
@@ -395,14 +392,8 @@
 </script>
 <!-- </head> -->
         
-            <%
- if (!message.equals(""))
- {
- %>
-<div align="left" style="width: 500px">
-<%=message %><br>
-</div>
-<%} %>
+<CommonMsg:commonMsg/><br>
+
 <table>
     <tr>
         <!-- Body -->

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp?rev=732432&r1=732431&r2=732432&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp Wed Jan  7 10:50:27 2009
@@ -19,6 +19,7 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
 <%@ page import="java.util.List" %>
 <%@ page import="org.apache.geronimo.monitoring.console.Constants" %>
 <%@ page import="org.apache.geronimo.monitoring.console.MRCConnector" %>
@@ -27,13 +28,9 @@
 <portlet:defineObjects/>
 
 <%
-
-    Node node = (Node) request.getAttribute("node");
-
-String message = (String) request.getAttribute("message");
+Node node = (Node) request.getAttribute("node");
 String snapshot = (String) request.getAttribute("snapshot");
 String retention = (String) request.getAttribute("retention");
-if(message == null)     message = "";
 if(snapshot == null)    snapshot = "";
 if(retention == null)   retention = "";
 if(node.getProtocol() == null || node.getProtocol().equals("EJB"))
@@ -132,14 +129,8 @@
 </script>
 <!-- </head> -->
         
-            <%
- if (!message.equals(""))
- {
- %>
-<div align="left" style="width: 500px">
-<%=message %><br>
-</div>
-<%} %>
+<CommonMsg:commonMsg/><br>
+
 <table>
     <tr>
         <!-- Body -->

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditView.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditView.jsp?rev=732432&r1=732431&r2=732432&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditView.jsp (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditView.jsp Wed Jan  7 10:50:27 2009
@@ -17,6 +17,7 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
 <%@ page import="org.apache.geronimo.monitoring.console.Constants" %>
 <%@ page import="org.apache.geronimo.monitoring.console.data.Graph" %>
 <%@ page import="org.apache.geronimo.monitoring.console.data.View" %>
@@ -24,9 +25,6 @@
 <portlet:defineObjects/>
 
 <%
-
-    String message = (String) request.getAttribute("message");
-
     View view = (View) request.getAttribute("view");
     if (view != null) {
 %>
@@ -61,14 +59,8 @@
 </script>
 <!-- </head> -->
         
-            <%
- if (message != null && !message.equals(""))
- {
- %>
-<div align="left" style="width: 650px">
-<%=message %><br>
-</div>
-<%} %>
+<CommonMsg:commonMsg/><br>
+
 <table>
     <tr>
         <!-- Body -->

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringGraphs.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringGraphs.jsp?rev=732432&r1=732431&r2=732432&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringGraphs.jsp (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringGraphs.jsp Wed Jan  7 10:50:27 2009
@@ -18,6 +18,7 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
 <%@ page import="java.util.List" %>
 <%@ page import="org.apache.geronimo.monitoring.console.data.Graph" %>
 <fmt:setBundle basename="monitor-portlet"/>
@@ -29,12 +30,9 @@
 }
 //-->
 </script>
-<%
-    String message = (String) request.getAttribute("message"); 
-    if (message != null) {
-%>
-        <p><%= message %></p>
-<%  }  %>
+
+<CommonMsg:commonMsg/><br>
+
 <table>
    <tr>
        <!-- Body -->

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp?rev=732432&r1=732431&r2=732432&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp Wed Jan  7 10:50:27 2009
@@ -18,6 +18,7 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
 <%@ page import="java.util.List" %>
 <%@ page import="org.apache.geronimo.monitoring.console.MRCConnector" %>
 <%@ page import="org.apache.geronimo.monitoring.console.data.Graph" %>
@@ -32,13 +33,9 @@
 }
 //-->
 </script>
-<%
-    String message = (String) request.getAttribute("message"); 
-    if (message != null)
-    {
-%>
-        <p><%= message %></p>
-<%  } %>
+
+<CommonMsg:commonMsg/>
+
 <br>
 <b><fmt:message key="monitor.common.view"/>:</b>
 <table width="100%" class="TableLine" summary="Monitoring - Views">

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp?rev=732432&r1=732431&r2=732432&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp Wed Jan  7 10:50:27 2009
@@ -17,6 +17,7 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
 <%@ page import="java.util.List" %>
 <%@ page import="org.apache.geronimo.monitoring.console.Constants" %>
 <%@ page import="org.apache.geronimo.monitoring.console.StatsGraph" %>
@@ -25,8 +26,6 @@
 <portlet:defineObjects/>
 
 <%
-String errors = "";
-
     View view = (View) request.getAttribute("view");
     List<StatsGraph> statsGraphs = (List<StatsGraph>) request.getAttribute("statsGraphs");
     if (view != null && statsGraphs != null) {
@@ -67,6 +66,8 @@
     </script>
 <!-- </head> -->
 
+<CommonMsg:commonMsg/><br>
+
 <table>
     <tr>
         <!-- Body -->
@@ -94,14 +95,6 @@
 {
     
 }
-if (!errors.equals(""))
-{
-    %>
-    <ul>
-    <font color="red"><%=errors%></font>
-    </ul>
-    <%
-}
 %>
 
         </td>

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringServers.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringServers.jsp?rev=732432&r1=732431&r2=732432&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringServers.jsp (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringServers.jsp Wed Jan  7 10:50:27 2009
@@ -17,20 +17,15 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
 <%@ page import="java.util.List" %>
 <%@ page import="org.apache.geronimo.monitoring.console.MRCConnector" %>
 <%@ page import="org.apache.geronimo.monitoring.console.data.Node" %>
 <fmt:setBundle basename="monitor-portlet"/>
 <portlet:defineObjects/>
-<%
-    String message = (String) request.getAttribute("message"); 
-if (!message.equals(""))
-{
-%>
-<div align="left" style="width: 650px">
-<%=message %><br>
-</div>
-<%} %>
+
+<CommonMsg:commonMsg/><br>
+
 <table>
    <tr>
        <!-- Body -->

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp?rev=732432&r1=732431&r2=732432&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp Wed Jan  7 10:50:27 2009
@@ -17,6 +17,7 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
 <%@ page import="java.util.ArrayList" %>
 <%@ page import="java.util.HashMap" %>
 <%@ page import="java.util.Iterator" %>
@@ -28,9 +29,20 @@
 <fmt:setBundle basename="monitor-portlet"/>
 <portlet:defineObjects/>
 
-<%
+<!-- <head> -->
+        <script type = "text/javascript">
+<!--
+function hide(x) {
+document.getElementById(x).style.display='none';
+}
+function show(x) {
+document.getElementById(x).style.display='';
+}
+//-->
+</script>
+<!-- </head> -->
 
-String message = (String) request.getAttribute("message");
+<%
 
 MRCConnector mrc = null;
 
@@ -38,9 +50,6 @@
 Integer collecting = 0;
 Long snapshotDuration = new Long(0);
 
-if (message == null)
-    message = new String("");
-
     Node node = (Node) request.getAttribute("node");
 if (node != null) {
     TreeMap <String,String> availableBeansMap = null;
@@ -56,30 +65,12 @@
     } catch (Exception e) {
         isOnline = false;
         collecting = 0;
-        message = message + "<br><font color='red'><strong><li>Server is offline</li></strong></font>";
     }
     
 %>
-<!-- <head> -->
-        <script type = "text/javascript">
-<!--
-function hide(x) {
-document.getElementById(x).style.display='none';
-}
-function show(x) {
-document.getElementById(x).style.display='';
-}
-//-->
-</script>
-<!-- </head> -->
-            <%
- if (!message.equals(""))
- {
- %>
-<div align="left" style="width: 500px">
-<%=message %><br>
-</div>
-<%} %>
+
+<CommonMsg:commonMsg/><br>
+
 <table>
     <tr>
         <!-- Body -->

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViews.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViews.jsp?rev=732432&r1=732431&r2=732432&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViews.jsp (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViews.jsp Wed Jan  7 10:50:27 2009
@@ -18,19 +18,14 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
 <%@ page import="java.util.List" %>
 <%@ page import="org.apache.geronimo.monitoring.console.data.View" %>
 <fmt:setBundle basename="monitor-portlet"/>
 <portlet:defineObjects/>
-<%
-    String message = (String) request.getAttribute("message"); 
-if (!message.equals(""))
-{
-%>
-<div align="left" style="width: 650px">
-<%=message %><br>
-</div>
-<%} %>
+
+<CommonMsg:commonMsg/><br>
+
 <table>
    <tr>
        <!-- Body -->



Mime
View raw message