Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 50212 invoked from network); 3 Nov 2007 02:58:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Nov 2007 02:58:28 -0000 Received: (qmail 40133 invoked by uid 500); 3 Nov 2007 02:58:15 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 40080 invoked by uid 500); 3 Nov 2007 02:58:15 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 40069 invoked by uid 99); 3 Nov 2007 02:58:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2007 19:58:15 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Nov 2007 02:58:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C08EE1A9832; Fri, 2 Nov 2007 19:58:06 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r591545 - in /geronimo/sandbox/monitoring/client/client-war/src/main: java/org/apache/geronimo/plugins/monitoring/client/ webapp/WEB-INF/view/ Date: Sat, 03 Nov 2007 02:58:06 -0000 To: scm@geronimo.apache.org From: akulshreshtha@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071103025806.C08EE1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: akulshreshtha Date: Fri Nov 2 19:58:05 2007 New Revision: 591545 URL: http://svn.apache.org/viewvc?rev=591545&view=rev Log: GERONIMO-3577 Monitoring Client: Patch by Erik B. Craig Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.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/monitoringViewServer.jsp Modified: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java?rev=591545&r1=591544&r2=591545&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 Fri Nov 2 19:58:05 2007 @@ -47,6 +47,8 @@ private static final String ADDVIEW_JSP = "/WEB-INF/view/monitoringAddView.jsp"; + private static final String ADDGRAPH_JSP = "/WEB-INF/view/monitoringAddGraph.jsp"; + private static final String VIEWSERVER_JSP = "/WEB-INF/view/monitoringViewServer.jsp"; private static final String EDITSERVER_JSP = "/WEB-INF/view/monitoringEditServer.jsp"; @@ -71,6 +73,8 @@ private PortletRequestDispatcher addView; + private PortletRequestDispatcher addGraph; + private PortletRequestDispatcher viewServer; private PortletRequestDispatcher editServer; @@ -115,6 +119,19 @@ { addView(actionRequest, actionResponse); } + else if (action.equals("showAddGraph")) + { + String server_id = actionRequest.getParameter("server_id"); + actionResponse.setRenderParameter("server_id", server_id); + String mbean = actionRequest.getParameter("mbean"); + actionResponse.setRenderParameter("mbean", mbean); + String dataname = actionRequest.getParameter("dataname"); + actionResponse.setRenderParameter("dataname", dataname); + } + else if (action.equals("saveAddGraph")) + { + addGraph(actionRequest, actionResponse); + } else if (action.equals("deleteView")) { deleteView(actionRequest, actionResponse); @@ -586,6 +603,22 @@ request.setAttribute("message", message); normalView.include(request, response); } + else if (action.equals("showAddGraph")) + { + String server_id = request.getParameter("server_id"); + request.setAttribute("server_id", server_id); + String mbean = request.getParameter("mbean"); + request.setAttribute("mbean", mbean); + String dataname = request.getParameter("dataname"); + request.setAttribute("dataname", dataname); + addGraph.include(request, response); + } + else if (action.equals("saveAddGraph")) + { + String message = request.getParameter("message"); + request.setAttribute("message", message); + normalView.include(request, response); + } else if (action.equals("deleteView")) { String message = request.getParameter("message"); @@ -873,6 +906,56 @@ } } + protected void addGraph(ActionRequest actionRequest, + ActionResponse actionResponse) + { + DBManager DBase = new DBManager(); + Connection con = DBase.getConnection(); + String name = actionRequest.getParameter("name"); + String description = actionRequest.getParameter("description"); + String server_id = actionRequest.getParameter("server_id"); + String xlabel = actionRequest.getParameter("xlabel"); + String ylabel = actionRequest.getParameter("ylabel"); + String timeframe = actionRequest.getParameter("timeframe"); + String mbean = actionRequest.getParameter("mbean"); + String dataname = actionRequest.getParameter("dataname"); + try + { + PreparedStatement pStmt = con + .prepareStatement("INSERT INTO graphs (server_id, name, description, timeframe, mbean, dataname1, xlabel, ylabel, data1operation, operation, data2operation, dataname2, warninglevel1, warninglevel2, added, modified, last_seen) VALUES (" + + server_id + + ",'" + + name + + "','" + + description + + "'," + + timeframe + + ",'" + + mbean + + "','" + + dataname + + "','" + + xlabel + + "','" + + ylabel + + "','D','/','D','time',500.0,1024.0,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP)"); + pStmt.executeUpdate(); + con.close(); + actionResponse.setRenderParameter("message", + "
  • Graph " + name + + " has been added.
  • "); + return; + + } + catch (Exception e) + { + actionResponse.setRenderParameter("message", + "
  • Error adding graph
  • " + + e.getMessage()); + return; + } + } + @Override public void init(PortletConfig portletConfig) throws PortletException { @@ -885,6 +968,8 @@ EDITVIEW_JSP); addView = portletConfig.getPortletContext().getRequestDispatcher( ADDVIEW_JSP); + addGraph = portletConfig.getPortletContext().getRequestDispatcher( + ADDGRAPH_JSP); viewServer = portletConfig.getPortletContext().getRequestDispatcher( VIEWSERVER_JSP); editServer = portletConfig.getPortletContext().getRequestDispatcher( @@ -910,6 +995,7 @@ pageView = null; editView = null; addView = null; + addGraph = null; viewServer = null; editServer = null; addServer = null; Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp?rev=591545&view=auto ============================================================================== --- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp (added) +++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp Fri Nov 2 19:58:05 2007 @@ -0,0 +1,193 @@ +<%-- + 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.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" %> + + +<% + +String message = (String) request.getAttribute("message"); +String mbean = (String) request.getAttribute("mbean"); +String dataname = (String) request.getAttribute("dataname"); +String server_id = (String) request.getAttribute("server_id"); + +if (message == null) + message = new String(""); + + +%> + + + + + + + << Back
    + <% + if (!message.equals("")) + { + %> +
    +<%=message %>
    +
    +<%} %> + + + + + + + + + + +
    +

    + + Add a Graph + +

    +

    +

    "> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Server: 
    Name: 
    Description: 
    X Axis label: 
    Y Axis label: 
    Timeframe:  minutes
    Mbean: 
    Data Name: 
     
     
    + + +

    + +
          + + + + + + + + +
    + Actions +
    +  
    +
      + +
    +  
    +
    + +
    + + + + Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp ------------------------------------------------------------------------------ svn:mime-type = text/plain 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=591545&r1=591544&r2=591545&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 Fri Nov 2 19:58:05 2007 @@ -78,11 +78,6 @@ reg = /[^0-9]/g; obj.value = obj.value.replace(reg,""); } -function onClick(href) -{ -window.location = href+"&ip="+document.addServer.ip.value; -return false; -} //--> Modified: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp?rev=591545&r1=591544&r2=591545&view=diff ============================================================================== --- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp (original) +++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp Fri Nov 2 19:58:05 2007 @@ -258,7 +258,7 @@ { String dataName = itt.next().toString(); %> - <%=dataName%><%=beanStats.get(dataName) %> + "><%=dataName%><%=beanStats.get(dataName) %> <% } %> @@ -417,6 +417,7 @@ <% rs.close(); }%> +