Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 38850 invoked from network); 1 Aug 2006 20:32:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Aug 2006 20:32:40 -0000 Received: (qmail 76652 invoked by uid 500); 1 Aug 2006 20:32:40 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 76614 invoked by uid 500); 1 Aug 2006 20:32:40 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 76602 invoked by uid 99); 1 Aug 2006 20:32:40 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 13:32:40 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 13:32:39 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id EE6391A981D; Tue, 1 Aug 2006 13:32:18 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r427714 - in /geronimo/trunk: applications/console/console-standard/src/java/org/apache/geronimo/console/car/ modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ modules/system/src/java/org/apache/geronimo/system/plugin/ Date: Tue, 01 Aug 2006 20:32:18 -0000 To: scm@geronimo.apache.org From: ammulder@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060801203218.EE6391A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ammulder Date: Tue Aug 1 13:32:17 2006 New Revision: 427714 URL: http://svn.apache.org/viewvc?rev=427714&view=rev Log: Merge GERONIMO-2261 and GERONIMO-2243 to trunk Modified: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/AddRepositoryHandler.java geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ListHandler.java geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java Modified: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/AddRepositoryHandler.java URL: http://svn.apache.org/viewvc/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/AddRepositoryHandler.java?rev=427714&r1=427713&r2=427714&view=diff ============================================================================== --- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/AddRepositoryHandler.java (original) +++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/AddRepositoryHandler.java Tue Aug 1 13:32:17 2006 @@ -16,12 +16,11 @@ */ package org.apache.geronimo.console.car; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.geronimo.console.MultiPageModel; import org.apache.geronimo.console.util.PortletManager; -import org.apache.geronimo.console.util.ConfigurationData; import org.apache.geronimo.system.plugin.PluginRepositoryList; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; @@ -30,14 +29,14 @@ import javax.portlet.RenderResponse; import java.io.IOException; import java.io.InputStream; -import java.io.FileNotFoundException; -import java.util.List; -import java.util.ArrayList; -import java.util.Arrays; -import java.net.URL; +import java.net.ConnectException; import java.net.HttpURLConnection; import java.net.MalformedURLException; +import java.net.URL; import java.net.URLConnection; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; /** * Handler for the import export main screen. @@ -116,7 +115,12 @@ URLConnection urlConnection = test.openConnection(); if(urlConnection instanceof HttpURLConnection) { HttpURLConnection con = (HttpURLConnection) urlConnection; - con.connect(); + try { + con.connect(); + } catch (ConnectException e) { + response.setRenderParameter("repoError", "Unable to connect to "+url+" ("+e.getMessage()+")"); + return false; + } int result = con.getResponseCode(); log.debug("Repository check response: "+result); if(result == 404) { Modified: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ListHandler.java URL: http://svn.apache.org/viewvc/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ListHandler.java?rev=427714&r1=427713&r2=427714&view=diff ============================================================================== --- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ListHandler.java (original) +++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ListHandler.java Tue Aug 1 13:32:17 2006 @@ -67,7 +67,9 @@ String repository = request.getParameter("repository"); String user = request.getParameter("repo-user"); String pass = request.getParameter("repo-pass"); - loadFromRepository(request, repository, user, pass); + if(!loadFromRepository(request, repository, user, pass)) { + //todo: loading failed -- do something! + } request.setAttribute("repository", repository); request.setAttribute("repouser", user); request.setAttribute("repopass", pass); @@ -77,7 +79,7 @@ return getMode()+BEFORE_ACTION; } - private void loadFromRepository(RenderRequest request, String repository, String username, String password) throws IOException, PortletException { + private boolean loadFromRepository(RenderRequest request, String repository, String username, String password) throws IOException, PortletException { PluginList data; try { data = PortletManager.getCurrentServer(request).getPluginInstaller().listPlugins(new URL(repository), username, password); @@ -85,6 +87,9 @@ throw new PortletException("Invalid login for Maven repository '"+repository+"'", e); } Map results = new HashMap(); + if(data == null || data.getPlugins() == null) { + return false; + } for (int i = 0; i < data.getPlugins().length; i++) { PluginMetadata metadata = data.getPlugins()[i]; List values = (List) results.get(metadata.getCategory()); @@ -101,5 +106,6 @@ } request.setAttribute("categories", results); request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, data); + return true; } } Modified: geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java?rev=427714&r1=427713&r2=427714&view=diff ============================================================================== --- geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java (original) +++ geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java Tue Aug 1 13:32:17 2006 @@ -22,6 +22,7 @@ import java.net.URISyntaxException; import java.net.URL; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -29,18 +30,14 @@ import java.util.List; import java.util.Map; import java.util.Set; -import java.util.Arrays; - import javax.naming.NamingException; import javax.naming.Reference; import javax.transaction.UserTransaction; import javax.xml.namespace.QName; - import org.apache.geronimo.common.DeploymentException; import org.apache.geronimo.common.UnresolvedReferenceException; import org.apache.geronimo.gbean.AbstractNameQuery; import org.apache.geronimo.gbean.GBeanData; -import org.apache.geronimo.gbean.ReferencePatterns; import org.apache.geronimo.j2ee.deployment.EARContext; import org.apache.geronimo.j2ee.deployment.Module; import org.apache.geronimo.j2ee.deployment.RefContext; @@ -855,7 +852,6 @@ return refMap; } - //TODO consider including target interface public static AbstractNameQuery buildAbstractNameQuery(GerPatternType pattern, String type, String moduleType, Set interfaceTypes) { String groupId = pattern.isSetGroupId() ? pattern.getGroupId().trim() : null; String artifactid = pattern.isSetArtifactId() ? pattern.getArtifactId().trim() : null; @@ -871,6 +867,14 @@ } if (module != null && moduleType != null) { nameMap.put(moduleType, module); + } + if(interfaceTypes != null) { + Set trimmed = new HashSet(); + for (Iterator it = interfaceTypes.iterator(); it.hasNext();) { + String intf = (String) it.next(); + trimmed.add(intf == null ? null : intf.trim()); + } + interfaceTypes = trimmed; } return new AbstractNameQuery(artifact, nameMap, interfaceTypes); } Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?rev=427714&r1=427713&r2=427714&view=diff ============================================================================== --- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java (original) +++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java Tue Aug 1 13:32:17 2006 @@ -1351,7 +1351,7 @@ if (moduleId != null) { artifact = Artifact.create(moduleId); // Tests, etc. don't need to have a ConfigurationManager - installed = configManager != null && configManager.isLoaded(artifact); + installed = configManager != null && configManager.isInstalled(artifact); } log.trace("Checking "+moduleId+": installed="+installed+", eligible="+eligible); PluginMetadata data = new PluginMetadata(getChildText(plugin, "name"),