geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r561149 [1/2] - in /geronimo/server/trunk: applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/ applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/ applications...
Date Mon, 30 Jul 2007 22:10:33 GMT
Author: pmcmahan
Date: Mon Jul 30 15:10:32 2007
New Revision: 561149

URL: http://svn.apache.org/viewvc?view=rev&rev=561149
Log:
GERONIMO-3350 updates to web connector portlet for recent api WebManager api changes.  This work
is not complete yet but should allow others to work on the tomcat and jetty connectors with some
UI support.  Creating and editing secure connectors in particular is still very fragile.
The basic UI with some input validation seems to work OK.  Had to comment out some of the
connector attributes for the jetty connectors because the kernel thinks that they are not persistent
attributes when it tries to create a new connector, even though the gbean info looks to me like they
should be, needs more investigation.

Added:
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editConnector.jsp
Modified:
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/BasePortlet.java
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/PortletManager.java
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/normal.jsp
    geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyManagerImpl.java
    geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/WebManager.java
    geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/BasePortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/BasePortlet.java?view=diff&rev=561149&r1=561148&r2=561149
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/BasePortlet.java (original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/BasePortlet.java Mon Jul 30 15:10:32 2007
@@ -76,10 +76,13 @@
     public final static Object getProperty(Object target, String name) {
         Class cls = target.getClass();
         String getter = "get"+Character.toUpperCase(name.charAt(0))+name.substring(1);
+        String booleanGetter = "is"+Character.toUpperCase(name.charAt(0))+name.substring(1);
         Method[] list = cls.getMethods();
         for (int i = 0; i < list.length; i++) {
             Method method = list[i];
-            if(method.getName().equals(getter) && method.getParameterTypes().length == 0 && Modifier.isPublic(method.getModifiers()) &&
+            String methodName = method.getName();
+            if( (methodName.equals(getter) || methodName.equals(booleanGetter))
+                && method.getParameterTypes().length == 0 && Modifier.isPublic(method.getModifiers()) &&
                     !Modifier.isStatic(method.getModifiers())) {
                 try {
                     return method.invoke(target, new Object[0]);

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/PortletManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/PortletManager.java?view=diff&rev=561149&r1=561148&r2=561149
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/PortletManager.java (original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/PortletManager.java Mon Jul 30 15:10:32 2007
@@ -55,6 +55,7 @@
 import org.apache.geronimo.management.geronimo.JMSConnector;
 import org.apache.geronimo.management.geronimo.JMSManager;
 import org.apache.geronimo.management.geronimo.JVM;
+import org.apache.geronimo.management.geronimo.NetworkConnector;
 import org.apache.geronimo.management.geronimo.ResourceAdapter;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 import org.apache.geronimo.management.geronimo.WebAccessLog;
@@ -254,27 +255,27 @@
         return manager.addConnector((WebContainer) helper.getObject(containerName), name, protocol, host, port);
     }
 
-    public static WebConnector[] getWebConnectors(PortletRequest request, AbstractName managerName) {
+    public static NetworkConnector[] getNetworkConnectors(PortletRequest request, AbstractName managerName) {
         ManagementHelper helper = getManagementHelper(request);
         WebManager manager = (WebManager) helper.getObject(managerName);
-        return (WebConnector[]) manager.getConnectors();
+        return manager.getConnectors();
     }
 
-    public static WebConnector[] getWebConnectors(PortletRequest request, AbstractName managerName, String protocol) {
+    public static NetworkConnector[] getNetworkConnectors(PortletRequest request, AbstractName managerName, String protocol) {
         ManagementHelper helper = getManagementHelper(request);
         WebManager manager = (WebManager) helper.getObject(managerName);
-        return (WebConnector[]) manager.getConnectors(protocol);
+        return manager.getConnectors(protocol);
     }
 
-    public static WebConnector getWebConnector(PortletRequest request, AbstractName connectorName) {
+    public static NetworkConnector getNetworkConnector(PortletRequest request, AbstractName connectorName) {
         ManagementHelper helper = getManagementHelper(request);
-        return (WebConnector) helper.getObject(connectorName);
+        return (NetworkConnector) helper.getObject(connectorName);
     }
 
-    public static WebConnector[] getWebConnectorsForContainer(PortletRequest request, AbstractName managerName, AbstractName containerName, String protocol) {
+    public static NetworkConnector[] getNetworkConnectorsForContainer(PortletRequest request, AbstractName managerName, AbstractName containerName, String protocol) {
         ManagementHelper helper = getManagementHelper(request);
         WebManager manager = (WebManager) helper.getObject(managerName);
-        return (WebConnector[]) manager.getConnectorsForContainer(containerName, protocol);
+        return manager.getConnectorsForContainer(containerName, protocol);
     }
 
     public static JMSBroker getJMSBroker(PortletRequest request, AbstractName brokerName) {

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java?view=diff&rev=561149&r1=561148&r2=561149
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java (original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java Mon Jul 30 15:10:32 2007
@@ -23,15 +23,18 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletContext;
 import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
 import javax.portlet.PortletRequestDispatcher;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.console.BasePortlet;
@@ -42,10 +45,12 @@
 import org.apache.geronimo.management.geronimo.KeystoreException;
 import org.apache.geronimo.management.geronimo.KeystoreInstance;
 import org.apache.geronimo.management.geronimo.KeystoreManager;
+import org.apache.geronimo.management.geronimo.NetworkConnector;
 import org.apache.geronimo.management.geronimo.SecureConnector;
-import org.apache.geronimo.management.geronimo.WebConnector;
 import org.apache.geronimo.management.geronimo.WebContainer;
 import org.apache.geronimo.management.geronimo.WebManager;
+import org.apache.geronimo.management.geronimo.WebManager.ConnectorAttribute;
+import org.apache.geronimo.management.geronimo.WebManager.ConnectorType;
 
 /**
  * A portlet that lets you list, add, remove, start, stop, and edit web
@@ -55,241 +60,156 @@
  */
 public class ConnectorPortlet extends BasePortlet {
     private final static Log log = LogFactory.getLog(ConnectorPortlet.class);
+    
+    public static final String PARM_CONTAINER_URI = "containerURI";
+    public static final String PARM_CONNECTOR_URI = "connectorURI";
+    public static final String PARM_MANAGER_URI = "managerURI";
+    public static final String PARM_MODE = "mode";
+    public static final String PARM_CONNECTOR_TYPE = "connectorType";
+    public static final String PARM_CONNECTOR_ATTRIBUTES = "connectorAttributes";
+    public static final String PARM_DISPLAY_NAME = "displayName";
+    public static final String PARM_SERVER = "server";
 
     private PortletRequestDispatcher normalView;
-
     private PortletRequestDispatcher maximizedView;
-
     private PortletRequestDispatcher helpView;
+    private PortletRequestDispatcher editConnectorView;
 
-    protected PortletRequestDispatcher editHttpView;
-    protected PortletRequestDispatcher editHttpsView;
-    
-    private final static HashMap<String, Object> TOMCAT_DEFAULTS;
-    static {
-        TOMCAT_DEFAULTS = new HashMap<String, Object>();
-        TOMCAT_DEFAULTS.put("allowTrace", Boolean.FALSE);
-        TOMCAT_DEFAULTS.put("emptySessionPath", Boolean.FALSE);
-        TOMCAT_DEFAULTS.put("enableLookups", Boolean.TRUE);
-        TOMCAT_DEFAULTS.put("maxPostSize", 2097152);
-        TOMCAT_DEFAULTS.put("maxSavePostSize", 4096);
-        TOMCAT_DEFAULTS.put("useBodyEncodingForURI", Boolean.FALSE);
-        TOMCAT_DEFAULTS.put("useIPVHosts", Boolean.FALSE);
-        TOMCAT_DEFAULTS.put("xpoweredBy", Boolean.FALSE);
-        TOMCAT_DEFAULTS.put("acceptCount", 10);
-        TOMCAT_DEFAULTS.put("bufferSize", 2048);
-        TOMCAT_DEFAULTS.put("compressableMimeType", "text/html,text/xml,text/plain");
-        TOMCAT_DEFAULTS.put("compression", "off");
-        TOMCAT_DEFAULTS.put("connectionLinger", -1);
-        TOMCAT_DEFAULTS.put("connectionTimeout", 60000);
-        TOMCAT_DEFAULTS.put("disableUploadTimeout", true);
-        TOMCAT_DEFAULTS.put("maxHttpHeaderSize", 4096);
-        TOMCAT_DEFAULTS.put("maxKeepAliveRequests", 100);
-        TOMCAT_DEFAULTS.put("maxSpareThreads", 50);
-        TOMCAT_DEFAULTS.put("minSpareThreads", 4);
-        TOMCAT_DEFAULTS.put("noCompressionUserAgents", "");
-        TOMCAT_DEFAULTS.put("restrictedUserAgents", "");
-        TOMCAT_DEFAULTS.put("socketBuffer", 9000);
-        TOMCAT_DEFAULTS.put("strategy", "lf");
-        TOMCAT_DEFAULTS.put("tcpNoDelay", true);
-        TOMCAT_DEFAULTS.put("threadPriority", Thread.NORM_PRIORITY);
-    }
+    // TODO: move these attributes to the ConnectorAttribute for tomcat's WebManager
+//    private final static HashMap<String, Object> TOMCAT_DEFAULTS;
+//    static {
+//        TOMCAT_DEFAULTS = new HashMap<String, Object>();
+//        TOMCAT_DEFAULTS.put("allowTrace", Boolean.FALSE);
+//        TOMCAT_DEFAULTS.put("emptySessionPath", Boolean.FALSE);
+//        TOMCAT_DEFAULTS.put("enableLookups", Boolean.TRUE);
+//        TOMCAT_DEFAULTS.put("maxPostSize", 2097152);
+//        TOMCAT_DEFAULTS.put("maxSavePostSize", 4096);
+//        TOMCAT_DEFAULTS.put("useBodyEncodingForURI", Boolean.FALSE);
+//        TOMCAT_DEFAULTS.put("useIPVHosts", Boolean.FALSE);
+//        TOMCAT_DEFAULTS.put("xpoweredBy", Boolean.FALSE);
+//        TOMCAT_DEFAULTS.put("acceptCount", 10);
+//        TOMCAT_DEFAULTS.put("bufferSize", 2048);
+//        TOMCAT_DEFAULTS.put("compressableMimeType", "text/html,text/xml,text/plain");
+//        TOMCAT_DEFAULTS.put("compression", "off");
+//        TOMCAT_DEFAULTS.put("connectionLinger", -1);
+//        TOMCAT_DEFAULTS.put("connectionTimeout", 60000);
+//        TOMCAT_DEFAULTS.put("disableUploadTimeout", true);
+//        TOMCAT_DEFAULTS.put("maxHttpHeaderSize", 4096);
+//        TOMCAT_DEFAULTS.put("maxKeepAliveRequests", 100);
+//        TOMCAT_DEFAULTS.put("maxSpareThreads", 50);
+//        TOMCAT_DEFAULTS.put("minSpareThreads", 4);
+//        TOMCAT_DEFAULTS.put("noCompressionUserAgents", "");
+//        TOMCAT_DEFAULTS.put("restrictedUserAgents", "");
+//        TOMCAT_DEFAULTS.put("socketBuffer", 9000);
+//        TOMCAT_DEFAULTS.put("strategy", "lf");
+//        TOMCAT_DEFAULTS.put("tcpNoDelay", true);
+//        TOMCAT_DEFAULTS.put("threadPriority", Thread.NORM_PRIORITY);
+//    }
 
     public void processAction(ActionRequest actionRequest,
                               ActionResponse actionResponse) throws PortletException, IOException {
         String submit = actionRequest.getParameter("submit");
         if ("Cancel".equalsIgnoreCase(submit)) {
             // User clicked on "Cancel" button in add/edit connector page
-            actionResponse.setRenderParameter("mode", "list");
+            actionResponse.setRenderParameter(PARM_MODE, "list");
             return;
         }
-        String mode = actionRequest.getParameter("mode");
-        String managerURI = actionRequest.getParameter("managerURI");
-        String containerURI = actionRequest.getParameter("containerURI");
-        if(managerURI != null) actionResponse.setRenderParameter("managerURI", managerURI);
-        if(containerURI != null) actionResponse.setRenderParameter("containerURI", containerURI);
-
-        String server;
+        
+        String mode = actionRequest.getParameter(PARM_MODE);
+        String managerURI = actionRequest.getParameter(PARM_MANAGER_URI);
+        String containerURI = actionRequest.getParameter(PARM_CONTAINER_URI);
+        if(managerURI != null) actionResponse.setRenderParameter(PARM_MANAGER_URI, managerURI);
+        if(containerURI != null) actionResponse.setRenderParameter(PARM_CONTAINER_URI, containerURI);
+        WebContainer webContainer  = null;
+        String server = null;
         if(containerURI != null) {
-            WebContainer container = PortletManager.getWebContainer(actionRequest, new AbstractName(URI.create(containerURI)));
-            server = getWebServerType(container.getClass());
+            webContainer = PortletManager.getWebContainer(actionRequest, new AbstractName(URI.create(containerURI)));
+            server = getWebServerType(webContainer.getClass());
         } else {
             server = "unknown";
         }
-        actionResponse.setRenderParameter("server", server);
+        actionResponse.setRenderParameter(PARM_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");
-            String containerDisplayName = actionRequest.getParameter("containerDisplayName");
-            actionResponse.setRenderParameter("protocol", protocol);
-            actionResponse.setRenderParameter("containerDisplayName", containerDisplayName);
+            actionResponse.setRenderParameter(PARM_MODE, "new");
+            String connectorType = actionRequest.getParameter(PARM_CONNECTOR_TYPE);
+            actionResponse.setRenderParameter(PARM_CONNECTOR_TYPE, connectorType);
         } 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"));
-            String displayName = actionRequest.getParameter("displayName");
             // Create and configure the connector
-            WebConnector connector = PortletManager.createWebConnector(actionRequest, new AbstractName(URI.create(managerURI)), new AbstractName(URI.create(containerURI)), displayName, protocol, host, port);
-            connector.setMaxThreads(maxThreads);
-            if (server.equals(WEB_SERVER_TOMCAT)) {
-                setTomcatAttributes(actionRequest, connector);
-            }
-            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");
-                String truststoreType = actionRequest.getParameter("truststoreType");
-                String truststoreFile = actionRequest.getParameter("truststoreFile");
-                String truststorePass = actionRequest.getParameter("truststorePassword");
-                String ciphers = actionRequest.getParameter("ciphers");
-                boolean clientAuth = isValid(actionRequest.getParameter("clientAuth"));
-                SecureConnector secure = (SecureConnector) connector;
-                if(isValid(keystoreType)) {
-                    secure.setKeystoreType(keystoreType);
-                } else {
-                    secure.setKeystoreType(null);
-                }
-                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);}
-                    String keyStore = actionRequest.getParameter("unlockKeyStore");
-                    setProperty(secure, "keyStore", keyStore);
-                    try {
-                        KeystoreInstance[] keystores = PortletManager.getCurrentServer(actionRequest).getKeystoreManager().getKeystores();
-
-                        String[] keys = null;
-                        for (int i = 0; i < keystores.length; i++) {
-                            KeystoreInstance keystore = keystores[i];
-                            if(keystore.getKeystoreName().equals(keyStore)) {
-                                keys = keystore.getUnlockedKeys(null);
-                            }
-                        }
-                        if(keys != null && keys.length == 1) {
-                            setProperty(secure, "keyAlias", keys[0]);
-                        } else {
-                            throw new PortletException("Cannot handle keystores with anything but 1 unlocked private key");
+            WebManager manager = PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI)));
+            ConnectorType connectorType = new ConnectorType(actionRequest.getParameter(PARM_CONNECTOR_TYPE));
+            
+            String displayName = actionRequest.getParameter(PARM_DISPLAY_NAME);
+            actionResponse.setRenderParameter(PARM_DISPLAY_NAME, displayName);
+            // set the connector attributes from the form post
+            List<ConnectorAttribute> connectorAttributes = manager.getConnectorAttributes(connectorType);
+            for (ConnectorAttribute attribute : connectorAttributes) {
+                String name = attribute.getAttributeName();
+                String value = actionRequest.getParameter(name);
+                if (value != null && value.trim().length() > 0) {
+                    // browser sends value of checked checkbox as "on"
+                    if (attribute.getAttributeClass().equals(Boolean.class)) {
+                        if ("on".equals(value)) {
+                            value=Boolean.toString(true);
                         }
-                    } catch (KeystoreException e) {
-                        throw new PortletException(e);
                     }
-                    String trustStore = actionRequest.getParameter("unlockTrustStore");
-                    // "" is a valid trustStore value, which means the parameter should be cleared
-                    setProperty(secure, "trustStore", isValid(trustStore) ? trustStore : null);
-                } else if (server.equals(WEB_SERVER_TOMCAT)) {
-                    if(isValid(truststoreType)) {setProperty(secure, "truststoreType", truststoreType);}
-                    if(isValid(truststoreFile)) {setProperty(secure, "truststoreFileName", truststoreFile);}
-                    if(isValid(truststorePass)) {setProperty(secure, "truststorePassword", truststorePass);}
-                    setProperty(secure, "ciphers", isValid(ciphers) ? ciphers : "");
-                } else {
-                    //todo:   Handle "should not occur" condition
+                    attribute.setStringValue(value.trim());
                 }
             }
+            AbstractName newConnectorName = manager.getConnectorConfiguration( connectorType, connectorAttributes, webContainer, displayName);
+            
+            // set the keystore properties if its a secure connector
+//            setKeystoreProperties(actionRequest, newConnectorName);
+            
             // Start the connector
             try {
-                ((GeronimoManagedBean)connector).startRecursive();
+                GeronimoManagedBean managedBean = PortletManager.getManagedBean(actionRequest, newConnectorName);
+                managedBean.startRecursive();
             } catch (Exception e) {
-                log.error("Unable to start connector", e); //todo: get into rendered page somehow?
+                log.error("Unable to start connector", e); //TODO: get into rendered page
             }
-            actionResponse.setRenderParameter("mode", "list");
+            actionResponse.setRenderParameter(PARM_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"));
-            String connectorURI = actionRequest.getParameter("connectorURI");
+            String connectorURI = actionRequest.getParameter(PARM_CONNECTOR_URI);
             // Identify and update the connector
-            WebConnector connector = PortletManager.getWebConnector(actionRequest, new AbstractName(URI.create(connectorURI)));
+            AbstractName connectorName = new AbstractName(URI.create(connectorURI));
+            NetworkConnector connector = PortletManager.getNetworkConnector(actionRequest, connectorName);
             if(connector != null) {
-                if(!connector.getHost().equals(host)) connector.setHost(host);
-                if(connector.getPort() != port) connector.setPort(port);
-                if(connector.getMaxThreads() != maxThreads) connector.setMaxThreads(maxThreads);
-                if (server.equals(WEB_SERVER_TOMCAT)) {
-                    setTomcatAttributes(actionRequest, connector);
-                }
-                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");
-                    String truststoreType = actionRequest.getParameter("truststoreType");
-                    String truststoreFile = actionRequest.getParameter("truststoreFile");
-                    String truststorePass = actionRequest.getParameter("truststorePassword");
-                    String ciphers = actionRequest.getParameter("ciphers");
-                    boolean clientAuth = isValid(actionRequest.getParameter("clientAuth"));
-                    SecureConnector secure = (SecureConnector) connector;
-                    String oldVal = secure.getKeystoreType();
-                    if(isValid(keystoreType)) {
-                        if(!keystoreType.equals(oldVal))
-                            secure.setKeystoreType(keystoreType);
-                    } else {
-                        if(oldVal != null) secure.setKeystoreType(null);
-                    }
-                    if(isValid(keystoreFile) && !keystoreFile.equals(secure.getKeystoreFileName())) {secure.setKeystoreFileName(keystoreFile);}
-                    if(isValid(keystorePass)) {secure.setKeystorePassword(keystorePass);}
-                    if(isValid(secureProtocol) && !secureProtocol.equals(secure.getSecureProtocol())) {secure.setSecureProtocol(secureProtocol);}
-                    if(isValid(algorithm) && !algorithm.equals(secure.getAlgorithm())) {secure.setAlgorithm(algorithm);}
-                    if(clientAuth != secure.isClientAuthRequired()) secure.setClientAuthRequired(clientAuth);
-                    if(server.equals(WEB_SERVER_JETTY)) {
-                        if(isValid(privateKeyPass)) {setProperty(secure, "keyPassword", privateKeyPass);}
-                        String keyStore = actionRequest.getParameter("unlockKeyStore");
-                        String trustStore = actionRequest.getParameter("unlockTrustStore");
-                        setProperty(secure, "keyStore", keyStore);
-                        try {
-                            KeystoreInstance[] keystores = PortletManager.getCurrentServer(actionRequest).getKeystoreManager().getKeystores();
-
-                            String[] keys = null;
-                            for (int i = 0; i < keystores.length; i++) {
-                                KeystoreInstance keystore = keystores[i];
-                                if(keystore.getKeystoreName().equals(keyStore)) {
-                                    keys = keystore.getUnlockedKeys(null);
-                                }
-                            }
-                            if(keys != null && keys.length == 1) {
-                                setProperty(secure, "keyAlias", keys[0]);
-                            } else {
-                                throw new PortletException("Cannot handle keystores with anything but 1 unlocked private key");
+                WebManager manager = PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI)));
+                ConnectorType connectorType = manager.getConnectorType(connectorName);
+                
+                // set the connector attributes from the form post
+                for (ConnectorAttribute attribute : manager.getConnectorAttributes(connectorType)) {
+                    String name = attribute.getAttributeName();
+                    String value = actionRequest.getParameter(name);
+                    if (value != null && value.trim().length() > 0) {
+                        // browser sends value of checked checkbox as "on"
+                        if (attribute.getAttributeClass().equals(Boolean.class)) {
+                            if ("on".equals(value)) {
+                                value=Boolean.toString(true);
                             }
-                        } catch (KeystoreException e) {
-                            throw new PortletException(e);
                         }
-                        // "" is a valid trustStore value, which means the parameter should be cleared
-                        setProperty(secure, "trustStore", isValid(trustStore) ? trustStore : null);
-                    }
-                    else if (server.equals(WEB_SERVER_TOMCAT)) {
-                        if(isValid(truststoreType) && !truststoreType.equals(getProperty(secure, "truststoreType"))) {setProperty(secure, "truststoreType", truststoreType);}
-                        if(isValid(truststorePass)) {setProperty(secure, "truststorePassword", truststorePass);}
-                        if(isValid(truststoreFile) && !truststoreFile.equals(getProperty(secure, "truststoreFileName"))) {setProperty(secure, "truststoreFileName", truststoreFile);}
-                        String prevVal = (String)getProperty(secure, "ciphers");
-                        if(isValid(ciphers)) {
-                            if(!ciphers.equals(prevVal)) setProperty(secure, "ciphers", ciphers);
-                        } else {
-                            if(prevVal != null) setProperty(secure, "ciphers", null);
+                        // set the string value on the ConnectorAttribute so 
+                        // it can handle type conversion via getValue()
+                        try {
+                            attribute.setStringValue(value);
+                            setProperty(connector,name,attribute.getValue());
+                        } catch (Exception e) {
+                            log.error("Unable to set property " + attribute.getAttributeName(), e);
                         }
                     }
-                    else {
-                        //todo:   Handle "should not occur" condition
-                    }
                 }
+                
+                // set the keystore properties if its a secure connector
+//                setKeystoreProperties(actionRequest, connectorName);
             }
-            actionResponse.setRenderParameter("mode", "list");
+            actionResponse.setRenderParameter(PARM_MODE, "list");
         } else if(mode.equals("start")) {
-            String connectorURI = actionRequest.getParameter("connectorURI");
+            String connectorURI = actionRequest.getParameter(PARM_CONNECTOR_URI);
             // work with the current connector to start it.
-            WebConnector connector = PortletManager.getWebConnector(actionRequest, new AbstractName(URI.create(connectorURI)));
+            NetworkConnector connector = PortletManager.getNetworkConnector(actionRequest, new AbstractName(URI.create(connectorURI)));
             if(connector != null) {
                 try {
                     ((GeronimoManagedBean)connector).startRecursive();
@@ -300,12 +220,12 @@
             else {
                 log.error("Incorrect connector reference"); //Replace this with correct error processing
             }
-            actionResponse.setRenderParameter("connectorURI", connectorURI);
-            actionResponse.setRenderParameter("mode", "list");
+            actionResponse.setRenderParameter(PARM_CONNECTOR_URI, connectorURI);
+            actionResponse.setRenderParameter(PARM_MODE, "list");
         } else if(mode.equals("stop")) {
-            String connectorURI = actionRequest.getParameter("connectorURI");
+            String connectorURI = actionRequest.getParameter(PARM_CONNECTOR_URI);
             // work with the current connector to stop it.
-            WebConnector connector = PortletManager.getWebConnector(actionRequest, new AbstractName(URI.create(connectorURI)));
+            NetworkConnector connector = PortletManager.getNetworkConnector(actionRequest, new AbstractName(URI.create(connectorURI)));
             if(connector != null) {
                 try {
                     ((GeronimoManagedBean)connector).stop();
@@ -316,537 +236,85 @@
             else {
                 log.error("Incorrect connector reference"); //Replace this with correct error processing
             }
-            actionResponse.setRenderParameter("connectorURI", connectorURI);
-            actionResponse.setRenderParameter("mode", "list");
+            actionResponse.setRenderParameter(PARM_CONNECTOR_URI, connectorURI);
+            actionResponse.setRenderParameter(PARM_MODE, "list");
         } else if(mode.equals("edit")) {
-            String connectorURI = actionRequest.getParameter("connectorURI");
-            actionResponse.setRenderParameter("connectorURI", connectorURI);
-            actionResponse.setRenderParameter("mode", "edit");
+            String connectorURI = actionRequest.getParameter(PARM_CONNECTOR_URI);
+            actionResponse.setRenderParameter(PARM_CONNECTOR_URI, connectorURI);
+            actionResponse.setRenderParameter(PARM_MODE, "edit");
 
         } else if(mode.equals("delete")) { // User chose to delete a connector
-            String connectorURI = actionRequest.getParameter("connectorURI");
+            String connectorURI = actionRequest.getParameter(PARM_CONNECTOR_URI);
             PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI))).removeConnector(new AbstractName(URI.create(connectorURI)));
-            actionResponse.setRenderParameter("mode", "list");
-        }
-    }
-
-    /**
-     * This method retrieves Tomcat Connector attributes from the action request and sets the attributes in the connector.
-     * @param actionRequest
-     * @param connector
-     */
-    private void setTomcatAttributes(ActionRequest actionRequest, WebConnector connector) {
-        boolean prevBoolVal;
-        int prevIntVal;
-        String prevVal;
-        
-        boolean allowTrace = isValid(actionRequest.getParameter("allowTrace"));
-        prevBoolVal = (Boolean)getProperty(connector, "allowTrace");
-        if(allowTrace != prevBoolVal) setProperty(connector, "allowTrace", allowTrace);
-
-        boolean emptySessionPath = isValid(actionRequest.getParameter("emptySessionPath"));
-        prevBoolVal = (Boolean)callOperation(connector, "isEmptySessionPath", null);
-        if(emptySessionPath != prevBoolVal) setProperty(connector, "emptySessionPath", emptySessionPath);
-
-        boolean enableLookups = isValid(actionRequest.getParameter("enableLookups"));
-        prevBoolVal = (Boolean)callOperation(connector, "isHostLookupEnabled", null);
-        if(enableLookups != prevBoolVal) setProperty(connector, "hostLookupEnabled", enableLookups);
-
-        String maxPostSize = actionRequest.getParameter("maxPostSize");
-        prevIntVal = (Integer)getProperty(connector, "maxPostSize");
-        if(isValid(maxPostSize)) {
-            int newVal = Integer.parseInt(maxPostSize);
-            if(newVal != prevIntVal) setProperty(connector, "maxPostSize", newVal);
-        } else {
-            if(prevIntVal != (Integer)TOMCAT_DEFAULTS.get("maxPostSize")) setProperty(connector, "maxPostSize", TOMCAT_DEFAULTS.get("maxPostSize"));
-        }
-
-        String maxSavePostSize = actionRequest.getParameter("maxSavePostSize");
-        prevIntVal = (Integer)getProperty(connector, "maxSavePostSize");
-        if(isValid(maxSavePostSize)) {
-            int newVal = Integer.parseInt(maxSavePostSize);
-            if(newVal != prevIntVal) setProperty(connector, "maxSavePostSize", newVal);
-        } else {
-            if(prevIntVal != (Integer)TOMCAT_DEFAULTS.get("maxSavePostSize")) setProperty(connector, "maxSavePostSize", TOMCAT_DEFAULTS.get("maxSavePostSize"));
-        }
-
-        String proxyName = actionRequest.getParameter("proxyName");
-        prevVal = (String)getProperty(connector, "proxyName");
-        if(isValid(proxyName)) {
-            if(!proxyName.equals(prevVal)) setProperty(connector, "proxyName", proxyName);
-        } else {
-            if(prevVal != null) setProperty(connector, "proxyName", null);
-        }
-
-        String proxyPort = actionRequest.getParameter("proxyPort");
-        prevIntVal = (Integer)getProperty(connector, "proxyPort");
-        if(isValid(proxyPort)) {
-            int newVal = Integer.parseInt(proxyPort);
-            if(newVal != prevIntVal) setProperty(connector, "proxyPort", newVal);
-        } else {
-            if(prevIntVal != 0) setProperty(connector, "proxyPort", 0);
-        }
-        
-        String redirectPort = actionRequest.getParameter("redirectPort");
-        prevIntVal = connector.getRedirectPort();
-        if(isValid(redirectPort)) {
-            int newVal = Integer.parseInt(redirectPort);
-            if(newVal != prevIntVal) connector.setRedirectPort(newVal);
-        } else {
-            if(prevIntVal != 0) connector.setRedirectPort(0);
-        }
-        
-        String URIEncoding = actionRequest.getParameter("URIEncoding");
-        prevVal = (String)getProperty(connector, "uriEncoding");
-        if(isValid(URIEncoding)) {
-            if(!URIEncoding.equals(prevVal)) setProperty(connector, "uriEncoding", URIEncoding);
-        } else {
-            if(prevVal != null) setProperty(connector, "uriEncoding", null);//FIXME
-        }
-        
-        boolean useBodyEncodingForURI = isValid(actionRequest.getParameter("useBodyEncodingForURI"));
-        prevBoolVal = (Boolean)getProperty(connector, "useBodyEncodingForURI");
-        if(useBodyEncodingForURI != prevBoolVal) setProperty(connector, "useBodyEncodingForURI", useBodyEncodingForURI);
-
-        boolean useIPVHosts = isValid(actionRequest.getParameter("useIPVHosts"));
-        prevBoolVal = (Boolean)getProperty(connector, "useIPVHosts");
-        if(useIPVHosts != prevBoolVal) setProperty(connector, "useIPVHosts", useIPVHosts);
-
-        boolean xpoweredBy = isValid(actionRequest.getParameter("xpoweredBy"));
-        prevBoolVal = (Boolean)getProperty(connector, "xpoweredBy");
-        if(xpoweredBy != prevBoolVal) setProperty(connector, "xpoweredBy", xpoweredBy);
-
-        String acceptCount = actionRequest.getParameter("acceptCount");
-        prevIntVal = connector.getAcceptQueueSize();
-        if(isValid(acceptCount)) {
-            int newVal = Integer.parseInt(acceptCount);
-            if(prevIntVal != newVal) connector.setAcceptQueueSize(newVal);
-        } else {
-            if(prevIntVal != (Integer)TOMCAT_DEFAULTS.get("acceptCount")) connector.setAcceptQueueSize((Integer)TOMCAT_DEFAULTS.get("acceptCount"));
-        }
-
-        String bufferSize = actionRequest.getParameter("bufferSize");
-        prevIntVal = connector.getBufferSizeBytes();
-        if(isValid(bufferSize)) {
-            int newVal = Integer.parseInt(bufferSize);
-            if(prevIntVal != newVal) connector.setBufferSizeBytes(newVal);
-        } else {
-            if(prevIntVal != (Integer)TOMCAT_DEFAULTS.get("bufferSize")) connector.setBufferSizeBytes((Integer)TOMCAT_DEFAULTS.get("bufferSize"));
-        }
-
-        String compressableMimeType = actionRequest.getParameter("compressableMimeType");
-        prevVal = (String)getProperty(connector, "compressableMimeType");
-        if(isValid(compressableMimeType)) {
-            if(!compressableMimeType.equals(prevVal)) setProperty(connector, "compressableMimeType", compressableMimeType);
-        } else {
-            if(!TOMCAT_DEFAULTS.get("compressableMimeType").equals(prevVal)) setProperty(connector, "compressableMimeType", TOMCAT_DEFAULTS.get("compressableMimeType"));
-        }
-
-        String compression = actionRequest.getParameter("compression");
-        prevVal = (String)getProperty(connector, "compression");
-        if(isValid(compression)) {
-            if(!compression.equals(prevVal)) setProperty(connector, "compression", compression);
-        } else {
-            if(!TOMCAT_DEFAULTS.get("compression").equals(prevVal)) setProperty(connector, "compression", TOMCAT_DEFAULTS.get("compression"));
-        }
-
-        String connectionLinger = actionRequest.getParameter("connectionLinger");
-        prevIntVal = connector.getLingerMillis();
-        if(isValid(connectionLinger)) {
-            int newVal = Integer.parseInt(connectionLinger);
-            if(prevIntVal != newVal) connector.setLingerMillis(newVal);
-        } else {
-            if(prevIntVal != (Integer)TOMCAT_DEFAULTS.get("connectionLinger")) connector.setLingerMillis((Integer)TOMCAT_DEFAULTS.get("connectionLinger"));
-        }
-
-        String connectionTimeout = actionRequest.getParameter("connectionTimeout");
-        prevIntVal = (Integer)getProperty(connector, "connectionTimeoutMillis");
-        if(isValid(connectionTimeout)) {
-            int newVal = Integer.parseInt(connectionTimeout);
-            if(prevIntVal != newVal) setProperty(connector, "connectionTimeoutMillis", newVal);
-        } else {
-            if(prevIntVal != (Integer)TOMCAT_DEFAULTS.get("connectionTimeout")) setProperty(connector, "connectionTimeoutMillis", (Integer)TOMCAT_DEFAULTS.get("connectionTimeout"));
-        }
-
-        String keepAliveTimeout = actionRequest.getParameter("keepAliveTimeout");
-        prevIntVal = (Integer)getProperty(connector, "keepAliveTimeout");
-        if(isValid(keepAliveTimeout)) {
-            int newVal = Integer.parseInt(keepAliveTimeout);
-            if(prevIntVal != newVal) setProperty(connector, "keepAliveTimeout", newVal);
-        } else {
-            if(prevIntVal != (Integer)getProperty(connector, "connectionTimeoutMillis")) setProperty(connector, "keepAliveTimeout", getProperty(connector, "connectionTimeoutMillis"));
-        }
-
-        boolean disableUploadTimeout = isValid(actionRequest.getParameter("disableUploadTimeout"));
-        prevBoolVal = !(Boolean)callOperation(connector, "isUploadTimeoutEnabled", null);
-        if(disableUploadTimeout != prevBoolVal) setProperty(connector, "uploadTimeoutEnabled", !disableUploadTimeout);
-
-        String maxHttpHeaderSize = actionRequest.getParameter("maxHttpHeaderSize");
-        prevIntVal = (Integer)getProperty(connector, "maxHttpHeaderSizeBytes");
-        if(isValid(maxHttpHeaderSize)) {
-            int newVal = Integer.parseInt(maxHttpHeaderSize);
-            if(newVal != prevIntVal) setProperty(connector, "maxHttpHeaderSizeBytes", newVal);
-        } else {
-            if(prevIntVal != (Integer)TOMCAT_DEFAULTS.get("maxHttpHeaderSize")) setProperty(connector, "maxHttpHeaderSizeBytes", TOMCAT_DEFAULTS.get("maxHttpHeaderSize"));
-        }
-        
-        String maxKeepAliveRequests = actionRequest.getParameter("maxKeepAliveRequests");
-        prevIntVal = (Integer)getProperty(connector, "maxKeepAliveRequests");
-        if(isValid(maxKeepAliveRequests)) {
-            int newVal = Integer.parseInt(maxKeepAliveRequests);
-            if(prevIntVal != newVal) setProperty(connector, "maxKeepAliveRequests", newVal);
-        } else {
-            if(prevIntVal != (Integer)TOMCAT_DEFAULTS.get("maxKeepAliveRequests")) setProperty(connector, "maxKeepAliveRequests", TOMCAT_DEFAULTS.get("maxKeepAliveRequests"));
-        }
-        
-        String maxSpareThreads = actionRequest.getParameter("maxSpareThreads");
-        prevIntVal = (Integer)getProperty(connector, "maxSpareThreads");
-        if(isValid(maxSpareThreads)) {
-            int newVal =  Integer.parseInt(maxSpareThreads);
-            if(prevIntVal != newVal) setProperty(connector, "maxSpareThreads", newVal);
-        } else {
-            if(prevIntVal != (Integer)TOMCAT_DEFAULTS.get("maxSpareThreads")) setProperty(connector, "maxSpareThreads", TOMCAT_DEFAULTS.get("maxSpareThreads"));
-        }
-        
-        String minSpareThreads = actionRequest.getParameter("minSpareThreads");
-        prevIntVal = (Integer)getProperty(connector, "minSpareThreads");
-        if(isValid(minSpareThreads)) {
-            int newVal = new Integer(minSpareThreads);
-            if(prevIntVal != newVal) setProperty(connector, "minSpareThreads", newVal);
-        } else {
-            if(prevIntVal != (Integer)TOMCAT_DEFAULTS.get("minSpareThreads")) setProperty(connector, "minSpareThreads", TOMCAT_DEFAULTS.get("minSpareThreads"));
-        }
-        
-        String noCompressionUserAgents = actionRequest.getParameter("noCompressionUserAgents");
-        prevVal = (String)getProperty(connector, "noCompressionUserAgents");
-        if(isValid(noCompressionUserAgents)) {
-            if(!noCompressionUserAgents.equals(prevVal)) setProperty(connector, "noCompressionUserAgents", noCompressionUserAgents);
-        } else {
-            if(prevVal != null) setProperty(connector, "noCompressionUserAgents", TOMCAT_DEFAULTS.get("noCompressionUserAgents"));
-        }
-
-        String restrictedUserAgents = actionRequest.getParameter("restrictedUserAgents");
-        prevVal = (String)getProperty(connector, "restrictedUserAgents");
-        if(isValid(restrictedUserAgents)) {
-            if(!restrictedUserAgents.equals(prevVal)) setProperty(connector, "restrictedUserAgents", restrictedUserAgents);
-        } else {
-            if(prevVal != null) setProperty(connector, "restrictedUserAgents", TOMCAT_DEFAULTS.get("restrictedUserAgents"));
-        }
-
-        String serverAttribute = actionRequest.getParameter("serverAttribute");
-        prevVal = (String)getProperty(connector, "server");
-        if(isValid(serverAttribute)) {
-            if(!serverAttribute.equals(prevVal)) setProperty(connector, "server", serverAttribute);
-        } else {
-            if(prevVal != null) setProperty(connector, "server", null);
-        }
-
-        String socketBuffer = actionRequest.getParameter("socketBuffer");
-        prevIntVal = (Integer)getProperty(connector, "socketBuffer");
-        if(isValid(socketBuffer)) {
-            int newVal = Integer.parseInt(socketBuffer);
-            if(prevIntVal != newVal) setProperty(connector, "socketBuffer", newVal);
-        } else {
-            if(prevIntVal != (Integer)TOMCAT_DEFAULTS.get("socketBuffer")) setProperty(connector, "socketBuffer", TOMCAT_DEFAULTS.get("socketBuffer"));
-        }
-
-        String strategy = actionRequest.getParameter("strategy");
-        prevVal = (String)getProperty(connector, "strategy");
-        if(isValid(strategy)) {
-            if(!strategy.equals(prevVal)) setProperty(connector, "strategy", strategy);
-        } else {
-            if(prevVal != null) setProperty(connector, "strategy", TOMCAT_DEFAULTS.get("strategy"));
-        }
-
-        boolean tcpNoDelay = isValid(actionRequest.getParameter("tcpNoDelay"));
-        prevBoolVal = connector.isTcpNoDelay();
-        if(tcpNoDelay != prevBoolVal) connector.setTcpNoDelay(tcpNoDelay);
-        
-        String threadPriority = actionRequest.getParameter("threadPriority");
-        prevIntVal = (Integer)getProperty(connector, "threadPriority");
-        if(isValid(threadPriority)) {
-            int newVal = Integer.parseInt(threadPriority);
-            if(prevIntVal != newVal) setProperty(connector, "threadPriority", newVal);
-        } else {
-            if(prevIntVal != (Integer)TOMCAT_DEFAULTS.get("threadPriority")) setProperty(connector, "threadPriority", TOMCAT_DEFAULTS.get("threadPriority"));
+            actionResponse.setRenderParameter(PARM_MODE, "list");
         }
     }
 
-    private Integer getInteger(ActionRequest actionRequest, String key) {
-        String value = actionRequest.getParameter(key);
-        if(value == null || value.equals("")) {
-            return null;
-        }
-        return new Integer(value);
-    }
-
     protected void doView(RenderRequest renderRequest,
                           RenderResponse renderResponse) throws IOException, PortletException {
         if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
             return;
         }
-        String mode = renderRequest.getParameter("mode");
+        String mode = renderRequest.getParameter(PARM_MODE);
         if(mode == null || mode.equals("")) {
             mode = "list";
         }
 
-
         if(mode.equals("list")) {
             doList(renderRequest, renderResponse);
         } else {
-            String managerURI = renderRequest.getParameter("managerURI");
-            String containerURI = renderRequest.getParameter("containerURI");
-            if(managerURI != null) renderRequest.setAttribute("managerURI", managerURI);
-            if(containerURI != null) renderRequest.setAttribute("containerURI", containerURI);
+            String managerURI = renderRequest.getParameter(PARM_MANAGER_URI);
+            String containerURI = renderRequest.getParameter(PARM_CONTAINER_URI);
+            if(managerURI != null) renderRequest.setAttribute(PARM_MANAGER_URI, managerURI);
+            if(containerURI != null) renderRequest.setAttribute(PARM_CONTAINER_URI, containerURI);
 
             WebContainer container = PortletManager.getWebContainer(renderRequest, new AbstractName(URI.create(containerURI)));
             String server = getWebServerType(container.getClass());
-            renderRequest.setAttribute("server", server);
+            renderRequest.setAttribute(PARM_SERVER, server);
 
             if(mode.equals("new")) {
-                String protocol = renderRequest.getParameter("protocol");
-                String containerDisplayName = renderRequest.getParameter("containerDisplayName");
-                renderRequest.setAttribute("maxThreads", "50");
-                if(server.equals(WEB_SERVER_JETTY)) {
-                    KeystoreManager mgr = PortletManager.getCurrentServer(renderRequest).getKeystoreManager();
-                    KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
-                    String[] storeNames = new String[stores.length];
-                    for (int i = 0; i < storeNames.length; i++) {
-                        storeNames[i] = stores[i].getKeystoreName();
-                    }
-                    renderRequest.setAttribute("keyStores", storeNames);
-                    KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
-                    String[] trustNames = new String[trusts.length];
-                    for (int i = 0; i < trustNames.length; i++) {
-                        trustNames[i] = trusts[i].getKeystoreName();
-                    }
-                    renderRequest.setAttribute("trustStores", trustNames);
-                    Map aliases = new HashMap();
-                    for (int i = 0; i < stores.length; i++) {
-                        try {
-                            aliases.put(stores[i].getKeystoreName(), stores[i].getUnlockedKeys(null));
-                        } catch (KeystoreException e) {}
-                    }
-                    renderRequest.setAttribute("unlockedKeys", aliases);
-                }
-                else if (server.equals(WEB_SERVER_TOMCAT)) {
-                    //todo:   Any Tomcat specific processing?
-                    for(String key:TOMCAT_DEFAULTS.keySet()) {
-                        Object val = TOMCAT_DEFAULTS.get(key);
-                        if(!(val instanceof Boolean))
-                            renderRequest.setAttribute(key, TOMCAT_DEFAULTS.get(key));
-                        else if((Boolean)val) // For boolean, set attribute only if it is true
-                            renderRequest.setAttribute(key, TOMCAT_DEFAULTS.get(key));
-                    }
-                }
-                else {
-                    //todo:   Handle "should not occur" condition
-                }
-                renderRequest.setAttribute("protocol", protocol);
-                renderRequest.setAttribute("mode", "add");
-                renderRequest.setAttribute("containerDisplayName", containerDisplayName);
-                if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
-                    editHttpsView.include(renderRequest, renderResponse);
-                } else {
-                    editHttpView.include(renderRequest, renderResponse);
+                String connectorType = renderRequest.getParameter(PARM_CONNECTOR_TYPE);
+                WebManager webManager = PortletManager.getWebManager(renderRequest, new AbstractName(URI.create(managerURI)));
+                ConnectorType type = new ConnectorType(connectorType);
+                List<ConnectorAttribute> connectorAttributes = webManager.getConnectorAttributes(type);
+                renderRequest.setAttribute(PARM_CONNECTOR_ATTRIBUTES, connectorAttributes);
+                renderRequest.setAttribute(PARM_CONNECTOR_TYPE, connectorType);
+                renderRequest.setAttribute(PARM_MODE, "add");
+                // add the special keystore properties to the render request
+                if (WEB_SERVER_JETTY.equals(server)) {
+//                    addKeystoreProperties(renderRequest);
                 }
-
+                editConnectorView.include(renderRequest, renderResponse);
             } else if(mode.equals("edit")) {
-                String connectorURI = renderRequest.getParameter("connectorURI");
-                WebConnector connector = PortletManager.getWebConnector(renderRequest, new AbstractName(URI.create(connectorURI)));
+                String connectorURI = renderRequest.getParameter(PARM_CONNECTOR_URI);
+                NetworkConnector connector = PortletManager.getNetworkConnector(renderRequest, new AbstractName(URI.create(connectorURI)));
                 if(connector == null) {
                     doList(renderRequest, renderResponse);
                 } else {
-                	String displayName = new AbstractName(URI.create(connectorURI)).getName().get("name").toString();
-                    renderRequest.setAttribute("displayName", displayName);
-                    renderRequest.setAttribute("connectorURI", connectorURI);
-                    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)) {
-                        KeystoreManager mgr = PortletManager.getCurrentServer(renderRequest).getKeystoreManager();
-                        KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
-                        String[] storeNames = new String[stores.length];
-                        for (int i = 0; i < storeNames.length; i++) {
-                            storeNames[i] = stores[i].getKeystoreName();
-                        }
-                        renderRequest.setAttribute("keyStores", storeNames);
-                        KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
-                        String[] trustNames = new String[trusts.length];
-                        for (int i = 0; i < trustNames.length; i++) {
-                            trustNames[i] = trusts[i].getKeystoreName();
-                        }
-                        renderRequest.setAttribute("trustStores", trustNames);
-                        Map aliases = new HashMap();
-                        for (int i = 0; i < stores.length; i++) {
-                            try {
-                                aliases.put(stores[i].getKeystoreName(), stores[i].getUnlockedKeys(null));
-                            } catch (KeystoreException e) {}
-                        }
-                        renderRequest.setAttribute("unlockedKeys", aliases);
-                    }
-                    else if (server.equals(WEB_SERVER_TOMCAT)) {
-                        //todo:   Any Tomcat specific processing?
-                        Boolean allowTrace = (Boolean)getProperty(connector, "allowTrace");
-                        if(allowTrace) {
-                            renderRequest.setAttribute("allowTrace", allowTrace);
-                        }
-
-                        Boolean emptySessionPath = (Boolean)callOperation(connector, "isEmptySessionPath", null);
-                        if(emptySessionPath) {
-                            renderRequest.setAttribute("emptySessionPath", emptySessionPath);
-                        }
-
-                        Boolean enableLookups = (Boolean)callOperation(connector, "isHostLookupEnabled", null);
-                        if(enableLookups) {
-                            renderRequest.setAttribute("enableLookups", enableLookups);
-                        }
-
-                        Integer maxPostSize = (Integer)getProperty(connector, "maxPostSize");
-                        renderRequest.setAttribute("maxPostSize", maxPostSize);
-
-                        Integer maxSavePostSize = (Integer)getProperty(connector, "maxSavePostSize");
-                        renderRequest.setAttribute("maxSavePostSize", maxSavePostSize);
-
-                        String proxyName = (String)getProperty(connector, "proxyName");
-                        if(isValid(proxyName)) {
-                            renderRequest.setAttribute("proxyName", proxyName);
-                        }
-
-                        Integer proxyPort = (Integer)getProperty(connector, "proxyPort");
-                        renderRequest.setAttribute("proxyPort", proxyPort);
-
-                        Integer redirectPort = connector.getRedirectPort();
-                        renderRequest.setAttribute("redirectPort", redirectPort);
-
-                        String URIEncoding = (String)getProperty(connector, "uriEncoding");
-                        if(isValid(URIEncoding)) {
-                            renderRequest.setAttribute("URIEncoding", URIEncoding);
-                        }
-
-                        Boolean useBodyEncodingForURI = (Boolean)getProperty(connector, "useBodyEncodingForURI");
-                        if(useBodyEncodingForURI) {
-                            renderRequest.setAttribute("useBodyEncodingForURI", useBodyEncodingForURI);
-                        }
-
-                        Boolean useIPVHosts = (Boolean)getProperty(connector, "useIPVHosts");
-                        if(useBodyEncodingForURI) {
-                            renderRequest.setAttribute("useIPVHosts", useIPVHosts);
-                        }
-
-                        Boolean xpoweredBy = (Boolean)getProperty(connector, "xpoweredBy");
-                        if(useBodyEncodingForURI) {
-                            renderRequest.setAttribute("xpoweredBy", xpoweredBy);
-                        }
-
-                        Integer acceptCount = connector.getAcceptQueueSize();
-                        renderRequest.setAttribute("acceptCount", acceptCount);
-
-                        Integer bufferSize = connector.getBufferSizeBytes();
-                        renderRequest.setAttribute("bufferSize", bufferSize);
-
-                        String compressableMimeType = (String)getProperty(connector, "compressableMimeType");
-                        if(isValid(compressableMimeType)) {
-                            renderRequest.setAttribute("compressableMimeType", compressableMimeType);
-                        }
-
-                        String compression = (String)getProperty(connector, "compression");
-                        if(isValid(compression)) {
-                            renderRequest.setAttribute("compression", compression);
-                        }
-
-                        Integer connectionLinger = connector.getLingerMillis();
-                        renderRequest.setAttribute("connectionLinger", connectionLinger);
-
-                        Integer connectionTimeout = (Integer)getProperty(connector, "connectionTimeoutMillis");
-                        renderRequest.setAttribute("connectionTimeout", connectionTimeout);
-
-                        Integer keepAliveTimeout = (Integer)getProperty(connector, "keepAliveTimeout");
-                        renderRequest.setAttribute("keepAliveTimeout", keepAliveTimeout);
-
-                        Boolean disableUploadTimeout = !(Boolean)callOperation(connector, "isUploadTimeoutEnabled", null);
-                        if(disableUploadTimeout) {
-                            renderRequest.setAttribute("disableUploadTimeout", disableUploadTimeout);
-                        }
-
-                        Integer maxHttpHeaderSize = (Integer)getProperty(connector, "maxHttpHeaderSizeBytes");
-                        renderRequest.setAttribute("maxHttpHeaderSize", maxHttpHeaderSize);
-
-                        Integer maxKeepAliveRequests = (Integer)getProperty(connector, "maxKeepAliveRequests");
-                        renderRequest.setAttribute("maxKeepAliveRequests", maxKeepAliveRequests);
-
-                        Integer maxSpareThreads = (Integer)getProperty(connector, "maxSpareThreads");
-                        renderRequest.setAttribute("maxSpareThreads", maxSpareThreads);
-
-                        Integer minSpareThreads = (Integer)getProperty(connector, "minSpareThreads");
-                        renderRequest.setAttribute("minSpareThreads", minSpareThreads);
-
-                        String noCompressionUserAgents = (String)getProperty(connector, "noCompressionUserAgents");
-                        if(isValid(noCompressionUserAgents)) {
-                            renderRequest.setAttribute("noCompressionUserAgents", noCompressionUserAgents);
-                        }
-
-                        String restrictedUserAgents = (String)getProperty(connector, "restrictedUserAgents");
-                        if(isValid(restrictedUserAgents)) {
-                            renderRequest.setAttribute("restrictedUserAgents", restrictedUserAgents);
-                        }
-                        
-                        String serverAttribute = (String)getProperty(connector, "server");
-                        if(isValid(serverAttribute)) {
-                            renderRequest.setAttribute("serverAttribute", serverAttribute);
-                        }
-
-                        Integer socketBuffer = (Integer)getProperty(connector, "socketBuffer");
-                        renderRequest.setAttribute("socketBuffer", socketBuffer);
-
-                        String strategy = (String)getProperty(connector, "strategy");
-                        if(isValid(strategy)) {
-                            renderRequest.setAttribute("strategy", strategy);
-                        }
-
-                        Boolean tcpNoDelay = connector.isTcpNoDelay();
-                        if(tcpNoDelay) {
-                            renderRequest.setAttribute("tcpNoDelay", tcpNoDelay);
-                        }
-
-                        Integer threadPriority = (Integer)getProperty(connector, "threadPriority");
-                        renderRequest.setAttribute("threadPriority", threadPriority);
-                    }
-                    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(server.equals(WEB_SERVER_JETTY)) {
-                            String keyStore = (String)getProperty(secure, "keyStore");
-                            String trustStore = (String)getProperty(secure, "trustStore");
-                            renderRequest.setAttribute("unlockKeyStore", keyStore);
-                            renderRequest.setAttribute("unlockTrustStore", trustStore);
-                        } else if(server.equals(WEB_SERVER_TOMCAT)) {
-                            String truststoreFile = (String)getProperty(secure, "truststoreFileName");
-                            String truststoreType = (String)getProperty(secure, "truststoreType");
-                            String ciphers = (String)getProperty(secure, "ciphers");
-                            renderRequest.setAttribute("truststoreFile", truststoreFile);
-                            renderRequest.setAttribute("truststoreType", truststoreType);
-                            renderRequest.setAttribute("ciphers", ciphers);
+                    AbstractName connectorName = new AbstractName(URI.create(connectorURI));
+                    String displayName = connectorName.getName().get("name").toString();
+                    renderRequest.setAttribute(PARM_DISPLAY_NAME, displayName);
+                    WebManager webManager = PortletManager.getWebManager(renderRequest, new AbstractName(URI.create(managerURI)));
+                    ConnectorType connectorType = webManager.getConnectorType(connectorName);
+                    List<ConnectorAttribute> connectorAttributes = webManager.getConnectorAttributes(connectorType);
+                    
+                    // populate the connector attributes from the connector
+                    for (ConnectorAttribute attribute : connectorAttributes) {
+                        try {
+                            Object value = getProperty(connector, attribute.getAttributeName());
+                            attribute.setValue(value);
+                        } catch (IllegalArgumentException e) {
+                            log.error("Unable to retrieve value of property " + attribute.getAttributeName(), e);
                         }
                     }
-
-                    if(connector.getProtocol().equals(WebManager.PROTOCOL_HTTPS)) {
-                        editHttpsView.include(renderRequest, renderResponse);
-                    } else {
-                        editHttpView.include(renderRequest, renderResponse);
+                    
+                    renderRequest.setAttribute(PARM_CONNECTOR_ATTRIBUTES, connectorAttributes);
+                    renderRequest.setAttribute(PARM_CONNECTOR_URI, connectorURI);
+                    if (WEB_SERVER_JETTY.equals(server)) {
+//                        addKeystoreProperties(renderRequest);
                     }
+                    renderRequest.setAttribute(PARM_MODE, "save");
+                    editConnectorView.include(renderRequest, renderResponse);
                 }
             }
         }
@@ -855,14 +323,14 @@
 
     private void doList(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException {
         WebManager[] managers = PortletManager.getWebManagers(renderRequest);
-        List all = new ArrayList();
+        List<ContainerInfo> all = new ArrayList<ContainerInfo>();
         for (int i = 0; i < managers.length; i++) {
             WebManager manager = managers[i];
             AbstractName webManagerName = PortletManager.getNameFor(renderRequest, manager);
-
+            
             WebContainer[] containers = (WebContainer[]) manager.getContainers();
             for (int j = 0; j < containers.length; j++) {
-                List beans = new ArrayList();
+                List<ConnectorInfo> beans = new ArrayList<ConnectorInfo>();
                 WebContainer container = containers[j];
                 AbstractName containerName = PortletManager.getNameFor(renderRequest, container);
                 String id;
@@ -873,9 +341,7 @@
                 }
                 ContainerInfo result = new ContainerInfo(id, webManagerName.toString(), containerName.toString());
 
-                WebConnector[] connectors = (WebConnector[]) manager.getConnectorsForContainer(container);
-                for (int k = 0; k < connectors.length; k++) {
-                    WebConnector connector = connectors[k];
+                for (NetworkConnector connector : manager.getConnectorsForContainer(container)) {
                     ConnectorInfo info = new ConnectorInfo();
                     AbstractName connectorName = PortletManager.getNameFor(renderRequest, connector);
                     info.setConnectorURI(connectorName.toString());
@@ -891,7 +357,7 @@
                     beans.add(info);
                 }
                 result.setConnectors(beans);
-                result.setProtocols(manager.getSupportedProtocols());
+                result.setConnectorTypes(manager.getConnectorTypes());
                 all.add(result);
             }
         }
@@ -909,7 +375,7 @@
         private String name;
         private String managerURI;
         private String containerURI;
-        private String[] protocols;
+        private List connectorTypes;
         private List connectors;
 
         public ContainerInfo(String name, String managerURI, String containerURI) {
@@ -922,12 +388,12 @@
             return name;
         }
 
-        public String[] getProtocols() {
-            return protocols;
+        public List getConnectorTypes() {
+            return connectorTypes;
         }
 
-        public void setProtocols(String[] protocols) {
-            this.protocols = protocols;
+        public void setConnectorTypes(List connectorTypes) {
+            this.connectorTypes = connectorTypes;
         }
 
         public List getConnectors() {
@@ -958,21 +424,87 @@
         normalView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/connector/normal.jsp");
         maximizedView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/connector/maximized.jsp");
         helpView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/connector/help.jsp");
-        editHttpView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/connector/editHTTP.jsp");
-        editHttpsView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/connector/editHTTPS.jsp");
+        editConnectorView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/connector/editConnector.jsp");
     }
 
     public void destroy() {
         normalView = null;
         maximizedView = null;
         helpView = null;
-        editHttpsView = null;
-        editHttpView = null;
+        editConnectorView = null;
         super.destroy();
     }
 
     public static boolean isValid(String s) {
         return s != null && !s.equals("");
     }
+    
+    // add the special keystore properties to the request
+    // TODO: need a more generic way to handle this
+    private void addKeystoreProperties(PortletRequest request) {
+        KeystoreManager mgr = PortletManager.getCurrentServer(request).getKeystoreManager();
+        KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
+        String[] storeNames = new String[stores.length];
+        for (int i = 0; i < storeNames.length; i++) {
+            storeNames[i] = stores[i].getKeystoreName();
+        }
+        request.setAttribute("keyStores", storeNames);
+        KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
+        String[] trustNames = new String[trusts.length];
+        for (int i = 0; i < trustNames.length; i++) {
+            trustNames[i] = trusts[i].getKeystoreName();
+        }
+        request.setAttribute("trustStores", trustNames);
+        Map<String,String[]> aliases = new HashMap<String,String[]>();
+        for (int i = 0; i < stores.length; i++) {
+            try {
+                aliases.put(stores[i].getKeystoreName(), stores[i].getUnlockedKeys(null));
+            } catch (KeystoreException e) {}
+        }
+        request.setAttribute("unlockedKeys", aliases);
+    }
+    
+    // get the special keystore properties from the request and set them on the connector
+    // TODO: need a more generic way to handle this
+    private void setKeystoreProperties(PortletRequest request, AbstractName connectorName) throws PortletException {
+        String containerURI = request.getParameter(PARM_CONTAINER_URI);
+        WebContainer container = PortletManager.getWebContainer(request, new AbstractName(URI.create(containerURI)));
+        String server = getWebServerType(container.getClass());
+        NetworkConnector connector = PortletManager.getNetworkConnector(request, connectorName);
 
+        // return if not a secure connector
+        if (!(connector instanceof SecureConnector)) {
+            return;
+        }
+        
+        SecureConnector secure = (SecureConnector) connector;
+        if (server.equals(WEB_SERVER_JETTY)) {
+            String keyStore = request.getParameter("unlockKeyStore");
+            setProperty(secure, "keyStore", keyStore);
+            try {
+                KeystoreInstance[] keystores = PortletManager.getCurrentServer(request)
+                        .getKeystoreManager().getKeystores();
+
+                String[] keys = null;
+                for (int i = 0; i < keystores.length; i++) {
+                    KeystoreInstance keystore = keystores[i];
+                    if (keystore.getKeystoreName().equals(keyStore)) {
+                        keys = keystore.getUnlockedKeys(null);
+                    }
+                }
+                if (keys != null && keys.length == 1) {
+                    setProperty(secure, "keyAlias", keys[0]);
+                } else {
+                    throw new PortletException("Cannot handle keystores with anything but 1 unlocked private key");
+                }
+            } catch (KeystoreException e) {
+                throw new PortletException(e);
+            }
+            String trustStore = request.getParameter("unlockTrustStore");
+            // "" is a valid trustStore value, which means the parameter
+            // should be cleared
+            setProperty(secure, "trustStore", isValid(trustStore) ? trustStore : null);
+        }
+        // TODO: what about Tomcat?
+    }
 }

Added: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editConnector.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editConnector.jsp?view=auto&rev=561149
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editConnector.jsp (added)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editConnector.jsp Mon Jul 30 15:10:32 2007
@@ -0,0 +1,137 @@
+<%--
+   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 prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+
+<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %>
+<portlet:defineObjects/>
+
+<script language="JavaScript">
+// validate the form submission
+function <portlet:namespace/>validateForm(){
+    var attributeName;
+    var element;
+
+    element = document.forms['<portlet:namespace/>Form'].elements['displayName'];
+    if(element.value.length < 1){
+        alert("displayName must not be empty.");
+        return false;
+    }
+    
+<c:forEach var="connectorAttribute" items="${connectorAttributes}">
+    attributeName = '${connectorAttribute.attributeName}';
+    element = document.forms['<portlet:namespace/>Form'].elements[attributeName];
+    <c:if test="${connectorAttribute.required}">
+    //validate the required attribute has a value
+    if(element.value.length < 1){
+        alert(attributeName + " must not be empty.");
+        return false;
+    }
+    </c:if>
+    <c:if test="${connectorAttribute.attributeClass.simpleName eq 'Integer'}">
+    //validate the Integer attribute has a numeric value
+    if(element.value.length > 0 && !checkIntegral('<portlet:namespace/>Form', attributeName)) {
+        return false;
+    }
+    </c:if>
+</c:forEach>
+
+    return true;
+}
+</script>
+
+<form name="<portlet:namespace/>Form" action="<portlet:actionURL/>">
+<input type="hidden" name="mode" value="${mode}">
+<input type="hidden" name="connectorType" value="${connectorType}">
+<input type="hidden" name="containerURI" value="${containerURI}">
+<input type="hidden" name="managerURI" value="${managerURI}">
+<c:if test="${mode eq 'save'}">
+  <input type="hidden" name="connectorURI" value="${connectorURI}">
+</c:if>
+
+<!-- Current Task -->
+<c:choose>
+  <c:when test="${mode eq 'add'}">
+    Add a new ${connectorType}
+  </c:when>
+  <c:otherwise>
+    Edit connector ${displayName}
+  </c:otherwise>
+</c:choose>
+<p>
+(<strong>*</strong> denotes a required attribute)
+<table border="0" cellpadding="3">
+<tr>
+  <th class="DarkBackground">Attribute</th>
+  <th class="DarkBackground">Type</th>
+  <th class="DarkBackground">Value</th>
+  <th class="DarkBackground">Description</th>
+</tr>
+<tr>
+  <td class="LightBackground"><strong>*displayName</strong></td>
+  <td>String</td>
+  <td><c:choose>
+        <c:when test="${empty connectorURI}">
+            <input name="displayName" type="text" size="30">
+        </c:when>
+        <c:otherwise>
+            <c:out escapeXml="true" value="${displayName}"/>
+        </c:otherwise>
+      </c:choose>
+  </td>
+  <td>A unique name for this connector</td>
+</tr>
+<c:forEach var="connectorAttribute" items="${connectorAttributes}" varStatus="status">
+  <c:set var="style" value="${status.index % 2 == 0 ? 'MediumBackground' : 'LightBackground'}"/>
+  <tr>
+    <td class="${style}">
+    <c:if test="${connectorAttribute.required}"><strong>*</c:if>
+    ${connectorAttribute.attributeName}
+    <c:if test="${connectorAttribute.required}"></strong></c:if>
+    </td>
+    <td class="${style}">${connectorAttribute.attributeClass.simpleName}</td>
+    <c:choose>
+        <c:when test="${connectorAttribute.attributeClass.simpleName eq 'Integer'}">
+    	    <td class="${style}"><input name="${connectorAttribute.attributeName}" type="text" size="5" 
+    	     value="<c:out escapeXml="true" value="${connectorAttribute.stringValue}"/>"></td>
+        </c:when>
+        <c:when test="${connectorAttribute.attributeClass.simpleName eq 'Boolean'}">
+		    <td class="${style}"><input name="${connectorAttribute.attributeName}" type="checkbox" ${connectorAttribute.value ? 'checked' : ''}></td>
+        </c:when>
+        <c:when test="${fn:containsIgnoreCase(connectorAttribute.attributeName, 'password')}">
+		    <td class="${style}"><input name="${connectorAttribute.attributeName}" type="password" size="30"
+    	     value="<c:out escapeXml="true" value="${connectorAttribute.stringValue}"/>"></td>
+        </c:when>
+        <c:otherwise>
+		    <td class="${style}"><input name="${connectorAttribute.attributeName}" type="text" size="30"
+    	     value="<c:out escapeXml="true" value="${connectorAttribute.stringValue}"/>"></td>
+        </c:otherwise>
+    </c:choose>
+    <td class="${style}">${connectorAttribute.description}</td>
+  </tr>
+</c:forEach>
+</table>
+<P>
+<!-- Submit Button -->
+<input name="submit" type="submit" value="Save" onClick="return <portlet:namespace/>validateForm()">
+<input name="reset" type="reset" value="Reset">
+<input name="submit" type="submit" value="Cancel">
+</form>
+<P>
+<a href='<portlet:actionURL portletMode="view">
+           <portlet:param name="mode" value="list" />
+         </portlet:actionURL>'>List connectors</a>

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/normal.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/normal.jsp?view=diff&rev=561149&r1=561148&r2=561149
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/normal.jsp (original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/normal.jsp Mon Jul 30 15:10:32 2007
@@ -93,18 +93,19 @@
           </c:otherwise>
         </c:choose>
 
-
+<P><HR><P>
 <!-- Links to add new connectors -->
-<c:forEach var="protocol" items="${container.protocols}">
-<br />
-<a href="<portlet:actionURL portletMode="view">
+Add new:
+<ul>
+<c:forEach var="connectorType" items="${container.connectorTypes}">
+<li><a href="<portlet:actionURL portletMode="view">
            <portlet:param name="mode" value="new" />
-           <portlet:param name="protocol" value="${protocol}" />
+           <portlet:param name="connectorType" value="${connectorType.description}" />
            <portlet:param name="managerURI" value="${container.managerURI}" />
            <portlet:param name="containerURI" value="${container.containerURI}" />
-           <portlet:param name="containerDisplayName" value="${container.name}" />
-         </portlet:actionURL>">Add new ${protocol} listener for ${container.name}</a>
+         </portlet:actionURL>">${connectorType.description}</a>
 </c:forEach>
+</ul>
 
     </c:forEach>
   </c:otherwise>



Mime
View raw message