geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecr...@apache.org
Subject svn commit: r601584 - in /geronimo/sandbox/monitoring/client/client-war/src/main: java/org/apache/geronimo/plugins/monitoring/client/ webapp/WEB-INF/view/
Date Thu, 06 Dec 2007 00:11:38 GMT
Author: ecraig
Date: Wed Dec  5 16:11:36 2007
New Revision: 601584

URL: http://svn.apache.org/viewvc?rev=601584&view=rev
Log:
# Added 'graphs' table to main page for easy listing and editing
# Improved navigation by adding navigation links in right column
# Added invididual pages for views/servers/graphs listings
# No longer listing all graphs on the server view page for performance 
purposes
# Disabling/enabling a server will disable/enable the corresponding 
graphs


Added:
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringGraphs.jsp
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringServers.jsp
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringViews.jsp
Modified:
    geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddServer.jsp
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddView.jsp
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditView.jsp
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java?rev=601584&r1=601583&r2=601584&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java Wed Dec  5 16:11:36 2007
@@ -42,6 +42,12 @@
 {
 
     private static final String      NORMALVIEW_JSP     = "/WEB-INF/view/monitoringNormal.jsp";
+    
+    private static final String      VIEWVIEWS_JSP     = "/WEB-INF/view/monitoringViews.jsp";
+    
+    private static final String      VIEWSERVERS_JSP     = "/WEB-INF/view/monitoringServers.jsp";
+    
+    private static final String      VIEWGRAPHS_JSP     = "/WEB-INF/view/monitoringGraphs.jsp";
 
     private static final String      PAGEVIEW_JSP       = "/WEB-INF/view/monitoringPage.jsp";
 
@@ -64,6 +70,12 @@
     private static final String      EDITNORMALVIEW_JSP = "/WEB-INF/view/monitoringEdit.jsp";
 
     private PortletRequestDispatcher normalView;
+    
+    private PortletRequestDispatcher viewViews;
+    
+    private PortletRequestDispatcher viewServers;
+    
+    private PortletRequestDispatcher viewGraphs;
 
     private PortletRequestDispatcher pageView;
 
@@ -96,6 +108,18 @@
             String view_id = actionRequest.getParameter("view_id");
             actionResponse.setRenderParameter("view_id", view_id);
         }
+        else if (action.equals("showAllViews"))
+        {
+            // no parameters needed to be redirected to doView()
+        }
+        else if (action.equals("showAllServers"))
+        {
+            // no parameters needed to be redirected to doView()
+        }
+        else if (action.equals("showAllGraphs"))
+        {
+            // no parameters needed to be redirected to doView()
+        }
         else if (action.equals("showEditView"))
         {
             String view_id = actionRequest.getParameter("view_id");
@@ -294,6 +318,9 @@
                 stmt
                         .executeUpdate("UPDATE SERVERS SET ENABLED = 0 WHERE SERVER_ID="
                                 + server_id);
+                stmt
+                .executeUpdate("UPDATE GRAPHS SET ENABLED = 0 WHERE SERVER_ID="
+                        + server_id);
                 message = "<font color=\"green\"><strong><li>Server " + name
                         + " was successfully disabled.</li></strong></font>";
             }
@@ -302,6 +329,9 @@
                 stmt
                         .executeUpdate("UPDATE SERVERS SET ENABLED = 1 WHERE SERVER_ID="
                                 + server_id);
+                stmt
+                .executeUpdate("UPDATE GRAPHS SET ENABLED = 1 WHERE SERVER_ID="
+                        + server_id);
                 message = "<font color=\"green\"><strong><li>Server " + name
                         + " was successfully enabled.</li></strong></font>";
             }
@@ -347,6 +377,21 @@
             request.setAttribute("view_id", view_id);
             pageView.include(request, response);
         }
