geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r612052 - in /geronimo/server/trunk/plugins/console: console-core/src/main/java/org/apache/geronimo/console/ console-jetty/ console-jetty/src/main/plan/ console-tomcat/ plugin-portlets/src/main/java/org/apache/geronimo/console/car/ plugin-p...
Date Tue, 15 Jan 2008 09:10:02 GMT
Author: djencks
Date: Tue Jan 15 01:10:00 2008
New Revision: 612052

URL: http://svn.apache.org/viewvc?rev=612052&view=rev
Log:
GERONIMO-3607, sort of.  Clean up plugin installation, in particular allowing import of multiple
plugins in one operation.  Preparatory to figuring out how to select plugins for inclusion
in an assembled server

Removed:
    geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/DownloadCARHandler.java
    geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/download.jsp
Modified:
    geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/MultiPageAbstractHandler.java
    geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/MultiPagePortlet.java
    geronimo/server/trunk/plugins/console/console-jetty/pom.xml
    geronimo/server/trunk/plugins/console/console-jetty/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/console/console-tomcat/pom.xml
    geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java
    geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java
    geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/PluginInfoBean.java
    geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java
    geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/downloadStatus.jsp
    geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/list.jsp
    geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp

Modified: geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/MultiPageAbstractHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/MultiPageAbstractHandler.java?rev=612052&r1=612051&r2=612052&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/MultiPageAbstractHandler.java
(original)
+++ geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/MultiPageAbstractHandler.java
Tue Jan 15 01:10:00 2008
@@ -29,6 +29,8 @@
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 
+import org.apache.commons.fileupload.FileItem;
+
 /**
  * Base class for handlers for the multi page portlet.  Each one is expected
  * to handle a single page -- the action request before the page is rendered,
@@ -42,7 +44,7 @@
     protected PortletRequestDispatcher view;
     private final String mode;
     private final String viewName;
-    private Map uploadFiles = new HashMap();
+    private Map<String, FileItem> uploadFiles = new HashMap<String, FileItem>();
     private Properties uploadFields = new Properties();
 
     protected MultiPageAbstractHandler(String mode, String viewName) {
@@ -84,7 +86,7 @@
      */
     public abstract String actionAfterView(ActionRequest request, ActionResponse response,
MultiPageModel model) throws PortletException, IOException;
 
