geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r578514 - in /geronimo/plugins/console/trunk: console-base-portlets/src/main/java/org/apache/geronimo/console/car/ console-base-portlets/src/main/webapp/WEB-INF/view/car/ console-portal-driver/src/main/webapp/images/
Date Sat, 22 Sep 2007 22:09:28 GMT
Author: pmcmahan
Date: Sat Sep 22 15:09:27 2007
New Revision: 578514

URL: http://svn.apache.org/viewvc?rev=578514&view=rev
Log:
GERONIMO-3330 improve the admin console's plugin management portlet.  alignment with new plugin
schema.

Added:
    geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/PluginInfoBean.java
  (with props)
    geronimo/plugins/console/trunk/console-portal-driver/src/main/webapp/images/checkmark._16_green.png
  (with props)
Modified:
    geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/IndexHandler.java
    geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java
    geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java
    geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/download.jsp
    geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/list.jsp
    geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp

Modified: geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/IndexHandler.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/IndexHandler.java?rev=578514&r1=578513&r2=578514&view=diff
==============================================================================
--- geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/IndexHandler.java
(original)
+++ geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/IndexHandler.java
Sat Sep 22 15:09:27 2007
@@ -29,6 +29,7 @@
 import org.apache.geronimo.console.util.ConfigurationData;
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.system.plugin.PluginRepositoryList;
+import org.apache.geronimo.system.plugin.model.PluginListType;
 
 /**
  * Handler for the import export main screen.
@@ -48,6 +49,10 @@
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel
model) throws PortletException, IOException {
         PluginRepositoryList[] lists = PortletManager.getCurrentServer(request).getPluginRepositoryLists();
+        
+        // clear out the catalog if it was previously loaded 
+        request.getPortletSession(true).removeAttribute(CONFIG_LIST_SESSION_KEY);
+        
         List list = new ArrayList();
         for (int i = 0; i < lists.length; i++) {
             PluginRepositoryList repo = lists[i];
@@ -61,6 +66,7 @@
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel
model) throws PortletException, IOException {
+        request.setAttribute("column", request.getParameter("column"));
         request.setAttribute("repository", request.getParameter("repository"));
         request.setAttribute("repo-user", request.getParameter("username"));
         request.setAttribute("repo-pass", request.getParameter("password"));

Modified: geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java?rev=578514&r1=578513&r2=578514&view=diff
==============================================================================
--- geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java
(original)
+++ geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java
Sat Sep 22 15:09:27 2007
@@ -19,12 +19,9 @@
 import java.io.IOException;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
@@ -35,6 +32,9 @@
 
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.system.plugin.PluginInstaller;
+import org.apache.geronimo.system.plugin.PluginInstallerGBean;
+import org.apache.geronimo.system.plugin.model.PluginArtifactType;
 import org.apache.geronimo.system.plugin.model.PluginListType;
 import org.apache.geronimo.system.plugin.model.PluginType;
 
@@ -44,7 +44,7 @@
  * @version $Rev$ $Date$
  */
 public class ListHandler extends BaseImportExportHandler {
-
+    
     public ListHandler() {
         super(LIST_MODE, "/WEB-INF/view/car/list.jsp");
     }
@@ -57,8 +57,11 @@
         response.setRenderParameter("repository", repository);
         String user = (String) request.getAttribute("repo-user");
         String pass = (String) request.getAttribute("repo-pass");
+        String column = (String) request.getAttribute("column");
+
         if(!isEmpty(user)) response.setRenderParameter("repo-user", user);
         if(!isEmpty(pass)) response.setRenderParameter("repo-pass", pass);
+        if(!isEmpty(column)) response.setRenderParameter("column", column);
         return getMode();
     }
 
@@ -66,12 +69,14 @@
         String repository = request.getParameter("repository");
         String user = request.getParameter("repo-user");
         String pass = request.getParameter("repo-pass");
+        String column = request.getParameter("column");
         if(!loadFromRepository(request, repository, user, pass)) {
             //todo: loading failed -- do something!
         }
         request.setAttribute("repository", repository);
         request.setAttribute("repouser", user);
         request.setAttribute("repopass", pass);
