geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akulshresh...@apache.org
Subject svn commit: r590509 - in /geronimo/sandbox/monitoring/client/client-war/src/main: java/org/apache/geronimo/plugins/monitoring/client/ webapp/WEB-INF/view/
Date Tue, 30 Oct 2007 23:29:54 GMT
Author: akulshreshtha
Date: Tue Oct 30 16:29:53 2007
New Revision: 590509

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

Added:
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddServer.jsp   (with props)
    geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp   (with props)
Modified:
    geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MRCConnector.java
    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/monitoringNormal.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/MRCConnector.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MRCConnector.java?rev=590509&r1=590508&r2=590509&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MRCConnector.java (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MRCConnector.java Tue Oct 30 16:29:53 2007
@@ -66,7 +66,6 @@
         Context ic = new InitialContext(props);
         mrc = (MasterRemoteControlRemote) ic.lookup("ejb/mgmt/MRCRemote");
         mrc.setUpMEJB(userName, password);
-
     }
 
     /**
@@ -324,9 +323,18 @@
         return mrc.startSnapshot(time);
     }
 
-    public boolean isSnapshotRunning() throws Exception
+    public boolean isSnapshotRunning()
     {
-        return mrc.isSnapshotRunning();
+        boolean running = false;
+        try
+        {
+            running = mrc.isSnapshotRunning();
+        }
+        catch (Exception e)
+        {
+            return false;
+        }
+        return running;
     }
 
     @SuppressWarnings("unchecked")

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=590509&r1=590508&r2=590509&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 Tue Oct 30 16:29:53 2007
@@ -45,6 +45,10 @@
 
     private static final String      VIEWSERVER_JSP    = "/WEB-INF/view/monitoringViewServer.jsp";
 
+    private static final String      EDITSERVER_JSP    = "/WEB-INF/view/monitoringEditServer.jsp";
+
+    private static final String      ADDSERVER_JSP     = "/WEB-INF/view/monitoringAddServer.jsp";
+
     private static final String      MBEAN_JSP         = "/WEB-INF/view/monitoringMbean.jsp";
 
     private static final String      TIMEFRAME_JSP     = "/WEB-INF/view/monitoringTimeframe.jsp";
@@ -61,6 +65,10 @@
 
     private PortletRequestDispatcher viewServer;
 
+    private PortletRequestDispatcher editServer;
+
+    private PortletRequestDispatcher addServer;
+
     private PortletRequestDispatcher mBeanView;
 
     private PortletRequestDispatcher timeFrameView;
@@ -87,6 +95,27 @@
             String server_id = actionRequest.getParameter("server_id");
             actionResponse.setRenderParameter("server_id", server_id);
         }
+        else if (action.equals("showEditServer"))
+        {
+            String server_id = actionRequest.getParameter("server_id");
+            actionResponse.setRenderParameter("server_id", server_id);
+        }
+        else if (action.equals("saveEditServer"))
+        {
+            updateServer(actionRequest, actionResponse);
+        }
+        else if (action.equals("showAddServer"))
+        {
+
+        }
+        else if (action.equals("deleteServer"))
+        {
+            deleteServer(actionRequest, actionResponse);
+        }
+        else if (action.equals("saveAddServer"))
+        {
+            addServer(actionRequest, actionResponse);
+        }
         else if (action.equals("startTrackingMbean"))
         {
             String server_id = actionRequest.getParameter("server_id");
@@ -500,10 +529,176 @@
     }
 
     @Override
-    protected void doEdit(RenderRequest renderRequest,
-            RenderResponse renderResponse) throws PortletException, IOException
+    protected void doEdit(RenderRequest request, RenderResponse response)
+            throws PortletException, IOException
+    {
+        String action = request.getParameter("action");
+        if (action.equals("showEditServer"))
+        {
+            String server_id = request.getParameter("server_id");
+            request.setAttribute("server_id", server_id);
+            editServer.include(request, response);
+        }
+        else if (action.equals("saveEditServer"))
+        {
+            String server_id = request.getParameter("server_id");
+            request.setAttribute("server_id", server_id);
+            String message = request.getParameter("message");
+            request.setAttribute("message", message);
+            editServer.include(request, response);
+        }
+        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"))
+        {
+            String message = request.getParameter("message");
+            request.setAttribute("message", message);
+            normalView.include(request, response);
+        }
+        else if (action.equals("deleteServer"))
+        {
+            String message = request.getParameter("message");
+            request.setAttribute("message", message);
+            normalView.include(request, response);
+        }
+        else
+            editView.include(request, response);
+    }
+
+    protected void updateServer(ActionRequest actionRequest,
+            ActionResponse actionResponse)
     {
-        editView.include(renderRequest, renderResponse);
+        String server_id = actionRequest.getParameter("server_id");
+        actionResponse.setRenderParameter("server_id", server_id);
+        DBManager DBase = new DBManager();
+        Connection con = DBase.getConnection();
+        String name = actionRequest.getParameter("name");
+        String ip = actionRequest.getParameter("ip");
+        String password = actionRequest.getParameter("password");
+        String username = actionRequest.getParameter("username");
+        String snapshot = actionRequest.getParameter("snapshot");
+        try
+        {
+            if (password.equals(""))
+            {
+                PreparedStatement pStmt = con
+                        .prepareStatement("UPDATE servers SET name='"
+                                + name
+                                + "', ip='"
+                                + ip
+                                + "', username='"
+                                + username
+                                + "', modified=CURRENT_TIMESTAMP, last_seen=CURRENT_TIMESTAMP WHERE server_id="
+                                + server_id);
+                pStmt.executeUpdate();
+            }
+            else
+            {
+                PreparedStatement pStmt = con
+                        .prepareStatement("UPDATE servers SET name='"
+                                + name
+                                + "', ip='"
+                                + ip
+                                + "', username='"
+                                + username
+                                + "', password='"
+                                + password
+                                + "', modified=CURRENT_TIMESTAMP, last_seen=CURRENT_TIMESTAMP WHERE server_id="
+                                + server_id);
+                pStmt.executeUpdate();
+            }
+            con.close();
+            actionResponse
+                    .setRenderParameter(
+                            "message",
+                            "<font color=\"green\"><strong><li>Server has been updated</li></strong></font>");
+            return;
+
+        }
+        catch (Exception e)
+        {
+            actionResponse.setRenderParameter("message",
+                    "<font color=\"red\"><strong><li>Error updating server</li></strong></font>"
+                            + e.getMessage());
+            return;
+        }
+    }
+
+    protected void addServer(ActionRequest actionRequest,
+            ActionResponse actionResponse)
+    {
+        DBManager DBase = new DBManager();
+        Connection con = DBase.getConnection();
+        String name = actionRequest.getParameter("name");
+        String ip = actionRequest.getParameter("ip");
+        String password = actionRequest.getParameter("password");
+        String username = actionRequest.getParameter("username");
+        try
+        {
+            PreparedStatement pStmt = con
+                    .prepareStatement("INSERT INTO servers (name, ip, username, password, modified, last_seen, added) VALUES ('"
+                            + name
+                            + "','"
+                            + ip
+                            + "','"
+                            + username
+                            + "','"
+                            + password
+                            + "',CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP)");
+            pStmt.executeUpdate();
+            con.close();
+            actionResponse.setRenderParameter("message",
+                    "<font color=\"green\"><strong><li>Server " + name + " at "
+                            + ip + " has been added.</li></strong></font>");
+            return;
+
+        }
+        catch (Exception e)
+        {
+            actionResponse.setRenderParameter("message",
+                    "<font color=\"red\"><strong><li>Error adding server</li></strong></font>"
+                            + e.getMessage());
+            return;
+        }
+    }
+
+    protected void deleteServer(ActionRequest actionRequest,
+            ActionResponse actionResponse)
+    {
+        String server_id = actionRequest.getParameter("server_id");
+        actionResponse.setRenderParameter("server_id", server_id);
+        DBManager DBase = new DBManager();
+        Connection con = DBase.getConnection();
+
+        try
+        {
+            PreparedStatement pStmt = con
+                    .prepareStatement("DELETE FROM graphs WHERE server_id="
+                            + server_id);
+            pStmt.executeUpdate();
+
+            pStmt = con.prepareStatement("DELETE FROM servers WHERE server_id="
+                    + server_id);
+            pStmt.executeUpdate();
+            con.close();
+            actionResponse
+                    .setRenderParameter(
+                            "message",
+                            "<font color=\"green\"><strong><li>Server and associated graphs have been deleted</li></strong></font>");
+            return;
+
+        }
+        catch (Exception e)
+        {
+            actionResponse.setRenderParameter("message",
+                    "<font color=\"red\"><strong><li>Error deleting server</li></strong></font>"
+                            + e.getMessage());
+            return;
+        }
     }
 
     @Override
@@ -516,6 +711,10 @@
                 PAGEVIEW_JSP);
         viewServer = portletConfig.getPortletContext().getRequestDispatcher(
                 VIEWSERVER_JSP);
+        editServer = portletConfig.getPortletContext().getRequestDispatcher(
+                EDITSERVER_JSP);
+        addServer = portletConfig.getPortletContext().getRequestDispatcher(
+                ADDSERVER_JSP);
         mBeanView = portletConfig.getPortletContext().getRequestDispatcher(
                 MBEAN_JSP);
         timeFrameView = portletConfig.getPortletContext().getRequestDispatcher(
@@ -534,6 +733,8 @@
         normalView = null;
         pageView = null;
         viewServer = null;
+        editServer = null;
+        addServer = null;
         mBeanView = null;
         timeFrameView = null;
         maximizedView = null;

Added: 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=590509&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddServer.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringAddServer.jsp Tue Oct 30 16:29:53 2007
@@ -0,0 +1,187 @@
+<%--
+   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" %>
+<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 <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 ))
+   {
+      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)
+   {
+      alert("Passwords do not match");
+      return false;
+   }
+   return;
+}
+function noAlpha(obj){
+    reg = /[^0-9]/g;
+    obj.value =  obj.value.replace(reg,"");
+ }
+
+//-->
+</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>
+            <%
+ 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">
+            Add a server
+            </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>">
+  <table cellpadding="1" cellspacing="1">
+    <tr>
+      <td>Name:</td>
+      <td>&nbsp;</td>
+      <td align="right"><input type="text" name="name" value=""></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>IP/Hostname:</td>
+      <td>&nbsp;</td>
+      <td align="right"><input type="text" name="ip" value=""/></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>Username:</td>
+      <td>&nbsp;</td>
+      <td align="right"><input type="text" name="username" value=""/></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>Password:</td>
+      <td>&nbsp;</td>
+      <td align="right"><input type="password" name="password" value=""/></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>Password (verify):</td>
+      <td>&nbsp;</td>
+      <td align="right"><input type="password" name="password2" value=""/></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="Add" /></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="#">Test these settings</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+            
+        </td>        
+    </tr>
+</table>
+
+
+
+

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

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

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

Added: 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=590509&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp Tue Oct 30 16:29:53 2007
@@ -0,0 +1,299 @@
+<%--
+   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" %>
+<portlet:defineObjects/>
+
+<%
+
+String server_id = (String) request.getAttribute("server_id"); 
+String message = (String) request.getAttribute("message");
+
+
+DBManager DBase = new DBManager();
+Connection con = DBase.getConnection();
+
+PreparedStatement pStmt = con.prepareStatement("SELECT * FROM servers WHERE server_id="+server_id);
+ResultSet rs = pStmt.executeQuery();
+MRCConnector MRCConnection = null;
+boolean isOnline = true;
+
+
+if (message == null)
+    message = new String("");
+
+if (rs.next())
+{    
+    try {
+        MRCConnection = new MRCConnector(rs.getString("ip"), rs
+            .getString("username"), rs.getString("password"));
+      //TODO: Fix update here
+        //rs2.updateTimestamp("last_seen", new Timestamp(System.currentTimeMillis()));
+    }
+    catch (Exception e)
+    {
+        isOnline = false;
+        message = message + "<br><font color='red'><li>Server is offline</li></font>";
+    }
+%>
+<!-- <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 <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 ))
+   {
+      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)
+   {
+      alert("Passwords do not match");
+      return false;
+   }
+   return;
+}
+function noAlpha(obj){
+    reg = /[^0-9]/g;
+    obj.value =  obj.value.replace(reg,"");
+ }
+
+//-->
+</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>
+            <%
+ 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: <%=rs.getString("name")%> (<%=rs.getString("ip")%>)
+            </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>">
+  <table cellpadding="1" cellspacing="1">
+    <tr>
+      <td>Added:</td>
+      <td>&nbsp;</td>
+      <td align="right"><%=rs.getString("added").substring(0,16)%></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>Last Modified:</td>
+      <td>&nbsp;</td>
+      <td align="right"><%=rs.getString("modified").substring(0,16)%></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>Last Seen:</td>
+      <td>&nbsp;</td>
+      <td align="right"><%=rs.getString("last_seen").substring(0,16)%></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>Name:</td>
+      <td>&nbsp;</td>
+      <td align="right"><input type="text" name="name" value="<%=rs.getString("name")%>"></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>IP/Hostname:</td>
+      <td>&nbsp;</td>
+      <td align="right"><input type="text" name="ip" value="<%=rs.getString("ip")%>"/></td>
+      <td></td>
+    </tr>
+    <%
+    if (isOnline)
+    {
+    %>
+    <tr>
+      <td>Snapshot Duration:</td>
+      <td>&nbsp;</td>
+      <td align="right"><input type="text" width="5" size="4" name="snapshot" onKeyUp='noAlpha(this)' onKeyPress='noAlpha(this)' value="<%=(Long)MRCConnection.getSnapshotDuration()/1000/60%>"/></td>
+      <td> minutes</td>
+    </tr>
+    <%
+    }
+    else
+    {
+    %>
+        <tr>
+        <td>Snapshot Duration:</td>
+        <td>&nbsp;</td>
+        <td align="right"><input type="text" width="5" size="4" name="snapshot" onKeyUp='noAlpha(this)' onKeyPress='noAlpha(this)' disabled="disabled" value="unknown"/></td>
+        <td> minutes</td>
+      </tr>
+    <%
+    }
+    %>
+    <tr>
+      <td>Username:</td>
+      <td>&nbsp;</td>
+      <td align="right"><input type="text" name="username" value="<%=rs.getString("username")%>"/></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>Password:</td>
+      <td>&nbsp;</td>
+      <td align="right"><input type="password" name="password" value=""/></td>
+      <td></td>
+    </tr>
+    <tr>
+      <td>Password (verify):</td>
+      <td>&nbsp;</td>
+      <td align="right"><input type="password" name="password2" value=""/></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="#">Test these settings</a></li>
+                        <li><a href="#">Disable this server</a></li>
+                        <li><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="deleteServer" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /></portlet:actionURL>">Delete this server</a></li>
+                        <li><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showAddServer" /></portlet:actionURL>">Add a new server</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">
+            Server 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="showAddServer" /></portlet:actionURL>">Add a new server</a></li>
+                        </ul>
+                        &nbsp;<br />
+                    </td>   
+                </tr>
+            </table>
+
+        </td>  
+    </tr>
+</table>
+    <%
+    }%>
+
+
+
+

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

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

Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringEditServer.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=590509&r1=590508&r2=590509&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 Tue Oct 30 16:29:53 2007
@@ -37,11 +37,11 @@
 border-width: 1px;">
  <thead align="center"><strong>Views</strong></thead>
  <tr>
-  <th class="DarkBackground" width="20%">Name</th>
+  <th class="DarkBackground" width="30%">Name</th>
   <th class="DarkBackground" width="10%">Elements</th>
   <th class="DarkBackground" width="10%">Created</th>
   <th class="DarkBackground" width="10%">Modified</th>
-  <th class="DarkBackground" width="20%" colspan="2">Actions</th>
+  <th class="DarkBackground" width="30%" colspan="2">Actions</th>
  </tr>
  <%
  DBManager DBase = new DBManager();
@@ -63,12 +63,12 @@
       </c:otherwise>
   </c:choose>
  <tr>
-  <td class="${backgroundClass}" width="20%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showView" /><portlet:param name="view_id" value="<%=rs.getString("view_id")%>" /></portlet:actionURL>"><%=rs.getString("name")%></a></td>
+  <td class="${backgroundClass}" width="30%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showView" /><portlet:param name="view_id" value="<%=rs.getString("view_id")%>" /></portlet:actionURL>"><%=rs.getString("name")%></a></td>
   <td class="${backgroundClass}" width="10%" align="center"><%=rs.getString("graph_count")%></td>
-  <td class="${backgroundClass}" width="10%" align="center"><%=rs.getString("added").substring(0,16)%></td>
-  <td class="${backgroundClass}" width="10%" align="center"><%=rs.getString("modified").substring(0,16)%></td>
-  <td class="${backgroundClass}" width="10%" 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="10%" 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"><%=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>
  </tr>
  <%} %>
 </table>
@@ -77,16 +77,17 @@
 border-width: 1px;">
  <thead align="center"><strong>Servers</strong></thead>
  <tr>
-  <th class="DarkBackground" width="20%">Name</th>
-  <th class="DarkBackground" width="10%">Address</th>
-  <th class="DarkBackground" width="10%">Status</th>
-  <th class="DarkBackground" width="10%">Stat. Query</th>
-  <th class="DarkBackground" width="20%" colspan="2">Actions</th>
+  <th class="DarkBackground" width="30%">Name</th>
+  <th class="DarkBackground" width="10%">IP/Hostname</th>
+  <th class="DarkBackground" width="15%">Status</th>
+  <th class="DarkBackground" width="15%">Stat. Query</th>
+  <th class="DarkBackground" width="30%" colspan="3">Actions</th>
  </tr>
  <%
  
  pStmt = con.prepareStatement("SELECT * FROM servers WHERE enabled=1");
  rs = pStmt.executeQuery();
+ con.close();
  while (rs.next())
  {
      boolean online = false;
@@ -113,7 +114,6 @@
      }
      catch (Exception e)
      {
-         e.printStackTrace();
          collecting = false;
          online = false;
      }
@@ -134,37 +134,40 @@
       </c:otherwise>
   </c:choose>
  <tr>
-  <td class="${backgroundClass}" width="20%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showServer" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /></portlet:actionURL>"><%=rs.getString("name")%></a></td>
+  <td class="${backgroundClass}" width="30%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showServer" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /></portlet:actionURL>"><%=rs.getString("name")%></a></td>
   <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="showServer" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /></portlet:actionURL>"><%=rs.getString("ip")%></a></td>
 <%
 if (online && collecting)
 {
 %>
-  <td class="${backgroundClass}" width="10%" align="center" bgcolor="green">Online</td>
-  <td class="${backgroundClass}" width="10%" align="center"><%=snapshotDuration/1000/60+" min. (running)"%></td>
-  <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showEditServer" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /></portlet:actionURL>">Edit</a></td>
+  <td class="${backgroundClass}" width="15%" align="center" bgcolor="green">Online</td>
+  <td class="${backgroundClass}" width="15%" align="center"><%=snapshotDuration/1000/60+" min. (running)"%></td>
   <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="stopThread" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /></portlet:actionURL>">Disable Query</a></td>
+  <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showEditServer" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /></portlet:actionURL>">Edit</a></td>
+  <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="deleteServer" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /></portlet:actionURL>">Delete</a></td>
 <%
 }
 else if (online && !collecting)
 {%>
-  <td class="${backgroundClass}" width="10%" align="center" bgcolor="green">Online</td>
-  <td class="${backgroundClass}" width="10%" align="center" bgcolor="red"><%=snapshotDuration/1000/60+" min. (stopped)"%></td>
-  <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showEditServer" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /></portlet:actionURL>">Edit Server</a></td>
+  <td class="${backgroundClass}" width="15%" align="center" bgcolor="green">Online</td>
+  <td class="${backgroundClass}" width="15%" align="center" bgcolor="red"><%=snapshotDuration/1000/60+" min. (stopped)"%></td>
   <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="view"><portlet:param name="action" value="startThread" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /><portlet:param name="snapshotDuration" value="<%=java.lang.Long.toString(snapshotDuration)%>" /></portlet:actionURL>">Enable Query</a></td>
+  <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showEditServer" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /></portlet:actionURL>">Edit</a></td>
+  <td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="deleteServer" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /></portlet:actionURL>">Delete</a></td>
 <%
 }
 else if (!online)
 {%>
-<td class="${backgroundClass}" width="10%" align="center" bgcolor="red">Offline</td>
-<td class="${backgroundClass}" width="10%" align="center" bgcolor="red">(stopped)</td>
-<td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showEditServer" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /></portlet:actionURL>">Edit Server</a></td>
+<td class="${backgroundClass}" width="15%" align="center" bgcolor="red">Offline</td>
+<td class="${backgroundClass}" width="15%" align="center" bgcolor="red">(stopped)</td>
 <td class="${backgroundClass}" width="10%" align="center">Enable Query</td>
+<td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showEditServer" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /></portlet:actionURL>">Edit</a></td>
+<td class="${backgroundClass}" width="10%" align="center"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="deleteServer" /><portlet:param name="server_id" value="<%=rs.getString("server_id")%>" /></portlet:actionURL>">Delete</a></td>
 <%
 }
 %>
  </tr>
  <%}
- con.close();%>
+%>
 </table>
-<div align="right"><a href="#">Add Server</a></div>
+<div align="right"><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showAddServer" /></portlet:actionURL>">Add Server</a></div>

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=590509&r1=590508&r2=590509&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 Tue Oct 30 16:29:53 2007
@@ -29,6 +29,7 @@
 <%@ page import="java.sql.PreparedStatement" %>
 <%@ page import="java.sql.ResultSet" %>
 <%@ page import="java.sql.SQLException" %>
+<%@ page import="java.sql.Timestamp" %>
 <%@ 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" %>
@@ -37,27 +38,77 @@
 <%
 
 String server_id = (String) request.getAttribute("server_id"); 
+String message = (String) request.getAttribute("message");
 
 DBManager DBase = new DBManager();
 Connection con = DBase.getConnection();
 
-PreparedStatement pStmt = con.prepareStatement("SELECT * FROM servers WHERE enabled=1 AND server_id="+server_id);
-ResultSet rs2 = pStmt.executeQuery();
-pStmt = con.prepareStatement("SELECT * FROM graphs WHERE enabled=1 AND server_id="+server_id);
+PreparedStatement pStmt = con.prepareStatement("SELECT * FROM graphs WHERE enabled=1 AND server_id="+server_id);
 ResultSet rs = pStmt.executeQuery();
+
 Vector <StatsGraph> GraphVector = new Vector<StatsGraph>();
 GraphsBuilder run = new GraphsBuilder(con);
+
+MRCConnector MRCConnection = null;
+
+boolean isOnline = true;
+boolean collecting = false;
+
+if (message == null)
+    message = new String("");
+
 while (rs.next())
 {   
     GraphVector.add(run.buildOneDB(14, rs.getInt("GRAPH_ID"))); 
 }
+rs.close();
+
+DBase = new DBManager();
+con = DBase.getConnection();
+pStmt = con.prepareStatement("SELECT * FROM servers WHERE enabled=1 AND server_id="+server_id);
+rs = pStmt.executeQuery();
 
-if (rs2.next())
+if (rs.next())
 {
-    MRCConnector MRCConnection = new MRCConnector(rs2.getString("ip"), rs2
-            .getString("username"), rs2.getString("password"));
-    TreeMap <String,String> availableBeansMap = MRCConnection.getFreeStatisticsProviderBeanNamesMap();
-    TreeMap <String,String> trackedBeansMap = MRCConnection.getTrackedBeansMap();
+    TreeMap <String,String> availableBeansMap = null;
+    TreeMap <String,String> trackedBeansMap = null;
+    String ip = rs.getString("ip");
+    String username = rs.getString("username");
+    String name = rs.getString("name");
+    String password = rs.getString("password");
+    String last_seen = rs.getString("last_seen").substring(0,16);
+    String added = rs.getString("added").substring(0,16);
+    String modified = rs.getString("modified").substring(0,16);
+    rs.close();
+    try {
+        MRCConnection = new MRCConnector(ip, username, password);
+        //TODO: Fix update here
+        //DBase = new DBManager();
+        //con = DBase.getConnection();
+        //pStmt = con.prepareStatement("UPDATE servers SET last_seen=CURRENT_TIMESTAMP WHERE server_id="+server_id);
+        //pStmt.executeUpdate();
+        //con.close();
+        
+        availableBeansMap = MRCConnection.getFreeStatisticsProviderBeanNamesMap();
+        trackedBeansMap = MRCConnection.getTrackedBeansMap();
+    }
+    catch (Exception e)
+    {
+        isOnline = false;
+        message = message + "<br><font color='red'><strong><li>Server is offline</li></strong></font>";
+    }
+    try
+    {
+        if (MRCConnection.isSnapshotRunning())
+            collecting = true;
+        else
+            collecting = false;
+    }
+    catch (Exception e)
+    {
+        collecting = false;
+        isOnline = false;
+    }
 
     
 
@@ -100,8 +151,7 @@
 <!-- </head> -->
         <a HREF="javascript:history.go(-1)"><< Back</a><br>
             <%
- String message = (String) request.getAttribute("message"); 
- if (message != null)
+ if (!message.equals(""))
  {
  %>
 <div align="left" style="width: 500px">
@@ -114,11 +164,78 @@
         <td width="90%" align="left" valign="top">
             <p>
             <font face="Verdana" size="+1">
-            <%=rs2.getString("name")%>
+            <%=name%>
             </font>
-            </p>         
-            <p><%=rs2.getString("ip")%></p>
+            </p>        
+            <p>
+            <table cellpadding="1" cellspacing="1">
+                <tr>
+                    <th align="left">Status:</th>
+                    <td>&nbsp;</td>
+                    <td align="right">
+                                <%if (isOnline)
+                {%>
+                    <font color="green"><strong>Online</strong></font>
+                   <%}
+                                else
+                                {%>
+                                <font color="red"><strong>Offline</strong></font>
+                                <%} %> 
+                    </td>
+                </tr>
+                
+                                <tr>
+                    <th align="left">Snapshot Thread:</th>
+                    <td>&nbsp;</td>
+                    <td align="right">
+                                <%if (isOnline && collecting)
+                {%>
+                    Running
+                   <%}
+                                else
+                                {%>
+                                <font color="red"><strong>Stopped</strong></font>
+                                <%} %> 
+                    </td>
+                </tr>
+                
+                <tr>
+                    <th align="left">Added:</th>
+                    <td>&nbsp;</td>
+                    <td align="right"><%=added%></td>
+                </tr>
+                <tr>
+                    <th align="left">Modified:</th>
+                    <td>&nbsp;</td>
+                    <td align="right"><%=modified%></td>
+                </tr>
+                <tr>
+                    <th align="left">Last seen:</th>
+                    <td>&nbsp;</td>
+                    <td align="right"><%=last_seen%></td>
+                </tr>
+                <tr>
+                    <th align="left">IP/Hostname:</th>
+                    <td>&nbsp;</td>
+                    <td align="right"><%=ip%></td>
+                </tr>
+                <tr>
+                    <th align="left">Snapshot Duration:</th>
+                    <td>&nbsp;</td>
+                          <%if (isOnline)
+                {%>
+                    <td align="right"><%=(Long)MRCConnection.getSnapshotDuration()/1000/60%> minutes</td>
+                     <%}
+                                else
+                                {
+                                    %>
+                                    <td align="right">Unknown</td>
+                                    <%} %>
+                </tr>             
+            </table>
+            </p>
             <table>
+            <thead><font size="+1">Live Statistics</font></thead>
             <%
             Integer counter = 0;
             for (Iterator <String> it = trackedBeansMap.keySet().iterator(); it.hasNext();)
@@ -185,8 +302,9 @@
                     <td bgcolor="#FFFFFF" nowrap>
                         &nbsp;<br />
                         <ul>
-                        <li><a href="#">Modify this server</a></li>
-                        <li><a href="#">Add a new server</a></li>
+                        <li><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showEditServer" /><portlet:param name="server_id" value="<%=server_id%>" /></portlet:actionURL>">Modify this server</a></li>
+                        <li><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="deleteServer" /><portlet:param name="server_id" value="<%=server_id%>" /></portlet:actionURL>">Delete this server</a></li>
+                        <li><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showAddServer" /></portlet:actionURL>">Add a new server</a></li>
                         </ul>
                         &nbsp;<br />
                     </td>   
@@ -254,7 +372,8 @@
         </td>        
     </tr>
 </table>
-<%}
+<%
+}
     else
     {%>
 <table>
@@ -285,7 +404,7 @@
                     <td bgcolor="#FFFFFF" nowrap>
                         &nbsp;<br />
                         <ul>
-                        <li><a href="#">Add a new server</a></li>
+                        <li><a href="<portlet:actionURL portletMode="edit"><portlet:param name="action" value="showAddServer" /></portlet:actionURL>">Add a new server</a></li>
                         </ul>
                         &nbsp;<br />
                     </td>   
@@ -295,7 +414,10 @@
         </td>  
     </tr>
 </table>
-    <%}%>
+    <%
+    rs.close();
+    }%>
+
 
 
 



Mime
View raw message