-    public Map getUploadFiles() {
+    public Map<String, FileItem> getUploadFiles() {
         return uploadFiles;
     }
 

Modified: geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/MultiPagePortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/MultiPagePortlet.java?rev=612052&r1=612051&r2=612052&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/MultiPagePortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/MultiPagePortlet.java
Tue Jan 15 01:10:00 2008
@@ -47,11 +47,10 @@
 public abstract class MultiPagePortlet extends BasePortlet {
     private final static Log log = LogFactory.getLog(MultiPagePortlet.class);
     protected static final String MODE_KEY = "mode";
-    protected Map helpers = new HashMap();
+    protected final Map<String, MultiPageAbstractHandler> helpers = new HashMap<String,
MultiPageAbstractHandler>();
 
     public void destroy() {
-        for (Iterator it = helpers.values().iterator(); it.hasNext();) {
-            MultiPageAbstractHandler handler = (MultiPageAbstractHandler) it.next();
+        for (MultiPageAbstractHandler handler : helpers.values()) {
             handler.destroy();
         }
         helpers.clear();
@@ -61,18 +60,17 @@
     public void processAction(ActionRequest actionRequest,
                               ActionResponse actionResponse) throws PortletException, IOException
{
         String mode = null;
-        Map files = null;
-        Map fields = null;
+        Map<String, FileItem> files = null;
+        Map<String, String> fields = null;
         if(actionRequest.getContentType() != null && actionRequest.getContentType().startsWith("multipart/form-data"))
{
-            files = new HashMap();
-            fields = new HashMap();
+            files = new HashMap<String, FileItem>();
+            fields = new HashMap<String, String>();
             PortletFileUpload request = new PortletFileUpload(new DiskFileItemFactory());
             try {
-                List items = request.parseRequest(actionRequest);
-                for (int i = 0; i < items.size(); i++) {
-                    FileItem item = (FileItem) items.get(i);
-                    if(item.isFormField()) {
-                        if(item.getFieldName().equals(MODE_KEY)) {
+                List<FileItem> items = request.parseRequest(actionRequest);
+                for (FileItem item : items) {
+                    if (item.isFormField()) {
+                        if (item.getFieldName().equals(MODE_KEY)) {
                             mode = item.getString();
                         }
                         fields.put(item.getFieldName(), item.getString());
@@ -97,7 +95,7 @@
             } else {
                 String type = mode.substring(pos+1);
                 mode = mode.substring(0, pos);
-                MultiPageAbstractHandler handler = (MultiPageAbstractHandler) helpers.get(mode);
+                MultiPageAbstractHandler handler = helpers.get(mode);
                 if(handler == null) {
                     log.error("No handler for action mode '"+mode+"'");
                     break;
@@ -137,7 +135,7 @@
         if(mode == null || mode.equals("")) {
             mode = getDefaultMode();
         }
-        MultiPageAbstractHandler handler = (MultiPageAbstractHandler) helpers.get(mode);
+        MultiPageAbstractHandler handler = helpers.get(mode);
         try {
             if(handler == null) {
                 log.error("No handler for render mode '"+mode+"'");

Modified: geronimo/server/trunk/plugins/console/console-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-jetty/pom.xml?rev=612052&r1=612051&r2=612052&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-jetty/pom.xml (original)
+++ geronimo/server/trunk/plugins/console/console-jetty/pom.xml Tue Jan 15 01:10:00 2008
@@ -157,22 +157,6 @@
                         <value>true</value>
                         <includeVersion>true</includeVersion>
                     </useMavenDependencies>
-<!--
-                    <instance>
-                        <plugin-artifact>
-                            <prerequisite>
-                                <id>
-                                    <groupId>org.apache.geronimo.configs</groupId>
-                                    <artifactId>jetty6</artifactId>
-                                </id>
-                                <resource-type>Web Container</resource-type>
-                                <description>
-                                    This version of the plugin works with the Geronimo/Jetty
distribution.
-                                </description>
-                            </prerequisite>
-                        </plugin-artifact>
-                    </instance>
--->
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/server/trunk/plugins/console/console-jetty/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-jetty/src/main/plan/plan.xml?rev=612052&r1=612051&r2=612052&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-jetty/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/console/console-jetty/src/main/plan/plan.xml Tue Jan 15
01:10:00 2008
@@ -38,7 +38,7 @@
             <security-realm-name>geronimo-admin</security-realm-name>
             <gbean name="CARExportForward" class="org.apache.geronimo.console.gbean.ContextForwardGBean"
xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
                 <attribute name="portalPathPrefix">/car-export</attribute>
-                <attribute name="portletContextPath">/console-base</attribute>
+                <attribute name="portletContextPath">/plugin</attribute>
                 <attribute name="portletServletPath">/car-export</attribute>
             </gbean>
             <gbean name="SVGForward" class="org.apache.geronimo.console.gbean.ContextForwardGBean"
xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">

Modified: geronimo/server/trunk/plugins/console/console-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-tomcat/pom.xml?rev=612052&r1=612051&r2=612052&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-tomcat/pom.xml (original)
+++ geronimo/server/trunk/plugins/console/console-tomcat/pom.xml Tue Jan 15 01:10:00 2008
@@ -165,20 +165,6 @@
                         <value>true</value>
                         <includeVersion>true</includeVersion>
                     </useMavenDependencies>
-                    <instance>
-                        <plugin-artifact>
-                            <prerequisite>
-                                <id>
-                                    <groupId>org.apache.geronimo.configs</groupId>
-                                    <artifactId>tomcat6</artifactId>
-                                </id>
-                                <resource-type>Web Container</resource-type>
-                                <description>
-                                    This version of the plugin works with the Geronimo/Tomcat
distribution.
-                                </description>
-                            </prerequisite>
-                        </plugin-artifact>
-                    </instance>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java?rev=612052&r1=612051&r2=612052&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java
Tue Jan 15 01:10:00 2008
@@ -33,7 +33,6 @@
         super.init(config);
         addHelper(new IndexHandler(), config);
         addHelper(new ListHandler(), config);
-        addHelper(new DownloadCARHandler(), config);
         addHelper(new ResultsHandler(), config);
         addHelper(new ExportConfigHandler(), config);
         addHelper(new ExportHandler(), config);

Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java?rev=612052&r1=612051&r2=612052&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java
(original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java
Tue Jan 15 01:10:00 2008
@@ -86,11 +86,13 @@
 
     private boolean loadFromRepository(RenderRequest request, String repository, String username,
String password) throws IOException, PortletException {
         
+        PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
+
         // try to reuse the catalog data if it was already downloaded
         PluginListType data = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
         if (data==null) {
             try {
-                data = ManagementHelper.getManagementHelper(request).getPluginInstaller().listPlugins(new
URL(repository), username, password);
+                data = pluginInstaller.listPlugins(new URL(repository), username, password);
             } catch (FailedLoginException e) {
                 throw new PortletException("Invalid login for Maven repository '"+repository+"'",
e);
             }
@@ -101,8 +103,7 @@
         }
         
         List<PluginInfoBean> plugins = new ArrayList<PluginInfoBean>();
-        PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
-        
+
         for (PluginType metadata: data.getPlugin()) {
             
             // ignore plugins which have no artifacts defined

Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/PluginInfoBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/PluginInfoBean.java?rev=612052&r1=612051&r2=612052&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/PluginInfoBean.java
(original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/PluginInfoBean.java
Tue Jan 15 01:10:00 2008
@@ -56,6 +56,7 @@
     protected PluginType plugin;
     protected PluginArtifactType pluginArtifact;
     protected boolean installable = true;
+    protected String validationMessage;
 
     public List<PropertyType> getArtifactAlias() {
         return artifactAlias;
@@ -243,5 +244,13 @@
 
     public void setInstallable(boolean installable) {
         this.installable = installable;
+    }
+
+    public String getValidationMessage() {
+        return validationMessage;
+    }
+
+    public void setValidationMessage(String validationMessage) {
+        this.validationMessage = validationMessage;
     }
 }

Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java?rev=612052&r1=612051&r2=612052&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java
(original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java
Tue Jan 15 01:10:00 2008
@@ -18,6 +18,8 @@
 
 import java.io.IOException;
 import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
@@ -26,11 +28,9 @@
 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.kernel.repository.Dependency;
+import org.apache.geronimo.system.plugin.DownloadResults;
 import org.apache.geronimo.system.plugin.PluginInstaller;
 import org.apache.geronimo.system.plugin.PluginInstallerGBean;
 import org.apache.geronimo.system.plugin.model.PluginArtifactType;
@@ -43,8 +43,7 @@
  *
  * @version $Rev$ $Date$
  */
-public class ViewPluginDownloadHandler  extends BaseImportExportHandler {
-    private final static Log log = LogFactory.getLog(ViewPluginDownloadHandler.class);
+public class ViewPluginDownloadHandler extends BaseImportExportHandler {
 
     public ViewPluginDownloadHandler() {
         super(VIEW_FOR_DOWNLOAD_MODE, "/WEB-INF/view/car/viewForDownload.jsp");
@@ -52,77 +51,134 @@
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel
model) throws PortletException, IOException {
         String configId = request.getParameter("configId");
+        String[] pluginIds = request.getParameterValues("plugin");
+        if (configId != null) {
+            pluginIds = new String[]{configId};
+        }
         String repo = request.getParameter("repository");
         String user = request.getParameter("repo-user");
         String pass = request.getParameter("repo-pass");
-        response.setRenderParameter("configId", configId);
+        response.setRenderParameter("pluginIds", pluginIds);
         response.setRenderParameter("repository", repo);
-        if(!isEmpty(user)) response.setRenderParameter("repo-user", user);
-        if(!isEmpty(pass)) response.setRenderParameter("repo-pass", pass);
+        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");
+        PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
+
+        String[] configIds = request.getParameterValues("pluginIds");
         String repo = request.getParameter("repository");
         String user = request.getParameter("repo-user");
         String pass = request.getParameter("repo-pass");
-        PluginInfoBean plugin = new PluginInfoBean();
-        
+        List<PluginInfoBean> plugins = new ArrayList<PluginInfoBean>();
+
         try {
             PluginListType list = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
-            if(list == null) {
-                list = ManagementHelper.getManagementHelper(request).getPluginInstaller().listPlugins(new
URL(repo), user, pass);
+            if (list == null) {
+                list = pluginInstaller.listPlugins(new URL(repo), user, pass);
                 request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, list);
             }
-            for (PluginType metadata: list.getPlugin()) {
-                for (PluginArtifactType testInstance: metadata.getPluginArtifact()) {
-                if(PluginInstallerGBean.toArtifact(testInstance.getModuleId()).toString().equals(configId))
{
-                    plugin.setPlugin(metadata);
-                    plugin.setPluginArtifact(testInstance);
-                    break;
+            for (String configId : configIds) {
+                PluginInfoBean plugin = new PluginInfoBean();
+                for (PluginType metadata : list.getPlugin()) {
+                    for (PluginArtifactType testInstance : metadata.getPluginArtifact())
{
+                        if (PluginInstallerGBean.toArtifact(testInstance.getModuleId()).toString().equals(configId))
{
+                            plugin.setPlugin(metadata);
+                            plugin.setPluginArtifact(testInstance);
+                            plugins.add(plugin);
+                            break;
+                        }
+                    }
                 }
+                if (plugin.getPluginArtifact() == null) {
+                    throw new PortletException("No configuration found for '" + configId
+ "'");
                 }
             }
         } catch (FailedLoginException e) {
-            throw new PortletException("Invalid login for Maven repository '"+repo+"'", e);
-        }
-        if(plugin.getPluginArtifact() == null) {
-            throw new PortletException("No configuration found for '"+configId+"'");
+            throw new PortletException("Invalid login for Maven repository '" + repo + "'",
e);
         }
-        
+
+        boolean allInstallable = true;
         // see if the plugin is installable.  if not then provide the details
         String validationOk = "All requirements for this plugin have been met.";
-        StringBuffer validationNotOk = new StringBuffer();
-        PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
-        PluginType holder = PluginInstallerGBean.copy(plugin.getPlugin(), plugin.getPluginArtifact());
-        try {
-            pluginInstaller.validatePlugin(holder);
-        } catch (Exception e) {
-            plugin.setInstallable(false);
-            validationNotOk.append(e.getMessage());
-            validationNotOk.append("<BR>\n");
-        }
-        Dependency[] missingPrereqs = pluginInstaller.checkPrerequisites(holder);
-        if (missingPrereqs.length > 0) {
-            plugin.setInstallable(false);
-            for (Dependency dep : missingPrereqs) {
-                validationNotOk.append(" Missing prerequisite ");
-                validationNotOk.append(dep.getArtifact().toString());
+        for (PluginInfoBean plugin : plugins) {
+            StringBuffer validationNotOk = new StringBuffer();
+            PluginType holder = PluginInstallerGBean.copy(plugin.getPlugin(), plugin.getPluginArtifact());
+            try {
+                pluginInstaller.validatePlugin(holder);
+            } catch (Exception e) {
+                plugin.setInstallable(false);
+                validationNotOk.append(e.getMessage());
                 validationNotOk.append("<BR>\n");
             }
+            Dependency[] missingPrereqs = pluginInstaller.checkPrerequisites(holder);
+            if (missingPrereqs.length > 0) {
+                plugin.setInstallable(false);
+                for (Dependency dep : missingPrereqs) {
+                    validationNotOk.append(" Missing prerequisite ");
+                    validationNotOk.append(dep.getArtifact().toString());
+                    validationNotOk.append("<BR>\n");
+                }
+            }
+            if (plugin.isInstallable()) {
+                plugin.setValidationMessage(validationOk);
+            } else {
+                plugin.setValidationMessage(validationNotOk.toString());
+                allInstallable = false;
+            }
         }
-        
-        request.setAttribute("validation", plugin.isInstallable() ? validationOk : validationNotOk.toString());
-        request.setAttribute("configId", configId);
-        request.setAttribute("plugin", plugin);
+        request.setAttribute("plugins", plugins);
         request.setAttribute("repository", repo);
         request.setAttribute("repouser", user);
         request.setAttribute("repopass", pass);
+        request.setAttribute("allInstallable", allInstallable);
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel
model) throws PortletException, IOException {
-        return DOWNLOAD_MODE+BEFORE_ACTION;
+        PluginInstaller configInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
+        PluginListType installList = new PluginListType();
+        String repo = request.getParameter("repository");
+        String user = request.getParameter("repo-user");
+        String pass = request.getParameter("repo-pass");
+        String[] configIds = request.getParameterValues("configId");
+
+        try {
+            PluginListType list = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
+            if (list == null) {
+                list = configInstaller.listPlugins(new URL(repo), user, pass);
+                request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, list);
+            }
+            for (String configId : configIds) {
+                PluginType plugin = null;
+                for (PluginType metadata : list.getPlugin()) {
+                    for (PluginArtifactType testInstance : metadata.getPluginArtifact())
{
+                        if (PluginInstallerGBean.toArtifact(testInstance.getModuleId()).toString().equals(configId))
{
+                            plugin = PluginInstallerGBean.copy(metadata, testInstance);
+                            installList.getPlugin().add(plugin);
+                            break;
+                        }
+                    }
+                }
+                if (plugin == null) {
+                    throw new PortletException("No configuration found for '" + configId
+ "'");
+                }
+            }
+        } catch (FailedLoginException e) {
+            throw new PortletException("Invalid login for Maven repository '" + repo + "'",
e);
+        }
+
+        Object downloadKey = configInstaller.startInstall(installList, repo, false, user,
pass);
+        DownloadResults results = configInstaller.checkOnInstall(downloadKey);
+        request.getPortletSession(true).setAttribute(DOWNLOAD_RESULTS_SESSION_KEY, results);
+        response.setRenderParameter("configIds", configIds);
+        response.setRenderParameter("repository", repo);
+        response.setRenderParameter("downloadKey", downloadKey.toString());
+
+        if (!isEmpty(user)) response.setRenderParameter("repo-user", user);
+        if (!isEmpty(pass)) response.setRenderParameter("repo-pass", pass);
+        return DOWNLOAD_STATUS_MODE + BEFORE_ACTION;
     }
 }

Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/downloadStatus.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/downloadStatus.jsp?rev=612052&r1=612051&r2=612052&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/downloadStatus.jsp
(original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/downloadStatus.jsp
Tue Jan 15 01:10:00 2008
@@ -23,14 +23,14 @@
 
 <p>
 <fmt:message key="car.downloadStatus.processing" >
-<fmt:param  value="${configId}"/>
+<fmt:param  value="${configIds}"/>
 </fmt:message>
 </p>
 
 
 <form name="<portlet:namespace/>ContinueForm" action="<portlet:actionURL/>">
     <input type="hidden" name="mode" value="downloadStatus-after" />
-    <input type="hidden" name="configId" value="${configId}" />
+    <%--<input type="hidden" name="configId" value="${configId}" />--%>
     <input type="hidden" name="repository" value="${repository}" />
     <input type="hidden" name="repo-user" value="${repouser}" />
     <input type="hidden" name="repo-pass" value="${repopass}" />

Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/list.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/list.jsp?rev=612052&r1=612051&r2=612052&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/list.jsp
(original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/list.jsp
Tue Jan 15 01:10:00 2008
@@ -41,9 +41,7 @@
 -->
 <table border="0" cellpadding="3">
 <tr>
-<!--
   <th class="DarkBackground">&nbsp;</th>
--->
   <c:forEach var="column" items="Name,Version,Category,Installable">
   <th class="DarkBackground"><a href='<portlet:actionURL>
   	                                   <portlet:param name="repository" value="${repository}"/>
@@ -72,6 +70,9 @@
     value='<c:out escapeXml="true" value="${artifact.groupId}/${artifact.artifactId}/${artifact.version}/${artifact.type}"/>'
/>
   </td>
 -->
+    <td class="${style}">
+        <input type="checkbox" name="plugin" value="${artifact.groupId}/${artifact.artifactId}/${artifact.version}/${artifact.type}"
${plugin.installable ? "": "disabled='true'"}/>
+    </td>
   <td class="${style}">
     <a href='<portlet:actionURL>
       <portlet:param name="repository" value="${repository}"/>
@@ -89,6 +90,7 @@
 </tr>
 </c:forEach>
 </table>
+    <input type="submit" value="Install"/>
 </form>
 </c:otherwise>
 </c:choose>

Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp?rev=612052&r1=612051&r2=612052&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp
(original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp
Tue Jan 15 01:10:00 2008
@@ -20,12 +20,15 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
 <fmt:setBundle basename="pluginportlets"/>
 <portlet:defineObjects/>
-
+<form name="<portlet:namespace/>PluginForm" action="<portlet:actionURL/>">
+<table border="0">
+<c:forEach var="plugin" items="${plugins}">
 <c:set var="artifact" value="${plugin.pluginArtifact.moduleId}"/>
+<input type="hidden" name="configId" value="${artifact.groupId}/${artifact.artifactId}/${artifact.version}/${artifact.type}"
/>
 
-<h1>${plugin.name}</h1>
-
-<table border="0">
+<tr>
+    <td><h1>${plugin.name}</h1></td>
+</tr>
   <tr>
     <th align="right" valign="top"><fmt:message key="car.viewForDownload.moduleId"
/>:</th>
     <td>${artifact.groupId}/${artifact.artifactId}/${artifact.version}/${artifact.type}</td>
@@ -134,16 +137,14 @@
     ${validation}
     </td>
   </tr>
+  </c:forEach>
 
-</table>
-<P>
 
-<form name="<portlet:namespace/>PluginForm" action="<portlet:actionURL/>">
-<table><tr>
-<c:if test="${plugin.installable}">
+<tr>
+<c:if test="${allInstallable}">
 <td valign="top">
     <input type="submit" value="<fmt:message key="consolebase.common.install" />"
/>
-    <input type="hidden" name="configId" value="${configId}" />
+    <%--<input type="hidden" name="configIds" value="${configIds}" />--%>
     <input type="hidden" name="mode" value="viewForDownload-after" />
     <input type="hidden" name="repository" value="${repository}" />
     <input type="hidden" name="repo-user" value="${repouser}" />
@@ -152,5 +153,7 @@
 </c:if>
 <td valign="top">
 <input type="submit" value="<fmt:message key="consolebase.common.return" />" onclick="history.go(-1);
return false;" />
-</td></tr></table>
+</td>
+</tr>
+</table>
 </form>



Mime
View raw message