+        request.setAttribute("column", column);
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel
model) throws PortletException, IOException {
@@ -79,41 +84,85 @@
     }
 
     private boolean loadFromRepository(RenderRequest request, String repository, String username,
String password) throws IOException, PortletException {
-        PluginListType data;
-        try {
-            data = PortletManager.getCurrentServer(request).getPluginInstaller().listPlugins(new
URL(repository), username, password);
-        } catch (FailedLoginException e) {
-            throw new PortletException("Invalid login for Maven repository '"+repository+"'",
e);
+        
+        // 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 = PortletManager.getCurrentServer(request).getPluginInstaller().listPlugins(new
URL(repository), username, password);
+            } catch (FailedLoginException e) {
+                throw new PortletException("Invalid login for Maven repository '"+repository+"'",
e);
+            }
         }
-        Map<String, List<PluginType>> results = new TreeMap<String, List<PluginType>>();
+        
         if(data == null || data.getPlugin() == null) {
             return false;
         }
+        
+        List<PluginInfoBean> plugins = new ArrayList<PluginInfoBean>();
+        PluginInstaller pluginInstaller = PortletManager.getCurrentServer(request).getPluginInstaller();
+        
         for (PluginType metadata: data.getPlugin()) {
-            String category = metadata.getCategory();
-            if (category==null || category.trim().length()<1) {
-                category = "No Category";
+            
+            // ignore plugins which have no artifacts defined
+            if (metadata.getPluginArtifact().isEmpty()) {
+                continue;
             }
-            List<PluginType> values;
-            if (!results.containsKey(category)) {
-                values = new ArrayList<PluginType>();
-                values.add(metadata);
-                results.put(category, values);
-            } else {
-                values = results.get(category);
-                values.add(metadata);
+            
+            if (metadata.getCategory() == null) {
+                metadata.setCategory("Unspecified");
+            }
+
+            for (PluginArtifactType artifact : metadata.getPluginArtifact()) {
+                PluginInfoBean plugin = new PluginInfoBean();
+                plugin.setPlugin(metadata);
+                plugin.setPluginArtifact(artifact);
+                
+                // determine if the plugin is installable
+                try {
+                    PluginType holder = PluginInstallerGBean.copy(metadata, artifact);
+                    pluginInstaller.validatePlugin(holder);
+                } catch (Exception e) {
+                    plugin.setInstallable(false);
+                }
+                plugins.add(plugin);
             }
         }
-        Collection<List<PluginType>> values = results.values();
-        for (List<PluginType> value : values) {
-            Collections.sort(value, new Comparator<PluginType>() {
 
-                public int compare(PluginType o1, PluginType o2) {
+        // sort the plugin list based on the selected table column
+        final String column = request.getParameter("column");
+        Collections.sort(plugins, new Comparator<PluginInfoBean>() {
+            public int compare(PluginInfoBean o1, PluginInfoBean o2) {
+                if ("Category".equals(column)) {
+                    String category1 = o1.getCategory();
+                    String category2 = o2.getCategory();
+                    if (category1.equals(category2)) {
+                        return o1.getName().compareTo(o2.getName());
+                    }
+                    return category1.compareTo(category2);
+                }
+                else if ("Version".equals(column)) {
+                    String version1 = o1.getPluginArtifact().getModuleId().getVersion();
+                    String version2 = o2.getPluginArtifact().getModuleId().getVersion();
+                    if (version1.equals(version2)) {
+                        return o1.getName().compareTo(o2.getName());
+                    }
+                    return version1.compareTo(version2);
+                }
+                else if ("Installable".equals(column)) {
+                    if (o1.isInstallable() == o2.isInstallable()) {
+                        return o1.getName().compareTo(o2.getName());
+                    }
+                    return o1.isInstallable() ? -1 : 1 ;
+                }
+                else { // default sort column is Name
                     return o1.getName().compareTo(o2.getName());
                 }
-            });
-        }
-        request.setAttribute("categories", results);
+            }
+        });
+        
+        // save everything in the request
+        request.setAttribute("plugins", plugins);
         request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, data);
         return true;
     }

Added: geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/PluginInfoBean.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/PluginInfoBean.java?rev=578514&view=auto
==============================================================================
--- geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/PluginInfoBean.java
(added)
+++ geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/PluginInfoBean.java
Sat Sep 22 15:09:27 2007
@@ -0,0 +1,246 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.util.List;
+
+import org.apache.geronimo.system.plugin.model.ArtifactType;
+import org.apache.geronimo.system.plugin.model.CopyFileType;
+import org.apache.geronimo.system.plugin.model.DependencyType;
+import org.apache.geronimo.system.plugin.model.HashType;
+import org.apache.geronimo.system.plugin.model.LicenseType;
+import org.apache.geronimo.system.plugin.model.PluginArtifactType;
+import org.apache.geronimo.system.plugin.model.PluginType;
+import org.apache.geronimo.system.plugin.model.PrerequisiteType;
+import org.apache.geronimo.system.plugin.model.PropertyType;
+
+/**
+ * Bean class that holds information about a plugin
+ * 
+ * @version $Rev$ $Date$
+ */
+public class PluginInfoBean {
+    protected ArtifactType moduleId;
+    protected HashType hash;
+    protected List<String> geronimoVersion;
+    protected List<String> jvmVersion;
+    protected List<PrerequisiteType> prerequisite;
+    protected List<DependencyType> dependency;
+    protected List<ArtifactType> obsoletes;
+    protected List<String> sourceRepository;
+    protected List<CopyFileType> copyFile;
+    protected PluginArtifactType.ConfigXmlContent configXmlContent;
+    protected List<PropertyType> artifactAlias;
+    protected List<PropertyType> configSubstitution;
+    protected String name;
+    protected String category;
+    protected String description;
+    protected String url;
+    protected String author;
+    protected List<LicenseType> license;
+    protected PluginType plugin;
+    protected PluginArtifactType pluginArtifact;
+    protected boolean installable = true;
+
+    public List<PropertyType> getArtifactAlias() {
+        return artifactAlias;
+    }
+
+    public void setArtifactAlias(List<PropertyType> artifactAlias) {
+        this.artifactAlias = artifactAlias;
+    }
+
+    public String getAuthor() {
+        return author;
+    }
+
+    public void setAuthor(String author) {
+        this.author = author;
+    }
+
+    public String getCategory() {
+        return category;
+    }
+
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    public List<PropertyType> getConfigSubstitution() {
+        return configSubstitution;
+    }
+
+    public void setConfigSubstitution(List<PropertyType> configSubstitution) {
+        this.configSubstitution = configSubstitution;
+    }
+
+    public PluginArtifactType.ConfigXmlContent getConfigXmlContent() {
+        return configXmlContent;
+    }
+
+    public void setConfigXmlContent(PluginArtifactType.ConfigXmlContent configXmlContent)
{
+        this.configXmlContent = configXmlContent;
+    }
+
+    public List<CopyFileType> getCopyFile() {
+        return copyFile;
+    }
+
+    public void setCopyFile(List<CopyFileType> copyFile) {
+        this.copyFile = copyFile;
+    }
+
+    public List<DependencyType> getDependency() {
+        return dependency;
+    }
+
+    public void setDependency(List<DependencyType> dependency) {
+        this.dependency = dependency;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public List<String> getGeronimoVersion() {
+        return geronimoVersion;
+    }
+
+    public void setGeronimoVersion(List<String> geronimoVersion) {
+        this.geronimoVersion = geronimoVersion;
+    }
+
+    public HashType getHash() {
+        return hash;
+    }
+
+    public void setHash(HashType hash) {
+        this.hash = hash;
+    }
+
+    public List<String> getJvmVersion() {
+        return jvmVersion;
+    }
+
+    public void setJvmVersion(List<String> jvmVersion) {
+        this.jvmVersion = jvmVersion;
+    }
+
+    public List<LicenseType> getLicense() {
+        return license;
+    }
+
+    public void setLicense(List<LicenseType> license) {
+        this.license = license;
+    }
+
+    public ArtifactType getModuleId() {
+        return moduleId;
+    }
+
+    public void setModuleId(ArtifactType moduleId) {
+        this.moduleId = moduleId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public List<ArtifactType> getObsoletes() {
+        return obsoletes;
+    }
+
+    public void setObsoletes(List<ArtifactType> obsoletes) {
+        this.obsoletes = obsoletes;
+    }
+
+    public List<PrerequisiteType> getPrerequisite() {
+        return prerequisite;
+    }
+
+    public void setPrerequisite(List<PrerequisiteType> prerequisite) {
+        this.prerequisite = prerequisite;
+    }
+
+    public List<String> getSourceRepository() {
+        return sourceRepository;
+    }
+
+    public void setSourceRepository(List<String> sourceRepository) {
+        this.sourceRepository = sourceRepository;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public PluginType getPlugin() {
+        return plugin;
+    }
+
+    public void setPlugin(PluginType plugin) {
+        this.plugin = plugin;
+        // copy the fields
+        author = plugin.getAuthor();
+        category = plugin.getCategory();
+        description = plugin.getDescription();
+        license = plugin.getLicense();
+        name = plugin.getName();
+        url = plugin.getUrl();
+    }
+
+    public PluginArtifactType getPluginArtifact() {
+        return pluginArtifact;
+    }
+
+    public void setPluginArtifact(PluginArtifactType pluginArtifact) {
+        this.pluginArtifact = pluginArtifact;
+        // copy the fields
+        artifactAlias = pluginArtifact.getArtifactAlias();
+        configSubstitution = pluginArtifact.getConfigSubstitution();
+        configXmlContent = pluginArtifact.getConfigXmlContent();
+        copyFile = pluginArtifact.getCopyFile();
+        dependency = pluginArtifact.getDependency();
+        geronimoVersion = pluginArtifact.getGeronimoVersion();
+        hash = pluginArtifact.getHash();
+        jvmVersion = pluginArtifact.getJvmVersion();
+        moduleId = pluginArtifact.getModuleId();
+        obsoletes = pluginArtifact.getObsoletes();
+        prerequisite = pluginArtifact.getPrerequisite();
+        sourceRepository = pluginArtifact.getSourceRepository();
+    }
+
+    public boolean isInstallable() {
+        return installable;
+    }
+
+    public void setInstallable(boolean installable) {
+        this.installable = installable;
+    }
+}
\ No newline at end of file

Propchange: geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/PluginInfoBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/PluginInfoBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/PluginInfoBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java?rev=578514&r1=578513&r2=578514&view=diff
==============================================================================
--- geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java
(original)
+++ geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java
Sat Sep 22 15:09:27 2007
@@ -30,6 +30,7 @@
 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.PluginInstaller;
 import org.apache.geronimo.system.plugin.PluginInstallerGBean;
 import org.apache.geronimo.system.plugin.model.PluginArtifactType;
 import org.apache.geronimo.system.plugin.model.PluginListType;
@@ -66,8 +67,8 @@
         String repo = request.getParameter("repository");
         String user = request.getParameter("repo-user");
         String pass = request.getParameter("repo-pass");
-        PluginType config = null;
-        PluginArtifactType instance = null;
+        PluginInfoBean plugin = new PluginInfoBean();
+        
         try {
             PluginListType list = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
             if(list == null) {
@@ -77,8 +78,8 @@
             for (PluginType metadata: list.getPlugin()) {
                 for (PluginArtifactType testInstance: metadata.getPluginArtifact()) {
                 if(PluginInstallerGBean.toArtifact(testInstance.getModuleId()).toString().equals(configId))
{
-                    config = metadata;
-                    instance = testInstance;
+                    plugin.setPlugin(metadata);
+                    plugin.setPluginArtifact(testInstance);
                     break;
                 }
                 }
@@ -86,14 +87,24 @@
         } catch (FailedLoginException e) {
             throw new PortletException("Invalid login for Maven repository '"+repo+"'", e);
         }
-        if(config == null) {
+        if(plugin.getPluginArtifact() == null) {
             throw new PortletException("No configuration found for '"+configId+"'");
         }
+        
+        // see if the plugin is installable.  if not then provide the details
+        String validation = "All requirements for this plugin have been met.";
+        PluginInstaller pluginInstaller = PortletManager.getCurrentServer(request).getPluginInstaller();
+        PluginType holder = PluginInstallerGBean.copy(plugin.getPlugin(), plugin.getPluginArtifact());
+        try {
+            pluginInstaller.validatePlugin(holder);
+        } catch (Exception e) {
+            plugin.setInstallable(false);
+            validation = e.getMessage();
+        }
+        
+        request.setAttribute("validation", validation);
         request.setAttribute("configId", configId);
-        request.setAttribute("plugin", config);
-        request.setAttribute("pluginArtifact", instance);
-//        request.setAttribute("gerVersions", instance.getGeronimoVersion());
-//        request.setAttribute("jvmVersions", instance.getJvmVersion());
+        request.setAttribute("plugin", plugin);
         request.setAttribute("repository", repo);
         request.setAttribute("repouser", user);
         request.setAttribute("repopass", pass);

Modified: geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/download.jsp
URL: http://svn.apache.org/viewvc/geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/download.jsp?rev=578514&r1=578513&r2=578514&view=diff
==============================================================================
--- geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/download.jsp
(original)
+++ geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/download.jsp
Sat Sep 22 15:09:27 2007
@@ -21,8 +21,8 @@
 
 <p>Processing ${configId}...</p>
 
-<p>Found the following dependencies for this plugin.  Any missing dependencies
-    will be installed for you automatically if you proceed.</p>
+<p>This plugin has the following dependencies.  Any missing dependencies
+    will be downloaded and installed automatically if you proceed.</p>
 <ul>
 <c:forEach var="dependency" items="${dependencies}">
     <li>${dependency.groupId}/${dependency.artifactId}/${dependency.type}/${dependency.version}</li>
@@ -30,6 +30,9 @@
 </ul>
 
 <form name="<portlet:namespace/>PluginForm" action="<portlet:actionURL/>">
+<table><tr>
+<td valign="top">
+    <input type="submit" value="Install Plugin" />
     <input type="hidden" name="file" value="${file}" />
     <input type="hidden" name="configId" value="${configId}" />
     <input type="hidden" name="mode" value="download-after" />
@@ -37,7 +40,8 @@
     <input type="hidden" name="repo-user" value="${repouser}" />
     <input type="hidden" name="repo-pass" value="${repopass}" />
     <input type="hidden" name="proceed" value="true" />
-    <input type="submit" value="Install Plugin" />
+</td>
+<td valign="top">
+<input type="submit" value="Cancel" onclick="history.go(-1); return false;" />
+</td></tr></table>
 </form>
-
-<p><a href="<portlet:actionURL portletMode="view"><portlet:param name="mode"
value="index-before" /></portlet:actionURL>">Cancel</a></p>

Modified: geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/list.jsp
URL: http://svn.apache.org/viewvc/geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/list.jsp?rev=578514&r1=578513&r2=578514&view=diff
==============================================================================
--- geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/list.jsp
(original)
+++ geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/list.jsp
Sat Sep 22 15:09:27 2007
@@ -18,65 +18,65 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
 <portlet:defineObjects/>
-<p>These are the Geronimo plugins available in the selected repository. They may or
may not already be installed in the geronimo server.</p>
 
-<c:forEach var="category" items="${categories}">
-    <h3>${category.key}</h3>
-    <ul>
-        <c:forEach var="entry" items="${category.value}">
-            <c:choose>
-            <c:when test="${fn:length(entry.pluginArtifact) == 1}">
-                <c:set var="instance" value="${entry.pluginArtifact[0]}"/>
-                <li><a href="<portlet:actionURL>
-                                 <portlet:param name="configId" value="${instance.moduleId.groupId}/${instance.moduleId.artifactId}/${instance.moduleId.version}/${instance.moduleId.type}"/>
-                                 <portlet:param name="repository" value="${repository}"/>
-                                 <portlet:param name="repo-user" value="${repouser}"/>
-                                 <portlet:param name="repo-pass" value="${repopass}"/>
-                                 <portlet:param name="mode" value="viewForDownload-before"/>
-                             </portlet:actionURL>">${entry.name}</a></li>
-            </c:when>
-            <c:when test="${fn:length(entry.pluginArtifact) > 1}">
-	            <p>${entry.name}</p>
-	            <c:forEach var="instance" items="${entry.pluginArtifact}">
-	                <%--      <c:choose>
-	                <c:when test="${entry.installed || !entry.eligible}">
-	                  <li>${entry.name}
-	                      <c:choose>
-	                          <c:when test="${entry.installed}">
-	                              (already installed)
-	                          </c:when>
-	                          <c:otherwise>
-	                              <c:if test="${!entry.eligible}">
-	                                  <c:forEach var="prereq" items="${entry.prerequisites}">
-	                                      <c:if test="${!prereq.present}">
-	                                          (${prereq.moduleIdWithStars} is not installed)
-	                                      </c:if>
-	                                  </c:forEach>
-	                              </c:if>
-	                              (Not available; <a href="<portlet:actionURL><portlet:param
name="configId" value="${entry.moduleId}"/><portlet:param name="repository" value="${repository}"/><portlet:param
name="repo-user" value="${repouser}"/><portlet:param name="repo-pass" value="${repopass}"/><portlet:param
name="mode" value="viewForDownload-before"/></portlet:actionURL>">View Details</a>)
-	                          </c:otherwise>
-	                      </c:choose>
-	                  </li>
-	                </c:when>
-	                <c:otherwise>
-	                --%>
-	                <%--${instance}   ${instance.class}<br/>--%>
-	                <li><a href="<portlet:actionURL>
-	                                 <portlet:param name="configId" value="${instance.moduleId.groupId}/${instance.moduleId.artifactId}/${instance.moduleId.version}/${instance.moduleId.type}"/>
-	                                 <portlet:param name="repository" value="${repository}"/>
-	                                 <portlet:param name="repo-user" value="${repouser}"/>
-	                                 <portlet:param name="repo-pass" value="${repopass}"/>
-	                                 <portlet:param name="mode" value="viewForDownload-before"/>
-	                             </portlet:actionURL>">${instance.moduleId.groupId}/${instance.moduleId.artifactId}/${instance.moduleId.version}/${instance.moduleId.type}</a></li>
-	            </c:forEach>
-	            <%--
-	                    </c:otherwise>
-	                  </c:choose>
-	            --%>
-           </c:when>
-           </c:choose>
-        </c:forEach>
-    </ul>
+<h3>Plugins listed at ${repository}</h3>
+
+<c:choose>
+<c:when test="${fn:length(plugins) < 1}">
+  No plugins are ilsted at this repository.
+</c:when>
+<c:otherwise>
+<form action="<portlet:actionURL/>">
+<input type="hidden" name="repository" value="${repository}"/>
+<input type="hidden" name="repo-user" value="${repouser}"/>
+<input type="hidden" name="repo-pass" value="${repopass}"/>
+<input id="mode" type="hidden" name="mode" value="viewForDownload-before"/>
+<input id="viewButton" type="submit" value="View" disabled
+onclick="document.getElementById('mode').value='viewForDownload-before'">
+<input id="installButton" type="submit" value="Install" disabled
+onclick="document.getElementById('mode').value='viewForDownload-after'">
+<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}"/>
+	                                   <portlet:param name="repo-user" value="${repouser}"/>
+	                                   <portlet:param name="repo-pass" value="${repopass}"/>
+	                                   <portlet:param name="column" value="${column}"/>
+	                                   <portlet:param name="mode" value="index-after"/>
+	                                  </portlet:actionURL>'>${column}</a></th>
+  </c:forEach>
+</tr>
+<c:forEach var="plugin" items="${plugins}" varStatus="status">
+<c:set var="style" value="${status.index % 2 == 0 ? 'MediumBackground' : 'LightBackground'}"/>
+<c:set var="artifact" value="${plugin.pluginArtifact.moduleId}"/>
+<tr>
+  <td class="${style}">
+    <input type="radio" name="configId" 
+    <c:choose>
+      <c:when test="${plugin.installable}">
+    onclick="document.getElementById('viewButton').disabled=false; document.getElementById('installButton').disabled=false;"
+      </c:when>
+      <c:otherwise>
+    onclick="document.getElementById('viewButton').disabled=false; document.getElementById('installButton').disabled=true;"
+      </c:otherwise>
+    </c:choose>
+    value='<c:out escapeXml="true" value="${artifact.groupId}/${artifact.artifactId}/${artifact.version}/${artifact.type}"/>'
/>
+  </td>
+  <td class="${style}">${plugin.name}</td>
+  <td class="${style}">${artifact.version}</td>
+  <td class="${style}">${plugin.category}</td>
+  <td align="center" class="${style}">
+    ${plugin.installable ? "<img alt='check' src='/console/images/checkmark._16_green.png'
/>" : "<strong><font color='red'>X</font></strong>"}
+  </td>
+</tr>
 </c:forEach>
+</table>
+</form>
+</c:otherwise>
+</c:choose>
 
-<p><a href="<portlet:actionURL portletMode="view"><portlet:param name="mode"
value="index-before" /></portlet:actionURL>">Cancel</a></p>
+<p><form>
+<input type="submit" value="Cancel" onclick="history.go(-1); return false;" />
+</form>

Modified: geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp
URL: http://svn.apache.org/viewvc/geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp?rev=578514&r1=578513&r2=578514&view=diff
==============================================================================
--- geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp
(original)
+++ geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp
Sat Sep 22 15:09:27 2007
@@ -19,18 +19,14 @@
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <portlet:defineObjects/>
 
-<h1>${plugin.name}</h1>
+<c:set var="artifact" value="${plugin.pluginArtifact.moduleId}"/>
 
-<p>Here is the available information on this plugin:</p>
+<h1>${plugin.name}</h1>
 
 <table border="0">
   <tr>
-    <th align="right" valign="top">Name:</th>
-    <td>${plugin.name}</td>
-  </tr>
-  <tr>
     <th align="right" valign="top">Module ID:</th>
-    <td>${pluginArtifact.moduleId.groupId}/${pluginArtifact.moduleId.artifactId}/${pluginArtifact.moduleId.version}/${pluginArtifact.moduleId.type}</td>
+    <td>${artifact.groupId}/${artifact.artifactId}/${artifact.version}/${artifact.type}</td>
   </tr>
   <tr>
     <th align="right" valign="top">Group:</th>
@@ -63,11 +59,11 @@
     <th align="right" valign="top">Geronimo-Versions:</th>
     <td>
       <c:choose>
-        <c:when test="${empty pluginArtifact.geronimoVersion}">
+        <c:when test="${empty plugin.geronimoVersion}">
           <i>None</i>
         </c:when>
         <c:otherwise>
-          <c:forEach var="geronimoVersion" items="${pluginArtifact.geronimoVersion}">
+          <c:forEach var="geronimoVersion" items="${plugin.geronimoVersion}">
             <b>${geronimoVersion}</b>
           </c:forEach>
         </c:otherwise>
@@ -79,11 +75,11 @@
     <th align="right" valign="top">JVM Versions:</th>
     <td>
       <c:choose>
-          <c:when test="${empty pluginArtifact.jvmVersion}">
+          <c:when test="${empty plugin.jvmVersion}">
             <i>Any</i>
           </c:when>
           <c:otherwise>
-            <c:forEach var="jvmVersion" items="${pluginArtifact.jvmVersion}">
+            <c:forEach var="jvmVersion" items="${plugin.jvmVersion}">
               ${jvmVersion}
             </c:forEach>
           </c:otherwise>
@@ -93,7 +89,7 @@
   <tr>
     <th align="right" valign="top">Dependencies:</th>
     <td>
-      <c:forEach var="dependency" items="${pluginArtifact.dependency}">
+      <c:forEach var="dependency" items="${plugin.dependency}">
         ${dependency.groupId}/${dependency.artifactId}/${dependency.version}/${dependency.type}<br
/>
       </c:forEach>
     </td>
@@ -102,79 +98,57 @@
     <th align="right" valign="top">Prerequisites:</th>
     <td>
       <c:choose>
-        <c:when test="${empty pluginArtifact.prerequisite}">
+        <c:when test="${empty plugin.prerequisite}">
           <i>None</i>
         </c:when>
         <c:otherwise>
-          <c:forEach var="prereq" items="${pluginArtifact.prerequisite}">
+          <c:forEach var="prereq" items="${plugin.prerequisite}">
             <b>${prereq.id.groupId}/${prereq.id.artifactId}/${prereq.id.version}/${prereq.id.type}</b>
(${prereq.resourceType})<br/>
             ${prereq.description}
-<%--
-            <c:if test="${!prereq.present}">
-                <br /><b><font color="red">NOT AVAILABLE</font></b>
-            </c:if>
---%>
           </c:forEach>
         </c:otherwise>
       </c:choose>
     </td>
   </tr>
   <tr>
-	<th align="right" valign="top">Version Specific Prerequisites:</th>
-	<td>
-	  <c:choose>
-		<c:when test="${empty gerVersions}">
-		  <i>None</i>
-		</c:when>
-		<c:otherwise>
-		  <c:forEach var="version" items="${gerVersions}">
-		    Version: ${version.version}:<br/>
-			<c:choose>
-			  <c:when test="${empty version.preReqs}">
-			    <i>None</i><br/>
-			  </c:when>
-			  <c:otherwise>
-			    <c:forEach var="preReq" items="${version.preReqs}">
-				  <b>${preReq.moduleIdWithStars}</b> (${preReq.resourceType})<br/>
-				  ${preReq.description}
-				  <c:if test="${!preReq.present}">
-                    <br /><b><font color="red">NOT AVAILABLE</font></b>
-				  </c:if>
-			    </c:forEach>
-			  </c:otherwise>
-			</c:choose>
-		  </c:forEach>
-		</c:otherwise>
-	  </c:choose>
-	</td>
-  </tr>		
-  <tr>
     <th align="right" valign="top">Obsoletes:</th>
     <td>
       <c:choose>
-        <c:when test="${empty pluginArtifact.obsoletes}">
+        <c:when test="${empty plugin.obsoletes}">
           <i>None</i>
         </c:when>
         <c:otherwise>
-          <c:forEach var="module" items="${pluginArtifact.obsoletes}">
+          <c:forEach var="module" items="${plugin.obsoletes}">
             ${module.groupId}/${module.artifactId}/${module.version}/${module.type}<br
/>
           </c:forEach>
         </c:otherwise>
       </c:choose>
     </td>
   </tr>
+  <tr>
+    <th align="right" valign="top">Installable:</th>
+    <td>
+    ${plugin.installable ? "<img alt='check' src='/console/images/checkmark._16_green.png'
/>" : "<strong><font color='red'>X</font></strong>"}
+    ${validation}
+    </td>
+  </tr>
 
 </table>
+<P>
 
-<%--<c:if test="${plugin.eligible}">--%>
 <form name="<portlet:namespace/>PluginForm" action="<portlet:actionURL/>">
+<table><tr>
+<c:if test="${plugin.installable}">
+<td valign="top">
+    <input type="submit" value="Install" />
     <input type="hidden" name="configId" value="${configId}" />
     <input type="hidden" name="mode" value="viewForDownload-after" />
     <input type="hidden" name="repository" value="${repository}" />
     <input type="hidden" name="repo-user" value="${repouser}" />
     <input type="hidden" name="repo-pass" value="${repopass}" />
-    <input type="submit" value="Continue" />
+<td>
+</c:if>
+<td valign="top">
+<input type="submit" value="Return" onclick="history.go(-1); return false;" />
+</td></tr></table>
 </form>
-<%--</c:if>--%>
-
-<p><a href="<portlet:actionURL portletMode="view"><portlet:param name="mode"
value="index-before" /></portlet:actionURL>">Cancel</a></p>

Added: geronimo/plugins/console/trunk/console-portal-driver/src/main/webapp/images/checkmark._16_green.png
URL: http://svn.apache.org/viewvc/geronimo/plugins/console/trunk/console-portal-driver/src/main/webapp/images/checkmark._16_green.png?rev=578514&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/plugins/console/trunk/console-portal-driver/src/main/webapp/images/checkmark._16_green.png
------------------------------------------------------------------------------
    svn:mime-type = image/png



Mime
View raw message