+        else if (action.equals("showAllViews"))
+        {
+        	request.setAttribute("message", "");
+            viewViews.include(request, response);
+        }
+        else if (action.equals("showAllServers"))
+        {
+        	request.setAttribute("message", "");
+            viewServers.include(request, response);
+        }
+        else if (action.equals("showAllGraphs"))
+        {
+        	request.setAttribute("message", "");
+            viewGraphs.include(request, response);
+        }
         else if (action.equals("showServer"))
         {
             String server_id = request.getParameter("server_id");
@@ -1324,6 +1369,12 @@
         super.init(portletConfig);
         normalView = portletConfig.getPortletContext().getRequestDispatcher(
                 NORMALVIEW_JSP);
+        viewViews = portletConfig.getPortletContext().getRequestDispatcher(
+                VIEWVIEWS_JSP);
+        viewServers = portletConfig.getPortletContext().getRequestDispatcher(
+                VIEWSERVERS_JSP);
+        viewGraphs = portletConfig.getPortletContext().getRequestDispatcher(
+                VIEWGRAPHS_JSP);
         pageView = portletConfig.getPortletContext().getRequestDispatcher(
                 PAGEVIEW_JSP);
         editView = portletConfig.getPortletContext().getRequestDispatcher(
@@ -1350,6 +1401,9 @@
     public void destroy()
     {
         normalView = null;
+        viewViews = null;
+        viewServers = null;
+        viewGraphs = null;
         pageView = null;
         editView = null;
         addView = null;

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp?rev=601584&r1=601583&r2=601584&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp Wed Dec  5 16:11:36 2007
@@ -383,7 +383,6 @@
 //-->
 </script>
 <!-- </head> -->
-        <a HREF="javascript:history.go(-1)"><img border=0 src="/monitoring/images/view.png">Back</a><br>
             <%
  if (!message.equals(""))
  {
@@ -542,14 +541,17 @@
             <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
                 <tr>
                     <td class="DarkBackground" align="left" nowrap>
-                        <font face="Verdana" size="+1">Actions</font>
+                        <font face="Verdana" size="+1">Navigation</font>
                     </td>
                 </tr>
                 <tr>
                     <td bgcolor="#FFFFFF" nowrap>
                         &nbsp;<br />
                         <ul>
-                        
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
                         </ul>
                         &nbsp;<br />
                     </td>   

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddServer.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddServer.jsp?rev=601584&r1=601583&r2=601584&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddServer.jsp (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddServer.jsp Wed Dec  5 16:11:36 2007
@@ -93,7 +93,7 @@
 //-->
 </script>
 <!-- </head> -->
-        <a HREF="javascript:history.go(-1)"><img border=0 src="/monitoring/images/view.png">Back</a><br/><br/><b>
+        
             <%
  if (!message.equals(""))
  {
@@ -164,7 +164,31 @@
 
         <!-- Geronimo Links -->
         <td valign="top">
-
+            <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Navigation</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            <table width="100%" cellspacing="1" cellpadding="1">
+            <tr>
+            <td>
+            </td>
+            </tr>
+            </table>
             <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
                 <tr>
                     <td class="DarkBackground" align="left" nowrap>

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddView.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddView.jsp?rev=601584&r1=601583&r2=601584&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddView.jsp (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddView.jsp Wed Dec  5 16:11:36 2007
@@ -71,7 +71,7 @@
 //-->
 </script>
 <!-- </head> -->
-        <a HREF="javascript:history.go(-1)"><img border=0 src="/monitoring/images/view.png">Back</a><br>
+        
             <%
  if (!message.equals(""))
  {
@@ -166,14 +166,17 @@
             <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
                 <tr>
                     <td class="DarkBackground" align="left" nowrap>
-                        <font face="Verdana" size="+1">Actions</font>
+                        <font face="Verdana" size="+1">Navigation</font>
                     </td>
                 </tr>
                 <tr>
                     <td bgcolor="#FFFFFF" nowrap>
                         &nbsp;<br />
                         <ul>
-                        <li><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showAddGraph" /></portlet:actionURL>">Create a new graph</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
                         </ul>
                         &nbsp;<br />
                     </td>   

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp?rev=601584&r1=601583&r2=601584&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp Wed Dec  5 16:11:36 2007
@@ -430,7 +430,7 @@
 //-->
 </script>
 <!-- </head> -->
-        <a HREF="javascript:history.go(-1)"><img border=0 src="/monitoring/images/view.png">Back</a><br>
+        
             <%
  if (!message.equals(""))
  {
@@ -608,7 +608,27 @@
 
         <!-- Geronimo Links -->
         <td valign="top">
-
+            <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Navigation</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            <br>
+            <br>
             <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
                 <tr>
                     <td class="DarkBackground" align="left" nowrap>
@@ -651,7 +671,27 @@
 
         <!-- Geronimo Links -->
         <td valign="top">
-
+            <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Navigation</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+			<br>
+            <br>
             <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
                 <tr>
                     <td class="DarkBackground" align="left" nowrap>

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp?rev=601584&r1=601583&r2=601584&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp Wed Dec  5 16:11:36 2007
@@ -169,7 +169,7 @@
 //-->
 </script>
 <!-- </head> -->
-        <a HREF="javascript:history.go(-1)"><img border=0 src="/monitoring/images/view.png">Back</a><br/><br/><b>
+        
             <%
  if (!message.equals(""))
  {
@@ -296,7 +296,27 @@
 
         <!-- Geronimo Links -->
         <td valign="top">
-
+            <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Navigation</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            <br>
+            <br>
             <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
                 <tr>
                     <td class="DarkBackground" align="left" nowrap>
@@ -353,7 +373,27 @@
 
         <!-- Geronimo Links -->
         <td valign="top">
-
+            <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Navigation</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            <br>
+            <br>
             <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
                 <tr>
                     <td class="DarkBackground" align="left" nowrap>

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditView.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditView.jsp?rev=601584&r1=601583&r2=601584&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditView.jsp (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditView.jsp Wed Dec  5 16:11:36 2007
@@ -87,7 +87,7 @@
 //-->
 </script>
 <!-- </head> -->
-        <a HREF="javascript:history.go(-1)"><img border=0 src="/monitoring/images/view.png">Back</a><br>
+        
             <%
  if (!message.equals(""))
  {
@@ -195,7 +195,27 @@
 
         <!-- Geronimo Links -->
         <td valign="top">
-
+            <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Navigation</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            <br>
+            <br>
             <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
                 <tr>
                     <td class="DarkBackground" align="left" nowrap>
@@ -241,7 +261,27 @@
 
         <!-- Geronimo Links -->
         <td valign="top">
-
+            <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Navigation</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            <br>
+            <br>
             <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
                 <tr>
                     <td class="DarkBackground" align="left" nowrap>

Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringGraphs.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringGraphs.jsp?rev=601584&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringGraphs.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringGraphs.jsp Wed Dec  5 16:11:36 2007
@@ -0,0 +1,173 @@
+
+<%--
+   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 uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<%@ page import="java.util.ArrayList" %>
+<%@ page import="java.sql.Connection" %>
+<%@ page import="java.sql.DatabaseMetaData" %>
+<%@ page import="java.sql.PreparedStatement" %>
+<%@ page import="java.sql.ResultSet" %>
+<%@ page import="java.sql.SQLException" %>
+<%@ page import="org.apache.geronimo.plugins.monitoring.client.MRCConnector" %>
+<%@ page import="org.apache.geronimo.plugins.monitoring.client.util.*" %>
+<%@ page import="org.apache.geronimo.console.util.PortletManager" %>
+<portlet:defineObjects/>
+<%
+    String message = (String) request.getAttribute("message"); 
+    if (message != null)
+    {
+%>
+        <p><%= message %></p>
+<%  }  %>
+<table>
+   <tr>
+       <!-- Body -->
+       <td width="100%" align="left" valign="top">
+<table width="100%" style="border-style: solid;
+border-width: 1px;">
+ <thead align="center"><strong>Graphs</strong></thead>
+ <tr>
+  <th class="DarkBackground" width="30%">Name</th>
+  <th class="DarkBackground" width="20%">Server</th>
+  <th class="DarkBackground" width="15%">Timeframe</th>
+  <th class="DarkBackground" width="20%">Data Series</th>
+  <th class="DarkBackground" width="15%">Actions</th>
+ </tr>
+ <%
+ DBManager DBase = new DBManager();
+ Connection con = DBase.getConnection();
+ 
+ PreparedStatement pStmt = con.prepareStatement("SELECT * FROM graphs");
+ ResultSet rs = pStmt.executeQuery();
+ // data structure to store the graph's info
+ class GraphInfo {
+     public String name;
+     public String server_name;
+     public String server_id;
+     public String graph_id;
+     public String timeframe;
+     public String dataname1;
+     public String operation;
+     public String dataname2;
+     public boolean enabled;
+ }
+ 
+ ArrayList<GraphInfo> graphInfo = new ArrayList<GraphInfo>();
+ // for each graph, save the information locally
+ while(rs.next()) {
+	 pStmt = con.prepareStatement("SELECT name FROM servers WHERE server_id="+rs.getInt("server_id"));
+     ResultSet rs2 = pStmt.executeQuery();
+     if (rs2.next())
+     {
+    	 GraphInfo s = new GraphInfo();
+    	 s.server_name = rs2.getString("name");
+         s.name = rs.getString("name");
+         s.timeframe = rs.getString("timeframe");
+         s.dataname1 = rs.getString("dataname1");
+         s.operation = rs.getString("operation");
+         s.dataname2 = rs.getString("dataname2");
+         s.server_id = rs.getString("server_id");
+         s.graph_id = rs.getString("graph_id");
+         s.enabled = rs.getInt("enabled") == 1 ? true : false;
+         graphInfo.add( s );
+     }
+     rs2.close();
+ }
+ // close connection
+ con.close();
+ // for each graph, draw it
+ for(int i = 0 ; i < graphInfo.size(); i++) {
+     String name = graphInfo.get(i).name;
+     String server_name = graphInfo.get(i).server_name;
+     String timeframe = graphInfo.get(i).timeframe;
+     String dataname1 = graphInfo.get(i).dataname1;
+     String operation = graphInfo.get(i).operation;
+     String dataname2 = graphInfo.get(i).dataname2;
+     String server_id = graphInfo.get(i).server_id;
+     String graph_id = graphInfo.get(i).graph_id;
+     boolean enabled = graphInfo.get(i).enabled;
+ %>
+  <c:set var="backgroundClass" value='MediumBackground'/>
+  <c:choose>
+      <c:when test="${backgroundClass == 'MediumBackground'}" >
+          <c:set var="backgroundClass" value='LightBackground'/>
+      </c:when>
+      <c:otherwise>
+          <c:set var="backgroundClass" value='MediumBackground'/>
+      </c:otherwise>
+  </c:choose>
+ <tr>
+ <%
+ if (enabled)
+ {
+ 	%>
+  	<td class="${backgroundClass}" width="30%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showGraph" /><portlet:param name="graph_id" value="<%=graph_id%>" /></portlet:actionURL>"><%=name%></a></td>
+  	<td class="${backgroundClass}" width="20%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showServer" /><portlet:param name="server_id" value="<%=server_id%>" /></portlet:actionURL>"><%=server_name%></a></td>
+  	<td class="${backgroundClass}" width="15%" align="center"><%=timeframe%></td>
+  	<td class="${backgroundClass}" width="20%" align="center"><%=dataname1%><%if (operation != null && !operation.equals("null")){%><%=operation%><%}%><%if (dataname2 != null && !dataname2.equals("null")){%><%=dataname2%><%}%></td>
+  	<td class="${backgroundClass}" width="15%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showEditGraph" /><portlet:param name="graph_id" value="<%=graph_id%>" /></portlet:actionURL>"><img border=0 src="/monitoring/images/edit-b.png">Edit</a></td>
+<%} 
+else
+{
+	%>
+	<td class="${backgroundClass}" width="30%" align="center"><%=name%></td>
+  	<td class="${backgroundClass}" width="20%" align="center"><%=server_name%></td>
+  	<td class="${backgroundClass}" width="15%" align="center"><%=timeframe%></td>
+  	<td class="${backgroundClass}" width="20%" align="center"><%=dataname1%><%if (operation != null && !operation.equals("null")){%><%=operation%><%}%><%if (dataname2 != null && !dataname2.equals("null")){%><%=dataname2%><%}%></td>
+  	<td class="${backgroundClass}" width="15%" align="center"><img border=0 src="/monitoring/images/edit-b.png">Edit</td>
+	<%
+}%>
+ </tr>
+ <%}
+%>
+</table>
+<div align="right"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showAddGraph" /></portlet:actionURL>"><img border=0 src="/monitoring/images/max-b.png">Add Graph</a></div>
+<%
+ // close connection
+ con.close();
+%>
+        </td>
+     
+         <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
+
+        <!-- Geronimo Links -->
+        <td valign="top">
+
+            <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Navigation</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            
+        </td>        
+    </tr>
+</table>
\ No newline at end of file

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp?rev=601584&r1=601583&r2=601584&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp Wed Dec  5 16:11:36 2007
@@ -114,8 +114,6 @@
      s.enabled = rs.getInt("enabled") == 1 ? true : false;
      serverInfos.add( s );
  }
- // close connection
- con.close();
  // for each server, draw it
  for(int i = 0 ; i < serverInfos.size(); i++) {
      String ip = serverInfos.get(i).ip;
@@ -232,3 +230,101 @@
 %>
 </table>
 <div align="right"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showAddServer" /></portlet:actionURL>"><img border=0 src="/monitoring/images/max-b.png">Add Server</a></div>
+<table width="100%" style="border-style: solid;
+border-width: 1px;">
+ <thead align="center"><strong>Graphs</strong></thead>
+ <tr>
+  <th class="DarkBackground" width="30%">Name</th>
+  <th class="DarkBackground" width="20%">Server</th>
+  <th class="DarkBackground" width="15%">Timeframe</th>
+  <th class="DarkBackground" width="20%">Data Series</th>
+  <th class="DarkBackground" width="15%">Actions</th>
+ </tr>
+ <%
+ 
+ pStmt = con.prepareStatement("SELECT * FROM graphs");
+ rs = pStmt.executeQuery();
+ 
+ // data structure to store the graph's info
+ class GraphInfo {
+     public String name;
+     public String server_name;
+     public String server_id;
+     public String graph_id;
+     public String timeframe;
+     public String dataname1;
+     public String operation;
+     public String dataname2;
+     public boolean enabled;
+ }
+ 
+ ArrayList<GraphInfo> graphInfo = new ArrayList<GraphInfo>();
+ // for each graph, save the information locally
+ while(rs.next()) {
+	 pStmt = con.prepareStatement("SELECT name FROM servers WHERE server_id="+rs.getInt("server_id"));
+     ResultSet rs2 = pStmt.executeQuery();
+     if (rs2.next())
+     {
+    	 GraphInfo s = new GraphInfo();
+    	 s.server_name = rs2.getString("name");
+         s.name = rs.getString("name");
+         s.timeframe = rs.getString("timeframe");
+         s.dataname1 = rs.getString("dataname1");
+         s.operation = rs.getString("operation");
+         s.dataname2 = rs.getString("dataname2");
+         s.server_id = rs.getString("server_id");
+         s.graph_id = rs.getString("graph_id");
+         s.enabled = rs.getInt("enabled") == 1 ? true : false;
+         graphInfo.add( s );
+     }
+     rs2.close();
+ }
+ // close connection
+ con.close();
+ // for each graph, draw it
+ for(int i = 0 ; i < graphInfo.size(); i++) {
+     String name = graphInfo.get(i).name;
+     String server_name = graphInfo.get(i).server_name;
+     String timeframe = graphInfo.get(i).timeframe;
+     String dataname1 = graphInfo.get(i).dataname1;
+     String operation = graphInfo.get(i).operation;
+     String dataname2 = graphInfo.get(i).dataname2;
+     String server_id = graphInfo.get(i).server_id;
+     String graph_id = graphInfo.get(i).graph_id;
+     boolean enabled = graphInfo.get(i).enabled;
+ %>
+  <c:set var="backgroundClass" value='MediumBackground'/>
+  <c:choose>
+      <c:when test="${backgroundClass == 'MediumBackground'}" >
+          <c:set var="backgroundClass" value='LightBackground'/>
+      </c:when>
+      <c:otherwise>
+          <c:set var="backgroundClass" value='MediumBackground'/>
+      </c:otherwise>
+  </c:choose>
+ <tr>
+ <%
+ if (enabled)
+ {
+ 	%>
+  	<td class="${backgroundClass}" width="30%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showGraph" /><portlet:param name="graph_id" value="<%=graph_id%>" /></portlet:actionURL>"><%=name%></a></td>
+  	<td class="${backgroundClass}" width="20%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showServer" /><portlet:param name="server_id" value="<%=server_id%>" /></portlet:actionURL>"><%=server_name%></a></td>
+  	<td class="${backgroundClass}" width="15%" align="center"><%=timeframe%></td>
+  	<td class="${backgroundClass}" width="20%" align="center"><%=dataname1%><%if (operation != null && !operation.equals("null")){%><%=operation%><%}%><%if (dataname2 != null && !dataname2.equals("null")){%><%=dataname2%><%}%></td>
+  	<td class="${backgroundClass}" width="15%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showEditGraph" /><portlet:param name="graph_id" value="<%=graph_id%>" /></portlet:actionURL>"><img border=0 src="/monitoring/images/edit-b.png">Edit</a></td>
+<%} 
+else
+{
+	%>
+	<td class="${backgroundClass}" width="30%" align="center"><%=name%></td>
+  	<td class="${backgroundClass}" width="20%" align="center"><%=server_name%></td>
+  	<td class="${backgroundClass}" width="15%" align="center"><%=timeframe%></td>
+  	<td class="${backgroundClass}" width="20%" align="center"><%=dataname1%><%if (operation != null && !operation.equals("null")){%><%=operation%><%}%><%if (dataname2 != null && !dataname2.equals("null")){%><%=dataname2%><%}%></td>
+  	<td class="${backgroundClass}" width="15%" align="center"><img border=0 src="/monitoring/images/edit-b.png">Edit</td>
+	<%
+}%>
+ </tr>
+ <%}
+%>
+</table>
+<div align="right"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showAddGraph" /></portlet:actionURL>"><img border=0 src="/monitoring/images/max-b.png">Add Graph</a></div>

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp?rev=601584&r1=601583&r2=601584&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp Wed Dec  5 16:11:36 2007
@@ -122,7 +122,6 @@
     <tr>
         <!-- Body -->
         <td width="90%" align="left" valign="top">
-            <a HREF="javascript:history.go(-1)"><img border=0 src="/monitoring/images/view.png">Back</a>
             <p>
             <font face="Verdana" size="+1">
             <%=name%>
@@ -137,7 +136,7 @@
 {
 %>
 <p>
-<div id="<%=graph.getDivName()%>Head" "style="background-color: #f2f2f2; border-top: 1px solid #2581c7; margin: 0px; width: 670px; height: 10px;"><div align="left" style="background-color: #f2f2f2; float:left; text-align:left; width:500px;"><%=graph.getName() %></div><div align=right style="background-color: #f2f2f2; float:left; width:170px; text-align:right;"><a href="#" onClick="hide('<%=graph.getDivName()%>')"><img border=0 src="/monitoring/images/min-b.png"></a>&nbsp;<a href="#" onClick="show('<%=graph.getDivName()%>')"><img border=0 src="/monitoring/images/max-b.png"></a>&nbsp;<a href="#" onClick="hide('<%=graph.getDivName()%>');hide('<%=graph.getDivName()%>Head');"><img border=0 src="/monitoring/images/close-b.png"> </a></div></div>
+<div id="<%=graph.getDivName()%>Head" "style="background-color: #f2f2f2; border-top: 1px solid #2581c7; margin: 0px; width: 670px; height: 16px;"><div align="left" style="background-color: #f2f2f2; float:left; text-align:left; width:500px;"><%=graph.getName() %></div><div align=right style="background-color: #f2f2f2; float:left; width:170px; text-align:right;"><a href="#" onClick="hide('<%=graph.getDivName()%>')"><img border=0 src="/monitoring/images/min-b.png"></a>&nbsp;<a href="#" onClick="show('<%=graph.getDivName()%>')"><img border=0 src="/monitoring/images/max-b.png"></a>&nbsp;<a href="#" onClick="hide('<%=graph.getDivName()%>');hide('<%=graph.getDivName()%>Head');"><img border=0 src="/monitoring/images/close-b.png"> </a></div></div>
 <%=graph.getDivImplement()%>
 </p>
 <%
@@ -163,7 +162,27 @@
 
         <!-- Geronimo Links -->
         <td valign="top">
-
+            <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Navigation</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            <br>
+            <br>
             <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
                 <tr>
                     <td class="DarkBackground" align="left" nowrap>
@@ -207,7 +226,27 @@
 
         <!-- Geronimo Links -->
         <td valign="top">
-
+            <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Navigation</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            <br>
+            <br>
             <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolor="#000000">
                 <tr>
                     <td class="DarkBackground" align="left" nowrap>

Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringServers.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringServers.jsp?rev=601584&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringServers.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringServers.jsp Wed Dec  5 16:11:36 2007
@@ -0,0 +1,231 @@
+<%--
+   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 uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<%@ page import="java.util.ArrayList" %>
+<%@ page import="java.sql.Connection" %>
+<%@ page import="java.sql.DatabaseMetaData" %>
+<%@ page import="java.sql.PreparedStatement" %>
+<%@ page import="java.sql.ResultSet" %>
+<%@ page import="java.sql.SQLException" %>
+<%@ page import="org.apache.geronimo.plugins.monitoring.client.MRCConnector" %>
+<%@ page import="org.apache.geronimo.plugins.monitoring.client.util.*" %>
+<%@ page import="org.apache.geronimo.console.util.PortletManager" %>
+<portlet:defineObjects/>
+<%
+    String message = (String) request.getAttribute("message"); 
+if (!message.equals(""))
+{
+%>
+<div align="left" style="width: 650px">
+<%=message %><br>
+</div>
+<%} %>
+<table>
+   <tr>
+       <!-- Body -->
+       <td width="100%" align="left" valign="top">
+<%
+ DBManager DBase = new DBManager();
+ Connection con = DBase.getConnection();
+ 
+ PreparedStatement pStmt = con.prepareStatement("SELECT * FROM servers");
+ ResultSet rs = pStmt.executeQuery();
+%>
+<table width="100%" style="border-style: solid;
+border-width: 1px;">
+ <thead align="center"><strong>Servers</strong></thead>
+ <tr>
+  <th class="DarkBackground" width="30%">Name</th>
+  <th class="DarkBackground" width="10%">IP/Hostname</th>
+  <th class="DarkBackground" width="15%">Status</th>
+  <th class="DarkBackground" width="15%">Stat. Query</th>
+  <th class="DarkBackground" width="30%" colspan="3">Actions</th>
+ </tr>
+ <%
+ // data structure to store the server's info
+ class ServerInfo {
+     public String ip;
+     public String username;
+     public String password;
+     public String server_id;
+     public boolean enabled;
+     public String name;
+ }
+ 
+ ArrayList<ServerInfo> serverInfos = new ArrayList<ServerInfo>();
+ // for each server, save the information locally
+ while(rs.next()) {
+     ServerInfo s = new ServerInfo();
+     s.ip = rs.getString("ip");
+     s.username = rs.getString("username");
+     s.password = rs.getString("password");
+     s.server_id = rs.getString("server_id");
+     s.name = rs.getString("name");
+     s.enabled = rs.getInt("enabled") == 1 ? true : false;
+     serverInfos.add( s );
+ }
+ // for each server, draw it
+ for(int i = 0 ; i < serverInfos.size(); i++) {
+     String ip = serverInfos.get(i).ip;
+     String username = serverInfos.get(i).username;
+     String password = serverInfos.get(i).password;
+     String server_id = serverInfos.get(i).server_id;
+     boolean enabled = serverInfos.get(i).enabled;
+     String name = serverInfos.get(i).name;
+     boolean online = false;
+     boolean collecting = false;
+     MRCConnector mrc = null;
+     Long snapshotDuration = new Long(0);
+     if (enabled) {
+	     try {
+	         mrc = new MRCConnector(ip, username, password);
+	         online = true;
+	     } catch (Exception e) {
+	         online = false;
+	     }
+	     try {
+	         snapshotDuration = mrc.getSnapshotDuration();
+	         if (mrc.isSnapshotRunning())
+	             collecting = true;
+	         else
+	             collecting = false;
+	     } catch (Exception e) {
+	         collecting = false;
+	         online = false;
+	     }
+     }
+ %>
+  <c:set var="backgroundClass" value='MediumBackground'/>
+  <c:choose>
+      <c:when test="${backgroundClass == 'MediumBackground'}" >
+          <c:set var="backgroundClass" value='LightBackground'/>
+      </c:when>
+      <c:otherwise>
+          <c:set var="backgroundClass" value='MediumBackground'/>
+      </c:otherwise>
+  </c:choose>
+ <tr>
+ <%
+if(enabled){
+ %>
+  <td class="${backgroundClass}" width="30%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showServer" /><portlet:param name="server_id" value="<%=server_id%>" /></portlet:actionURL>"><%=name%></a></td>
+  <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showServer" /><portlet:param name="server_id" value="<%=server_id%>" /></portlet:actionURL>"><%=ip%></a></td>
+<%
+}
+else{
+    %>
+    <td class="${backgroundClass}" width="30%" align="center"><%=name%></td>
+    <td class="${backgroundClass}" width="10%" align="center"><%=ip%></td>
+  <% 
+}
+if (online) {     // online
+%>
+  <td class="${backgroundClass}" width="15%" align="center" bgcolor="#cccccc">Online</td>
+<%
+} else if(enabled){         // offline
+%>
+  <td class="${backgroundClass}" width="15%" align="center"><font color="red"><img border=0 src="/monitoring/images/help-b.png">Offline</font></td>
+<%
+} else {         // Disabled
+     %>
+       <td class="${backgroundClass}" width="15%" align="center"><font color="red">Disabled</font></td>
+     <%
+     }
+if (!collecting) {  // not collecting statistics
+%>
+    <td class="${backgroundClass}" width="15%" align="center"><font color="red">(stopped)</font></td>
+<%
+    if(enabled) {   // enable the links
+%>
+        <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="startThread" /><portlet:param name="server_id" value="<%=server_id%>" /><portlet:param name="snapshotDuration" value="<%=java.lang.Long.toString(snapshotDuration)%>" /></portlet:actionURL>"><img border=0 src="/monitoring/images/max-b.png">Enable Query</a></td>
+<%
+    } else {        // do not provide links
+%>
+        <td class="${backgroundClass}" width="10%" align="center">Enable Query</td>
+<%
+    }
+%>
+  <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showEditServer" /><portlet:param name="server_id" value="<%=server_id%>" /></portlet:actionURL>"><img border=0 src="/monitoring/images/edit-b.png">Edit</a></td>
+<%
+} else {            // collecting statistics
+    if (enabled)
+    {
+%>
+  <td class="${backgroundClass}" width="15%" align="center"><%=snapshotDuration/1000/60+" min. (running)"%></td>
+  <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="stopThread" /><portlet:param name="server_id" value="<%=server_id%>" /></portlet:actionURL>"><img border=0 src="/monitoring/images/close-b.png">Disable Query</a></td>
+  <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showEditServer" /><portlet:param name="server_id" value="<%=server_id%>" /></portlet:actionURL>"><img border=0 src="/monitoring/images/edit-b.png">Edit</a></td>
+<%
+    }
+    else
+    {
+        %>
+        <td class="${backgroundClass}" width="15%" align="center">Stopped</td>
+        <td class="${backgroundClass}" width="10%" align="center">Disable Query</td>
+        <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showEditServer" /><portlet:param name="server_id" value="<%=server_id%>" /></portlet:actionURL>"><img border=0 src="/monitoring/images/edit-b.png">Edit</a></td>
+      <%        
+    }
+}
+if(enabled) {   // enabled server
+%>
+  <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="disableServer" /><portlet:param name="server_id" value="<%=server_id%>" /></portlet:actionURL>"><img border=0 src="/monitoring/images/close-b.png">Disable</a></td>
+<%
+} else {        // disabled server
+%>
+  <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="enableServer" /><portlet:param name="server_id" value="<%=server_id%>" /></portlet:actionURL>"><img border=0 src="/monitoring/images/max-b.png">Enable</a></td>
+<%
+}
+%>
+ </tr>
+ <%}
+%>
+</table>
+<div align="right"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showAddServer" /></portlet:actionURL>"><img border=0 src="/monitoring/images/max-b.png">Add Server</a></div>
+<%
+ // close connection
+ con.close();
+%>
+        </td>
+     
+         <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
+
+        <!-- Geronimo Links -->
+        <td valign="top">
+
+            <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Navigation</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            
+        </td>        
+    </tr>
+</table>
\ No newline at end of file

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp?rev=601584&r1=601583&r2=601584&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp Wed Dec  5 16:11:36 2007
@@ -43,12 +43,6 @@
 DBManager DBase = new DBManager();
 Connection con = DBase.getConnection();
 
-PreparedStatement pStmt = con.prepareStatement("SELECT * FROM graphs WHERE enabled=1 AND server_id="+server_id);
-ResultSet rs = pStmt.executeQuery();
-
-Vector <StatsGraph> GraphVector = new Vector<StatsGraph>();
-GraphsBuilder run = new GraphsBuilder(con);
-
 MRCConnector mrc = null;
 
 boolean isOnline = true;
@@ -58,24 +52,10 @@
 if (message == null)
     message = new String("");
 
-while (rs.next())
-{
-    try
-    {
-        GraphVector.add(run.buildOneDB(rs.getInt("GRAPH_ID")));
-    }
- 
-    catch (Exception e)
-    {
-
-    }
-}
-rs.close();
-
 DBase = new DBManager();
 con = DBase.getConnection();
-pStmt = con.prepareStatement("SELECT * FROM servers WHERE enabled=1 AND server_id="+server_id);
-rs = pStmt.executeQuery();
+PreparedStatement pStmt = con.prepareStatement("SELECT * FROM servers WHERE enabled=1 AND server_id="+server_id);
+ResultSet rs = pStmt.executeQuery();
 
 if (rs.next())
 {
@@ -118,22 +98,6 @@
     
 %>
 <!-- <head> -->
-
-    <style type='text/css'>
-    <%
-    try
-    {
-    for (StatsGraph graph : GraphVector) 
-            out.println(graph.getDiv());
-    }
-    catch (Exception e)
-    {
-        
-    }
-    %>
-    </style>
-    <script type='text/javascript' src='/dojo/dojo.js'>
-    </script>
         <script type = "text/javascript">
 <!--
 function hide(x) {
@@ -144,28 +108,7 @@
 }
 //-->
 </script>
-    <script type='text/javascript'>
-    var dojoConfig =
-    {
-        isDebug:true
-    };
-    dojo.require("dojo.collections.Store");
-    dojo.require("dojo.charting.Chart");
-    dojo.require('dojo.json');
-    <% 
-    try
-    {
-    for (StatsGraph graph : GraphVector)
-       out.println(graph.getJS());
-    }
-    catch (Exception e)
-    {
-        
-    }
-    %>
-    </script>
 <!-- </head> -->
-        <a HREF="javascript:history.go(-1)"><img border=0 src="/monitoring/images/view.png">Back</a><br>
             <%
  if (!message.equals(""))
  {
@@ -306,15 +249,7 @@
              }
              %>
             </table>
-<% for (StatsGraph graph : GraphVector) 
-{
-%>
-<p>
-<div id="<%=graph.getDivName()%>Head" "style="background-color: #f2f2f2; border-top: 1px solid #2581c7; margin: 0px; width: 670px; height: 10px;"><div align="left" style="background-color: #f2f2f2; float:left; text-align:left; width:500px;"><%=graph.getName()%></div><div align=right style="background-color: #f2f2f2; float:left; width:170px; text-align:right;"><a href="#" onClick="hide('<%=graph.getDivName()%>')"><img border=0 src="/monitoring/images/min-b.png"></a>&nbsp;<a href="#" onClick="show('<%=graph.getDivName()%>')"><img border=0 src="/monitoring/images/max-b.png"></a>&nbsp;<a href="#" onClick="hide('<%=graph.getDivName()%>');hide('<%=graph.getDivName()%>Head');"><img border=0 src="/monitoring/images/close-b.png"></a></div></div>
-<%=graph.getDivImplement()%>
-</p>
 <%
-}
             }
             else
             {
@@ -331,7 +266,27 @@
 
         <!-- Geronimo Links -->
         <td valign="top">
-
+            <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Navigation</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            <br>
+            <br>            
             <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
                 <tr>
                     <td class="DarkBackground" align="left" nowrap>
@@ -456,7 +411,27 @@
 
         <!-- Geronimo Links -->
         <td valign="top">
-
+            <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Navigation</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            <br>
+            <br>
             <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
                 <tr>
                     <td class="DarkBackground" align="left" nowrap>

Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringViews.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringViews.jsp?rev=601584&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringViews.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringViews.jsp Wed Dec  5 16:11:36 2007
@@ -0,0 +1,118 @@
+
+<%--
+   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 uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<%@ page import="java.util.ArrayList" %>
+<%@ page import="java.sql.Connection" %>
+<%@ page import="java.sql.DatabaseMetaData" %>
+<%@ page import="java.sql.PreparedStatement" %>
+<%@ page import="java.sql.ResultSet" %>
+<%@ page import="java.sql.SQLException" %>
+<%@ page import="org.apache.geronimo.plugins.monitoring.client.MRCConnector" %>
+<%@ page import="org.apache.geronimo.plugins.monitoring.client.util.*" %>
+<%@ page import="org.apache.geronimo.console.util.PortletManager" %>
+<portlet:defineObjects/>
+<%
+    String message = (String) request.getAttribute("message"); 
+if (!message.equals(""))
+{
+%>
+<div align="left" style="width: 650px">
+<%=message %><br>
+</div>
+<%} %>
+<table>
+   <tr>
+       <!-- Body -->
+       <td width="100%" align="left" valign="top">
+<table width="100%" style="border-style: solid;
+border-width: 1px;">
+ <thead align="center"><strong>Views</strong></thead>
+ <tr>
+  <th class="DarkBackground" width="30%">Name</th>
+  <th class="DarkBackground" width="10%">Elements</th>
+  <th class="DarkBackground" width="10%">Created</th>
+  <th class="DarkBackground" width="10%">Modified</th>
+  <th class="DarkBackground" width="30%" colspan="2">Actions</th>
+ </tr>
+ <%
+ DBManager DBase = new DBManager();
+ Connection con = DBase.getConnection();
+ 
+ PreparedStatement pStmt = con.prepareStatement("SELECT view_id, name, description, graph_count, added, modified FROM views");
+ ResultSet rs = pStmt.executeQuery();
+ while (rs.next())
+ {
+     String view_id = rs.getString("view_id");
+ %>
+ <c:set var="backgroundClass" value='MediumBackground'/>
+  <c:choose>
+      <c:when test="${backgroundClass == 'MediumBackground'}" >
+          <c:set var="backgroundClass" value='LightBackground'/>
+      </c:when>
+      <c:otherwise>
+          <c:set var="backgroundClass" value='MediumBackground'/>
+      </c:otherwise>
+  </c:choose>
+ <tr>
+  <td class="${backgroundClass}" width="30%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showView" /><portlet:param name="view_id" value="<%=rs.getString("view_id")%>" /></portlet:actionURL>"><%=rs.getString("name")%></a></td>
+  <td class="${backgroundClass}" width="10%" align="center"><%=rs.getString("graph_count")%></td>
+  <td class="${backgroundClass}" width="15%" align="center"><%=rs.getString("added").substring(0,16)%></td>
+  <td class="${backgroundClass}" width="15%" align="center"><%=rs.getString("modified").substring(0,16)%></td>
+  <td class="${backgroundClass}" width="15%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showEditView" /><portlet:param name="view_id" value="<%=rs.getString("view_id")%>" /></portlet:actionURL>"><img border=0 src="/monitoring/images/edit-b.png">Edit</a></td>
+ </tr>
+ <%
+ }
+ rs.close();
+ %>
+</table>
+<div align="right"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showAddView" /></portlet:actionURL>"><img border=0 src="/monitoring/images/max-b.png">Create View</a></div>
+<%
+ // close connection
+ con.close();
+%>
+        </td>
+     
+         <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
+
+        <!-- Geronimo Links -->
+        <td valign="top">
+
+            <table width="100%" style="border-bottom: 1px solid #2581c7;" cellspacing="1" cellpadding="1">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Navigation</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showHome" /></portlet:actionURL>">Home</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllViews" /></portlet:actionURL>">Views</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllServers" /></portlet:actionURL>">Servers</a></li>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showAllGraphs" /></portlet:actionURL>">Graphs</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            
+        </td>        
+    </tr>
+</table>



Mime
View raw message