Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 20374 invoked from network); 2 Aug 2006 14:14:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Aug 2006 14:14:13 -0000 Received: (qmail 87640 invoked by uid 500); 2 Aug 2006 14:14:11 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 87603 invoked by uid 500); 2 Aug 2006 14:14:11 -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 87574 invoked by uid 99); 2 Aug 2006 14:14:11 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2006 07:14:11 -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; Wed, 02 Aug 2006 07:14:08 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 106031A981D; Wed, 2 Aug 2006 07:13:48 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r427991 - in /geronimo/sandbox/svkmerge/trunk: ./ applications/console/console-standard/src/java/org/apache/geronimo/console/car/ applications/console/console-standard/src/webapp/WEB-INF/view/car/ modules/system/src/java/org/apache/geronimo... Date: Wed, 02 Aug 2006 14:13:44 -0000 To: scm@geronimo.apache.org From: jdillon@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060802141348.106031A981D@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: jdillon Date: Wed Aug 2 07:13:42 2006 New Revision: 427991 URL: http://svn.apache.org/viewvc?rev=427991&view=rev Log: r607@dyn456093 (orig r427388): ammulder | 2006-07-31 17:43:46 -0700 Merge GERONIMO-2253 to trunk Added: geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java (with props) geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/viewForDownload.jsp (with props) Modified: geronimo/sandbox/svkmerge/trunk/ (props changed) geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/BaseImportExportHandler.java geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ImportExportPortlet.java geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/download.jsp geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/list.jsp geronimo/sandbox/svkmerge/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java Propchange: geronimo/sandbox/svkmerge/trunk/ ------------------------------------------------------------------------------ --- svk:merge (original) +++ svk:merge Wed Aug 2 07:13:42 2006 @@ -1,2 +1,2 @@ 13f79535-47bb-0310-9956-ffa450edef68:/geronimo/sandbox/svkmerge/m2migration:419395 -13f79535-47bb-0310-9956-ffa450edef68:/geronimo/trunk:427270 +13f79535-47bb-0310-9956-ffa450edef68:/geronimo/trunk:427388 Modified: geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/BaseImportExportHandler.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/BaseImportExportHandler.java?rev=427991&r1=427990&r2=427991&view=diff ============================================================================== --- geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/BaseImportExportHandler.java (original) +++ geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/BaseImportExportHandler.java Wed Aug 2 07:13:42 2006 @@ -29,6 +29,7 @@ protected static final String INDEX_MODE = "index"; protected static final String LIST_MODE = "list"; protected static final String DOWNLOAD_MODE = "download"; + protected static final String VIEW_FOR_DOWNLOAD_MODE = "viewForDownload"; protected static final String DOWNLOAD_STATUS_MODE = "downloadStatus"; protected static final String RESULTS_MODE = "results"; protected static final String CONFIGURE_EXPORT_MODE = "configure"; Modified: geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ImportExportPortlet.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ImportExportPortlet.java?rev=427991&r1=427990&r2=427991&view=diff ============================================================================== --- geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ImportExportPortlet.java (original) +++ geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ImportExportPortlet.java Wed Aug 2 07:13:42 2006 @@ -39,6 +39,7 @@ addHelper(new ExportHandler(), config); addHelper(new DownloadStatusHandler(), config); addHelper(new UpdateListHandler(), config); + addHelper(new ViewPluginDownloadHandler(), config); } protected String getModelJSPVariableName() { Added: geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java?rev=427991&view=auto ============================================================================== --- geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java (added) +++ geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java Wed Aug 2 07:13:42 2006 @@ -0,0 +1,95 @@ +/** + * + * Copyright 2006 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.car; + +import java.io.IOException; +import java.net.URL; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.PortletException; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.security.auth.login.FailedLoginException; +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.system.plugin.PluginMetadata; +import org.apache.geronimo.system.plugin.PluginList; + +/** + * Handler for the screen that shows you plugin details before you go on and + * install it. + * + * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $ + */ +public class ViewPluginDownloadHandler extends BaseImportExportHandler { + private final static Log log = LogFactory.getLog(ViewPluginDownloadHandler.class); + + public ViewPluginDownloadHandler() { + super(VIEW_FOR_DOWNLOAD_MODE, "/WEB-INF/view/car/viewForDownload.jsp"); + } + + public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException { + String configId = request.getParameter("configId"); + String repo = request.getParameter("repository"); + String user = request.getParameter("repo-user"); + String pass = request.getParameter("repo-pass"); + response.setRenderParameter("configId", configId); + response.setRenderParameter("repository", repo); + if(!isEmpty(user)) response.setRenderParameter("repo-user", user); + if(!isEmpty(pass)) response.setRenderParameter("repo-pass", pass); + + return getMode(); + } + + public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException { + String configId = request.getParameter("configId"); + String repo = request.getParameter("repository"); + String user = request.getParameter("repo-user"); + String pass = request.getParameter("repo-pass"); + PluginMetadata config = null; + try { + PluginList list = (PluginList) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY); + if(list == null) { + list = PortletManager.getCurrentServer(request).getPluginInstaller().listPlugins(new URL(repo), user, pass); + request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, list); + } + for (int i = 0; i < list.getPlugins().length; i++) { + PluginMetadata metadata = list.getPlugins()[i]; + if(metadata.getModuleId().toString().equals(configId)) { + config = metadata; + break; + } + } + } catch (FailedLoginException e) { + throw new PortletException("Invalid login for Maven repository '"+repo+"'", e); + } + if(config == null) { + throw new PortletException("No configuration found for '"+configId+"'"); + } + request.setAttribute("configId", configId); + request.setAttribute("plugin", config); + request.setAttribute("repository", repo); + request.setAttribute("repouser", user); + request.setAttribute("repopass", pass); + } + + public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException { + return DOWNLOAD_MODE+BEFORE_ACTION; + } +} Propchange: geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/download.jsp URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/download.jsp?rev=427991&r1=427990&r2=427991&view=diff ============================================================================== --- geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/download.jsp (original) +++ geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/download.jsp Wed Aug 2 07:13:42 2006 @@ -1,4 +1,3 @@ -<%@ page import="org.apache.geronimo.console.util.PortletManager"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%> Modified: geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/list.jsp URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/list.jsp?rev=427991&r1=427990&r2=427991&view=diff ============================================================================== --- geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/list.jsp (original) +++ geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/list.jsp Wed Aug 2 07:13:42 2006 @@ -1,4 +1,3 @@ -<%@ page import="org.apache.geronimo.console.util.PortletManager"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%> @@ -21,19 +20,20 @@ (already installed) - +<%-- (${prereq.moduleIdWithStars} is not installed) - + --%> + (Not available; ">View Details) -
  • ">${entry.name} (${entry.version})
  • +
  • ">${entry.name} (${entry.version})
  • Added: geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/viewForDownload.jsp URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/viewForDownload.jsp?rev=427991&view=auto ============================================================================== --- geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/viewForDownload.jsp (added) +++ geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/viewForDownload.jsp Wed Aug 2 07:13:42 2006 @@ -0,0 +1,121 @@ +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%> + + +

    ${plugin.name}

    + +

    Here is the available information on this plugin:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Name:${plugin.name}
    Module ID:${plugin.moduleId}
    Group:${plugin.category}
    Description:${plugin.HTMLDescription}
    Author:${plugin.author}
    Web Site:${plugin.pluginURL}
    License:${license.name} + + (Open Source) + (Proprietary) + +
    Ger Versions: + ${fn:join(plugin.geronimoVersions, ", ")} +
    JVM Versions: + + + Any + + + ${fn:join(plugin.jvmVersions, ", ")} + + +
    Dependencies: + + ${fn:replace(dependency, "//", "/*/")}
    +
    +
    Prerequisites: + + + None + + + + ${prereq.moduleIdWithStars} (${prereq.resourceType})
    + ${prereq.description} + +
    NOT AVAILABLE +
    +
    +
    +
    +
    Obsoletes: + + + None + + + + ${fn:replace(module, "//", "/*/")}
    +
    +
    +
    +
    + + +
    + + + + + + +
    +
    + +

    ">Cancel

    Propchange: geronimo/sandbox/svkmerge/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/viewForDownload.jsp ------------------------------------------------------------------------------ svn:eol-style = native Modified: geronimo/sandbox/svkmerge/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java?rev=427991&r1=427990&r2=427991&view=diff ============================================================================== --- geronimo/sandbox/svkmerge/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java (original) +++ geronimo/sandbox/svkmerge/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java Wed Aug 2 07:13:42 2006 @@ -18,6 +18,8 @@ import java.io.Serializable; import java.net.URL; +import java.util.List; +import java.util.ArrayList; import org.apache.geronimo.kernel.repository.Artifact; import org.apache.geronimo.system.configuration.GBeanOverride; @@ -96,6 +98,20 @@ } /** + * Gets a description of this module in HTML format (with paragraph + * markers). + */ + public String getHTMLDescription() { + String[] paras = splitParas(description); + StringBuffer buf = new StringBuffer(); + for (int i = 0; i < paras.length; i++) { + String para = paras[i]; + buf.append("

    ").append(para).append("

    \n"); + } + return buf.toString(); + } + + /** * Gets a category name for this configuration. In a list, configurations * in the same category will be listed together. There are no specific * allowed values, though each repository may have standards for that. @@ -348,5 +364,53 @@ } return buf.toString(); } + } + + private static String[] splitParas(String desc) { + int start = 0, last=0; + List list = new ArrayList(); + boolean inSpace = false, multiple = false; + for(int i=0; i