You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ak...@apache.org on 2007/10/09 05:27:26 UTC

svn commit: r583038 [2/2] - in /geronimo/sandbox/monitoring/client: client-ear/src/main/resources/ client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/ client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/ clie...

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java?rev=583038&r1=583037&r2=583038&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java Mon Oct  8 20:27:25 2007
@@ -20,28 +20,33 @@
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Vector;
-import java.lang.Character;
 
-public class StatsGraph {
+public class StatsGraph
+{
     private String GraphName;
-    private String DivName; 
-    private String PrettyName;
-    private String DivDefine; 
+    private String DivName;
+    private String Description;
+    private String DivDefine;
     private String DivImplement;
     private String XAxisLabel;
     private String YAxisLabel;
-    private int SnapshotDuration; 
-    private int TimeFrame;
-    private int PointCount;
+    private int    SnapshotDuration;
+    private int    TimeFrame;
+    private int    PointCount;
     private String HexColor;
     private String GraphJS;
 
-    public StatsGraph(String graphName, String prettyName, String xAxisLabel, String yAxisLabel, Vector<Object> dataSet1, Character operation, Vector<Object> dataSet2, Vector<Object> snapshotTimes, int snapshotDuration, int timeFrame, String hexColor) 
+    public StatsGraph(Integer graph_id, String graphName, String description,
+            String xAxisLabel, String yAxisLabel, char data1operation,
+            Vector<Object> dataSet1, String operation, char data2operation,
+            Vector<Object> dataSet2, Vector<Object> snapshotTimes,
+            int snapshotDuration, int timeFrame, String hexColor,
+            float warninglevel1, float warninglevel2)
     {
 
-        DivName = graphName +"Container";
+        DivName = graphName + "Container";
         GraphName = graphName;
-        PrettyName = prettyName;
+        Description = description;
         XAxisLabel = xAxisLabel;
         YAxisLabel = yAxisLabel;
         SnapshotDuration = snapshotDuration;
@@ -49,80 +54,81 @@
         PointCount = dataSet1.size();
         HexColor = hexColor;
 
-        DivDefine = "#" + DivName + "\n" +
-                    "{\n" +
-                    "margin: 0px;\n" +
-                    "background-color: #"+hexColor+"\n" +
-                    "border: 1px solid #999;\n" +
-                    "width: 750px;\n" +
-                    "height: 260px;\n" +
-                    "}";
-
-        DivImplement = "<tr><td>\n" +
-                       "<div id=\""+DivName+"\"></div><br>\n" +
-                       "</td></tr>\n";
-
-        GraphJS = "var " + graphName + "Data = \n" +
-                  "[\n";
-
-        for (int i = 1; i < dataSet1.size(); i++) {
-            if (((Long)dataSet1.get(i) - (Long)dataSet1.get(i-1)) < 0)
-                dataSet1.set(i-1, dataSet1.get(i));
-            GraphJS = GraphJS+" { index: " + (i) + ", value: Math.round(("+((Long)dataSet1.get(i)-(Long)dataSet1.get(i-1))+operation+((Long)dataSet2.get(i)-(Long)dataSet2.get(i-1))+")*10)/10 },\n";
-            //System.out.println("StatsGraph Says: Data object "+i+" is "+dataSet2.get(i));
-        }
-
-        GraphJS = GraphJS+"];\n";
-
-
-        GraphJS = GraphJS+"var " + graphName
-                  + "Store = new dojo.collections.Store();\n";
-        GraphJS = GraphJS+graphName + "Store.setData(" + graphName + "Data);\n";
-        GraphJS = GraphJS+graphName + "Max = 0;\n" + 
-                  graphName + "Min = 0;\n" + 
-                  graphName + "Avg = 0;\n" + 
-                  "for (var i = 0; i<"+ graphName + "Data.length; i++)\n" + 
-                  "{\n" + 
-                  graphName + "Max = Math.max(" + graphName + "Max," + graphName+ "Data[i].value);\n" + 
-                  graphName + "Min = Math.min("+ graphName + "Min," + graphName + "Data[i].value);\n"
-                  + graphName + "Avg = (" + graphName + "Avg + " + graphName
-                  + "Data[i].value);\n" + "}\n" + graphName
-                  + "Avg = Math.round(" + graphName + "Avg/" + graphName
-                  + "Data.length*10)/10;\n" + "if (" + graphName + "Max == 0)\n"
-                  + graphName + "Max = 1;\n";
+        DivDefine = "#" + DivName + "\n" + "{\n" + "margin: 0px;\n"
+                + "background-color: #" + hexColor + "\n"
+                + "border: 1px solid #999;\n" + "width: 750px;\n"
+                + "height: 260px;\n" + "}";
+
+        DivImplement = "<div id=\"" + DivName + "\"></div>" + "\n";
+
+        GraphJS = "var " + graphName + "Data = \n" + "[\n";
+
+        for (int i = 1; i < dataSet1.size(); i++)
+        {
+            if (((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1)) < 0)
+                dataSet1.set(i - 1, dataSet1.get(i));
+            GraphJS = GraphJS + " { index: " + (i) + ", value: Math.round(("
+                    + ((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1))
+                    + operation
+                    + ((Long) dataSet2.get(i) - (Long) dataSet2.get(i - 1))
+                    + ")*10)/10 },\n";
+            // System.out.println("StatsGraph Says: Data object "+i+" is
+            // "+dataSet2.get(i));
+        }
+
+        GraphJS = GraphJS + "];\n";
+
+        GraphJS = GraphJS + "var " + graphName
+                + "Store = new dojo.collections.Store();\n";
+        GraphJS = GraphJS + graphName + "Store.setData(" + graphName
+                + "Data);\n";
+        GraphJS = GraphJS + graphName + "Max = 0;\n" + graphName + "Min = 0;\n"
+                + graphName + "Avg = 0;\n" + "for (var i = 0; i<" + graphName
+                + "Data.length; i++)\n" + "{\n" + graphName + "Max = Math.max("
+                + graphName + "Max," + graphName + "Data[i].value);\n"
+                + graphName + "Min = Math.min(" + graphName + "Min,"
+                + graphName + "Data[i].value);\n" + graphName + "Avg = ("
+                + graphName + "Avg + " + graphName + "Data[i].value);\n"
+                + "}\n" + graphName + "Avg = Math.round(" + graphName + "Avg/"
+                + graphName + "Data.length*10)/10;\n" + "if (" + graphName
+                + "Max == 0)\n" + graphName + "Max = 1;\n";
 
         // Setup the data series
-        GraphJS = GraphJS+"var " + graphName
-                  + "Series = new dojo.charting.Series({\n";
-        GraphJS = GraphJS+"dataSource: " + graphName + "Store,\n";
-        GraphJS = GraphJS+"bindings: { x: \"index\", y: \"value\" },\n";
-        GraphJS = GraphJS+"label: \"" + graphName + "\"\n";
-        GraphJS = GraphJS+"});\n";
+        GraphJS = GraphJS + "var " + graphName
+                + "Series = new dojo.charting.Series({\n";
+        GraphJS = GraphJS + "dataSource: " + graphName + "Store,\n";
+        GraphJS = GraphJS + "bindings: { x: \"index\", y: \"value\" },\n";
+        GraphJS = GraphJS + "label: \"" + graphName + "\"\n";
+        GraphJS = GraphJS + "});\n";
 
         // Define the x-axis
-        GraphJS = GraphJS+"var " + graphName + "xAxis = new dojo.charting.Axis(); \n";
+        GraphJS = GraphJS + "var " + graphName
+                + "xAxis = new dojo.charting.Axis(); \n";
 
         // Set the upper and lower data range valuesprettyName
-        GraphJS = GraphJS+graphName + "xAxis.range = { lower: "
-                  + graphName + "Data[0].index, upper: " + graphName
-                  + "Data[" + graphName + "Data.length-1].index };\n";
-
-        GraphJS = GraphJS+graphName + "xAxis.origin = \"" + graphName
-                  + "Max\";\n";
-        GraphJS = GraphJS+graphName + "xAxis.showTicks = true;\n";
-        GraphJS = GraphJS+graphName + "xAxis.label = \"" + prettyName + "\";\n";
+        GraphJS = GraphJS + graphName + "xAxis.range = { lower: " + graphName
+                + "Data[0].index, upper: " + graphName + "Data[" + graphName
+                + "Data.length-1].index };\n";
+
+        GraphJS = GraphJS + graphName + "xAxis.origin = \"" + graphName
+                + "Max\";\n";
+        GraphJS = GraphJS + graphName + "xAxis.showTicks = true;\n";
+        GraphJS = GraphJS + graphName + "xAxis.label = \"" + xAxisLabel
+                + "\";\n";
 
         // Setup the x tick marks on the chart
-        GraphJS = GraphJS+graphName + "xAxis.labels = [ \n";
-        //timeFrame = ((int) ((Long)snapshotTimes.get(0) - (Long)snapshotTimes
-        //.get(snapshotTimes.size() - 1)) / 60000);
+        GraphJS = GraphJS + graphName + "xAxis.labels = [ \n";
+        // timeFrame = ((int) ((Long)snapshotTimes.get(0) - (Long)snapshotTimes
+        // .get(snapshotTimes.size() - 1)) / 60000);
         Format formatter = new SimpleDateFormat("HH:mm");
         if ((timeFrame / 1440) > 7)
             formatter = new SimpleDateFormat("M/d");
-        else {
+        else
+        {
             if ((timeFrame / 60) > 24)
                 formatter = new SimpleDateFormat("E a");
-            else {
+            else
+            {
                 // if (timeFrame > 60)
                 // formatter = new SimpleDateFormat("HH:mm");
                 // else
@@ -130,44 +136,49 @@
             }
         }
 
-        for (int i = 1; i < dataSet1.size(); i++) {
-            Date date = new Date((Long)snapshotTimes.get(i));
-            //System.out.println("StatsGraph Says: Time object "+i+" is "+snapshotTimes.get(i));
-            //System.out.println("StatsGraph Says: Time object "+i+" is "+formatter.format(date));
-            GraphJS = GraphJS+"{ label: '" + formatter.format(date)
-                      + "', value: " + (i)
-                      + " }, \n";
+        for (int i = 1; i < dataSet1.size(); i++)
+        {
+            Date date = new Date((Long) snapshotTimes.get(i));
+            // System.out.println("StatsGraph Says: Time object "+i+" is
+            // "+snapshotTimes.get(i));
+            // System.out.println("StatsGraph Says: Time object "+i+" is
+            // "+formatter.format(date));
+            GraphJS = GraphJS + "{ label: '" + formatter.format(date)
+                    + "', value: " + (i) + " }, \n";
         }
-        GraphJS = GraphJS+"];\n";
+        GraphJS = GraphJS + "];\n";
         // Define the y-axis
-        GraphJS = GraphJS+"var " + graphName
-                  + "yAxis = new dojo.charting.Axis();\n";
-        GraphJS = GraphJS+graphName + "yAxis.range = { lower: " + graphName
-                  + "Min, upper: " + graphName + "Max+(0.1*"+graphName+"Max)};\n";
-        GraphJS = GraphJS+graphName + "yAxis.showLines = true;\n";
-        GraphJS = GraphJS+graphName + "yAxis.showTicks = true;\n";
-        GraphJS = GraphJS+graphName + "yAxis.label = \"" + yAxisLabel + "\";\n";
+        GraphJS = GraphJS + "var " + graphName
+                + "yAxis = new dojo.charting.Axis();\n";
+        GraphJS = GraphJS + graphName + "yAxis.range = { lower: " + graphName
+                + "Min, upper: " + graphName + "Max+(0.1*" + graphName
+                + "Max)};\n";
+        GraphJS = GraphJS + graphName + "yAxis.showLines = true;\n";
+        GraphJS = GraphJS + graphName + "yAxis.showTicks = true;\n";
+        GraphJS = GraphJS + graphName + "yAxis.label = \"" + yAxisLabel
+                + "\";\n";
 
         // Setup the y tick marks on the chart
-        GraphJS = GraphJS+graphName + "yAxis.labels = [ \n";
-        GraphJS = GraphJS+"{ label: \"min - \"+" + graphName + "Min, value: "
-                  + graphName + "Min },\n";
-        GraphJS = GraphJS+"{ label: \"avg - \"+" + graphName + "Avg, value: "
-                  + graphName + "Avg },\n";
-        GraphJS = GraphJS+"{ label: \"max - \"+" + graphName + "Max, value: "
-                  + graphName + "Max },\n";
-        GraphJS = GraphJS+"{ label: Math.round(("+ graphName + "Max+(0.1*"+graphName+"Max))), value: "
-                  + graphName + "Max+(0.1*"+graphName+"Max) },\n";
-        GraphJS = GraphJS+"];  \n";
+        GraphJS = GraphJS + graphName + "yAxis.labels = [ \n";
+        GraphJS = GraphJS + "{ label: \"min - \"+" + graphName + "Min, value: "
+                + graphName + "Min },\n";
+        GraphJS = GraphJS + "{ label: \"avg - \"+" + graphName + "Avg, value: "
+                + graphName + "Avg },\n";
+        GraphJS = GraphJS + "{ label: \"max - \"+" + graphName + "Max, value: "
+                + graphName + "Max },\n";
+        GraphJS = GraphJS + "{ label: Math.round((" + graphName + "Max+(0.1*"
+                + graphName + "Max))), value: " + graphName + "Max+(0.1*"
+                + graphName + "Max) },\n";
+        GraphJS = GraphJS + "];  \n";
 
         // Create the actual graph with the x and y axes defined above
-        GraphJS = GraphJS+"var " + graphName
-                  + "chartPlotArea = new dojo.charting.PlotArea();\n";
-        GraphJS = GraphJS+"var " + graphName
-                  + "chartPlot = new dojo.charting.Plot(" + graphName
-                  + "xAxis, " + graphName + "yAxis);\n";
-        GraphJS = GraphJS+graphName + "chartPlotArea.initializePlot("
-                  + graphName + "chartPlot);\n";
+        GraphJS = GraphJS + "var " + graphName
+                + "chartPlotArea = new dojo.charting.PlotArea();\n";
+        GraphJS = GraphJS + "var " + graphName
+                + "chartPlot = new dojo.charting.Plot(" + graphName + "xAxis, "
+                + graphName + "yAxis);\n";
+        GraphJS = GraphJS + graphName + "chartPlotArea.initializePlot("
+                + graphName + "chartPlot);\n";
         // graphOutput.add(graphName+"xAxis.initializeLabels();");
         // graphOutput.add(graphName+"xAxis.renderLabels("+graphName+"chartPlotArea,
         // "+graphName+"chartPlot, '200', '10', 'LABEL');");
@@ -178,237 +189,45 @@
         // Bar, HorizontalBar, Gantt, StackedArea, StackedCurvedArea,
         // HighLow, HighLowClose, HighLowOpenClose, Bubble,
         // DataBar, Line, CurvedLine, Area, CurvedArea, Scatter
-        GraphJS = GraphJS+graphName + "chartPlot.addSeries({ \n";
-        GraphJS = GraphJS+"data: " + graphName + "Series,\n";
-        GraphJS = GraphJS+"plotter: dojo.charting.Plotters.CurvedArea\n";
-        GraphJS = GraphJS+"});\n";
+        GraphJS = GraphJS + graphName + "chartPlot.addSeries({ \n";
+        GraphJS = GraphJS + "data: " + graphName + "Series,\n";
+        GraphJS = GraphJS + "plotter: dojo.charting.Plotters.CurvedArea\n";
+        GraphJS = GraphJS + "});\n";
 
         // Define the plot area
 
-        GraphJS = GraphJS+graphName
-                  + "chartPlotArea.size = { width: 650, height: 200 };\n";
-        GraphJS = GraphJS+graphName
-                  + "chartPlotArea.padding = { top: 30, right: 20, bottom: 30, left: 80 };\n";
+        GraphJS = GraphJS + graphName
+                + "chartPlotArea.size = { width: 650, height: 200 };\n";
+        GraphJS = GraphJS
+                + graphName
+                + "chartPlotArea.padding = { top: 30, right: 20, bottom: 30, left: 80 };\n";
 
         // Add the plot to the area
-        GraphJS = GraphJS+graphName + "chartPlotArea.plots.push(" + graphName
-                  + "chartPlot);\n";
+        GraphJS = GraphJS + graphName + "chartPlotArea.plots.push(" + graphName
+                + "chartPlot);\n";
         // Simply use the next available color when plotting the time series
         // plot
-        GraphJS = GraphJS+graphName + "Series.color = '#"+hexColor+"';\n";
+        GraphJS = GraphJS + graphName + "Series.color = '#" + hexColor + "';\n";
 
         // Create the actual chart "canvas"
-        GraphJS = GraphJS+"var " + graphName
-                  + "chart = new dojo.charting.Chart(null, \"" + graphName
-                  + "\", \"This is the example chart description\");\n";
+        GraphJS = GraphJS + "var " + graphName
+                + "chart = new dojo.charting.Chart(null, \"" + graphName
+                + "\", \"This is the example chart description\");\n";
 
         // Add the plot area at an offset of 10 pixels from the top left
-        GraphJS = GraphJS+graphName + "chart.addPlotArea({ x: "
-                  + dataSet1.size() + ", y: " + dataSet1.size()
-                  + ", plotArea: " + graphName + "chartPlotArea });\n";
+        GraphJS = GraphJS + graphName + "chart.addPlotArea({ x: "
+                + dataSet1.size() + ", y: " + dataSet1.size() + ", plotArea: "
+                + graphName + "chartPlotArea });\n";
 
         // Setup the chart to be added to the DOM on load
-        GraphJS = GraphJS+"dojo.addOnLoad(function()\n{\n"+graphName + "chart.node = dojo.byId(\"" + DivName +"\");";
-
-        GraphJS = GraphJS+graphName + "chart.render();\n});\n";
-
-    }
-
-    public StatsGraph(String graphName, String prettyName, String xAxisLabel, String yAxisLabel, Vector<Long> dataSet1, Character operation, Vector<Long> dataSet2, Vector<Long> snapshotTimes, int snapshotDuration, int timeFrame, int pointCount) 
-    {
-
-    }
+        GraphJS = GraphJS + "dojo.addOnLoad(function()\n{\n" + graphName
+                + "chart.node = dojo.byId(\"" + DivName + "\");";
 
-    public StatsGraph(String graphName, String prettyName, String xAxisLabel, String yAxisLabel, Vector<Long> dataSet1, Character operation, Vector<Long> dataSet2, Vector<Long> snapshotTimes, int snapshotDuration, int timeFrame) 
-    {
-
-    }
-
-    public StatsGraph(String graphName, String prettyName, String xAxisLabel, String yAxisLabel, Vector<Object> dataSet1, Vector<Object> snapshotTimes, int snapshotDuration, int timeFrame, String hexColor) 
-    {
-        DivName = graphName +"Container";
-        GraphName = graphName;
-        PrettyName = prettyName;
-        XAxisLabel = xAxisLabel;
-        YAxisLabel = yAxisLabel;
-        SnapshotDuration = snapshotDuration;
-        TimeFrame = timeFrame;
-        PointCount = dataSet1.size();
-        HexColor = hexColor;
-
-        DivDefine = "#" + DivName + "\n" +
-                    "{\n" +
-                    "margin: 0px;\n" +
-                    "background-color: #"+hexColor+"\n" +
-                    "border: 1px solid #999;\n" +
-                    "width: 750px;\n" +
-                    "height: 260px;\n" +
-                    "}";
-
-        DivImplement = "<tr><td>\n" +
-                       "<div id=\""+DivName+"\"></div><br>\n" +
-                       "</td></tr>\n";
-
-        GraphJS = "var " + graphName + "Data = \n" +
-                  "[\n";
-
-        for (int i = 1; i < dataSet1.size(); i++) {
-            GraphJS = GraphJS+" { index: " + (i) + ", value: Math.round(("+(Long)dataSet1.get(i)+")*10)/10 },\n";
-            //System.out.println("StatsGraph Says: Data object "+i+" is "+dataSet2.get(i));
-        }
-
-        GraphJS = GraphJS+"];\n";
-
-
-        GraphJS = GraphJS+"var " + graphName
-                  + "Store = new dojo.collections.Store();\n";
-        GraphJS = GraphJS+graphName + "Store.setData(" + graphName + "Data);\n";
-        GraphJS = GraphJS+graphName + "Max = 0;\n" + 
-                  graphName + "Min = 0;\n" + 
-                  graphName + "Avg = 0;\n" + 
-                  "for (var i = 0; i<"+ graphName + "Data.length; i++)\n" + 
-                  "{\n" + 
-                  graphName + "Max = Math.max(" + graphName + "Max," + graphName+ "Data[i].value);\n" + 
-                  graphName + "Min = Math.min("+ graphName + "Min," + graphName + "Data[i].value);\n"
-                  + graphName + "Avg = (" + graphName + "Avg + " + graphName
-                  + "Data[i].value);\n" + "}\n" + graphName
-                  + "Avg = Math.round(" + graphName + "Avg/" + graphName
-                  + "Data.length*10)/10;\n" + "if (" + graphName + "Max == 0)\n"
-                  + graphName + "Max = 1;\n";
-
-        // Setup the data series
-        GraphJS = GraphJS+"var " + graphName
-                  + "Series = new dojo.charting.Series({\n";
-        GraphJS = GraphJS+"dataSource: " + graphName + "Store,\n";
-        GraphJS = GraphJS+"bindings: { x: \"index\", y: \"value\" },\n";
-        GraphJS = GraphJS+"label: \"" + graphName + "\"\n";
-        GraphJS = GraphJS+"});\n";
-
-        // Define the x-axis
-        GraphJS = GraphJS+"var " + graphName + "xAxis = new dojo.charting.Axis(); \n";
-
-        // Set the upper and lower data range valuesprettyName
-        GraphJS = GraphJS+graphName + "xAxis.range = { lower: "
-                  + graphName + "Data[0].index, upper: " + graphName
-                  + "Data[" + graphName + "Data.length-1].index };\n";
-
-        GraphJS = GraphJS+graphName + "xAxis.origin = \"" + graphName
-                  + "Max\";\n";
-        GraphJS = GraphJS+graphName + "xAxis.showTicks = true;\n";
-        GraphJS = GraphJS+graphName + "xAxis.label = \"" + prettyName + "\";\n";
-
-        // Setup the x tick marks on the chart
-        GraphJS = GraphJS+graphName + "xAxis.labels = [ \n";
-        //timeFrame = ((int) ((Long)snapshotTimes.get(0) - (Long)snapshotTimes
-        //.get(snapshotTimes.size() - 1)) / 60000);
-        Format formatter = new SimpleDateFormat("HH:mm");
-        if ((timeFrame / 1440) > 7)
-            formatter = new SimpleDateFormat("M/d");
-        else {
-            if ((timeFrame / 60) > 24)
-                formatter = new SimpleDateFormat("E a");
-            else {
-                // if (timeFrame > 60)
-                // formatter = new SimpleDateFormat("HH:mm");
-                // else
-                formatter = new SimpleDateFormat("HH:mm");
-            }
-        }
-
-        for (int i = 1; i < dataSet1.size(); i++) {
-            Date date = new Date((Long)snapshotTimes.get(i));
-            //System.out.println("StatsGraph Says: Time object "+i+" is "+snapshotTimes.get(i));
-            //System.out.println("StatsGraph Says: Time object "+i+" is "+formatter.format(date));
-            GraphJS = GraphJS+"{ label: '" + formatter.format(date)
-                      + "', value: " + (i)
-                      + " }, \n";
-        }
-        GraphJS = GraphJS+"];\n";
-        // Define the y-axis
-        GraphJS = GraphJS+"var " + graphName
-                  + "yAxis = new dojo.charting.Axis();\n";
-        GraphJS = GraphJS+graphName + "yAxis.range = { lower: " + graphName
-                  + "Min, upper: " + graphName + "Max+(0.1*"+graphName+"Max)};\n";
-        GraphJS = GraphJS+graphName + "yAxis.showLines = true;\n";
-        GraphJS = GraphJS+graphName + "yAxis.showTicks = true;\n";
-        GraphJS = GraphJS+graphName + "yAxis.label = \"" + yAxisLabel + "\";\n";
-
-        // Setup the y tick marks on the chart
-        GraphJS = GraphJS+graphName + "yAxis.labels = [ \n";
-        GraphJS = GraphJS+"{ label: \"min - \"+" + graphName + "Min, value: "
-                  + graphName + "Min },\n";
-        GraphJS = GraphJS+"{ label: \"avg - \"+" + graphName + "Avg, value: "
-                  + graphName + "Avg },\n";
-        GraphJS = GraphJS+"{ label: \"max - \"+" + graphName + "Max, value: "
-                  + graphName + "Max },\n";
-        GraphJS = GraphJS+"{ label: Math.round(("+ graphName + "Max+(0.1*"+graphName+"Max))), value: "
-                  + graphName + "Max+(0.1*"+graphName+"Max) },\n";
-        GraphJS = GraphJS+"];  \n";
-
-        // Create the actual graph with the x and y axes defined above
-        GraphJS = GraphJS+"var " + graphName
-                  + "chartPlotArea = new dojo.charting.PlotArea();\n";
-        GraphJS = GraphJS+"var " + graphName
-                  + "chartPlot = new dojo.charting.Plot(" + graphName
-                  + "xAxis, " + graphName + "yAxis);\n";
-        GraphJS = GraphJS+graphName + "chartPlotArea.initializePlot("
-                  + graphName + "chartPlot);\n";
-        // graphOutput.add(graphName+"xAxis.initializeLabels();");
-        // graphOutput.add(graphName+"xAxis.renderLabels("+graphName+"chartPlotArea,
-        // "+graphName+"chartPlot, '200', '10', 'LABEL');");
-
-        // Add the time series to the graph. The plotter will be a curved
-        // area graph.
-        // Other available plotters are:
-        // Bar, HorizontalBar, Gantt, StackedArea, StackedCurvedArea,
-        // HighLow, HighLowClose, HighLowOpenClose, Bubble,
-        // DataBar, Line, CurvedLine, Area, CurvedArea, Scatter
-        GraphJS = GraphJS+graphName + "chartPlot.addSeries({ \n";
-        GraphJS = GraphJS+"data: " + graphName + "Series,\n";
-        GraphJS = GraphJS+"plotter: dojo.charting.Plotters.CurvedArea\n";
-        GraphJS = GraphJS+"});\n";
-
-        // Define the plot area
-
-        GraphJS = GraphJS+graphName
-                  + "chartPlotArea.size = { width: 650, height: 200 };\n";
-        GraphJS = GraphJS+graphName
-                  + "chartPlotArea.padding = { top: 30, right: 20, bottom: 30, left: 80 };\n";
-
-        // Add the plot to the area
-        GraphJS = GraphJS+graphName + "chartPlotArea.plots.push(" + graphName
-                  + "chartPlot);\n";
-        // Simply use the next available color when plotting the time series
-        // plot
-        GraphJS = GraphJS+graphName + "Series.color = '#"+hexColor+"';\n";
-
-        // Create the actual chart "canvas"
-        GraphJS = GraphJS+"var " + graphName
-                  + "chart = new dojo.charting.Chart(null, \"" + graphName
-                  + "\", \"This is the example chart description\");\n";
-
-        // Add the plot area at an offset of 10 pixels from the top left
-        GraphJS = GraphJS+graphName + "chart.addPlotArea({ x: "
-                  + dataSet1.size() + ", y: " + dataSet1.size()
-                  + ", plotArea: " + graphName + "chartPlotArea });\n";
-
-        // Setup the chart to be added to the DOM on load
-        GraphJS = GraphJS+"dojo.addOnLoad(function()\n{\n"+graphName + "chart.node = dojo.byId(\"" + DivName +"\");";
-
-        GraphJS = GraphJS+graphName + "chart.render();\n});\n";
-    }
-
-    public StatsGraph(String graphName, String prettyName, String xAxisLabel, String yAxisLabel, Vector<Long> dataSet1, Vector<Long> snapshotTimes, int snapshotDuration, int timeFrame, int pointCount) 
-    {
-
-    }
-
-    public StatsGraph(String graphName, String prettyName, String xAxisLabel, String yAxisLabel, Vector<Long> dataSet1, Vector<Long> snapshotTimes, int snapshotDuration, int timeFrame) 
-    {
+        GraphJS = GraphJS + graphName + "chart.render();\n});\n";
 
     }
 
-    public StatsGraph() 
+    public StatsGraph()
     {
 
     }
@@ -453,9 +272,9 @@
         return GraphName;
     }
 
-    public String getPrettyName()
+    public String getDescription()
     {
-        return PrettyName;
+        return Description;
     }
 
     public int getSnapshotDuration()

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java?rev=583038&r1=583037&r2=583038&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java Mon Oct  8 20:27:25 2007
@@ -17,6 +17,9 @@
 package org.apache.geronimo.plugins.monitoring.client.util;
 
 import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
 import java.sql.SQLException;
 
 import javax.naming.Context;
@@ -24,22 +27,214 @@
 import javax.naming.NamingException;
 import javax.sql.DataSource;
 
+public class DBManager
+{
+    private static Connection con         = null;
+    private static boolean    initialized = false;
 
-public class DBManager {
-    
-    public static Connection getConnection(){
-        Connection con = null;
+    public DBManager()
+    {
+        con = this.createConnection();
+        if (!initialized)
+            if (this.initializeDB())
+                initialized = true;
+    }
+
+    private Connection createConnection()
+    {
 
-        try {
+        try
+        {
             Context context = new InitialContext();
-            DataSource ds = (DataSource)context.lookup("java:comp/env/jdbc/MonitoringClientDS");
+            DataSource ds = (DataSource) context
+                    .lookup("java:comp/env/jdbc/MonitoringClientDS");
             con = ds.getConnection();
-        } catch (NamingException e) {
+        }
+        catch (NamingException e)
+        {
             e.printStackTrace();
-        } catch (SQLException e) {
+        }
+        catch (SQLException e)
+        {
+            System.err.println("SQL state: " + e.getSQLState());
+            System.err.println("SQL error: " + e.getErrorCode());
             e.printStackTrace();
         }
         return con;
     }
 
+    public Connection getConnection()
+    {
+        return con;
+    }
+
+    public boolean isInitialized()
+    {
+        return initialized;
+    }
+
+    private boolean checkTables()
+    {
+        try
+        {
+            DatabaseMetaData metadata = null;
+            metadata = con.getMetaData();
+            String[] names = { "TABLE" };
+            ResultSet tableNames = metadata.getTables(null, null, null, names);
+
+            if (tableNames.next())
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+        catch (SQLException e)
+        {
+            System.err.println("SQL state: " + e.getSQLState());
+            System.err.println("SQL error: " + e.getErrorCode());
+            e.printStackTrace();
+        }
+        return false;
+    }
+
+    private boolean initializeDB()
+    {
+        boolean success = false;
+        if (checkTables())
+            return true;
+        try
+        {
+            PreparedStatement pStmt = con
+                    .prepareStatement("CREATE TABLE servers("
+                            + "server_id   INTEGER PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 0, INCREMENT BY 1),"
+                            + "enabled SMALLINT DEFAULT 1 NOT NULL,"
+                            + "name VARCHAR(128) DEFAULT NULL,"
+                            + "ip   VARCHAR(15) UNIQUE NOT NULL,"
+                            + "username    VARCHAR(128) NOT NULL,"
+                            + "password    VARCHAR(1024) NOT NULL,"
+                            + "added       TIMESTAMP NOT NULL,"
+                            + "modified    TIMESTAMP NOT NULL,"
+                            + "last_seen   TIMESTAMP NOT NULL" + ")");
+            pStmt.executeUpdate();
+            pStmt = con
+                    .prepareStatement("CREATE TABLE graphs("
+                            + "graph_id    INTEGER PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 0, INCREMENT BY 1),"
+                            + "enabled     SMALLINT NOT NULL DEFAULT 1,"
+                            + "server_id   INTEGER NOT NULL DEFAULT 0,"
+                            + "name        VARCHAR(128) UNIQUE NOT NULL,"
+                            + "description LONG VARCHAR DEFAULT NULL,"
+                            + "timeframe   INTEGER NOT NULL DEFAULT 60,"
+                            + "mbean       VARCHAR(512) NOT NULL,"
+                            + "data1operation  CHAR DEFAULT NULL,"
+                            + "dataname1   VARCHAR(128) NOT NULL,"
+                            + "operation   VARCHAR(128) DEFAULT NULL,"
+                            + "data2operation  CHAR DEFAULT NULL,"
+                            + "dataname2   VARCHAR(128) DEFAULT NULL,"
+                            + "xlabel      VARCHAR(128) DEFAULT NULL,"
+                            + "ylabel      VARCHAR(128) DEFAULT NULL,"
+                            + "warninglevel1   FLOAT DEFAULT NULL,"
+                            + "warninglevel2   FLOAT DEFAULT NULL,"
+                            + "color       VARCHAR(6) NOT NULL DEFAULT '1176c2',"
+                            + "last_js     LONG VARCHAR DEFAULT NULL,"
+                            + "added       TIMESTAMP NOT NULL,"
+                            + "modified    TIMESTAMP NOT NULL,"
+                            + "last_seen   TIMESTAMP NOT NULL" + ")");
+            pStmt.executeUpdate();
+            pStmt = con
+                    .prepareStatement("CREATE TABLE views("
+                            + "view_id     INTEGER PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 0, INCREMENT BY 1),"
+                            + "enabled     SMALLINT NOT NULL DEFAULT 1,"
+                            + "name        VARCHAR(128) NOT NULL,"
+                            + "description LONG VARCHAR DEFAULT NULL,"
+                            + "graph_count INTEGER NOT NULL DEFAULT 0,"
+                            + "graph_ids   LONG VARCHAR NOT NULL,"
+                            + "added       TIMESTAMP NOT NULL,"
+                            + "modified    TIMESTAMP NOT NULL)");
+            pStmt.executeUpdate();
+            pStmt = con
+                    .prepareStatement("INSERT INTO servers VALUES(DEFAULT, DEFAULT, 'localhost', '127.0.0.1', 'system', 'manager', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)");
+            pStmt.executeUpdate();
+            pStmt = con
+                    .prepareStatement("INSERT INTO graphs VALUES("
+                            + "DEFAULT,"
+                            + "DEFAULT,"
+                            + "DEFAULT,"
+                            + "'TomcatWebBytesSentSecond60Min',"
+                            + "'KiloBytes sent per second from the Tomcat Web Connector',"
+                            + "DEFAULT,"
+                            + "'geronimo:J2EEServer=geronimo,ServiceModule=org.apache.geronimo.configs/tomcat6/2.1-SNAPSHOT/car,j2eeType=GBean,name=TomcatWebConnector',"
+                            + "'D'," + "'BytesSent'," + "'/1024/'," + "'D',"
+                            + "'time'," + "'Tomcat Web KBytes/Sec Sent',"
+                            + "'KBps'," + "500.0," + "1024.0," + "DEFAULT,"
+                            + "DEFAULT," + "CURRENT_TIMESTAMP,"
+                            + "CURRENT_TIMESTAMP," + "CURRENT_TIMESTAMP" + ")");
+            pStmt.executeUpdate();
+            pStmt = con
+                    .prepareStatement("INSERT INTO graphs VALUES("
+                            + "DEFAULT,"
+                            + "DEFAULT,"
+                            + "DEFAULT,"
+                            + "'TomcatWebBytesReceivedSecond60Min',"
+                            + "'KiloBytes received per second from the Tomcat Web Connector',"
+                            + "DEFAULT,"
+                            + "'geronimo:J2EEServer=geronimo,ServiceModule=org.apache.geronimo.configs/tomcat6/2.1-SNAPSHOT/car,j2eeType=GBean,name=TomcatWebConnector',"
+                            + "'D'," + "'BytesReceived'," + "'/1024/',"
+                            + "'D'," + "'time',"
+                            + "'Tomcat Web KBytes/Sec Received'," + "'KBps',"
+                            + "500.0," + "1024.0," + "DEFAULT," + "DEFAULT,"
+                            + "CURRENT_TIMESTAMP," + "CURRENT_TIMESTAMP,"
+                            + "CURRENT_TIMESTAMP" + ")");
+            pStmt.executeUpdate();
+            pStmt = con
+                    .prepareStatement("INSERT INTO graphs VALUES("
+                            + "DEFAULT,"
+                            + "DEFAULT,"
+                            + "DEFAULT,"
+                            + "'TomcatWebRequestTimeSecond60Min',"
+                            + "'Request processing time over time from the Tomcat Web Connector',"
+                            + "DEFAULT,"
+                            + "'geronimo:J2EEServer=geronimo,ServiceModule=org.apache.geronimo.configs/tomcat6/2.1-SNAPSHOT/car,j2eeType=GBean,name=TomcatWebConnector',"
+                            + "'D'," + "'RequestTimeCurrentTime'," + "'/',"
+                            + "'D'," + "'time',"
+                            + "'Tomcat Request Time/Second',"
+                            + "'RequestTime'," + "500.0," + "1024.0,"
+                            + "DEFAULT," + "DEFAULT," + "CURRENT_TIMESTAMP,"
+                            + "CURRENT_TIMESTAMP," + "CURRENT_TIMESTAMP" + ")");
+            pStmt.executeUpdate();
+            pStmt = con
+                    .prepareStatement("INSERT INTO graphs VALUES("
+                            + "DEFAULT,"
+                            + "DEFAULT,"
+                            + "DEFAULT,"
+                            + "'TomcatWebErrorCountSecond60Min',"
+                            + "'Error count over time from the Tomcat Web Connector',"
+                            + "DEFAULT,"
+                            + "'geronimo:J2EEServer=geronimo,ServiceModule=org.apache.geronimo.configs/tomcat6/2.1-SNAPSHOT/car,j2eeType=GBean,name=TomcatWebConnector',"
+                            + "'D'," + "'ErrorCount'," + "'/'," + "'D',"
+                            + "'time'," + "'Error Count/Sec'," + "'Errors',"
+                            + "500.0," + "1024.0," + "DEFAULT," + "DEFAULT,"
+                            + "CURRENT_TIMESTAMP," + "CURRENT_TIMESTAMP,"
+                            + "CURRENT_TIMESTAMP" + ")");
+            pStmt.executeUpdate();
+            pStmt = con.prepareStatement("INSERT INTO views VALUES("
+                    + "DEFAULT," + "DEFAULT,"
+                    + "'Tomcat Web Connector 60 mins',"
+                    + "'Tomcat Web Connector 60 minute graphs'," + "4,"
+                    + "'0,1,2,3,'," + "CURRENT_TIMESTAMP,"
+                    + "CURRENT_TIMESTAMP)");
+
+            pStmt.executeUpdate();
+            success = true;
+        }
+        catch (SQLException e)
+        {
+            System.err.println("SQL state: " + e.getSQLState());
+            System.err.println("SQL error: " + e.getErrorCode());
+            e.printStackTrace();
+        }
+        return success;
+    }
 }

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/geronimo-web.xml?rev=583038&r1=583037&r2=583038&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/geronimo-web.xml (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/geronimo-web.xml Mon Oct  8 20:27:25 2007
@@ -40,7 +40,7 @@
         <resource-link>MonitoringClientPool</resource-link>
     </resource-ref> 
     <gbean name="MonitoringPortlet" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
-        <attribute name="pageTitle">Monitoring</attribute>
+        <attribute name="pageTitle">Server/Monitoring</attribute>
         <attribute name="portletContext">/MonitoringPortlet</attribute>
         <attribute name="portletList">[MonitoringPortlet]</attribute>
     </gbean>

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/portlet.xml?rev=583038&r1=583037&r2=583038&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/portlet.xml (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/portlet.xml Mon Oct  8 20:27:25 2007
@@ -32,6 +32,7 @@
             <mime-type>text/html</mime-type>
             <portlet-mode>VIEW</portlet-mode>
             <portlet-mode>HELP</portlet-mode>
+            <portlet-mode>EDIT</portlet-mode>
         </supports>
         <portlet-info>
             <title>Monitoring</title>

Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEdit.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEdit.jsp?rev=583038&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEdit.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEdit.jsp Mon Oct  8 20:27:25 2007
@@ -0,0 +1,22 @@
+<%--
+   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.
+--%>
+<p><font face="Verdana" size="+1">
+<center><b>This is the edit page for the Monitoring Portlet</b></center>
+</font></p>
+<P>Edit stuff...</P>
+<P>To return to the main Monitoring panel select the "view" link
+from the header of this portlet.</P>

Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEdit.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEdit.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEdit.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringHelp.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringHelp.jsp?rev=583038&r1=583037&r2=583038&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringHelp.jsp (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringHelp.jsp Mon Oct  8 20:27:25 2007
@@ -14,9 +14,9 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 --%>
-
-<p><font face="Verdana" size="+1"><center><b>This is the help for the MRC Statistics.</b></center></font></p>
-
+<p><font face="Verdana" size="+1">
+<center><b>This is the help for the Monitoring Portlet.</b></center>
+</font></p>
 <P>The stats page needs help documentation</P>
-
-<P>To return to the main Welcome panel select the "view" link from the header of this portlet.</P>
+<P>To return to the main Monitoring panel select the "view" link
+from the header of this portlet.</P>

Added: 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=583038&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp Mon Oct  8 20:27:25 2007
@@ -0,0 +1,93 @@
+<%--
+   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.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.util.*" %>
+<%@ page import="org.apache.geronimo.console.util.PortletManager" %>
+<portlet:defineObjects/>
+
+<table width="100%">
+ <thead align="center"><strong>Views</strong></thead>
+ <tr>
+  <th width="20%">Name</th>
+  <th width="10%">Number of elements</th>
+  <th width="10%">Created</th>
+  <th width="10%">Modified</th>
+  <th width="10%"></th>
+  <th width="10%"></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 WHERE enabled=1");
+ ResultSet rs = pStmt.executeQuery();
+ while (rs.next())
+ {
+     String view_id = rs.getString("view_id");
+ %>
+ <tr>
+  <td 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 align="center"><%=rs.getString("graph_count")%></td>
+  <td align="center"><%=rs.getString("added").substring(0,19)%></td>
+  <td align="center"><%=rs.getString("modified").substring(0,19)%></td>
+  <td align="center"><a href="#">Edit</a></td>
+  <td align="center"><a href="#">Delete</a></td>
+ </tr>
+ <%} %>
+</table>
+<hr>
+<table width="100%">
+ <thead align="center"><strong>Servers</strong></thead>
+ <tr>
+  <th width="20%">Name</th>
+  <th width="10%">IP</th>
+  <th width="10%">Recent1</th>
+  <th width="10%">Recent2</th>
+  <th width="10%">Recent3</th>
+  <th width="10%">Recent4</th>
+ </tr>
+ <%
+ 
+ pStmt = con.prepareStatement("SELECT server_id, name, ip FROM servers");
+ rs = pStmt.executeQuery();
+ while (rs.next())
+ {
+
+//     String server_name = rs.getString("server_name");
+//     String server_ip = rs.getString("server_ip");
+//     String username = rs.getString("username");
+//     String password = rs.getString("password");
+
+
+ %>
+ <tr>
+  <td align="center"><a href="#"><%=rs.getString("name")%></a></td>
+  <td align="center"><a href="#"><%=rs.getString("ip")%></a></td>
+  <td align="center">??</td>
+  <td align="center">??</td>
+  <td align="center">??</td>
+  <td align="center">??</td>
+ </tr>
+ <%}
+ con.close();%>
+</table>

Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=583038&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp Mon Oct  8 20:27:25 2007
@@ -0,0 +1,147 @@
+<%--
+   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="org.apache.geronimo.plugins.monitoring.client.StatsGraph" %>
+<%@ page import="org.apache.geronimo.plugins.monitoring.client.GraphsBuilder" %>
+<%@ page import="java.util.Vector" %>
+<%@ page import="java.util.Set" %>
+<%@ 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.util.*" %>
+<%@ page import="org.apache.geronimo.console.util.PortletManager" %>
+<portlet:defineObjects/>
+
+<%
+
+//Set <String> trackedBeans = (Set<String>) request.getAttribute("trackedBeans");
+String view_id = (String) request.getAttribute("view_id"); 
+
+DBManager DBase = new DBManager();
+Connection con = DBase.getConnection();
+
+PreparedStatement pStmt = con.prepareStatement("SELECT view_id, name, description, graph_count, graph_ids, added, modified FROM views WHERE enabled=1 AND view_id="+view_id);
+ResultSet rs = pStmt.executeQuery();
+GraphsBuilder run = new GraphsBuilder(con);
+
+
+if (rs.next())
+{
+    String[] graph_ids = rs.getString("graph_ids").split(",");
+    Vector <StatsGraph> GraphVector = new Vector<StatsGraph>();
+    
+    for (int i = 0; i < graph_ids.length; i++)
+    {
+        
+        GraphVector.add(run.buildOneDB(14, Integer.parseInt(graph_ids[i]))); 
+    }
+    
+%>
+<!-- <head> -->
+    <style type='text/css'>
+    <% 
+
+    for (StatsGraph graph : GraphVector) 
+            out.println(graph.getDiv());
+
+    %>
+    </style>
+    <script type='text/javascript' src='/dojo/dojo.js'>
+    </script>
+    <script type='text/javascript'>
+    var dojoConfig =
+    {
+        isDebug:true
+    };
+    dojo.require("dojo.collections.Store");
+    dojo.require("dojo.charting.Chart");
+    dojo.require('dojo.json');
+    <% for (StatsGraph graph : GraphVector)
+       out.println(graph.getJS());
+
+    %>
+    </script>
+<!-- </head> -->
+
+<table>
+    <tr>
+        <!-- Body -->
+        <td width="90%" align="left" valign="top">
+            <a HREF="javascript:history.go(-1)"><< Back</a>
+            <p>
+            <font face="Verdana" size="+1">
+            <%=rs.getString("name")%>
+            </font>
+            </p>         
+            <p><%=rs.getString("description")%></p>
+<% for (StatsGraph graph : GraphVector) 
+{
+%>
+
+<%=graph.getDivImplement()%>
+
+<%
+}
+%>
+
+        </td>
+     
+         <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
+
+        <!-- Geronimo Links -->
+        <td valign="top">
+
+            <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolor="#000000">
+                <tr>
+                    <td class="DarkBackground" align="left" nowrap>
+                        <font face="Verdana" size="+1">Actions</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <a href="#">Add a graph to the current view</a><br />
+                        <a href="#">Modify the current view</a><br />
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+
+        </td>        
+    </tr>
+</table>
+<%}
+    else
+    {%>
+<table>
+    <tr>
+        <!-- Body -->
+        <td width="90%" align="left" valign="top">
+            <p>
+            <font face="Verdana" size="+1">
+            View does not exist or is disabled
+            </font>
+            </p>         
+
+        </td>
+    </tr>
+</table>
+    <%}%>
+

Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain