geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akulshresh...@apache.org
Subject svn commit: r591189 - in /geronimo/sandbox/monitoring/client/client-war/src/main: java/org/apache/geronimo/plugins/monitoring/client/ webapp/WEB-INF/view/
Date Fri, 02 Nov 2007 01:47:21 GMT
Author: akulshreshtha
Date: Thu Nov  1 18:47:20 2007
New Revision: 591189

URL: http://svn.apache.org/viewvc?rev=591189&view=rev
Log:
GERONIMO-3576 Monitoring Client Patch by Erik B. Craig

Added:
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddView.jsp
  (with props)
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditView.jsp
  (with props)
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/monitoringAddServer.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/monitoringNormal.jsp
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringPage.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=591189&r1=591188&r2=591189&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
Thu Nov  1 18:47:20 2007
@@ -39,30 +39,38 @@
 public class MonitoringPortlet extends GenericPortlet
 {
 
-    private static final String      NORMALVIEW_JSP    = "/WEB-INF/view/monitoringNormal.jsp";
+    private static final String      NORMALVIEW_JSP     = "/WEB-INF/view/monitoringNormal.jsp";
 
-    private static final String      PAGEVIEW_JSP      = "/WEB-INF/view/monitoringPage.jsp";
+    private static final String      PAGEVIEW_JSP       = "/WEB-INF/view/monitoringPage.jsp";
 
-    private static final String      VIEWSERVER_JSP    = "/WEB-INF/view/monitoringViewServer.jsp";
+    private static final String      EDITVIEW_JSP       = "/WEB-INF/view/monitoringEditView.jsp";
 
-    private static final String      EDITSERVER_JSP    = "/WEB-INF/view/monitoringEditServer.jsp";
+    private static final String      ADDVIEW_JSP        = "/WEB-INF/view/monitoringAddView.jsp";
 
-    private static final String      ADDSERVER_JSP     = "/WEB-INF/view/monitoringAddServer.jsp";
+    private static final String      VIEWSERVER_JSP     = "/WEB-INF/view/monitoringViewServer.jsp";
 
-    private static final String      MBEAN_JSP         = "/WEB-INF/view/monitoringMbean.jsp";
+    private static final String      EDITSERVER_JSP     = "/WEB-INF/view/monitoringEditServer.jsp";
 
-    private static final String      TIMEFRAME_JSP     = "/WEB-INF/view/monitoringTimeframe.jsp";
+    private static final String      ADDSERVER_JSP      = "/WEB-INF/view/monitoringAddServer.jsp";
 
-    private static final String      MAXIMIZEDVIEW_JSP = "/WEB-INF/view/monitoringMaximized.jsp";
+    private static final String      MBEAN_JSP          = "/WEB-INF/view/monitoringMbean.jsp";
 
-    private static final String      HELPVIEW_JSP      = "/WEB-INF/view/monitoringHelp.jsp";
+    private static final String      TIMEFRAME_JSP      = "/WEB-INF/view/monitoringTimeframe.jsp";
 
-    private static final String      EDITVIEW_JSP      = "/WEB-INF/view/monitoringEdit.jsp";
+    private static final String      MAXIMIZEDVIEW_JSP  = "/WEB-INF/view/monitoringMaximized.jsp";
+
+    private static final String      HELPVIEW_JSP       = "/WEB-INF/view/monitoringHelp.jsp";
+
+    private static final String      EDITNORMALVIEW_JSP = "/WEB-INF/view/monitoringEdit.jsp";
 
     private PortletRequestDispatcher normalView;
 
     private PortletRequestDispatcher pageView;
 
+    private PortletRequestDispatcher editView;
+
+    private PortletRequestDispatcher addView;
+
     private PortletRequestDispatcher viewServer;
 
     private PortletRequestDispatcher editServer;
@@ -77,7 +85,7 @@
 
     private PortletRequestDispatcher helpView;
 
-    private PortletRequestDispatcher editView;
+    private PortletRequestDispatcher editNormalView;
 
     @Override
     public void processAction(ActionRequest actionRequest,
@@ -90,6 +98,27 @@
             String view_id = actionRequest.getParameter("view_id");
             actionResponse.setRenderParameter("view_id", view_id);
         }
+        else if (action.equals("showEditView"))
+        {
+            String view_id = actionRequest.getParameter("view_id");
+            actionResponse.setRenderParameter("view_id", view_id);
+        }
+        else if (action.equals("saveEditView"))
+        {
+            updateView(actionRequest, actionResponse);
+        }
+        else if (action.equals("showAddView"))
+        {
+
+        }
+        else if (action.equals("saveAddView"))
+        {
+            addView(actionRequest, actionResponse);
+        }
+        else if (action.equals("deleteView"))
+        {
+            deleteView(actionRequest, actionResponse);
+        }
         else if (action.equals("showServer"))
         {
             String server_id = actionRequest.getParameter("server_id");
@@ -533,7 +562,37 @@
             throws PortletException, IOException
     {
         String action = request.getParameter("action");
-        if (action.equals("showEditServer"))
+        if (action.equals("showEditView"))
+        {
+            String view_id = request.getParameter("view_id");
+            request.setAttribute("view_id", view_id);
+            editView.include(request, response);
+        }
+        else if (action.equals("saveEditView"))
+        {
+            String view_id = request.getParameter("view_id");
+            request.setAttribute("view_id", view_id);
+            String message = request.getParameter("message");
+            request.setAttribute("message", message);
+            editView.include(request, response);
+        }
+        else if (action.equals("showAddView"))
+        {
+            addView.include(request, response);
+        }
+        else if (action.equals("saveAddView"))
+        {
+            String message = request.getParameter("message");
+            request.setAttribute("message", message);
+            normalView.include(request, response);
+        }
+        else if (action.equals("deleteView"))
+        {
+            String message = request.getParameter("message");
+            request.setAttribute("message", message);
+            normalView.include(request, response);
+        }
+        else if (action.equals("showEditServer"))
         {
             String server_id = request.getParameter("server_id");
             request.setAttribute("server_id", server_id);
@@ -549,8 +608,6 @@
         }
         else if (action.equals("showAddServer"))
         {
-            String server_id = request.getParameter("server_id");
-            request.setAttribute("server_id", server_id);
             addServer.include(request, response);
         }
         else if (action.equals("saveAddServer"))
@@ -566,7 +623,92 @@
             normalView.include(request, response);
         }
         else
-            editView.include(request, response);
+            editNormalView.include(request, response);
+    }
+
+    protected void updateView(ActionRequest actionRequest,
+            ActionResponse actionResponse)
+    {
+        String view_id = actionRequest.getParameter("view_id");
+        actionResponse.setRenderParameter("view_id", view_id);
+        DBManager DBase = new DBManager();
+        Connection con = DBase.getConnection();
+        String name = actionRequest.getParameter("name");
+        String description = actionRequest.getParameter("description");
+        String[] graphsArray = actionRequest.getParameterValues("graph_ids");
+        String graph_ids = "";
+        if (graphsArray != null)
+            for (int i = 0; i < graphsArray.length; i++)
+            {
+                graph_ids = graph_ids + graphsArray[i] + ",";
+            }
+        try
+        {
+            PreparedStatement pStmt = con
+                    .prepareStatement("UPDATE views SET name='" + name
+                            + "', description='" + description
+                            + "', graph_ids='" + graph_ids + "', graph_count="
+                            + graphsArray.length
+                            + ", modified=CURRENT_TIMESTAMP WHERE view_id="
+                            + view_id);
+            pStmt.executeUpdate();
+            con.close();
+            actionResponse.setRenderParameter("message",
+                    "<font color=\"green\"><strong><li>View " + name
+                            + " has been updated</li></strong></font>");
+            return;
+
+        }
+        catch (Exception e)
+        {
+            actionResponse.setRenderParameter("message",
+                    "<font color=\"red\"><strong><li>Error updating View
"
+                            + name + "</li></strong></font>" + e.getMessage());
+            return;
+        }
+    }
+
+    protected void addView(ActionRequest actionRequest,
+            ActionResponse actionResponse)
+    {
+        DBManager DBase = new DBManager();
+        Connection con = DBase.getConnection();
+        String name = actionRequest.getParameter("name");
+        String description = actionRequest.getParameter("description");
+        String[] graphsArray = actionRequest.getParameterValues("graph_ids");
+        String graph_ids = "";
+        if (graphsArray != null)
+            for (int i = 0; i < graphsArray.length; i++)
+            {
+                graph_ids = graph_ids + graphsArray[i] + ",";
+            }
+        try
+        {
+            PreparedStatement pStmt = con
+                    .prepareStatement("INSERT INTO views (name, description, graph_count,
graph_ids, modified, added) VALUES ('"
+                            + name
+                            + "','"
+                            + description
+                            + "',"
+                            + graphsArray.length
+                            + ",'"
+                            + graph_ids
+                            + "',CURRENT_TIMESTAMP,CURRENT_TIMESTAMP)");
+            pStmt.executeUpdate();
+            con.close();
+            actionResponse.setRenderParameter("message",
+                    "<font color=\"green\"><strong><li>View " + name
+                            + " has been added</li></strong></font>");
+            return;
+
+        }
+        catch (Exception e)
+        {
+            actionResponse.setRenderParameter("message",
+                    "<font color=\"red\"><strong><li>Error adding View
" + name
+                            + "</li></strong></font>" + e.getMessage());
+            return;
+        }
     }
 
     protected void updateServer(ActionRequest actionRequest,
@@ -701,6 +843,36 @@
         }
     }
 
