geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r289886 - in /geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console: ./ configmanager/ databasemanager/ derbylogmanager/ infomanager/ internaldb/ jmsmanager/ logmanager/ repository/ securitymanager/ servermanager...
Date Sun, 18 Sep 2005 04:33:43 GMT
Author: ammulder
Date: Sat Sep 17 21:33:28 2005
New Revision: 289886

URL: http://svn.apache.org/viewcvs?rev=289886&view=rev
Log:
Update the portlet inheritance tree to make the web server type check
  more widely available (for example, to web log portlet, in a different
  package tree than web server portlet).  GERONIMO-988  A slightly
  adjusted version of the patch posted to that issue.

Removed:
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/BaseWebPortlet.java
Modified:
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/BasePortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/AbstractConnectionFactoryManagerPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/derbylogmanager/DerbyLogViewerPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/infomanager/JavaSystemInfoPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/DBViewerPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/InternalDBPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/RunSQLPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSConnectionFactoryManagerPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSManagerPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/AbstractSecurityManagerPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/servermanager/ServerManagerPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/BasePortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/BasePortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/BasePortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/BasePortlet.java Sat Sep 17 21:33:28 2005
@@ -19,9 +19,13 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import javax.portlet.GenericPortlet;
+import javax.portlet.PortletRequest;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.management.geronimo.WebContainer;
+
 /**
  * Superclass with some generic functionality for console portlets
  *
@@ -29,6 +33,22 @@
  */
 public class BasePortlet extends GenericPortlet {
     private final static Log log = LogFactory.getLog(BasePortlet.class);
+    protected final static String WEB_SERVER_JETTY = "jetty";
+    protected final static String WEB_SERVER_TOMCAT = "tomcat";
+    protected final static String WEB_SERVER_GENERIC = "generic";
+
+    protected final static String getWebServerType(Class cls) {
+        Class[] intfs = cls.getInterfaces();
+        for (int i = 0; i < intfs.length; i++) {
+            Class intf = intfs[i];
+            if(intf.getName().indexOf("Jetty") > -1) {
+                return WEB_SERVER_JETTY;
+            } else if(intf.getName().indexOf("Tomcat") > -1) {
+                return WEB_SERVER_TOMCAT;
+            }
+        }
+        return WEB_SERVER_GENERIC;
+    }
 
     public final static void setProperty(Object target, String name, Object value) {
         boolean found = false;

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java Sat Sep 17 21:33:28 2005
@@ -27,7 +27,6 @@
 import javax.management.ObjectName;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
@@ -35,6 +34,7 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.util.ObjectNameConstants;
 import org.apache.geronimo.console.util.SecurityConstants;
 import org.apache.geronimo.kernel.Kernel;
@@ -48,7 +48,7 @@
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.management.State;
 
-public class ConfigManagerPortlet extends GenericPortlet {
+public class ConfigManagerPortlet extends BasePortlet {
 
     private static final String START_ACTION = "start";
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java Sat Sep 17 21:33:28 2005
@@ -26,7 +26,6 @@
 import javax.management.ObjectName;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
@@ -38,6 +37,7 @@
 import org.apache.commons.fileupload.disk.DiskFileItemFactory;
 import org.apache.commons.fileupload.portlet.PortletFileUpload;
 import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.util.ObjectNameConstants;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
@@ -45,7 +45,7 @@
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 
-public class DeploymentPortlet extends GenericPortlet {
+public class DeploymentPortlet extends BasePortlet {
     private final String LINE_SEP = System.getProperty("line.separator");
 
     private PortletRequestDispatcher deployView;

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/AbstractConnectionFactoryManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/AbstractConnectionFactoryManagerPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/AbstractConnectionFactoryManagerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/AbstractConnectionFactoryManagerPortlet.java Sat Sep 17 21:33:28 2005
@@ -30,7 +30,6 @@
 import javax.management.ObjectName;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletContext;
 import javax.portlet.PortletException;
@@ -39,13 +38,14 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.databasemanager.connectionmanager.ConnectionManagerRenderer;
 import org.apache.geronimo.console.databasemanager.generic.ConnectorRenderer;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
 
 public abstract class AbstractConnectionFactoryManagerPortlet extends
-        GenericPortlet {
+        BasePortlet {
 
     private final static DatabaseManagerHelper helper = new DatabaseManagerHelper();
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/derbylogmanager/DerbyLogViewerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/derbylogmanager/DerbyLogViewerPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/derbylogmanager/DerbyLogViewerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/derbylogmanager/DerbyLogViewerPortlet.java Sat Sep 17 21:33:28 2005
@@ -19,7 +19,6 @@
 
 import java.io.IOException;
 
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletContext;
 import javax.portlet.PortletException;
@@ -27,7 +26,9 @@
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 
-public class DerbyLogViewerPortlet extends GenericPortlet {
+import org.apache.geronimo.console.BasePortlet;
+
+public class DerbyLogViewerPortlet extends BasePortlet {
 
     protected PortletRequestDispatcher normalView;
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/infomanager/JavaSystemInfoPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/infomanager/JavaSystemInfoPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/infomanager/JavaSystemInfoPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/infomanager/JavaSystemInfoPortlet.java Sat Sep 17 21:33:28 2005
@@ -25,16 +25,17 @@
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
+
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.util.PortletManager;
 
-public class JavaSystemInfoPortlet extends GenericPortlet {
+public class JavaSystemInfoPortlet extends BasePortlet {
 
     private static final String NORMALVIEW_JSP = "/WEB-INF/view/infomanager/javaSysNormal.jsp";
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java Sat Sep 17 21:33:28 2005
@@ -24,7 +24,6 @@
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
@@ -32,6 +31,7 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.management.geronimo.JVM;
 
@@ -41,7 +41,7 @@
  *
  * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
  */
-public class ServerInfoPortlet extends GenericPortlet {
+public class ServerInfoPortlet extends BasePortlet {
     private static final String NORMALVIEW_JSP = "/WEB-INF/view/infomanager/svrInfoNormal.jsp";
 
     private static final String MAXIMIZEDVIEW_JSP = "/WEB-INF/view/infomanager/svrInfoMaximized.jsp";

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/DBViewerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/DBViewerPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/DBViewerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/DBViewerPortlet.java Sat Sep 17 21:33:28 2005
@@ -21,7 +21,6 @@
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
@@ -29,7 +28,9 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
-public class DBViewerPortlet extends GenericPortlet {
+import org.apache.geronimo.console.BasePortlet;
+
+public class DBViewerPortlet extends BasePortlet {
 
     private static final int RDBMS_DERBY = 1;
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/InternalDBPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/InternalDBPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/InternalDBPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/InternalDBPortlet.java Sat Sep 17 21:33:28 2005
@@ -23,7 +23,6 @@
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
@@ -31,7 +30,9 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
-public class InternalDBPortlet extends GenericPortlet {
+import org.apache.geronimo.console.BasePortlet;
+
+public class InternalDBPortlet extends BasePortlet {
 
     private static final String NORMALVIEW_JSP = "/WEB-INF/view/internaldb/internalDBNormal.jsp";
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/RunSQLPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/RunSQLPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/RunSQLPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/RunSQLPortlet.java Sat Sep 17 21:33:28 2005
@@ -22,7 +22,6 @@
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
@@ -30,7 +29,9 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
-public class RunSQLPortlet extends GenericPortlet {
+import org.apache.geronimo.console.BasePortlet;
+
+public class RunSQLPortlet extends BasePortlet {
 
     private static final String NORMALVIEW_JSP = "/WEB-INF/view/internaldb/runSQLNormal.jsp";
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSConnectionFactoryManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSConnectionFactoryManagerPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSConnectionFactoryManagerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSConnectionFactoryManagerPortlet.java Sat Sep 17 21:33:28 2005
@@ -33,7 +33,6 @@
 import javax.management.ObjectName;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletContext;
 import javax.portlet.PortletException;
@@ -42,6 +41,7 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.databasemanager.DataSourceInfo;
 import org.apache.geronimo.console.jmsmanager.activemqCF.ActiveMQConnectorHelper;
 import org.apache.geronimo.gbean.GAttributeInfo;
@@ -50,7 +50,7 @@
 import org.apache.geronimo.kernel.KernelRegistry;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 
-public class JMSConnectionFactoryManagerPortlet extends GenericPortlet {
+public class JMSConnectionFactoryManagerPortlet extends BasePortlet {
 
     private final static ActiveMQConnectorHelper helper = new ActiveMQConnectorHelper();
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSManagerPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSManagerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSManagerPortlet.java Sat Sep 17 21:33:28 2005
@@ -24,7 +24,6 @@
 import javax.jms.ConnectionFactory;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletContext;
 import javax.portlet.PortletException;
@@ -33,6 +32,7 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.jmsmanager.handlers.CreateDestinationHandler;
 import org.apache.geronimo.console.jmsmanager.handlers.PortletResponseHandler;
 import org.apache.geronimo.console.jmsmanager.handlers.RemoveDestinationHandler;
@@ -44,7 +44,7 @@
 import org.apache.geronimo.console.jmsmanager.renderers.ViewDestinationsRenderer;
 import org.apache.geronimo.console.jmsmanager.renderers.ViewMessagesRenderer;
 
-public class JMSManagerPortlet extends GenericPortlet {
+public class JMSManagerPortlet extends BasePortlet {
 
     private PortletRequestDispatcher edit;
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java Sat Sep 17 21:33:28 2005
@@ -21,7 +21,6 @@
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletContext;
 import javax.portlet.PortletException;
@@ -30,10 +29,11 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.system.logging.SystemLog;
 
-public class LogManagerPortlet extends GenericPortlet {
+public class LogManagerPortlet extends BasePortlet {
 
     protected PortletRequestDispatcher normalView;
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java Sat Sep 17 21:33:28 2005
@@ -21,7 +21,6 @@
 import java.io.Serializable;
 import java.io.File;
 
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletContext;
 import javax.portlet.PortletException;
@@ -31,10 +30,11 @@
 import javax.portlet.WindowState;
 import javax.portlet.PortletSession;
 
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.system.logging.SystemLog;
 
-public class LogViewerPortlet extends GenericPortlet {
+public class LogViewerPortlet extends BasePortlet {
     private final static String CRITERIA_KEY = "org.apache.geronimo.console.log.CRITERIA";
 
     protected PortletRequestDispatcher searchView;

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java Sat Sep 17 21:33:28 2005
@@ -20,18 +20,16 @@
 import java.io.IOException;
 import java.util.Calendar;
 
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.WindowState;
+import javax.portlet.*;
 
-public class WebAccessLogViewerPortlet extends GenericPortlet {
+import org.apache.geronimo.console.BasePortlet;
+import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.management.geronimo.WebContainer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class WebAccessLogViewerPortlet extends BasePortlet {
+    private final static Log log = LogFactory.getLog(WebAccessLogViewerPortlet.class);
 
     protected PortletRequestDispatcher searchView;
 
@@ -47,75 +45,100 @@
         if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
             return;
         }
-        String action = renderRequest.getParameter("action");
-        if ("refresh".equals(action)) {
-            WebAccessLogHelper.refresh();
-        }
 
-        String startDate = (String) renderRequest.getParameter("startDate");
-        String startMonth = (String) renderRequest.getParameter("startMonth");
-        String startYear = (String) renderRequest.getParameter("startYear");
-        String endDate = (String) renderRequest.getParameter("endDate");
-        String endMonth = (String) renderRequest.getParameter("endMonth");
-        String endYear = (String) renderRequest.getParameter("endYear");
-
-        Calendar cal1 = Calendar.getInstance(), cal2 = Calendar.getInstance();
-        // If no dates were passed we assume than no fields were passed and just
-        // filter on the current date.
-        if (startDate == null || startMonth == null || startDate == null
-                || endDate == null || endMonth == null || endDate == null) {
-            // just keep the month date and year
-            cal1.clear(Calendar.MILLISECOND);
-            cal1.clear(Calendar.MINUTE);
-            cal1.clear(Calendar.SECOND);
-            // Weird java bug. calling calendar.clear(Calendar.HOUR) does not
-            // clear the hour but this works.
-            cal1.clear(cal1.HOUR_OF_DAY);
-            cal1.clear(cal1.HOUR);
-
-            renderRequest.setAttribute("logs", WebAccessLogHelper
-                    .getLogsByDate(cal1.getTime()));
-            renderRequest.setAttribute("toDate", cal1.getTime());
-        } else {
-            int sdt = Integer.parseInt(startDate), smnth = Integer
-                    .parseInt(startMonth), syr = Integer.parseInt(startYear), edt = Integer
-                    .parseInt(endDate), emnth = Integer.parseInt(endMonth), eyr = Integer
-                    .parseInt(endYear);
-            boolean ignoreDates = renderRequest.getParameter("ignoreDates") == null;
-            String requestHost = (String) renderRequest
-                    .getParameter("requestHost");
-            String authUser = (String) renderRequest.getParameter("authUser");
-            String requestMethod = (String) renderRequest
-                    .getParameter("requestMethod");
-            String requestedURI = (String) renderRequest
-                    .getParameter("requestedURI");
-            if (ignoreDates) {
-                cal1.clear();
-                cal2.clear();
-                cal1.set(Calendar.DATE, sdt);
-                cal1.set(Calendar.MONTH, smnth);
-                cal1.set(Calendar.YEAR, syr);
-                cal2.set(Calendar.DATE, edt);
-                cal2.set(Calendar.MONTH, emnth);
-                cal2.set(Calendar.YEAR, eyr);
-                renderRequest.setAttribute("logs", WebAccessLogHelper
-                        .searchLogs(requestHost, authUser, requestMethod,
-                                requestedURI, cal1.getTime(), cal2.getTime()));
+        String server = getWebServerType(renderRequest);
+        if(server.equals(WEB_SERVER_JETTY)) {
+
+            String action = renderRequest.getParameter("action");
+            if ("refresh".equals(action)) {
+                WebAccessLogHelper.refresh();
+            }
+
+            String startDate = (String) renderRequest.getParameter("startDate");
+            String startMonth = (String) renderRequest.getParameter("startMonth");
+            String startYear = (String) renderRequest.getParameter("startYear");
+            String endDate = (String) renderRequest.getParameter("endDate");
+            String endMonth = (String) renderRequest.getParameter("endMonth");
+            String endYear = (String) renderRequest.getParameter("endYear");
+
+            Calendar cal1 = Calendar.getInstance(), cal2 = Calendar.getInstance();
+            // If no dates were passed we assume than no fields were passed and just
+            // filter on the current date.
+            if (startDate == null || startMonth == null || startYear == null
+                    || endDate == null || endMonth == null || endYear == null) {
+                // just keep the month date and year
+                cal1.clear(Calendar.MILLISECOND);
+                cal1.clear(Calendar.MINUTE);
+                cal1.clear(Calendar.SECOND);
+                // Weird java bug. calling calendar.clear(Calendar.HOUR) does not
+                // clear the hour but this works.
+                cal1.clear(Calendar.HOUR_OF_DAY);
+                cal1.clear(Calendar.HOUR);
+
+                renderRequest.setAttribute("logs", WebAccessLogHelper.getLogsByDate(cal1.getTime()));
+                renderRequest.setAttribute("toDate", cal1.getTime());
             } else {
-                renderRequest.setAttribute("logs", WebAccessLogHelper
-                        .searchLogs(requestHost, authUser, requestMethod,
-                                requestedURI));
+                int sdt = Integer.parseInt(startDate), 
+                    smnth = Integer.parseInt(startMonth), 
+                    syr = Integer.parseInt(startYear), 
+                    edt = Integer.parseInt(endDate), 
+                    emnth = Integer.parseInt(endMonth), 
+                    eyr = Integer.parseInt(endYear);
+                boolean ignoreDates = renderRequest.getParameter("ignoreDates") == null;
+                String requestHost = (String) renderRequest.getParameter("requestHost");
+                String authUser = (String) renderRequest.getParameter("authUser");
+                String requestMethod = (String) renderRequest.getParameter("requestMethod");
+                String requestedURI = (String) renderRequest.getParameter("requestedURI");
+                if (ignoreDates) {
+                    cal1.clear();
+                    cal2.clear();
+                    cal1.set(Calendar.DATE, sdt);
+                    cal1.set(Calendar.MONTH, smnth);
+                    cal1.set(Calendar.YEAR, syr);
+                    cal2.set(Calendar.DATE, edt);
+                    cal2.set(Calendar.MONTH, emnth);
+                    cal2.set(Calendar.YEAR, eyr);
+                    renderRequest.setAttribute("logs", WebAccessLogHelper
+                            .searchLogs(requestHost, authUser, requestMethod,
+                                    requestedURI, cal1.getTime(), cal2.getTime()));
+                } else {
+                    renderRequest.setAttribute("logs", WebAccessLogHelper
+                            .searchLogs(requestHost, authUser, requestMethod,
+                                    requestedURI));
+                }
+                renderRequest.setAttribute("toDate", cal2.getTime());
+                renderRequest.setAttribute("ignoreDates", new Boolean(ignoreDates));
+                renderRequest.setAttribute("requestHost", requestHost);
+                renderRequest.setAttribute("authUser", authUser);
+                renderRequest.setAttribute("requestMethod", requestMethod);
+                renderRequest.setAttribute("requestedURI", requestedURI);
+
             }
-            renderRequest.setAttribute("toDate", cal2.getTime());
-            renderRequest.setAttribute("ignoreDates", new Boolean(ignoreDates));
-            renderRequest.setAttribute("requestHost", requestHost);
-            renderRequest.setAttribute("authUser", authUser);
-            renderRequest.setAttribute("requestMethod", requestMethod);
-            renderRequest.setAttribute("requestedURI", requestedURI);
+            renderRequest.setAttribute("fromDate", cal1.getTime());
+            searchView.include(renderRequest, renderRespose);
+        } else if(server.equals(WEB_SERVER_TOMCAT)) {
+            log.warn("Web server logs not handled for Tomcat yet"); //todo -  Handle tomcat logs
+        } else {
+            log.warn("Web server logs not handled for server type "+server);
+        }
+    }
 
+    protected final static String getWebServerType(PortletRequest request) {
+        String[] names = PortletManager.getWebManagerNames(request);  //todo: handle multiple
+        if (names != null) {
+            String managerName = names[0];  //todo: handle multiple
+            String[] containers = PortletManager.getWebContainerNames(request, managerName);  //todo: handle multiple
+            if (containers != null) {
+                String containerName = containers[0];  //todo: handle multiple
+                WebContainer container = PortletManager.getWebContainer(request, containerName);
+                return getWebServerType(container.getClass());
+            } else {
+                log.error("No web containers for manager "+managerName);
+            }
+        } else {
+            log.error("No web managers present in server environment");
         }
-        renderRequest.setAttribute("fromDate", cal1.getTime());
-        searchView.include(renderRequest, renderRespose);
+        return WEB_SERVER_GENERIC;
     }
 
     public void init(PortletConfig portletConfig) throws PortletException {

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java Sat Sep 17 21:33:28 2005
@@ -30,7 +30,6 @@
 import javax.management.ObjectName;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletContext;
 import javax.portlet.PortletException;
@@ -39,6 +38,7 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.fileupload.FileUploadException;
 import org.apache.commons.fileupload.disk.DiskFileItemFactory;
@@ -46,7 +46,7 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
 
-public class RepositoryViewPortlet extends GenericPortlet {
+public class RepositoryViewPortlet extends BasePortlet {
 
     private static final String REPO_OBJ_NAME = "geronimo.server:name=Repository,J2EEServer=geronimo,J2EEApplication=null,j2eeType=GBean,J2EEModule=org/apache/geronimo/System";
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/AbstractSecurityManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/AbstractSecurityManagerPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/AbstractSecurityManagerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/AbstractSecurityManagerPortlet.java Sat Sep 17 21:33:28 2005
@@ -19,14 +19,15 @@
 
 import java.io.IOException;
 
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
-public abstract class AbstractSecurityManagerPortlet extends GenericPortlet {
+import org.apache.geronimo.console.BasePortlet;
+
+public abstract class AbstractSecurityManagerPortlet extends BasePortlet {
 
     protected PortletRequestDispatcher normalView;
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/servermanager/ServerManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/servermanager/ServerManagerPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/servermanager/ServerManagerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/servermanager/ServerManagerPortlet.java Sat Sep 17 21:33:28 2005
@@ -21,7 +21,6 @@
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
@@ -30,11 +29,12 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
 import org.apache.geronimo.system.main.Daemon;
 
-public class ServerManagerPortlet extends GenericPortlet {
+public class ServerManagerPortlet extends BasePortlet {
 
     private static final Log log = LogFactory.getLog("ServerManager");
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java Sat Sep 17 21:33:28 2005
@@ -103,6 +103,9 @@
             server = helper.getServers(getCurrentDomain(request))[0]; //todo: some day, select a server from the domain
             request.getPortletSession().setAttribute(SERVER_KEY, server, PortletSession.APPLICATION_SCOPE);
         }
+        else {
+            // to do     handle "should not occur" error   - message?
+        }
         return server;
     }
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java Sat Sep 17 21:33:28 2005
@@ -31,6 +31,7 @@
 import javax.portlet.PortletContext;
 import javax.management.ObjectName;
 import javax.management.MalformedObjectNameException;
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.management.geronimo.WebContainer;
 import org.apache.geronimo.management.geronimo.WebConnector;
@@ -46,7 +47,7 @@
  *
  * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
  */
-public class ConnectorPortlet extends BaseWebPortlet {
+public class ConnectorPortlet extends BasePortlet {
     private final static Log log = LogFactory.getLog(ConnectorPortlet.class);
 
     private PortletRequestDispatcher normalView;
@@ -61,165 +62,201 @@
     public void processAction(ActionRequest actionRequest,
             ActionResponse actionResponse) throws PortletException, IOException {
         String mode = actionRequest.getParameter("mode");
-        String managerName = PortletManager.getWebManagerNames(actionRequest)[0];  //todo: handle multiple
-        String containerName = PortletManager.getWebContainerNames(actionRequest, managerName)[0];  //todo: handle multiple
-        WebContainer container = PortletManager.getWebContainer(actionRequest, containerName);
-        String server = getServerType(container.getClass());
-        actionResponse.setRenderParameter("server", server);
-        if(mode.equals("new")) {
-            // User selected to add a new connector, need to show criteria portlet
-            actionResponse.setRenderParameter("mode", "new");
-            String protocol = actionRequest.getParameter("protocol");
-            actionResponse.setRenderParameter("protocol", protocol);
-        } else if(mode.equals("add")) { // User just submitted the form to add a new connector
-            // Get submitted values
-            //todo: lots of validation
-            String protocol = actionRequest.getParameter("protocol");
-            String host = actionRequest.getParameter("host");
-            int port = Integer.parseInt(actionRequest.getParameter("port"));
-            int maxThreads = Integer.parseInt(actionRequest.getParameter("maxThreads"));
-            Integer minThreads = getInteger(actionRequest, "minThreads");
-            String name = actionRequest.getParameter("name");
-            // Create and configure the connector
-            WebConnector connector = PortletManager.createWebConnector(actionRequest, managerName, containerName, name, protocol, host, port);
-            connector.setMaxThreads(maxThreads);
-            // todo: more configurable HTTP/Jetty values
-            if(server.equals(SERVER_JETTY)) {
-                if(minThreads != null) {
-                    setProperty(connector, "minThreads", minThreads);
-                }
-            }
-            if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
-                String keystoreType = actionRequest.getParameter("keystoreType");
-                String keystoreFile = actionRequest.getParameter("keystoreFile");
-                String privateKeyPass = actionRequest.getParameter("privateKeyPassword");
-                String keystorePass = actionRequest.getParameter("keystorePassword");
-                String secureProtocol = actionRequest.getParameter("secureProtocol");
-                String algorithm = actionRequest.getParameter("algorithm");
-                boolean clientAuth = isValid(actionRequest.getParameter("clientAuth"));
-                SecureConnector secure = (SecureConnector) connector;
-                if(isValid(keystoreType)) {secure.setKeystoreType(keystoreType);}
-                if(isValid(keystoreFile)) {secure.setKeystoreFileName(keystoreFile);}
-                if(isValid(keystorePass)) {secure.setKeystorePassword(keystorePass);}
-                if(isValid(secureProtocol)) {secure.setSecureProtocol(secureProtocol);}
-                if(isValid(algorithm)) {secure.setAlgorithm(algorithm);}
-                secure.setClientAuthRequired(clientAuth);
-                if(server.equals(SERVER_JETTY)) {
-                    if(isValid(privateKeyPass)) {setProperty(secure, "keyPassword", privateKeyPass);}
-                }
-            }
-            // Start the connector
-            try {
-                ((GeronimoManagedBean)connector).startRecursive();
-            } catch (Exception e) {
-                log.error("Unable to start connector", e); //todo: get into rendered page somehow?
-            }
-            actionResponse.setRenderParameter("mode", "list");
-        } else if(mode.equals("save")) { // User just submitted the form to update a connector
-            // Get submitted values
-            //todo: lots of validation
-            String host = actionRequest.getParameter("host");
-            int port = Integer.parseInt(actionRequest.getParameter("port"));
-            int maxThreads = Integer.parseInt(actionRequest.getParameter("maxThreads"));
-            Integer minThreads = getInteger(actionRequest, "minThreads");
-            String objectName = actionRequest.getParameter("objectName");
-            // Identify and update the connector
-            WebConnector connector = null;
-            WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
-            for (int i = 0; i < all.length; i++) {
-                WebConnector conn = all[i];
-                if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
-                    connector = conn;
-                    break;
-                }
-            }
-            if(connector != null) {
-                connector.setHost(host);
-                connector.setPort(port);
-                connector.setMaxThreads(maxThreads);
-                if(server.equals(SERVER_JETTY)) {
-                    if(minThreads != null) {
-                        setProperty(connector,"minThreads",minThreads);
+        String[] names = PortletManager.getWebManagerNames(actionRequest);  //todo: handle multiple
+        if (names != null) {
+            String managerName = names[0];  //todo: handle multiple
+            String[] containers = PortletManager.getWebContainerNames(actionRequest, managerName);  //todo: handle multiple
+            if (containers != null) {
+                String containerName = containers[0];  //todo: handle multiple
+                WebContainer container = PortletManager.getWebContainer(actionRequest, containerName);
+                String server = getWebServerType(container.getClass());
+                actionResponse.setRenderParameter("server", server);
+                if(mode.equals("new")) {
+                    // User selected to add a new connector, need to show criteria portlet
+                    actionResponse.setRenderParameter("mode", "new");
+                    String protocol = actionRequest.getParameter("protocol");
+                    actionResponse.setRenderParameter("protocol", protocol);
+                } else if(mode.equals("add")) { // User just submitted the form to add a new connector
+                    // Get submitted values
+                    //todo: lots of validation
+                    String protocol = actionRequest.getParameter("protocol");
+                    String host = actionRequest.getParameter("host");
+                    int port = Integer.parseInt(actionRequest.getParameter("port"));
+                    int maxThreads = Integer.parseInt(actionRequest.getParameter("maxThreads"));
+                    Integer minThreads = getInteger(actionRequest, "minThreads");
+                    String name = actionRequest.getParameter("name");
+                    // Create and configure the connector
+                    WebConnector connector = PortletManager.createWebConnector(actionRequest, managerName, containerName, name, protocol, host, port);
+                    connector.setMaxThreads(maxThreads);
+                    // todo: more configurable HTTP/Jetty values
+                    if(server.equals(WEB_SERVER_JETTY)) {
+                        if(minThreads != null) {
+                            setProperty(connector, "minThreads", minThreads);
+                        }
                     }
-                }
-                if(connector instanceof SecureConnector) {
-                    String keystoreType = actionRequest.getParameter("keystoreType");
-                    String keystoreFile = actionRequest.getParameter("keystoreFile");
-                    String privateKeyPass = actionRequest.getParameter("privateKeyPassword");
-                    String keystorePass = actionRequest.getParameter("keystorePassword");
-                    String secureProtocol = actionRequest.getParameter("secureProtocol");
-                    String algorithm = actionRequest.getParameter("algorithm");
-                    boolean clientAuth = isValid(actionRequest.getParameter("clientAuth"));
-                    SecureConnector secure = (SecureConnector) connector;
-                    if(isValid(keystoreType)) {secure.setKeystoreType(keystoreType);}
-                    if(isValid(keystoreFile)) {secure.setKeystoreFileName(keystoreFile);}
-                    if(isValid(keystorePass)) {secure.setKeystorePassword(keystorePass);}
-                    if(isValid(secureProtocol)) {secure.setSecureProtocol(secureProtocol);}
-                    if(isValid(algorithm)) {secure.setAlgorithm(algorithm);}
-                    secure.setClientAuthRequired(clientAuth);
-                    if(server.equals(SERVER_JETTY)) {
-                        if(isValid(privateKeyPass)) {setProperty(secure, "keyPassword", privateKeyPass);}
+                    else if (server.equals(WEB_SERVER_TOMCAT)) {
+                        //todo:   Any Tomcat specific processing?
                     }
-                }
-            }
-            actionResponse.setRenderParameter("mode", "list");
-        } else if(mode.equals("start")) {
-            String objectName = actionRequest.getParameter("name");
-            // work with the current connector to start it.
-            WebConnector connector = null;
-            WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
-            for (int i = 0; i < all.length; i++) {
-                WebConnector conn = all[i];
-                if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
-                    connector = conn;
-                    break;
-                }
-            }
-            if(connector != null) {
-                try {
-                    ((GeronimoManagedBean)connector).startRecursive();
-                } catch (Exception e) {
-                    log.error("Unable to start connector", e); //todo: get into rendered page somehow?
-                }
-            }
-            else {
-                log.error("Incorrect connector reference"); //Replace this with correct error processing
-            }
-            actionResponse.setRenderParameter("name", objectName);
-            actionResponse.setRenderParameter("mode", "list");
-        } else if(mode.equals("stop")) {
-            String objectName = actionRequest.getParameter("name");
-            // work with the current connector to stop it.
-            WebConnector connector = null;
-            WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
-            for (int i = 0; i < all.length; i++) {
-                WebConnector conn = all[i];
-                if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
-                    connector = conn;
-                    break;
-                }
-            }
-            if(connector != null) {
-                try {
-                    ((GeronimoManagedBean)connector).stop();
-                } catch (Exception e) {
-                    log.error("Unable to stop connector", e); //todo: get into rendered page somehow?
+                    else {
+                        //todo:   Handle "should not occur" condition
+                    }
+                    if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
+                        String keystoreType = actionRequest.getParameter("keystoreType");
+                        String keystoreFile = actionRequest.getParameter("keystoreFile");
+                        String privateKeyPass = actionRequest.getParameter("privateKeyPassword");
+                        String keystorePass = actionRequest.getParameter("keystorePassword");
+                        String secureProtocol = actionRequest.getParameter("secureProtocol");
+                        String algorithm = actionRequest.getParameter("algorithm");
+                        boolean clientAuth = isValid(actionRequest.getParameter("clientAuth"));
+                        SecureConnector secure = (SecureConnector) connector;
+                        if(isValid(keystoreType)) {secure.setKeystoreType(keystoreType);}
+                        if(isValid(keystoreFile)) {secure.setKeystoreFileName(keystoreFile);}
+                        if(isValid(keystorePass)) {secure.setKeystorePassword(keystorePass);}
+                        if(isValid(secureProtocol)) {secure.setSecureProtocol(secureProtocol);}
+                        if(isValid(algorithm)) {secure.setAlgorithm(algorithm);}
+                        secure.setClientAuthRequired(clientAuth);
+                        if(server.equals(WEB_SERVER_JETTY)) {
+                            if(isValid(privateKeyPass)) {setProperty(secure, "keyPassword", privateKeyPass);}
+                        }
+                        else if (server.equals(WEB_SERVER_TOMCAT)) {
+                            //todo:   Any Tomcat specific processing?
+                        }
+                        else {
+                            //todo:   Handle "should not occur" condition
+                        }
+                    }
+                    // Start the connector
+                    try {
+                        ((GeronimoManagedBean)connector).startRecursive();
+                    } catch (Exception e) {
+                        log.error("Unable to start connector", e); //todo: get into rendered page somehow?
+                    }
+                    actionResponse.setRenderParameter("mode", "list");
+                } else if(mode.equals("save")) { // User just submitted the form to update a connector
+                    // Get submitted values
+                    //todo: lots of validation
+                    String host = actionRequest.getParameter("host");
+                    int port = Integer.parseInt(actionRequest.getParameter("port"));
+                    int maxThreads = Integer.parseInt(actionRequest.getParameter("maxThreads"));
+                    Integer minThreads = getInteger(actionRequest, "minThreads");
+                    String objectName = actionRequest.getParameter("objectName");
+                    // Identify and update the connector
+                    WebConnector connector = null;
+                    WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
+                    for (int i = 0; i < all.length; i++) {
+                        WebConnector conn = all[i];
+                        if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
+                            connector = conn;
+                            break;
+                        }
+                    }
+                    if(connector != null) {
+                        connector.setHost(host);
+                        connector.setPort(port);
+                        connector.setMaxThreads(maxThreads);
+                        if(server.equals(WEB_SERVER_JETTY)) {
+                            if(minThreads != null) {
+                                setProperty(connector,"minThreads",minThreads);
+                            }
+                            else if (server.equals(WEB_SERVER_TOMCAT)) {
+                                //todo:   Any Tomcat specific processing?
+                            }
+                            else {
+                                //todo:   Handle "should not occur" condition
+                            }
+                        }
+                        if(connector instanceof SecureConnector) {
+                            String keystoreType = actionRequest.getParameter("keystoreType");
+                            String keystoreFile = actionRequest.getParameter("keystoreFile");
+                            String privateKeyPass = actionRequest.getParameter("privateKeyPassword");
+                            String keystorePass = actionRequest.getParameter("keystorePassword");
+                            String secureProtocol = actionRequest.getParameter("secureProtocol");
+                            String algorithm = actionRequest.getParameter("algorithm");
+                            boolean clientAuth = isValid(actionRequest.getParameter("clientAuth"));
+                            SecureConnector secure = (SecureConnector) connector;
+                            if(isValid(keystoreType)) {secure.setKeystoreType(keystoreType);}
+                            if(isValid(keystoreFile)) {secure.setKeystoreFileName(keystoreFile);}
+                            if(isValid(keystorePass)) {secure.setKeystorePassword(keystorePass);}
+                            if(isValid(secureProtocol)) {secure.setSecureProtocol(secureProtocol);}
+                            if(isValid(algorithm)) {secure.setAlgorithm(algorithm);}
+                            secure.setClientAuthRequired(clientAuth);
+                            if(server.equals(WEB_SERVER_JETTY)) {
+                                if(isValid(privateKeyPass)) {setProperty(secure, "keyPassword", privateKeyPass);}
+                            }
+                            else if (server.equals(WEB_SERVER_TOMCAT)) {
+                                //todo:   Any Tomcat specific processing?
+                            }
+                            else {
+                                //todo:   Handle "should not occur" condition
+                            }
+                        }
+                    }
+                    actionResponse.setRenderParameter("mode", "list");
+                } else if(mode.equals("start")) {
+                    String objectName = actionRequest.getParameter("name");
+                    // work with the current connector to start it.
+                    WebConnector connector = null;
+                    WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
+                    for (int i = 0; i < all.length; i++) {
+                        WebConnector conn = all[i];
+                        if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
+                            connector = conn;
+                            break;
+                        }
+                    }
+                    if(connector != null) {
+                        try {
+                            ((GeronimoManagedBean)connector).startRecursive();
+                        } catch (Exception e) {
+                            log.error("Unable to start connector", e); //todo: get into rendered page somehow?
+                        }
+                    }
+                    else {
+                        log.error("Incorrect connector reference"); //Replace this with correct error processing
+                    }
+                    actionResponse.setRenderParameter("name", objectName);
+                    actionResponse.setRenderParameter("mode", "list");
+                } else if(mode.equals("stop")) {
+                    String objectName = actionRequest.getParameter("name");
+                    // work with the current connector to stop it.
+                    WebConnector connector = null;
+                    WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
+                    for (int i = 0; i < all.length; i++) {
+                        WebConnector conn = all[i];
+                        if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
+                            connector = conn;
+                            break;
+                        }
+                    }
+                    if(connector != null) {
+                        try {
+                            ((GeronimoManagedBean)connector).stop();
+                        } catch (Exception e) {
+                            log.error("Unable to stop connector", e); //todo: get into rendered page somehow?
+                        }
+                    }
+                    else {
+                        log.error("Incorrect connector reference"); //Replace this with correct error processing
+                    }
+                    actionResponse.setRenderParameter("name", objectName);
+                    actionResponse.setRenderParameter("mode", "list");
+                } else if(mode.equals("edit")) {
+                    String objectName = actionRequest.getParameter("name");
+                    actionResponse.setRenderParameter("objectName", objectName);
+                    actionResponse.setRenderParameter("mode", "edit");
+
+                } else if(mode.equals("delete")) { // User chose to delete a connector
+                    String objectName = actionRequest.getParameter("name");
+                    PortletManager.getWebManager(actionRequest, managerName).removeConnector(objectName);
+                    actionResponse.setRenderParameter("mode", "list");
                 }
             }
             else {
-                log.error("Incorrect connector reference"); //Replace this with correct error processing
+                // todo - Handle "should not occur" error (message?)
             }
-            actionResponse.setRenderParameter("name", objectName);
-            actionResponse.setRenderParameter("mode", "list");
-        } else if(mode.equals("edit")) {
-            String objectName = actionRequest.getParameter("name");
-            actionResponse.setRenderParameter("objectName", objectName);
-            actionResponse.setRenderParameter("mode", "edit");
-
-        } else if(mode.equals("delete")) { // User chose to delete a connector
-            String objectName = actionRequest.getParameter("name");
-            PortletManager.getWebManager(actionRequest, managerName).removeConnector(objectName);
-            actionResponse.setRenderParameter("mode", "list");
+        }                   
+        else {
+            // todo - Handle "should not occur" error (message?)
         }
     }
 
@@ -240,71 +277,97 @@
         if(mode == null || mode.equals("")) {
             mode = "list";
         }
-        String managerName = PortletManager.getWebManagerNames(renderRequest)[0];  //todo: handle multiple
-        String containerName = PortletManager.getWebContainerNames(renderRequest, managerName)[0];  //todo: handle multiple
-        WebContainer container = PortletManager.getWebContainer(renderRequest, containerName);
-        String server = getServerType(container.getClass());
-        renderRequest.setAttribute("server", server);
-
-        if(mode.equals("new")) {
-            String protocol = renderRequest.getParameter("protocol");
-            renderRequest.setAttribute("maxThreads", "50");
-            if(server.equals(SERVER_JETTY)) {
-                renderRequest.setAttribute("minThreads", "10");
-            }
-            renderRequest.setAttribute("protocol", protocol);
-            renderRequest.setAttribute("mode", "add");
-            if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
-                editHttpsView.include(renderRequest, renderResponse);
-            } else {
-                editHttpView.include(renderRequest, renderResponse);
-            }
-
-        } else if(mode.equals("edit")) {
-            String objectName = renderRequest.getParameter("objectName");
-            WebConnector connector = null;
-            WebConnector all[] = PortletManager.getWebConnectors(renderRequest, managerName);
-            for (int i = 0; i < all.length; i++) {
-                WebConnector conn = all[i];
-                if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
-                    connector = conn;
-                    break;
-                }
-            }
-            if(connector == null) {
-                doList(renderRequest, managerName, renderResponse);
-            } else {
-                renderRequest.setAttribute("objectName", objectName);
-                renderRequest.setAttribute("port", new Integer(connector.getPort()));
-                renderRequest.setAttribute("host", connector.getHost());
-                int maxThreads = connector.getMaxThreads();
-                renderRequest.setAttribute("maxThreads", Integer.toString(maxThreads));
-                if(server.equals(SERVER_JETTY)) {
-                    int minThreads = ((Number)getProperty(connector, "minThreads")).intValue();
-                    renderRequest.setAttribute("minThreads", String.valueOf(minThreads));
-                }
-                renderRequest.setAttribute("mode", "save");
 
-                if(connector instanceof SecureConnector) {
-                    SecureConnector secure = (SecureConnector) connector;
-                    renderRequest.setAttribute("keystoreFile",secure.getKeystoreFileName());
-                    renderRequest.setAttribute("keystoreType",secure.getKeystoreType());
-                    renderRequest.setAttribute("algorithm",secure.getAlgorithm());
-                    renderRequest.setAttribute("secureProtocol",secure.getSecureProtocol());
-                    if(secure.isClientAuthRequired()) {
-                        renderRequest.setAttribute("clientAuth", Boolean.TRUE);
+        String[] names = PortletManager.getWebManagerNames(renderRequest);  //todo: handle multiple
+        if (names != null) {
+            String managerName = names[0];  //todo: handle multiple
+            String[] containers = PortletManager.getWebContainerNames(renderRequest, managerName);  //todo: handle multiple
+            if (containers != null) {
+                String containerName = containers[0];  //todo: handle multiple
+                WebContainer container = PortletManager.getWebContainer(renderRequest, containerName);
+                String server = getWebServerType(container.getClass());
+                renderRequest.setAttribute("server", server);
+
+                if(mode.equals("new")) {
+                    String protocol = renderRequest.getParameter("protocol");
+                    renderRequest.setAttribute("maxThreads", "50");
+                    if(server.equals(WEB_SERVER_JETTY)) {
+                        renderRequest.setAttribute("minThreads", "10");
+                    }
+                    else if (server.equals(WEB_SERVER_TOMCAT)) {
+                        //todo:   Any Tomcat specific processing?
+                    }
+                    else {
+                        //todo:   Handle "should not occur" condition
+                    }
+                    renderRequest.setAttribute("protocol", protocol);
+                    renderRequest.setAttribute("mode", "add");
+                    if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
+                        editHttpsView.include(renderRequest, renderResponse);
+                    } else {
+                        editHttpView.include(renderRequest, renderResponse);
                     }
-                }
 
-                if(connector.getProtocol().equals(WebManager.PROTOCOL_HTTPS)) {
-                    editHttpsView.include(renderRequest, renderResponse);
-                } else {
-                    editHttpView.include(renderRequest, renderResponse);
+                } else if(mode.equals("edit")) {
+                    String objectName = renderRequest.getParameter("objectName");
+                    WebConnector connector = null;
+                    WebConnector all[] = PortletManager.getWebConnectors(renderRequest, managerName);
+                    for (int i = 0; i < all.length; i++) {
+                        WebConnector conn = all[i];
+                        if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
+                            connector = conn;
+                            break;
+                        }
+                    }
+                    if(connector == null) {
+                        doList(renderRequest, managerName, renderResponse);
+                    } else {
+                        renderRequest.setAttribute("objectName", objectName);
+                        renderRequest.setAttribute("port", new Integer(connector.getPort()));
+                        renderRequest.setAttribute("host", connector.getHost());
+                        int maxThreads = connector.getMaxThreads();
+                        renderRequest.setAttribute("maxThreads", Integer.toString(maxThreads));
+                        if(server.equals(WEB_SERVER_JETTY)) {
+                            int minThreads = ((Number)getProperty(connector, "minThreads")).intValue();
+                            renderRequest.setAttribute("minThreads", String.valueOf(minThreads));
+                        }
+                        else if (server.equals(WEB_SERVER_TOMCAT)) {
+                            //todo:   Any Tomcat specific processing?
+                        }
+                        else {
+                            //todo:   Handle "should not occur" condition
+                        }
+                        renderRequest.setAttribute("mode", "save");
+
+                        if(connector instanceof SecureConnector) {
+                            SecureConnector secure = (SecureConnector) connector;
+                            renderRequest.setAttribute("keystoreFile",secure.getKeystoreFileName());
+                            renderRequest.setAttribute("keystoreType",secure.getKeystoreType());
+                            renderRequest.setAttribute("algorithm",secure.getAlgorithm());
+                            renderRequest.setAttribute("secureProtocol",secure.getSecureProtocol());
+                            if(secure.isClientAuthRequired()) {
+                                renderRequest.setAttribute("clientAuth", Boolean.TRUE);
+                            }
+                        }
+
+                        if(connector.getProtocol().equals(WebManager.PROTOCOL_HTTPS)) {
+                            editHttpsView.include(renderRequest, renderResponse);
+                        } else {
+                            editHttpView.include(renderRequest, renderResponse);
+                        }
+                    }
+                } else if(mode.equals("list")) {
+                    doList(renderRequest, managerName, renderResponse);
                 }
             }
-        } else if(mode.equals("list")) {
-            doList(renderRequest, managerName, renderResponse);
+            else {
+                // todo  - Handle "should not occur" error  - message?
+            }
+        }                   
+        else {
+            // todo - Handle "should not occur" error (message?)
         }
+
     }
 
     private void doList(RenderRequest renderRequest, String managerName, RenderResponse renderResponse) throws PortletException, IOException {

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java?rev=289886&r1=289885&r2=289886&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java Sat Sep 17 21:33:28 2005
@@ -28,6 +28,7 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
+import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.management.geronimo.WebContainer;
 
@@ -36,7 +37,7 @@
  *
  * @version $Rev: 46228 $ $Date: 2004-09-16 21:21:04 -0400 (Thu, 16 Sep 2004) $
  */
-public class WebManagerPortlet extends BaseWebPortlet {
+public class WebManagerPortlet extends BasePortlet {
     private PortletRequestDispatcher normalView;
 
     private PortletRequestDispatcher maximizedView;
@@ -46,22 +47,46 @@
     public void processAction(ActionRequest actionRequest,
             ActionResponse actionResponse) throws PortletException, IOException {
         try {
-            String managerName = PortletManager.getWebManagerNames(actionRequest)[0];  //todo: handle multiple
-            String containerName = PortletManager.getWebContainerNames(actionRequest, managerName)[0];  //todo: handle multiple
-            WebContainer container = PortletManager.getWebContainer(actionRequest, containerName);
-            String server = getServerType(container.getClass());
-            String action = actionRequest.getParameter("stats");
-            if (action != null) {
-                boolean stats = action.equals("true");
-                if(server.equals(SERVER_JETTY)) {
-                    setProperty(container, "collectStatistics", stats ? Boolean.TRUE : Boolean.FALSE);
+            String[] names = PortletManager.getWebManagerNames(actionRequest);  //todo: handle multiple
+            if (names != null) {
+                String managerName = names[0];  //todo: handle multiple
+                String[] containers = PortletManager.getWebContainerNames(actionRequest, managerName);  //todo: handle multiple
+                if (containers != null) {
+                    String containerName = containers[0];  //todo: handle multiple
+                    WebContainer container = PortletManager.getWebContainer(actionRequest, containerName);
+                    String server = getWebServerType(container.getClass());
+                    String action = actionRequest.getParameter("stats");
+                    if (action != null) {
+                        boolean stats = action.equals("true");
+                        if(server.equals(WEB_SERVER_JETTY)) {
+                            setProperty(container, "collectStatistics", stats ? Boolean.TRUE : Boolean.FALSE);
+                        }
+                        else if (server.equals(WEB_SERVER_TOMCAT)) {
+                            //todo:   Any Tomcat specific processing?
+                        }
+                        else {
+                            //todo:   Handle "should not occur" condition
+                        }
+                    }
+                    if (actionRequest.getParameter("resetStats") != null) {
+                        if(server.equals(WEB_SERVER_JETTY)) {
+                            callOperation(container, "resetStatistics", null);
+                        }
+                        else if (server.equals(WEB_SERVER_TOMCAT)) {
+                            //todo:   Any Tomcat specific processing?
+                        }
+                        else {
+                            //todo:   Handle "should not occur" condition
+                        }
+                    }
                 }
-            }
-            if (actionRequest.getParameter("resetStats") != null) {
-                if(server.equals(SERVER_JETTY)) {
-                    callOperation(container, "resetStatistics", null);
+                else {
+                    // todo  - Handle "should not occur" error  - message?
                 }
             }
+            else {
+                // todo  - Handle "should not occur" error  - message?
+            }
         } catch (Exception e) {
             throw new PortletException(e);
         }
@@ -73,18 +98,33 @@
             return;
         }
         try {
-            String managerName = PortletManager.getWebManagerNames(renderRequest)[0];  //todo: handle multiple
-            String containerName = PortletManager.getWebContainerNames(renderRequest, managerName)[0];  //todo: handle multiple
-            WebContainer container = PortletManager.getWebContainer(renderRequest, containerName);
-            String server = getServerType(container.getClass());
-            StatisticsHelper helper = null;
-            if(server.equals(SERVER_JETTY)) {
-                helper = new JettyStatisticsHelper();
-            } else if(server.equals(SERVER_TOMCAT)) {
-                //todo
+            String[] names = PortletManager.getWebManagerNames(renderRequest);  //todo: handle multiple
+            if (names != null) {
+                String managerName = names[0];  //todo: handle multiple
+                String[] containers = PortletManager.getWebContainerNames(renderRequest, managerName);  //todo: handle multiple
+                if (containers != null) {
+                    String containerName = containers[0];  //todo: handle multiple
+                    WebContainer container = PortletManager.getWebContainer(renderRequest, containerName);
+                    String server = getWebServerType(container.getClass());
+                    StatisticsHelper helper = null;
+                    if(server.equals(WEB_SERVER_JETTY)) {
+                        helper = new JettyStatisticsHelper();
+                    } else if(server.equals(WEB_SERVER_TOMCAT)) {
+                        //todo     - Handle Tomcat logs
+                    }
+                    else {
+                        // todo   - Log error, unknown server
+                    }
+                    if(helper != null) {
+                        helper.gatherStatistics(container, renderRequest);
+                    }
+                }
+                else {
+                    // todo  - Handle "should not occur" error  - message?
+                }
             }
-            if(helper != null) {
-                helper.gatherStatistics(container, renderRequest);
+            else {
+                // todo  - Handle "should not occur" error  - message?
             }
         } catch (Exception e) {
             throw new PortletException(e);



Mime
View raw message