geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlaskow...@apache.org
Subject svn commit: r393787 [6/22] - in /geronimo/trunk/applications: ./ console/ console/console-core/ console/console-core/src/ console/console-core/src/java/ console/console-core/src/java/org/ console/console-core/src/java/org/apache/ console/console-core/s...
Date Thu, 13 Apr 2006 11:36:26 GMT
Added: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/CertManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/CertManagerPortlet.java?rev=393787&view=auto
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/CertManagerPortlet.java (added)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/CertManagerPortlet.java Thu Apr 13 04:34:08 2006
@@ -0,0 +1,139 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+package org.apache.geronimo.console.certmanager;
+
+import java.io.IOException;
+import java.util.Enumeration;
+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;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.geronimo.console.certmanager.actions.ChangeStorePassword;
+import org.apache.geronimo.console.certmanager.actions.GenerateCSR;
+import org.apache.geronimo.console.certmanager.actions.GenerateKeyPair;
+import org.apache.geronimo.console.certmanager.actions.ImportCAReply;
+import org.apache.geronimo.console.certmanager.actions.ImportTrustedCertificate;
+import org.apache.geronimo.console.certmanager.actions.UploadCertificateFile;
+import org.apache.geronimo.console.certmanager.actions.ViewKeyStore;
+import org.apache.geronimo.console.certmanager.actions.ViewKeyStoreEntryDetail;
+import org.apache.geronimo.console.util.ObjectNameConstants;
+
+public class CertManagerPortlet extends GenericPortlet {
+
+    private PortletContext ctx;
+
+    public CertManagerPortlet() {
+        this.ctx = null;
+    }
+
+    public void init(PortletConfig portletConfig) throws PortletException {
+        super.init(portletConfig);
+
+        // iniitialize portlet environment
+        this.ctx = portletConfig.getPortletContext();
+        this.ctx.log("Certificate manager portlet initialized");
+    }
+
+    public ObjectName getKeyStoreObjectName() {
+        return ObjectNameConstants.KEYSTORE_OBJ_NAME;
+    }
+
+    public void processAction(ActionRequest request, ActionResponse response)
+            throws PortletException, IOException {
+
+        String action = request.getParameter("action");
+        ctx.log("process-action: action = " + action);
+
+        if (action == null) {
+            return;
+        }
+
+        // pass 'action' parameter value to render method
+        response.setRenderParameter("action", action);
+
+        if (action.equals("upload-certificate-file")) {
+            UploadCertificateFile.action(this, request, response);
+        } else if (action.equals("import-trusted-certificate")) {
+            ImportTrustedCertificate.action(this, request, response);
+        } else if (action.equals("tools-generate-key-pair")) {
+            GenerateKeyPair.action(this, request, response);
+        } else if (action.equals("tools-change-keystore-password")) {
+            ChangeStorePassword.action(this, request, response);
+        } else if (action.equals("generate-csr")) {
+            GenerateCSR.action(this, request, response);
+        } else if (action.equals("import-ca-reply")) {
+            ImportCAReply.action(this, request, response);
+        } else if (action.equals("save-pkcs7-cert")) {
+            ImportCAReply.action(this, request, response);
+        } else if (action.equals("generate-key-pair")) {
+            GenerateKeyPair.action(this, request, response);
+        }
+    }
+
+    public void doView(RenderRequest request, RenderResponse response)
+            throws PortletException, IOException {
+
+        String action = request.getParameter("action");
+        ctx.log("do-view: action = " + action);
+
+        Enumeration e = request.getParameterNames();
+        while (e.hasMoreElements()) {
+            String pname = (String) e.nextElement();
+            String value = request.getParameter(pname);
+            ctx.log("param-name = " + pname + ", param-value = " + value);
+        }
+
+        if (action == null) {
+            ViewKeyStore.render(this, request, response);
+        } else if (action.equals("tools-import-trusted-certificate")) {
+            ImportTrustedCertificate.render(this, request, response);
+        } else if (action.equals("tools-generate-key-pair")) {
+            GenerateKeyPair.render(this, request, response);
+        } else if (action.equals("tools-change-keystore-password")) {
+            ChangeStorePassword.render(this, request, response);
+        } else if (action.equals("upload-certificate-file")) {
+            UploadCertificateFile.render(this, request, response);
+        } else if (action.equals("import-trusted-certificate")) {
+            ImportTrustedCertificate.render(this, request, response);
+        } else if (action.equals("view-keystore-entry-details")) {
+            ViewKeyStoreEntryDetail.render(this, request, response);
+        } else if (action.equals("generate-csr")) {
+            GenerateCSR.render(this, request, response);
+        } else if (action.equals("import-ca-reply")) {
+            ImportCAReply.render(this, request, response);
+        } else if (action.equals("save-pkcs7-cert")) {
+            ImportCAReply.render(this, request, response);
+        } else if (action.equals("generate-key-pair")) {
+            GenerateKeyPair.render(this, request, response);
+        }
+    }
+
+    public void doHelp(RenderRequest renderRequest,
+            RenderResponse renderResponse) throws PortletException, IOException {
+        PortletRequestDispatcher prd = ctx
+                .getRequestDispatcher("/WEB-INF/view/certmanager/viewKeyStoreHelp.jsp");
+        prd.include(renderRequest, renderResponse);
+    }
+}

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/CertManagerPortlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/CertManagerPortlet.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/CertManagerPortlet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ChangeStorePassword.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ChangeStorePassword.java?rev=393787&view=auto
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ChangeStorePassword.java (added)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ChangeStorePassword.java Thu Apr 13 04:34:08 2006
@@ -0,0 +1,49 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+package org.apache.geronimo.console.certmanager.actions;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.geronimo.console.certmanager.CertManagerPortlet;
+
+public class ChangeStorePassword {
+    public static void action(CertManagerPortlet portlet,
+            ActionRequest request, ActionResponse response)
+            throws PortletException, IOException {
+        response.setRenderParameter("action", request.getParameter("action"));
+    }
+
+    public static void render(CertManagerPortlet portlet,
+            RenderRequest request, RenderResponse response)
+            throws PortletException, IOException {
+
+        PortletRequestDispatcher rd = portlet
+                .getPortletContext()
+                .getRequestDispatcher(
+                        "/WEB-INF/view/certmanager/changeStorePasswordNormal.jsp");
+
+        rd.include(request, response);
+    }
+}

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ChangeStorePassword.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ChangeStorePassword.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ChangeStorePassword.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/GenerateCSR.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/GenerateCSR.java?rev=393787&view=auto
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/GenerateCSR.java (added)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/GenerateCSR.java Thu Apr 13 04:34:08 2006
@@ -0,0 +1,63 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+package org.apache.geronimo.console.certmanager.actions;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.geronimo.console.certmanager.CertManagerPortlet;
+import org.apache.geronimo.kernel.KernelRegistry;
+
+public class GenerateCSR {
+    public static void action(CertManagerPortlet portlet,
+            ActionRequest request, ActionResponse response)
+            throws PortletException, IOException {
+        response.setRenderParameter("action", request.getParameter("action"));
+    }
+
+    public static void render(CertManagerPortlet portlet,
+            RenderRequest request, RenderResponse response)
+            throws PortletException, IOException {
+
+        String alias = request.getParameter("alias");
+
+        try {
+            String csr = (String) KernelRegistry.getSingleKernel()
+                    .invoke(portlet.getKeyStoreObjectName(), "generateCSR",
+                            new Object[] { alias },
+                            new String[] { "java.lang.String" });
+
+            request.setAttribute("org.apache.geronimo.console.cert.csr", csr);
+            request.setAttribute("alias", alias);
+        } catch (Exception e) {
+            throw new PortletException(e);
+        }
+
+        PortletRequestDispatcher rd = portlet.getPortletContext()
+                .getRequestDispatcher(
+                        "/WEB-INF/view/certmanager/generateCSRNormal.jsp");
+
+        rd.include(request, response);
+    }
+}

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/GenerateCSR.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/GenerateCSR.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/GenerateCSR.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/GenerateKeyPair.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/GenerateKeyPair.java?rev=393787&view=auto
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/GenerateKeyPair.java (added)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/GenerateKeyPair.java Thu Apr 13 04:34:08 2006
@@ -0,0 +1,143 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+package org.apache.geronimo.console.certmanager.actions;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.management.ObjectName;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.geronimo.console.certmanager.CertManagerPortlet;
+import org.apache.geronimo.kernel.KernelRegistry;
+
+public class GenerateKeyPair {
+    public static void action(CertManagerPortlet portlet,
+            ActionRequest request, ActionResponse response)
+            throws PortletException, IOException {
+        response.setRenderParameter("action", request.getParameter("action"));
+
+        String action = request.getParameter("action");
+
+        if (action == null) {
+            return;
+        }
+
+        if (action.equals("generate-key-pair")) {
+
+            String submit = request.getParameter("submit");
+            String alias = request.getParameter("alias");
+            String keyalg = request.getParameter("keyalg");
+            String keysize = request.getParameter("keysize");
+            String sigalg = request.getParameter("sigalg");
+            String validity = request.getParameter("validity");
+
+            String cn = request.getParameter("cn");
+            String ou = request.getParameter("ou");
+            String o = request.getParameter("o");
+            String l = request.getParameter("l");
+            String st = request.getParameter("st");
+            String c = request.getParameter("c");
+
+            if (submit.equals("cancel")) {
+                return;
+            }
+
+            try {
+                Integer ikeysize = new Integer(Integer.parseInt(keysize));
+                Integer ivalidity = new Integer(Integer.parseInt(validity));
+
+                KernelRegistry.getSingleKernel().invoke(
+                        portlet.getKeyStoreObjectName(),
+                        "generateKeyPair",
+                        new Object[] { alias, keyalg, ikeysize, sigalg,
+                                ivalidity, cn, ou, o, l, st, c },
+                        new String[] { "java.lang.String", "java.lang.String",
+                                "java.lang.Integer", "java.lang.String",
+                                "java.lang.Integer", "java.lang.String",
+                                "java.lang.String", "java.lang.String",
+                                "java.lang.String", "java.lang.String",
+                                "java.lang.String" });
+            } catch (Exception ex) {
+                throw new PortletException(ex);
+            }
+        }
+    }
+
+    public static void render(CertManagerPortlet portlet,
+            RenderRequest request, RenderResponse response)
+            throws PortletException, IOException {
+
+        String action = request.getParameter("action");
+
+        PortletRequestDispatcher rd = null;
+
+        if (action.equals("tools-generate-key-pair")) {
+            rd = portlet.getPortletContext().getRequestDispatcher(
+                    "/WEB-INF/view/certmanager/generateKeyPairNormal.jsp");
+        } else {
+            try {
+                ObjectName objname = portlet.getKeyStoreObjectName();
+
+                String keyStoreType = (String) KernelRegistry.getSingleKernel()
+                        .getAttribute(objname, "keyStoreType");
+                String keyStoreProvider = (String) KernelRegistry
+                        .getSingleKernel().getAttribute(objname,
+                                "keyStoreProvider");
+                String keyStoreLocation = (String) KernelRegistry
+                        .getSingleKernel().getAttribute(objname,
+                                "keyStoreLocation");
+
+                request.setAttribute("org.apache.geronimo.console.keystore.type",
+                        keyStoreType);
+                request.setAttribute("org.apache.geronimo.console.keystore.provider",
+                        keyStoreProvider);
+                request.setAttribute("org.apache.geronimo.console.keystore.location",
+                        keyStoreLocation);
+
+                List storelist = (List) KernelRegistry.getSingleKernel()
+                        .invoke(objname, "getKeyStoreEntries");
+
+                Iterator iter = storelist.iterator();
+                while (iter.hasNext()) {
+                    portlet.getPortletContext().log(
+                            "store-item = " + iter.next());
+                }
+
+                request
+                        .setAttribute("org.apache.geronimo.console.keystore.list",
+                                storelist);
+                request.setAttribute("org.apache.geronimo.console.keystore.size", String
+                        .valueOf(storelist.size()));
+            } catch (Exception e) {
+                throw new PortletException(e);
+            }
+
+            rd = portlet.getPortletContext().getRequestDispatcher(
+                    "/WEB-INF/view/certmanager/viewKeyStoreNormal.jsp");
+        }
+
+        rd.include(request, response);
+    }
+}

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/GenerateKeyPair.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/GenerateKeyPair.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/GenerateKeyPair.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ImportCAReply.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ImportCAReply.java?rev=393787&view=auto
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ImportCAReply.java (added)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ImportCAReply.java Thu Apr 13 04:34:08 2006
@@ -0,0 +1,101 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+package org.apache.geronimo.console.certmanager.actions;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.geronimo.console.certmanager.CertManagerPortlet;
+import org.apache.geronimo.kernel.KernelRegistry;
+
+public class ImportCAReply {
+    public static void action(CertManagerPortlet portlet,
+            ActionRequest request, ActionResponse response)
+            throws PortletException, IOException {
+
+        // pass 'alias' parameter along
+        String alias = request.getParameter("alias");
+        response.setRenderParameter("alias", alias);
+
+        String action = request.getParameter("action");
+
+        // this should never happen
+        if (action == null) {
+            return;
+        }
+
+        if (action.equals("import-ca-reply")) {
+            return;
+        } else if (action.equals("save-pkcs7-cert")) {
+            String submit = request.getParameter("submit");
+
+            if (submit.equalsIgnoreCase("cancel")) {
+                return;
+            }
+
+            // save pkcs7-encoded certificate
+            String pkcs7cert = request.getParameter("pkcs7cert");
+
+            try {
+                KernelRegistry.getSingleKernel()
+                        .invoke(
+                                portlet.getKeyStoreObjectName(),
+                                "importPKCS7Certificate",
+                                new Object[] { alias, pkcs7cert },
+                                new String[] { "java.lang.String",
+                                        "java.lang.String" });
+            } catch (Exception e) {
+                throw new PortletException(e);
+            }
+        }
+    }
+
+    public static void render(CertManagerPortlet portlet,
+            RenderRequest request, RenderResponse response)
+            throws PortletException, IOException {
+
+        String action = request.getParameter("action");
+        String alias = request.getParameter("alias");
+
+        // set alias name
+        request.setAttribute("alias", alias);
+
+        // this should never happen
+        if (action == null) {
+            ViewKeyStoreEntryDetail.render(portlet, request, response);
+            return;
+        }
+
+        if (action.equals("import-ca-reply")) {
+            PortletRequestDispatcher rd = portlet
+                    .getPortletContext()
+                    .getRequestDispatcher(
+                            "/WEB-INF/view/certmanager/importCAReplyNormal.jsp");
+
+            rd.include(request, response);
+        } else if (action.equals("save-pkcs7-cert")) {
+            ViewKeyStoreEntryDetail.render(portlet, request, response);
+        }
+    }
+}

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ImportCAReply.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ImportCAReply.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ImportCAReply.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ImportTrustedCertificate.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ImportTrustedCertificate.java?rev=393787&view=auto
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ImportTrustedCertificate.java (added)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ImportTrustedCertificate.java Thu Apr 13 04:34:08 2006
@@ -0,0 +1,90 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+package org.apache.geronimo.console.certmanager.actions;
+
+import java.io.IOException;
+import java.net.URLDecoder;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.geronimo.console.certmanager.CertManagerPortlet;
+import org.apache.geronimo.kernel.KernelRegistry;
+
+public class ImportTrustedCertificate {
+    public static void action(CertManagerPortlet portlet,
+            ActionRequest request, ActionResponse response)
+            throws PortletException, IOException {
+
+        String action = request.getParameter("action");
+
+        if (action == null) {
+            return;
+        }
+
+        // nothing to do
+        if (action.equals("tools-generate-trusted-certificate")) {
+            return;
+        }
+
+        String submit = request.getParameter("submit");
+
+        if (submit.equalsIgnoreCase("cancel")) {
+            return;
+        }
+
+        String certfileEnc = request
+                .getParameter("org.apache.geronimo.console.cert.file.enc");
+        String alias = request.getParameter("alias");
+
+        // decode certificate file name
+        String certfile = URLDecoder.decode(certfileEnc, "UTF-8");
+
+        // import certificate into the key store
+        try {
+            KernelRegistry.getSingleKernel().invoke(
+                    portlet.getKeyStoreObjectName(),
+                    "importTrustedX509Certificate",
+                    new Object[] { alias, certfile },
+                    new String[] { "java.lang.String", "java.lang.String" });
+        } catch (Exception ex) {
+            throw new PortletException(ex);
+        }
+    }
+
+    public static void render(CertManagerPortlet portlet,
+            RenderRequest request, RenderResponse response)
+            throws PortletException, IOException {
+        PortletRequestDispatcher rd = null;
+
+        String action = request.getParameter("action");
+
+        if (action.equals("tools-import-trusted-certificate")) {
+            rd = portlet.getPortletContext().getRequestDispatcher(
+                    "/WEB-INF/view/certmanager/importTrustedCertNormal.jsp");
+
+            rd.include(request, response);
+        } else {
+            ViewKeyStore.render(portlet, request, response);
+        }
+    }
+}

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ImportTrustedCertificate.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ImportTrustedCertificate.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ImportTrustedCertificate.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/UploadCertificateFile.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/UploadCertificateFile.java?rev=393787&view=auto
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/UploadCertificateFile.java (added)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/UploadCertificateFile.java Thu Apr 13 04:34:08 2006
@@ -0,0 +1,142 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+package org.apache.geronimo.console.certmanager.actions;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+import java.security.cert.CertificateFactory;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileUploadException;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.fileupload.portlet.PortletFileUpload;
+import org.apache.geronimo.console.certmanager.CertManagerPortlet;
+
+public class UploadCertificateFile {
+
+    public static void action(CertManagerPortlet portlet,
+            ActionRequest request, ActionResponse response)
+            throws PortletException, IOException {
+        if (!PortletFileUpload.isMultipartContent(request)) {
+            throw new PortletException("Expected file upload");
+        }
+
+        File rootDir = new File(System.getProperty("java.io.tmpdir"));
+        PortletFileUpload uploader = new PortletFileUpload(
+                new DiskFileItemFactory(10240, rootDir));
+        File certFile = null;
+
+        try {
+            List items = uploader.parseRequest(request);
+            for (Iterator i = items.iterator(); i.hasNext();) {
+                FileItem item = (FileItem) i.next();
+                if (!item.isFormField()) {
+                    String name = item.getName().trim();
+
+                    if (name.length() == 0) {
+                        certFile = null;
+                    } else {
+                        // Firefox sends basename, IE sends full path
+                        int index = name.lastIndexOf('\\');
+                        if (index != -1) {
+                            name = name.substring(index + 1);
+                        }
+                        certFile = new File(rootDir, name);
+                    }
+
+                    if (certFile != null) {
+                        try {
+                            item.write(certFile);
+                        } catch (Exception e) {
+                            throw new PortletException(e);
+                        }
+                    }
+                }
+            }
+        } catch (FileUploadException e) {
+            throw new PortletException(e);
+        }
+
+        // pass certificate file name along
+        String certFileName = certFile.getCanonicalPath();
+        String enc = URLEncoder.encode(certFileName, "UTF-8");
+
+        portlet.getPortletContext().log("cert-file-name: " + certFileName);
+        portlet.getPortletContext().log("enc: " + enc);
+
+        response.setRenderParameter("org.apache.geronimo.console.cert.file.enc", enc);
+        response.setRenderParameter("action", request.getParameter("action"));
+    }
+
+    public static void render(CertManagerPortlet portlet,
+            RenderRequest request, RenderResponse response)
+            throws PortletException, IOException {
+
+        String encodedCertFileName = request
+                .getParameter("org.apache.geronimo.console.cert.file.enc");
+        String certFileName = URLDecoder.decode(encodedCertFileName, "UTF-8");
+        portlet.getPortletContext().log("cert file: " + certFileName);
+
+        Collection certs = null;
+        InputStream is = null;
+
+        if (certFileName != null) {
+            File certFile = new File(certFileName);
+            try {
+                is = new FileInputStream(certFile);
+
+                CertificateFactory cf = CertificateFactory.getInstance("X.509");
+                certs = cf.generateCertificates(is);
+            } catch (Exception e) {
+                throw new PortletException(e);
+            } finally {
+                try {
+                    if (is != null) {
+                        is.close();
+                    }
+                } catch (Exception e) {
+                }
+            }
+
+            request.setAttribute("org.apache.geronimo.console.certs", certs);
+            request.setAttribute("org.apache.geronimo.console.cert.file.enc",
+                    encodedCertFileName);
+        }
+
+        PortletRequestDispatcher prd = null;
+
+        prd = portlet.getPortletContext().getRequestDispatcher(
+                "/WEB-INF/view/certmanager/importTrustedCertNormal.jsp");
+
+        prd.include(request, response);
+    }
+}

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/UploadCertificateFile.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/UploadCertificateFile.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/UploadCertificateFile.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ViewKeyStore.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ViewKeyStore.java?rev=393787&view=auto
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ViewKeyStore.java (added)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ViewKeyStore.java Thu Apr 13 04:34:08 2006
@@ -0,0 +1,83 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+package org.apache.geronimo.console.certmanager.actions;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.management.ObjectName;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.geronimo.console.certmanager.CertManagerPortlet;
+import org.apache.geronimo.kernel.KernelRegistry;
+
+public class ViewKeyStore {
+    public static void action(CertManagerPortlet portlet,
+            ActionRequest request, ActionResponse response)
+            throws PortletException, Exception {
+        response.setRenderParameter("action", request.getParameter("action"));
+    }
+
+    public static void render(CertManagerPortlet portlet,
+            RenderRequest request, RenderResponse response)
+            throws PortletException, IOException {
+
+        PortletRequestDispatcher rd = null;
+
+        try {
+            ObjectName objname = portlet.getKeyStoreObjectName();
+
+            String keyStoreType = (String) KernelRegistry.getSingleKernel()
+                    .getAttribute(objname, "keyStoreType");
+            String keyStoreProvider = (String) KernelRegistry.getSingleKernel()
+                    .getAttribute(objname, "keyStoreProvider");
+            String keyStoreLocation = (String) KernelRegistry.getSingleKernel()
+                    .getAttribute(objname, "keyStoreLocation");
+
+            request.setAttribute("org.apache.geronimo.console.keystore.type", keyStoreType);
+            request.setAttribute("org.apache.geronimo.console.keystore.provider",
+                    keyStoreProvider);
+            request.setAttribute("org.apache.geronimo.console.keystore.location",
+                    keyStoreLocation);
+
+            List storelist = (List) KernelRegistry.getSingleKernel().invoke(
+                    objname, "getKeyStoreEntries");
+
+            Iterator iter = storelist.iterator();
+            while (iter.hasNext()) {
+                portlet.getPortletContext().log("store-item = " + iter.next());
+            }
+
+            request.setAttribute("org.apache.geronimo.console.keystore.list", storelist);
+            request.setAttribute("org.apache.geronimo.console.keystore.size", String
+                    .valueOf(storelist.size()));
+        } catch (Exception e) {
+            throw new PortletException(e);
+        }
+
+        rd = portlet.getPortletContext().getRequestDispatcher(
+                "/WEB-INF/view/certmanager/viewKeyStoreNormal.jsp");
+        rd.include(request, response);
+    }
+}

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ViewKeyStore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ViewKeyStore.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ViewKeyStore.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ViewKeyStoreEntryDetail.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ViewKeyStoreEntryDetail.java?rev=393787&view=auto
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ViewKeyStoreEntryDetail.java (added)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ViewKeyStoreEntryDetail.java Thu Apr 13 04:34:08 2006
@@ -0,0 +1,73 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+package org.apache.geronimo.console.certmanager.actions;
+
+import java.io.IOException;
+import java.security.cert.Certificate;
+import javax.management.ObjectName;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.geronimo.console.certmanager.CertManagerPortlet;
+import org.apache.geronimo.console.core.keystore.KeyEntryInfo;
+import org.apache.geronimo.console.util.ObjectNameConstants;
+import org.apache.geronimo.kernel.KernelRegistry;
+
+public class ViewKeyStoreEntryDetail {
+
+    public static void render(CertManagerPortlet portlet,
+            RenderRequest request, RenderResponse response)
+            throws PortletException, IOException {
+
+        String alias = request.getParameter("alias");
+
+        portlet.getPortletContext().log(
+                "view-key-store-entry-detail: key-store-alias = " + alias);
+
+        try {
+            // entry info
+            ObjectName objname = ObjectNameConstants.KEYSTORE_OBJ_NAME;
+            KeyEntryInfo kinfo = (KeyEntryInfo) KernelRegistry
+                    .getSingleKernel().invoke(objname, "getKeyEntryInfo",
+                            new Object[] { alias },
+                            new String[] { "java.lang.String" });
+
+            request.setAttribute("org.apache.geronimo.console.keystore.entry.info", kinfo);
+
+            // get keystore certificate chain by the alias
+            Certificate[] chain = (Certificate[]) KernelRegistry
+                    .getSingleKernel().invoke(objname, "getCertificateChain",
+                            new Object[] { alias },
+                            new String[] { "java.lang.String" });
+
+            // set attributes
+            request.setAttribute("org.apache.geronimo.console.certs", chain);
+        } catch (Exception e) {
+            throw new PortletException(e);
+        }
+
+        // display entry detail
+        PortletRequestDispatcher rd = portlet.getPortletContext()
+                .getRequestDispatcher(
+                        "/WEB-INF/view/certmanager/viewCertificateNormal.jsp");
+
+        rd.include(request, response);
+    }
+}

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ViewKeyStoreEntryDetail.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ViewKeyStoreEntryDetail.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/certmanager/actions/ViewKeyStoreEntryDetail.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java?rev=393787&view=auto
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java (added)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java Thu Apr 13 04:34:08 2006
@@ -0,0 +1,268 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+package org.apache.geronimo.console.configmanager;
+
+import org.apache.geronimo.console.BasePortlet;
+import org.apache.geronimo.console.util.SecurityConstants;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.KernelRegistry;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationInfo;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.config.NoSuchStoreException;
+import org.apache.geronimo.kernel.management.State;
+
+import javax.management.ObjectName;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+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 java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.Collections;
+
+public class ConfigManagerPortlet extends BasePortlet {
+
+    private static final String START_ACTION = "start";
+
+    private static final String STOP_ACTION = "stop";
+
+    private static final String UNINSTALL_ACTION = "uninstall";
+
+    private static final String CONTAINSCONFIG_METHOD = "containsConfiguration";
+
+    private static final String UNINSTALL_METHOD = "uninstall";
+
+    private static final String[] CONTAINSCONFIG_SIG = {URI.class.getName()};
+
+    private static final String[] UNINSTALL_SIG = {URI.class.getName()};
+
+    private static final String QUEUETOPIC_URI = "runtimedestination/";
+
+    private static final String CONFIG_INIT_PARAM = "config-type";
+
+    private String messageInstalled = "";
+
+    private String messageStatus = "";
+
+    private Kernel kernel;
+
+    private PortletRequestDispatcher normalView;
+
+    private PortletRequestDispatcher maximizedView;
+
+    private PortletRequestDispatcher helpView;
+
+    private static final Collection EXCLUDED;
+
+    static {
+        // Add list of the configurationIDs that you do not want to list to this
+        // List.
+        EXCLUDED = new ArrayList();
+    }
+
+    public void processAction(ActionRequest actionRequest,
+                              ActionResponse actionResponse) throws PortletException, IOException {
+        String action = actionRequest.getParameter("action");
+        actionResponse.setRenderParameter("message", ""); // set to blank first
+        try {
+            ConfigurationManager configurationManager = ConfigurationUtil
+                    .getConfigurationManager(kernel);
+            String config = getConfigID(actionRequest);
+            URI configID = URI.create(config);
+
+            if (START_ACTION.equals(action)) {
+                List list = configurationManager.loadRecursive(configID);
+                for (Iterator it = list.iterator(); it.hasNext();) {
+                    URI uri = (URI) it.next();
+                    configurationManager.loadGBeans(uri);
+                    configurationManager.start(uri);
+                }
+                messageStatus = "Started application<br /><br />";
+            } else if (STOP_ACTION.equals(action)) {
+                configurationManager.stop(configID);
+                configurationManager.unload(configID);
+                messageStatus = "Stopped application<br /><br />";
+            } else if (UNINSTALL_ACTION.equals(action)) {
+                uninstallConfig(actionRequest);
+                messageStatus = "Uninstalled application<br /><br />";
+            } else {
+                messageStatus = "Invalid value for changeState: " + action
+                        + "<br /><br />";
+                throw new PortletException("Invalid value for changeState: "
+                        + action);
+            }
+        } catch (NoSuchConfigException e) {
+            // ignore this for now
+            messageStatus = "Configuration not found<br /><br />";
+            throw new PortletException("Configuration not found", e);
+        } catch (InvalidConfigException e) {
+            messageStatus = "Configuration not found<br /><br />";
+            throw new PortletException("Configuration not found", e);
+        } catch (Exception e) {
+            messageStatus = "Encountered an unhandled exception<br /><br />";
+            throw new PortletException("Exception", e);
+        }
+    }
+
+    /**
+     * Uninstall an application configuration
+     *
+     * @param actionRequest
+     * @throws PortletException
+     * @throws Exception
+     */
+    private void uninstallConfig(ActionRequest actionRequest)
+            throws PortletException, Exception {
+        ConfigurationManager configManager = ConfigurationUtil
+                .getConfigurationManager(kernel);
+        List configStores = configManager.listStores();
+        int size = configStores.size();
+        String configID = getConfigID(actionRequest);
+        URI configURI = URI.create(configID);
+        for (int i = 0; i < size; i++) {
+            ObjectName configStore = (ObjectName) configStores.get(i);
+            Boolean result = (Boolean) kernel.invoke(configStore,
+                    CONTAINSCONFIG_METHOD,
+                    new Object[]{configURI}, CONTAINSCONFIG_SIG);
+            if (result.booleanValue() == true) {
+                // stop config if running
+                if (configManager.isLoaded(configURI)) {
+                    int state = kernel.getGBeanState(Configuration.getConfigurationObjectName(configURI));
+                    if (state == State.RUNNING.toInt()) {
+
+                        configManager.stop(configURI);
+                        configManager.unload(configURI);
+                    }
+                }
+                kernel.invoke(configStore, UNINSTALL_METHOD, new Object[]{configURI}, UNINSTALL_SIG);
+            }
+        }
+    }
+
+    /**
+     * Check if a configuration should be listed here. This method depends on the "config-type" portlet parameter
+     * which is set in portle.xml.
+     */
+    private boolean shouldListConfig(ConfigurationInfo info) {
+        String configType = getInitParameter(CONFIG_INIT_PARAM);
+        if (configType != null && !info.getType().getName().equalsIgnoreCase(configType))
+            return false;
+        else
+            return true;
+    }
+
+    /*
+     * private URI getConfigID(ActionRequest actionRequest) throws
+     * PortletException { URI configID; try { configID = new
+     * URI(actionRequest.getParameter("configId")); } catch (URISyntaxException
+     * e) { throw new PortletException("Invalid configId parameter: " +
+     * actionRequest.getParameter("configId")); } return configID; }
+     */
+
+    private String getConfigID(ActionRequest actionRequest)
+            throws PortletException {
+        return actionRequest.getParameter("configId");
+    }
+
+    protected void doView(RenderRequest renderRequest,
+                          RenderResponse renderResponse) throws IOException, PortletException {
+        if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
+            return;
+        }
+
+        List configInfo = new ArrayList();
+        ConfigurationManager configManager = ConfigurationUtil
+                .getConfigurationManager(kernel);
+        List stores = configManager.listStores();
+        for (Iterator i = stores.iterator(); i.hasNext();) {
+            ObjectName storeName = (ObjectName) i.next();
+            try {
+                List infos = configManager.listConfigurations(storeName);
+                for (Iterator j = infos.iterator(); j.hasNext();) {
+                    ConfigurationInfo info = (ConfigurationInfo) j.next();
+                    if (shouldListConfig(info)) {
+                        // TODO: Check if this is the right solution
+                        // Disregard JMS Queues and Topics &&
+                        if (!info.getConfigID().getPath().startsWith(QUEUETOPIC_URI)
+                                && !info
+                                .getConfigID()
+                                .getPath()
+                                .startsWith(SecurityConstants.SECURITY_CONFIG_PREFIX)) {
+                            configInfo.add(info);
+                        }
+                    }
+                }
+            } catch (NoSuchStoreException e) {
+                // we just got this list so this should not happen
+                // in the unlikely event it does, just continue
+            }
+        }
+        Collections.sort(configInfo, new Comparator() {
+            public int compare(Object o1, Object o2) {
+                ConfigurationInfo ci1 = (ConfigurationInfo) o1;
+                ConfigurationInfo ci2 = (ConfigurationInfo) o2;
+                return ci1.getConfigID().toString().compareTo(ci2.getConfigID().toString());
+            }
+        });
+        renderRequest.setAttribute("configurations", configInfo);
+        messageInstalled = configInfo.size() == 0 ? "No modules found of this type<br /><br />"
+                : "";
+        renderRequest.setAttribute("messageInstalled", messageInstalled);
+        renderRequest.setAttribute("messageStatus", messageStatus);
+        messageStatus = "";
+        if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
+            normalView.include(renderRequest, renderResponse);
+        } else {
+            maximizedView.include(renderRequest, renderResponse);
+        }
+    }
+
+    protected void doHelp(RenderRequest renderRequest,
+                          RenderResponse renderResponse) throws PortletException, IOException {
+        helpView.include(renderRequest, renderResponse);
+    }
+
+    public void init(PortletConfig portletConfig) throws PortletException {
+        super.init(portletConfig);
+        kernel = KernelRegistry.getSingleKernel();
+        normalView = portletConfig.getPortletContext().getRequestDispatcher("/WEB-INF/view/configmanager/normal.jsp");
+        maximizedView = portletConfig.getPortletContext().getRequestDispatcher("/WEB-INF/view/configmanager/maximized.jsp");
+        helpView = portletConfig.getPortletContext().getRequestDispatcher("/WEB-INF/view/configmanager/help.jsp");
+    }
+
+    public void destroy() {
+        normalView = null;
+        maximizedView = null;
+        kernel = null;
+        super.destroy();
+    }
+}

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java?rev=393787&view=auto
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java (added)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java Thu Apr 13 04:34:08 2006
@@ -0,0 +1,186 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+package org.apache.geronimo.console.configmanager;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.util.Iterator;
+import java.util.List;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileUploadException;
+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;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
+
+public class DeploymentPortlet extends BasePortlet {
+    private final String LINE_SEP = System.getProperty("line.separator");
+
+    private PortletRequestDispatcher deployView;
+
+    private PortletRequestDispatcher helpView;
+
+    private Kernel kernel;
+
+    private static final String[] ARGS = {File.class.getName(),
+                                          File.class.getName()};
+
+    private boolean messageNotRendered = true;
+
+    public void processAction(ActionRequest actionRequest,
+                              ActionResponse actionResponse) throws PortletException, IOException {
+        messageNotRendered = true;
+        if (!PortletFileUpload.isMultipartContent(actionRequest)) {
+            throw new PortletException("Expected file upload");
+        }
+
+        File rootDir = new File(System.getProperty("java.io.tmpdir"));
+        PortletFileUpload uploader = new PortletFileUpload(new DiskFileItemFactory(10240, rootDir));
+        File moduleFile = null;
+        File planFile = null;
+        String startApp = null;
+        try {
+            List items = uploader.parseRequest(actionRequest);
+            for (Iterator i = items.iterator(); i.hasNext();) {
+                FileItem item = (FileItem) i.next();
+                if (!item.isFormField()) {
+                    String fieldName = item.getFieldName();
+                    String name = item.getName().trim();
+                    File file;
+                    if (name.length() == 0) {
+                        file = null;
+                    } else {
+                        // Firefox sends basename, IE sends full path
+                        int index = name.lastIndexOf('\\');
+                        if (index != -1) {
+                            name = name.substring(index + 1);
+                        }
+                        file = new File(rootDir, name);
+                    }
+                    if ("module".equals(fieldName)) {
+                        moduleFile = file;
+                    } else if ("plan".equals(fieldName)) {
+                        planFile = file;
+                    }
+                    if (file != null) {
+                        try {
+                            item.write(file);
+                        } catch (Exception e) {
+                            throw new PortletException(e);
+                        }
+                    }
+                } else {
+                    // retrieve 'startApp' form field value
+                    if ("startApp".equalsIgnoreCase(item.getFieldName())) {
+                        startApp = item.getString();
+                    }
+                }
+            }
+        } catch (FileUploadException e) {
+            throw new PortletException(e);
+        }
+        try {
+            List list = (List) kernel.invoke(ObjectNameConstants.DEPLOYER_OBJECT_NAME, "deploy", new Object[]{
+                moduleFile, planFile}, ARGS);
+            actionResponse.setRenderParameter("outcome",
+                    "The application was successfully deployed.<br/>");
+            // start installed app/s
+            if ((startApp != null) && "YES".equalsIgnoreCase(startApp)) {
+                ConfigurationManager configurationManager = ConfigurationUtil
+                        .getConfigurationManager(kernel);
+                for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+                    URI configID = URI.create((String)iterator.next());
+                    if (!configurationManager.isLoaded(configID)) {
+                        configurationManager.load(configID);
+                    }
+                    configurationManager.loadGBeans(configID);
+                    configurationManager.start(configID);
+                }
+            }
+        } catch (DeploymentException e) {
+            e.printStackTrace();
+            StringBuffer buf = new StringBuffer(256);
+            Throwable cause = e;
+            while (cause != null) {
+                append(buf, cause.getMessage());
+                buf.append(LINE_SEP);
+                cause = cause.getCause();
+            }
+            actionResponse.setRenderParameter("outcome", buf.toString());
+        } catch (Exception e) {
+            throw new PortletException(e);
+        }
+    }
+
+    private void append(StringBuffer buf, String message) {
+        for (int i = 0; i < message.length(); i++) {
+            char ch = message.charAt(i);
+            if (ch == '<') {
+                buf.append("&lt;");
+            } else if (ch == '>') {
+                buf.append("&gt;");
+            } else {
+                buf.append(ch);
+            }
+        }
+    }
+
+    protected void doView(RenderRequest renderRequest,
+                          RenderResponse renderResponse) throws PortletException, IOException {
+        if (messageNotRendered) {
+            renderRequest.setAttribute("outcome", renderRequest
+                    .getParameter("outcome"));
+            messageNotRendered = false;
+        }
+        deployView.include(renderRequest, renderResponse);
+        // clear previous message for next rendering
+    }
+
+    protected void doHelp(RenderRequest renderRequest,
+                          RenderResponse renderResponse) throws PortletException, IOException {
+        helpView.include(renderRequest, renderResponse);
+    }
+
+    public void init(PortletConfig portletConfig) throws PortletException {
+        super.init(portletConfig);
+        kernel = KernelRegistry.getSingleKernel();
+        deployView = portletConfig.getPortletContext().getRequestDispatcher("/WEB-INF/view/configmanager/deploy.jsp");
+        helpView = portletConfig.getPortletContext().getRequestDispatcher("/WEB-INF/view/configmanager/deployHelp.jsp");
+    }
+
+    public void destroy() {
+        deployView = null;
+        helpView = null;
+        kernel = null;
+        super.destroy();
+    }
+}

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/databasemanager/DataSourceInfo.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/databasemanager/DataSourceInfo.java?rev=393787&view=auto
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/databasemanager/DataSourceInfo.java (added)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/databasemanager/DataSourceInfo.java Thu Apr 13 04:34:08 2006
@@ -0,0 +1,76 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+package org.apache.geronimo.console.databasemanager;
+
+import javax.management.ObjectName;
+
+public class DataSourceInfo implements Comparable {
+    private ObjectName objectName;
+
+    private String name;
+
+    private Integer state;
+
+    private boolean working;
+
+    private String message;
+
+    public ObjectName getObjectName() {
+        return objectName;
+    }
+
+    public void setObjectName(ObjectName objectName) {
+        this.objectName = objectName;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getState() {
+        return state;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
+    public int compareTo(Object o) {
+        return name.compareToIgnoreCase(((DataSourceInfo) o).name);
+    }
+
+    public boolean isWorking() {
+        return working;
+    }
+
+    public void setWorking(boolean working) {
+        this.working = working;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+}

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/databasemanager/DataSourceInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/databasemanager/DataSourceInfo.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/databasemanager/DataSourceInfo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabaseInfo.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabaseInfo.java?rev=393787&view=auto
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabaseInfo.java (added)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabaseInfo.java Thu Apr 13 04:34:08 2006
@@ -0,0 +1,143 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed 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.
+ */
+package org.apache.geronimo.console.databasemanager.wizard;
+
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Information about common database drivers.
+ *
+ * @version $Rev$ $Date$
+ */
+public class DatabaseInfo {
+    /**
+     * todo: EVIL!!!  Should be replaced with something, somehow!
+     */
+    private final static String TRANQL_RAR_NAME = "tranql/tranql-connector/1.1/rar";
+    private final static String DERBY_EMBEDDED_RAR_NAME = "tranql/tranql-connector-derby-embed-xa/1.1/rar";
+    private final static String DERBY_NETWORK_RAR_NAME = "tranql/tranql-connector-derby-client-xa/1.1/rar";
+
+    //todo: Load this from a config file or something
+    public static final DatabaseInfo[] ALL_DATABASES = new DatabaseInfo[]{
+        new DatabaseInfo("DaffodilDB Embedded","jdbc:daffodilDB_embedded:<Database>","in.co.daffodil.db.jdbc.DaffodilDBDriver"),
+        new DatabaseInfo("DaffodilDB Server","jdbc:daffodilDB://<Host>:<Port>/<Database>","in.co.daffodil.db.rmi.RmiDaffodilDBDriver", 3456),
+        new DatabaseInfo("DB2","jdbc:db2://<Host>:<Port>/<Database>","com.ibm.db2.jcc.DB2Driver", 50000),
+        new DatabaseInfo("DB2 (DataDirect)","jdbc:datadirect:db2://<Host>:<Port>;DatabaseName=<Database>","com.ddtek.jdbc.db2.DB2Driver", 50000),
+        new DatabaseInfo("Derby embedded","jdbc:derby:<Database>","org.apache.derby.jdbc.EmbeddedDriver"),
+        new DatabaseInfo("Derby network","jdbc:derby://<Host>:<Port>/<Database>","org.apache.derby.jdbc.ClientDriver", 1527),
+        new DatabaseInfo("Derby embedded XA", DERBY_EMBEDDED_RAR_NAME),
+        new DatabaseInfo("Derby network XA", DERBY_NETWORK_RAR_NAME),
+        new DatabaseInfo("FrontBase","jdbc:FrontBase://<Host>:<Port>/<Database>","com.frontbase.jdbc.FBJDriver"),
+        new DatabaseInfo("HSQLDB embedded","jdbc:hsqldb:<Database>","org.hsqldb.jdbcDriver"),
+        new DatabaseInfo("HSQLDB server","jdbc:hsqldb:hsql://<Host>:<Port>/<Database>","org.hsqldb.jdbcDriver"),
+        new DatabaseInfo("Informix","jdbc:informix-sqli://<Host>:<Port>/<Database>:informixserver=<dbservername>","com.informix.jdbc.IfxDriver"),
+        new DatabaseInfo("Informix (DataDirect)","jdbc:datadirect:informix://<Host>:<Port>;informixServer=<dbservername>;DatabaseName=<Database>","com.ddtek.jdbc.informix.InformixDriver"),
+        new DatabaseInfo("InterSystems Cache","jdbc:Cache://<Host>:<Port>/<namespace>","com.intersys.jdbc.CacheDriver"),
+        new DatabaseInfo("JDataStore","jdbc:borland:dslocal:<file>","com.borland.datastore.jdbc.DataStoreDriver"),
+        new DatabaseInfo("JDBC/ODBC Bridge","jdbc:odbc:<datasource>","sun.jdbc.odbc.JdbcOdbcDriver"),
+        new DatabaseInfo("McKoi embedded","jdbc:mckoi:local://<ConfigPath>/<Schema>/","com.mckoi.JDBCDriver"),
+        new DatabaseInfo("McKoi server","jdbc:mckoi://<Host>:<Port>/<Schema>/","com.mckoi.JDBCDriver"),
+        new DatabaseInfo("Mimer","jdbc:mimer://<Host>:<Port>/<Database>","com.mimer.jdbc.Driver"),
+        new DatabaseInfo("MySQL","jdbc:mysql://<Host>:<Port>/<Database>","com.mysql.jdbc.Driver", 3306),
+        new DatabaseInfo("Oracle Thin","jdbc:oracle:thin:@<Host>:<Port>:<SID>","oracle.jdbc.OracleDriver", 1521),
+        new DatabaseInfo("Oracle OCI","jdbc:oracle:oci:@<Host>:<Port>:<SID>","oracle.jdbc.OracleDriver", 1521),
+        new DatabaseInfo("Oracle (DataDirect)","jdbc:datadirect:oracle://<Host>:<Port>;ServiceName=<SID>","com.ddtek.jdbc.oracle.OracleDriver", 1521),
+        new DatabaseInfo("Pervasive","jdbc:pervasive://<Host>:<Port>/<Database>","com.pervasive.jdbc.v2.Driver"),
+        new DatabaseInfo("Pointbase server","jdbc:pointbase:server://<Host>:<Port>/<Database>","com.pointbase.jdbc.jdbcUniversalDriver"),
+        new DatabaseInfo("PostgreSQL","jdbc:postgresql://<Host>:<Port>/<Database>","org.postgresql.Driver", 5432),
+        new DatabaseInfo("Progress","jdbc:jdbcProgress:T:<Host>:<Port>:<Database>","com.progress.sql.jdbc.JdbcProgressDriver"),
+        new DatabaseInfo("MaxDB","jdbc:sapdb://<Host>:<Port>/<Database>","com.sap.dbtech.jdbc.DriverSapDB"),
+        new DatabaseInfo("SQL Server","jdbc:microsoft:sqlserver://<Host>:<Port>;DatabaseName=<Database>","com.microsoft.jdbc.sqlserver.SQLServerDriver", 1433),
+        new DatabaseInfo("SQL Server (jTDS)","jdbc:jtds:sqlserver://<Host>:<Port>;DatabaseName=<Database>","net.sourceforge.jtds.jdbc.Driver", 1433),
+        new DatabaseInfo("SQL Server (DataDirect)","jdbc:datadirect:sqlserver://<Host>:<Port>;DatabaseName=<Database>","com.ddtek.jdbc.sqlserver.SQLServerDriver", 1433),
+        new DatabaseInfo("Sybase ASE","jdbc:sybase:Tds:<Host>:<Port>/<Database>","com.sybase.jdbc3.jdbc.SybDriver", 2048),
+        new DatabaseInfo("Sybase ASA","jdbc:sybase:Tds:<Host>:<Port>/<Database>","com.sybase.jdbc3.jdbc.SybDriver", 2638),
+        new DatabaseInfo("Sybase (DataDirect)","jdbc:datadirect:sybase://<Host>:<Port>;DatabaseName=<Database>","com.ddtek.jdbc.sybase.SybaseDriver"),
+        new DatabaseInfo("Other","",""),
+    };
+    private final static Pattern PARAM_PATTERN = Pattern.compile("<.+?>");
+
+    private String name;
+    private String url;
+    private String driverClass;
+    private int defaultPort;
+    private boolean xa;
+    private String rarPath;
+
+    public DatabaseInfo(String name, String url, String driverClass) {
+        this.name = name;
+        this.url = url;
+        this.driverClass = driverClass;
+        xa = false;
+        rarPath = getDefaultRARPath();
+    }
+
+    public DatabaseInfo(String name, String url, String driverClass, int defaultPort) {
+        this.name = name;
+        this.url = url;
+        this.driverClass = driverClass;
+        this.defaultPort = defaultPort;
+        xa = false;
+        rarPath = getDefaultRARPath();
+    }
+
+    public DatabaseInfo(String name, String rarPath) {
+        this.name = name;
+        xa = true;
+        this.rarPath = rarPath;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public String getDriverClass() {
+        return driverClass;
+    }
+
+    public int getDefaultPort() {
+        return defaultPort;
+    }
+
+    public boolean isXA() {
+        return xa;
+    }
+
+    public String getRarPath() {
+        return rarPath;
+    }
+
+    public String[] getUrlParameters() {
+        Matcher m = PARAM_PATTERN.matcher(url);
+        List list = new ArrayList();
+        while(m.find()) {
+            list.add(url.substring(m.start()+1, m.end()-1));
+        }
+        return (String[]) list.toArray(new String[list.size()]);
+    }
+
+    public static String getDefaultRARPath() {
+        return TRANQL_RAR_NAME;
+    }
+}

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabaseInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabaseInfo.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabaseInfo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message