+    protected void deleteView(ActionRequest actionRequest,
+            ActionResponse actionResponse)
+    {
+        String view_id = actionRequest.getParameter("view_id");
+        actionResponse.setRenderParameter("view_id", view_id);
+        DBManager DBase = new DBManager();
+        Connection con = DBase.getConnection();
+
+        try
+        {
+            PreparedStatement pStmt = con
+                    .prepareStatement("DELETE FROM views WHERE view_id="
+                            + view_id);
+            pStmt.executeUpdate();
+            con.close();
+            actionResponse
+                    .setRenderParameter("message",
+                            "<font color=\"green\"><strong><li>View has
been deleted</li></strong></font>");
+            return;
+
+        }
+        catch (Exception e)
+        {
+            actionResponse.setRenderParameter("message",
+                    "<font color=\"red\"><strong><li>Error deleting view</li></strong></font>"
+                            + e.getMessage());
+            return;
+        }
+    }
+
     @Override
     public void init(PortletConfig portletConfig) throws PortletException
     {
@@ -709,6 +881,10 @@
                 NORMALVIEW_JSP);
         pageView = portletConfig.getPortletContext().getRequestDispatcher(
                 PAGEVIEW_JSP);
+        editView = portletConfig.getPortletContext().getRequestDispatcher(
+                EDITVIEW_JSP);
+        addView = portletConfig.getPortletContext().getRequestDispatcher(
+                ADDVIEW_JSP);
         viewServer = portletConfig.getPortletContext().getRequestDispatcher(
                 VIEWSERVER_JSP);
         editServer = portletConfig.getPortletContext().getRequestDispatcher(
@@ -723,8 +899,8 @@
                 MAXIMIZEDVIEW_JSP);
         helpView = portletConfig.getPortletContext().getRequestDispatcher(
                 HELPVIEW_JSP);
-        editView = portletConfig.getPortletContext().getRequestDispatcher(
-                EDITVIEW_JSP);
+        editNormalView = portletConfig.getPortletContext()
+                .getRequestDispatcher(EDITNORMALVIEW_JSP);
     }
 
     @Override
