Author: ammulder
Date: Mon Jul 31 17:43:46 2006
New Revision: 427388
URL: http://svn.apache.org/viewvc?rev=427388&view=rev
Log:
Merge GERONIMO-2253 to trunk
Added:
geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java (with props)
geronimo/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/viewForDownload.jsp (with props)
Modified:
geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/BaseImportExportHandler.java
geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ImportExportPortlet.java
geronimo/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/download.jsp
geronimo/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/list.jsp
geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java
Modified: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/BaseImportExportHandler.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/BaseImportExportHandler.java?rev=427388&r1=427387&r2=427388&view=diff
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/BaseImportExportHandler.java (original)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/BaseImportExportHandler.java Mon Jul 31 17:43:46 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/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ImportExportPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ImportExportPortlet.java?rev=427388&r1=427387&r2=427388&view=diff
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ImportExportPortlet.java (original)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ImportExportPortlet.java Mon Jul 31 17:43:46 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/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java?rev=427388&view=auto
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java (added)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java Mon Jul 31 17:43:46 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/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: geronimo/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/download.jsp
URL: http://svn.apache.org/viewvc/geronimo/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/download.jsp?rev=427388&r1=427387&r2=427388&view=diff
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/download.jsp (original)
+++ geronimo/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/download.jsp Mon Jul 31 17:43:46 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/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/list.jsp
URL: http://svn.apache.org/viewvc/geronimo/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/list.jsp?rev=427388&r1=427387&r2=427388&view=diff
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/list.jsp (original)
+++ geronimo/trunk/applications/console/console-standard/src/webapp/WEB-INF/view/car/list.jsp Mon Jul 31 17:43:46 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)
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}
+ |
+
| Ger Versions: | ++ ${fn:join(plugin.geronimoVersions, ", ")} + | +
| JVM Versions: | +
+ |
+
| Dependencies: | +
+ + |
+
| Prerequisites: | +
+ + ${prereq.description} + NOT AVAILABLE + |
+
| Obsoletes: | +
+ + |
+
").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