@@ -732,6 +908,8 @@
     {
         normalView = null;
         pageView = null;
+        editView = null;
+        addView = null;
         viewServer = null;
         editServer = null;
         addServer = null;
@@ -739,7 +917,7 @@
         timeFrameView = null;
         maximizedView = null;
         helpView = null;
-        editView = null;
+        editNormalView = null;
         super.destroy();
     }
 }

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=591189&r1=591188&r2=591189&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
Thu Nov  1 18:47:20 2007
@@ -58,16 +58,16 @@
 function show(x) {
 document.getElementById(x).style.display='';
 }
-function <portlet:namespace/>validate() {
-   if (! (document.<portlet:namespace/>addServer.name.value 
-      && document.<portlet:namespace/>addServer.ip.value 
-      && document.<portlet:namespace/>addServer.username.value
-      && document.<portlet:namespace/>addServer.password.value ))
+function validate() {
+   if (! (document.addServer.name.value 
+      && document.addServer.ip.value 
+      && document.addServer.username.value
+      && document.addServer.password.value ))
    {
       alert("Name, Address, and Username and password are all required fields");
       return false;
    }
-   if (document.<portlet:namespace/>addServer.password.value != document.<portlet:namespace/>addServer.password2.value)
+   if (document.addServer.password.value != document.addServer.password2.value)
    {
       alert("Passwords do not match");
       return false;
@@ -78,18 +78,14 @@
     reg = /[^0-9]/g;
     obj.value =  obj.value.replace(reg,"");
  }
+function onClick(href)
+{
+window.location = href+"&ip="+document.addServer.ip.value;
+return false;
+}
 
 //-->
 </script>
-    <script type='text/javascript'>
-    var dojoConfig =
-    {
-        isDebug:true
-    };
-    dojo.require("dojo.collections.Store");
-    dojo.require("dojo.charting.Chart");
-    dojo.require('dojo.json');
-    </script>
 <!-- </head> -->
         <a HREF="javascript:history.go(-1)"><< Back</a><br>
             <%
@@ -110,7 +106,7 @@
             </font>
             </p>         
             <p>
-  <form onsubmit="return <portlet:namespace/>validate();" name="<portlet:namespace/>addServer"
method="POST" action="<portlet:actionURL portletMode="edit"><portlet:param name="action"
value="saveAddServer"/></portlet:actionURL>">
+  <form onsubmit="return validate();" name="addServer" method="POST" action="<portlet:actionURL
portletMode="edit"><portlet:param name="action" value="saveAddServer"/></portlet:actionURL>">
   <table cellpadding="1" cellspacing="1">
     <tr>
       <td>Name:</td>
@@ -181,6 +177,7 @@
         </td>        
     </tr>
 </table>
+
 
 
 

Added: 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=591189&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddView.jsp
(added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddView.jsp
Thu Nov  1 18:47:20 2007
@@ -0,0 +1,175 @@
+<%--
+   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.util.Iterator" %>
+<%@ page import="java.util.HashMap" %>
+<%@ page import="java.util.TreeMap" %>
+<%@ page import="java.util.ArrayList" %>
+<%@ page import="java.lang.String" %>
+<%@ 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" %>
+<%@ page import="org.apache.geronimo.plugins.monitoring.client.MRCConnector" %>
+<portlet:defineObjects/>
+
+<%
+
+String message = (String) request.getAttribute("message");
+
+
+if (message == null)
+    message = new String("");
+
+%>
+<!-- <head> -->
+
+    <style type='text/css'>
+    </style>
+    <script type='text/javascript' src='/dojo/dojo.js'>
+    </script>
+        <script type = "text/javascript">
+<!--
+function hide(x) {
+document.getElementById(x).style.display='none';
+}
+function show(x) {
+document.getElementById(x).style.display='';
+}
+function validate() {
+   if (! (document.addView.name.value 
+      && document.addView.description.value  ))
+   {
+      alert("Name and Description are required fields");
+      return false;
+   }
+   return;
+}
+
+//-->
+</script>
+<!-- </head> -->
+        <a HREF="javascript:history.go(-1)"><< Back</a><br>
+            <%
+ if (!message.equals(""))
+ {
+ %>
+<div align="left" style="width: 500px">
+<%=message %><br>
+</div>
+<%} %>
+<table>
+    <tr>
+        <!-- Body -->
+        <td width="90%" align="left" valign="top">
+            <p>
+            <font face="Verdana" size="+1">
+            Adding a new view
+            </font>
+            </p>         
+            <p>
+  <form onsubmit="return validate();" name="addView" method="POST" action="<portlet:actionURL
portletMode="edit"><portlet:param name="action" value="saveAddView"/></portlet:actionURL>">
+  <table cellpadding="1" cellspacing="1">
+    <tr>
+      <td>Name:</td>
+      <td>&nbsp;</td>
+      <td align="right"><input size="50" type="text" name="name" value=""></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>Description:</td>
+      <td>&nbsp;</td>
+      <td align="right"><textarea rows="5" cols="50" name="description"></textarea></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>Included graphs:</td>
+      <td>&nbsp;</td>
+      <td align="right">
+      <%
+      DBManager DBase = new DBManager();
+      Connection con = DBase.getConnection();
+          PreparedStatement pStmt = con.prepareStatement("SELECT * FROM graphs");
+          ResultSet rs = pStmt.executeQuery();
+      %>
+      <select name="graph_ids" size="15" multiple="multiple" id="graph_ids">
+      <%
+          while (rs.next())
+          {
+      %>
+          
+            <option value="<%=rs.getString("graph_id")%>"><%=rs.getString("name")%></option>
+      <%
+          }
+      rs.close();
+      %>
+      </select>
+</td>
+      <td></td>
+    </tr>
+    <tr><td colspan="2"><font size="-2">&nbsp;</font></td></tr>
+    <tr>
+      <td colspan="1" align="left"><button type="button" value="Cancel" onclick="javascript:history.go(-1)">Cancel</button></td>
+      <td>&nbsp;</td>
+      <td colspan="1" align="right"><input type="submit" value="Save" /></td>
+      <td></td>
+    </tr>
+  </table>
+  </form>
+
+            </p>
+
+        </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">Actions</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="#">Create a new graph</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            
+        </td>        
+    </tr>
+</table>
+
+
+
+
+

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

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

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

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=591189&r1=591188&r2=591189&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
Thu Nov  1 18:47:20 2007
@@ -80,16 +80,16 @@
 function show(x) {
 document.getElementById(x).style.display='';
 }
-function <portlet:namespace/>validate() {
-   if (! (document.<portlet:namespace/>editServer.name.value 
-      && document.<portlet:namespace/>editServer.ip.value 
-      && document.<portlet:namespace/>editServer.username.value
-      && document.<portlet:namespace/>editServer.snapshot.value ))
+function validate() {
+   if (! (document.editServer.name.value 
+      && document.editServer.ip.value 
+      && document.editServer.username.value
+      && document.editServer.snapshot.value ))
    {
       alert("Name, Address, Username and Snapshot Duration are all required fields");
       return false;
    }
-   if (document.<portlet:namespace/>editServer.password.value != document.<portlet:namespace/>editServer.password2.value)
+   if (document.editServer.password.value != document.editServer.password2.value)
    {
       alert("Passwords do not match");
       return false;
@@ -103,15 +103,6 @@
 
 //-->
 </script>
-    <script type='text/javascript'>
-    var dojoConfig =
-    {
-        isDebug:true
-    };
-    dojo.require("dojo.collections.Store");
-    dojo.require("dojo.charting.Chart");
-    dojo.require('dojo.json');
-    </script>
 <!-- </head> -->
         <a HREF="javascript:history.go(-1)"><< Back</a><br>
             <%
@@ -132,7 +123,7 @@
             </font>
             </p>         
             <p>
-  <form onsubmit="return <portlet:namespace/>validate();" name="<portlet:namespace/>editServer"
method="POST" action="<portlet:actionURL portletMode="edit"><portlet:param name="action"
value="saveEditServer"/><portlet:param name="server_id" value="<%=server_id%>"/></portlet:actionURL>">
+  <form onsubmit="return validate();" name="editServer" method="POST" action="<portlet:actionURL
portletMode="edit"><portlet:param name="action" value="saveEditServer"/><portlet:param
name="server_id" value="<%=server_id%>"/></portlet:actionURL>">
   <table cellpadding="1" cellspacing="1">
     <tr>
       <td>Added:</td>
@@ -293,6 +284,7 @@
 </table>
     <%
     }%>
+
 
 
 

Added: 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=591189&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditView.jsp
(added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditView.jsp
Thu Nov  1 18:47:20 2007
@@ -0,0 +1,254 @@
+<%--
+   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.util.Iterator" %>
+<%@ page import="java.util.HashMap" %>
+<%@ page import="java.util.TreeMap" %>
+<%@ page import="java.util.ArrayList" %>
+<%@ page import="java.lang.String" %>
+<%@ 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" %>
+<%@ page import="org.apache.geronimo.plugins.monitoring.client.MRCConnector" %>
+<portlet:defineObjects/>
+
+<%
+
+String view_id = (String) request.getAttribute("view_id"); 
+String message = (String) request.getAttribute("message");
+
+
+DBManager DBase = new DBManager();
+Connection con = DBase.getConnection();
+
+PreparedStatement pStmt = con.prepareStatement("SELECT * FROM views WHERE view_id="+view_id);
+ResultSet rs = pStmt.executeQuery();
+
+if (message == null)
+    message = new String("");
+
+if (rs.next())
+{    
+    String added = rs.getString("added").substring(0,16);
+    String modified = rs.getString("modified").substring(0,16);
+    Integer enabled = rs.getInt("enabled");
+    String name = rs.getString("name");
+    String description = rs.getString("description");
+    Integer graph_count = rs.getInt("graph_count");
+    String graph_ids = rs.getString("graph_ids");
+    rs.close();
+%>
+<!-- <head> -->
+
+    <style type='text/css'>
+    </style>
+    <script type='text/javascript' src='/dojo/dojo.js'>
+    </script>
+        <script type = "text/javascript">
+<!--
+function hide(x) {
+document.getElementById(x).style.display='none';
+}
+function show(x) {
+document.getElementById(x).style.display='';
+}
+function validate() {
+   if (! (document.editView.name.value 
+      && document.editView.description.value  ))
+   {
+      alert("Name and Description are required fields");
+      return false;
+   }
+   return;
+}
+
+//-->
+</script>
+<!-- </head> -->
+        <a HREF="javascript:history.go(-1)"><< Back</a><br>
+            <%
+ if (!message.equals(""))
+ {
+ %>
+<div align="left" style="width: 500px">
+<%=message %><br>
+</div>
+<%} %>
+<table>
+    <tr>
+        <!-- Body -->
+        <td width="90%" align="left" valign="top">
+            <p>
+            <font face="Verdana" size="+1">
+            Editing: <%=name%>
+            </font>
+            </p>         
+            <p>
+  <form onsubmit="return validate();" name="editView" method="POST" action="<portlet:actionURL
portletMode="edit"><portlet:param name="action" value="saveEditView"/><portlet:param
name="view_id" value="<%=view_id%>"/></portlet:actionURL>">
+  <table cellpadding="1" cellspacing="1">
+    <tr>
+      <td>Added:</td>
+      <td>&nbsp;</td>
+      <td align="right"><%=added%></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>Last Modified:</td>
+      <td>&nbsp;</td>
+      <td align="right"><%=modified%></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>Name:</td>
+      <td>&nbsp;</td>
+      <td align="right"><input size="50" type="text" name="name" value="<%=name%>"></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>Description:</td>
+      <td>&nbsp;</td>
+      <td align="right"><textarea rows="5" cols="50" name="description"><%=description%></textarea></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>Included graphs:</td>
+      <td>&nbsp;</td>
+      <td align="right">
+      <%
+      String[] graphs = graph_ids.split(",");
+      DBase = new DBManager();
+      con = DBase.getConnection();
+          pStmt = con.prepareStatement("SELECT * FROM graphs");
+          rs = pStmt.executeQuery();
+          ArrayList graphsList = new ArrayList(java.util.Arrays.asList(graphs));
+      %>
+      <select name="graph_ids" size="15" multiple="multiple" id="graph_ids">
+      <%
+          while (rs.next())
+          {
+      %>
+          
+            <option value="<%=rs.getString("graph_id")%>" <%if (graphsList.contains(rs.getString("graph_id"))){%>selected="selected"<%}%>><%=rs.getString("name")%></option>
+      <%
+          }
+      rs.close();
+      %>
+      </select>
+</td>
+      <td></td>
+    </tr>
+    <tr><td colspan="2"><font size="-2">&nbsp;</font></td></tr>
+    <tr>
+      <td colspan="1" align="left"><button type="button" value="Cancel" onclick="javascript:history.go(-1)">Cancel</button></td>
+      <td>&nbsp;</td>
+      <td colspan="1" align="right"><input type="submit" value="Save" /></td>
+      <td></td>
+    </tr>
+  </table>
+  </form>
+
+            </p>
+
+        </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">Actions</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="view"><portlet:param
name="action" value="showView" /><portlet:param name="view_id" value="<%=view_id%>"
/></portlet:actionURL>">Show this view</a></li>
+                        <li><a href="#">Create a new graph</a></li>
+                        <li><a href="#">Disable this view</a></li>
+                        <li><a href="<portlet:actionURL portletMode="edit"><portlet:param
name="action" value="deleteView" /><portlet:param name="view_id" value="<%=view_id%>"
/></portlet:actionURL>">Delete this view</a></li>
+                        <li><a href="<portlet:actionURL portletMode="edit"><portlet:param
name="action" value="showAddView" /></portlet:actionURL>">Add a new view</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            
+        </td>        
+    </tr>
+</table>
+<%
+con.close();
+}
+    else
+    {%>
+<table>
+    <tr>
+        <!-- Body -->
+        <td width="90%" align="left" valign="top">
+            <a HREF="javascript:history.go(-1)"><< Back</a>
+            <p>
+            <font face="Verdana" size="+1">
+            View does not exist
+            </font>
+            </p>         
+
+        </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">Actions</font>
+                    </td>
+                </tr>
+                <tr>
+                    <td bgcolor="#FFFFFF" nowrap>
+                        &nbsp;<br />
+                        <ul>
+                        <li><a href="<portlet:actionURL portletMode="edit"><portlet:param
name="action" value="showAddView" /></portlet:actionURL>">Add a new view</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+
+        </td>  
+    </tr>
+</table>
+    <%
+    }%>
+
+
+
+

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

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

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

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=591189&r1=591188&r2=591189&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
Thu Nov  1 18:47:20 2007
@@ -68,11 +68,11 @@
   <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>">Edit</a></td>
-  <td class="${backgroundClass}" width="15%" align="center"><a href="<portlet:actionURL
portletMode="edit"><portlet:param name="action" value="doDeleteView" /><portlet:param
name="view_id" value="<%=rs.getString("view_id")%>" /></portlet:actionURL>">Delete</a></td>
+  <td class="${backgroundClass}" width="15%" align="center"><a href="<portlet:actionURL
portletMode="edit"><portlet:param name="action" value="deleteView" /><portlet:param
name="view_id" value="<%=rs.getString("view_id")%>" /></portlet:actionURL>">Delete</a></td>
  </tr>
  <%} %>
 </table>
-<div align="right"><a href="#">Create View</a></div>
+<div align="right"><a href="<portlet:actionURL portletMode="edit"><portlet:param
name="action" value="showAddView" /></portlet:actionURL>">Create View</a></div>
 <table width="100%" style="border-style: solid;
 border-width: 1px;">
  <thead align="center"><strong>Servers</strong></thead>

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=591189&r1=591188&r2=591189&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
Thu Nov  1 18:47:20 2007
@@ -128,8 +128,8 @@
                     <td bgcolor="#FFFFFF" nowrap>
                         &nbsp;<br />
                         <ul>
-                        <li><a href="#">Modify this view</a></li>
-                        <li><a href="#">Create a new view</a></li>
+                        <li><a href="<portlet:actionURL portletMode="edit"><portlet:param
name="action" value="showEditView" /><portlet:param name="view_id" value="<%=view_id%>"
/></portlet:actionURL>">Modify this view</a></li>
+                        <li><a href="<portlet:actionURL portletMode="edit"><portlet:param
name="action" value="showAddView" /></portlet:actionURL>">Create a new view</a></li>
                         </ul>
                         &nbsp;<br />
                     </td>   
@@ -181,6 +181,7 @@
     </tr>
 </table>
     <%}%>
+
 
 
 



Mime
View raw message