geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r572762 - in /geronimo/plugins/console/trunk/console-base-portlets/src/main: java/org/apache/geronimo/console/car/ webapp/WEB-INF/view/car/
Date Tue, 04 Sep 2007 18:03:02 GMT
Author: pmcmahan
Date: Tue Sep  4 11:03:01 2007
New Revision: 572762

URL: http://svn.apache.org/viewvc?rev=572762&view=rev
Log:
GERONIMO-3413 merge plugin installer changes from rev 572395.  This synchs the console plugin with the
admin console in trunk, both now have the same issues as mentioned in GERONIMO-3330.

Modified:
    geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/DownloadCARHandler.java
    geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java
    geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.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/index.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/DownloadCARHandler.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/DownloadCARHandler.java?rev=572762&r1=572761&r2=572762&view=diff
==============================================================================
--- geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/DownloadCARHandler.java (original)
+++ geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/DownloadCARHandler.java Tue Sep  4 11:03:01 2007
@@ -18,6 +18,7 @@
 
 import java.io.IOException;
 import java.net.URL;
+
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.PortletException;
@@ -25,16 +26,18 @@
 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.ajax.ProgressInfo;
 import org.apache.geronimo.console.util.PortletManager;
-import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.system.plugin.PluginList;
-import org.apache.geronimo.system.plugin.PluginMetadata;
-import org.apache.geronimo.system.plugin.PluginInstaller;
 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;
+import org.apache.geronimo.system.plugin.model.PluginListType;
+import org.apache.geronimo.system.plugin.model.PluginType;
 
 /**
  * Handler for the initial download screen.
@@ -55,8 +58,8 @@
         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);
+        if (!isEmpty(user)) response.setRenderParameter("repo-user", user);
+        if (!isEmpty(pass)) response.setRenderParameter("repo-pass", pass);
 
         return getMode();
     }
@@ -66,28 +69,28 @@
         String repo = request.getParameter("repository");
         String user = request.getParameter("repo-user");
         String pass = request.getParameter("repo-pass");
-        PluginMetadata config = null;
+        PluginType config = null;
         try {
-            PluginList list = (PluginList) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
-            if(list == null) {
+            PluginListType list = (PluginListType) 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;
-                }
+            for (PluginType metadata : list.getPlugin()) {
+                for (PluginArtifactType instance : metadata.getPluginArtifact())
+                    if (PluginInstallerGBean.toArtifact(instance.getModuleId()).toString().equals(configId)) {
+                        config = metadata;
+                        request.setAttribute("dependencies", instance.getDependency());
+                        break;
+                    }
             }
         } catch (FailedLoginException e) {
-            throw new PortletException("Invalid login for Maven repository '"+repo+"'", e);
+            throw new PortletException("Invalid login for Maven repository '" + repo + "'", e);
         }
-        if(config == null) {
-            throw new PortletException("No configuration found for '"+configId+"'");
+        if (config == null) {
+            throw new PortletException("No configuration found for '" + configId + "'");
         }
         request.setAttribute("configId", configId);
-        request.setAttribute("dependencies", config.getDependencies());
         request.setAttribute("repository", repo);
         request.setAttribute("repouser", user);
         request.setAttribute("repopass", pass);
@@ -101,20 +104,33 @@
         if(proceed) {
             String configId = request.getParameter("configId");
 
-            PluginList installList;
+            PluginType plugin = null;
+            PluginArtifactType instance = null;
             try {
-                PluginList list = (PluginList) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
+                PluginListType list = (PluginListType) 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);
                 }
-                installList = PluginList.createInstallList(list, Artifact.create(configId));
+                for (PluginType metadata: list.getPlugin()) {
+                    for (PluginArtifactType testInstance: metadata.getPluginArtifact()) {
+                    if(PluginInstallerGBean.toArtifact(testInstance.getModuleId()).toString().equals(configId)) {
+                        plugin = metadata;
+                        instance = testInstance;
+                        break;
+                    }
+                    }
+                }
             } catch (FailedLoginException e) {
                 throw new PortletException("Invalid login for Maven repository '"+repo+"'", e);
             }
-            if(installList == null) {
-                throw new PortletException("No configuration found for '"+configId+"'");
+            if (plugin == null) {
+                throw new PortletException("No configuration found for '" + configId + "'");
             }
+            PluginType copy = PluginInstallerGBean.copy(plugin, instance);
+            PluginListType installList = new PluginListType();
+            installList.getPlugin().add(copy);
+            installList.getDefaultRepository().add(repo);
 
             PluginInstaller configInstaller = PortletManager.getCurrentServer(request).getPluginInstaller();
             Object downloadKey = configInstaller.startInstall(installList, user, pass);
@@ -129,4 +145,42 @@
         }
         return DOWNLOAD_STATUS_MODE+BEFORE_ACTION;
     }
-}
+        
+
+    public static class Installer implements Runnable {
+        private PluginInstaller configInstaller;
+        private Object downloadKey;
+        private ProgressInfo progressInfo;
+        private PortletSession session;
+
+        public Installer(PluginInstaller configInstaller, Object downloadKey, ProgressInfo progressInfo, PortletSession session) {
+            this.configInstaller = configInstaller;
+            this.downloadKey = downloadKey;
+            this.progressInfo = progressInfo;
+            this.session = session;
+        }
+
+        public void run() {
+            DownloadResults results;
+
+            while (true) {
+                results = configInstaller.checkOnInstall(downloadKey);
+                progressInfo.setMainMessage(results.getCurrentMessage());
+                progressInfo.setProgressPercent(results.getCurrentFilePercent());
+                progressInfo.setFinished(results.isFinished());
+                log.debug(progressInfo.getMainMessage());
+                if (results.isFinished()) {
+                    log.debug("Installation finished");
+                    session.setAttribute(DOWNLOAD_RESULTS_SESSION_KEY, results);
+                    break;
+                } else {
+                    try {
+                        Thread.sleep(1000);
+                    } catch (InterruptedException e) {
+                        log.error("Download monitor thread interrupted", e);
+                    }
+                }
+            }
+        }
+    }
+}
\ No newline at end of file

Modified: geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java?rev=572762&r1=572761&r2=572762&view=diff
==============================================================================
--- geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java (original)
+++ geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java Tue Sep  4 11:03:01 2007
@@ -16,24 +16,32 @@
  */
 package org.apache.geronimo.console.car;
 
-import java.io.IOException;
 import java.io.BufferedReader;
+import java.io.IOException;
 import java.io.StringReader;
-import java.util.List;
 import java.util.ArrayList;
-import java.net.URL;
-import java.net.MalformedURLException;
+import java.util.List;
+
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.PortletException;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
+
 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.Artifact;
-import org.apache.geronimo.system.plugin.PluginMetadata;
+import org.apache.geronimo.kernel.repository.Dependency;
+import org.apache.geronimo.kernel.repository.ImportType;
+import org.apache.geronimo.system.plugin.PluginInstallerGBean;
+import org.apache.geronimo.system.plugin.model.ArtifactType;
+import org.apache.geronimo.system.plugin.model.DependencyType;
+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;
 
 /**
  * Handler for the screen where you configure plugin data before exporting
@@ -49,7 +57,7 @@
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
         String configId = request.getParameter("configId");
-        if(configId != null) {
+        if (configId != null) {
             response.setRenderParameter("configId", configId);
         }
         return getMode();
@@ -57,178 +65,198 @@
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
         String configId = request.getParameter("configId");
-        PluginMetadata data = PortletManager.getCurrentServer(request).getPluginInstaller().getPluginMetadata(Artifact.create(configId));
-        request.setAttribute("configId", data.getModuleId());
+        PluginType data = PortletManager.getCurrentServer(request).getPluginInstaller().getPluginMetadata(
+                Artifact.create(configId));
+        PluginArtifactType instance = data.getPluginArtifact().get(0);
+        request.setAttribute("configId", PluginInstallerGBean.toArtifact(instance.getModuleId()).toString());
         request.setAttribute("name", data.getName());
-        request.setAttribute("repository", combine(data.getRepositories()));
+        request.setAttribute("repository", combine(instance.getSourceRepository()));
         request.setAttribute("category", data.getCategory());
-        request.setAttribute("url", data.getPluginURL());
+        request.setAttribute("url", data.getUrl());
         request.setAttribute("author", data.getAuthor());
         request.setAttribute("description", data.getDescription());
-        PluginMetadata.License[] licenses = data.getLicenses();
-        if(licenses != null && licenses.length > 0) {
-            request.setAttribute("license", licenses[0].getName());
-            if(licenses[0].isOsiApproved()) {
+        List<LicenseType> licenses = data.getLicense();
+        if (licenses != null && licenses.size() > 0) {
+            request.setAttribute("license", licenses.get(0).getValue());
+            if (licenses.get(0).isOsiApproved()) {
                 request.setAttribute("licenseOSI", "true");
             }
-            if(licenses.length > 1) {
-                log.warn("Unable to edit plugin metadata containing more than one license!  Additional license data will not be editable.");
+            if (licenses.size() > 1) {
+                log.warn(
+                        "Unable to edit plugin metadata containing more than one license!  Additional license data will not be editable.");
             }
         }
         //Choose the first geronimo-versions element and set the config version element to that version number.
-        PluginMetadata.geronimoVersions[] gerVers = data.getGeronimoVersions();
-        if(gerVers != null && gerVers.length > 0) {
-            request.setAttribute("geronimoVersion",gerVers[0].getVersion());
-        }
-        request.setAttribute("jvmVersions", combine(data.getJvmVersions()));
-        request.setAttribute("dependencies", combine(data.getDependencies()));
-        request.setAttribute("obsoletes", combine(data.getObsoletes()));
-        PluginMetadata.Prerequisite[] reqs = data.getPrerequisites();
-        if(reqs != null && reqs.length > 0) {
-            for (int i = 0; i < reqs.length; i++) {
-                PluginMetadata.Prerequisite req = reqs[i];
-                String prefix = "prereq" + (i+1);
-                request.setAttribute(prefix, req.getModuleId().toString());
-                request.setAttribute(prefix +"type", req.getResourceType());
-                request.setAttribute(prefix +"desc", req.getDescription());
-            }
-            if(reqs.length > 3) {
-                log.warn("Unable to edit plugin metadata containing more than three prerequisites!  Additional prereqs will not be editable.");
+        List<String> gerVers = instance.getGeronimoVersion();
+        if (gerVers != null && gerVers.size() > 0) {
+            request.setAttribute("geronimoVersion", gerVers.get(0));
+        }
+        request.setAttribute("jvmVersions", combine(instance.getJvmVersion()));
+        request.setAttribute("dependencies", toString(instance.getDependency()));
+        request.setAttribute("obsoletes", toString(instance.getObsoletes()));
+        List<PrerequisiteType> reqs = instance.getPrerequisite();
+        if (reqs != null && reqs.size() > 0) {
+            int i = 1;
+            for (PrerequisiteType prereq: reqs) {
+                String prefix = "prereq" + i;
+                request.setAttribute(prefix, PluginInstallerGBean.toArtifact(prereq.getId()).toString());
+                request.setAttribute(prefix + "type", prereq.getResourceType());
+                request.setAttribute(prefix + "desc", prereq.getDescription());
+            }
+            if (reqs.size() > 3) {
+                log.warn(
+                        "Unable to edit plugin metadata containing more than three prerequisites!  Additional prereqs will not be editable.");
             }
         }
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
         String configId = request.getParameter("configId");
+        PluginType metadata = PortletManager.getCurrentServer(request).getPluginInstaller().getPluginMetadata(Artifact.create(configId));
+        PluginArtifactType instance = metadata.getPluginArtifact().get(0);
+
         String name = request.getParameter("name");
-        String repo = request.getParameter("repository");
-        String category = request.getParameter("category");
-        String url = request.getParameter("url");
-        String author = request.getParameter("author");
-        String description = request.getParameter("description");
-        String license = request.getParameter("license");
+        metadata.setName(name);
+        metadata.setCategory(request.getParameter("category"));
+        metadata.setUrl(request.getParameter("url"));
+        metadata.setAuthor(request.getParameter("author"));
+        metadata.setDescription(request.getParameter("description"));
+        String licenseString = request.getParameter("license");
         String osi = request.getParameter("licenseOSI");
-        String jvms = request.getParameter("jvmVersions");
+        List<LicenseType> licenses = metadata.getLicense();
+        if (!licenses.isEmpty()) {
+            licenses.remove(0);
+        }
+        if (licenseString != null && !licenseString.trim().equals("")) {
+            LicenseType license = new LicenseType();
+            license.setValue(licenseString.trim());
+            license.setOsiApproved(osi != null && !osi.equals(""));
+            licenses.add(0, license);
+        }
+
+        String jvmsString = request.getParameter("jvmVersions");
+        split(jvmsString, instance.getJvmVersion());
+
         String deps = request.getParameter("dependencies");
+        toDependencies(split(deps), instance.getDependency());
+
         String obsoletes = request.getParameter("obsoletes");
-        PluginMetadata data = PortletManager.getCurrentServer(request).getPluginInstaller().getPluginMetadata(Artifact.create(configId));
-        PluginMetadata metadata = new PluginMetadata(name, data.getModuleId(),
-                category, description, url, author, null, true, false);
-        metadata.setDependencies(split(deps));
-        metadata.setJvmVersions(split(jvms));
-        metadata.setObsoletes(split(obsoletes));
-        List licenses = new ArrayList();
-        if(license != null && !license.trim().equals("")) {
-            licenses.add(new PluginMetadata.License(license.trim(), osi != null && !osi.equals("")));
-        }
-        for (int i = 1; i < data.getLicenses().length; i++) {
-            licenses.add(data.getLicenses()[i]);
-        }
-        metadata.setLicenses((PluginMetadata.License[]) licenses.toArray(new PluginMetadata.License[licenses.size()]));
-        //Take the geronimo version and throw it into a geronimo-versions element and then add it to the metadata object.
-        PluginMetadata.geronimoVersions geronimoVersion = null;
+        toArtifacts(split(obsoletes), instance.getObsoletes());
+
+        String repo = request.getParameter("repository");
+        split(repo, instance.getSourceRepository());
+
+        //TODO this is wrong, we are only supplying one version to the UI
         String version = request.getParameter("geronimoVersion");
-        List gerVersions = new ArrayList();
-        gerVersions.add(new PluginMetadata.geronimoVersions(version,null,null,null));
-        metadata.setGeronimoVersions((PluginMetadata.geronimoVersions[])gerVersions.toArray(new PluginMetadata.geronimoVersions[gerVersions.size()]));
-        List prereqs = new ArrayList();
+        split(version, instance.getGeronimoVersion());
+
+        List<PrerequisiteType> prereqs = instance.getPrerequisite();
+        //TODO this is probably wrong if # of prereqs is changed.
+        for (int i = 0; i < 3 && !prereqs.isEmpty(); i++) {
+            prereqs.remove(0);
+        }
         int counter = 1;
-        while(true) {
+        while (true) {
             String prefix = "prereq" + counter;
             ++counter;
             String id = request.getParameter(prefix);
-            if(id == null || id.trim().equals("")) {
+            if (id == null || id.trim().equals("")) {
                 break;
             }
-            String type = request.getParameter(prefix+"type");
-            String desc = request.getParameter(prefix+"desc");
-            if(type != null && type.trim().equals("")) {
+            String type = request.getParameter(prefix + "type");
+            String desc = request.getParameter(prefix + "desc");
+            if (type != null && type.trim().equals("")) {
                 type = null;
             }
-            if(desc != null && desc.trim().equals("")) {
+            if (desc != null && desc.trim().equals("")) {
                 desc = null;
             }
-            prereqs.add(new PluginMetadata.Prerequisite(Artifact.create(id), false, type, desc));
+            PrerequisiteType prereq = new PrerequisiteType();
+            prereq.setResourceType(type);
+            prereq.setDescription(desc);
+            prereq.setId(PluginInstallerGBean.toArtifactType(Artifact.create(id)));
+            prereqs.add(counter - 1, prereq);
         }
-        for (int i = 3; i < data.getPrerequisites().length; i++) {
-            PluginMetadata.Prerequisite req = data.getPrerequisites()[i];
-            prereqs.add(req);
-        }
-        metadata.setPrerequisites((PluginMetadata.Prerequisite[]) prereqs.toArray(new PluginMetadata.Prerequisite[prereqs.size()]));
-        URL[] backupURLs = splitURLs(repo);
-        metadata.setRepositories(backupURLs);
-
-        // TODO: Fields not yet handled by the UI
-        metadata.setForceStart(data.getForceStart());
-        metadata.setFilesToCopy(data.getFilesToCopy());
-        metadata.setConfigXmls(data.getConfigXmls());
+
         // Save updated metadata
         PortletManager.getCurrentServer(request).getPluginInstaller().updatePluginMetadata(metadata);
 
         response.setRenderParameter("configId", configId);
         response.setRenderParameter("name", name);
 
-        return CONFIRM_EXPORT_MODE+BEFORE_ACTION;
+        return CONFIRM_EXPORT_MODE + BEFORE_ACTION;
     }
 
-    private URL[] splitURLs(String backups) throws MalformedURLException {
-        String[] strings = split(backups);
-        URL[] result = new URL[strings.length];
-        for (int i = 0; i < result.length; i++) {
-            result[i] = new URL(strings[i]);
+    private List<String> split(String deps) {
+        List<String> split = new ArrayList<String>();
+        if (deps != null && !deps.equals("")) {
+            split(deps, split);
         }
-        return result;
+        return split;
     }
 
-
-    private String[] split(String deps) {
-        if(deps == null || deps.equals("")) {
-            return new String[0];
-        }
-        List list = new ArrayList();
+    private void split(String deps, List<String> split) {
+        split.clear();
         BufferedReader in = new BufferedReader(new StringReader(deps));
         String line;
         try {
-            while((line = in.readLine()) != null) {
+            while ((line = in.readLine()) != null) {
                 line = line.trim();
-                if(!line.equals("")) {
-                    list.add(line);
+                if (!line.equals("")) {
+                    split.add(line);
                 }
             }
             in.close();
         } catch (IOException e) {
             log.error("Unable to parse request arguments", e);
         }
-        return (String[]) list.toArray(new String[list.size()]);
     }
 
-    private String combine(String[] strings) {
-        if(strings == null || strings.length == 0) {
+    private String combine(List<String> strings) {
+        if (strings == null || strings.size() == 0) {
             return null;
         }
         StringBuffer buf = new StringBuffer();
-        for (int i = 0; i < strings.length; i++) {
-            String string = strings[i];
-            if(i > 0) {
+        boolean first = true;
+        for (String string : strings) {
+            if (!first) {
                 buf.append("\n");
             }
+            first = false;
             buf.append(string);
         }
         return buf.toString();
     }
 
-    private String combine(URL[] urls) {
-        if(urls == null || urls.length == 0) {
+    private void toArtifacts(List<String> artifacts, List<ArtifactType> result) {
+        result.clear();
+        for (String artifact : artifacts) {
+            result.add(PluginInstallerGBean.toArtifactType(Artifact.create(artifact)));
+        }
+    }
+    private void toDependencies(List<String> artifacts, List<DependencyType> result) {
+        result.clear();
+        for (String artifact : artifacts) {
+            //TODO this is wrong.... need to encode import type as well
+            result.add(PluginInstallerGBean.toDependencyType(new Dependency(Artifact.create(artifact), ImportType.ALL)));
+        }
+    }
+
+    private String toString(List<? extends ArtifactType> artifacts) {
+        if (artifacts == null || artifacts.size() == 0) {
             return null;
         }
         StringBuffer buf = new StringBuffer();
-        for (int i = 0; i < urls.length; i++) {
-            URL url = urls[i];
-            if(i > 0) {
+        boolean first = true;
+        for (ArtifactType artifactType : artifacts) {
+            if (!first) {
                 buf.append("\n");
             }
-            buf.append(url.toString());
+            first = false;
+            buf.append(PluginInstallerGBean.toArtifact(artifactType).toString());
         }
         return buf.toString();
-    }
+     }
+
+
 }

Modified: geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java?rev=572762&r1=572761&r2=572762&view=diff
==============================================================================
--- geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java (original)
+++ geronimo/plugins/console/trunk/console-base-portlets/src/main/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java Tue Sep  4 11:03:01 2007
@@ -24,40 +24,42 @@
 import java.io.OutputStream;
 import java.io.PrintWriter;
 import java.util.Iterator;
-import java.util.List;
 import java.util.Set;
+
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.xml.bind.JAXBException;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLStreamException;
 import javax.xml.transform.OutputKeys;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
-import org.apache.geronimo.kernel.util.XmlUtil;
-import org.apache.geronimo.kernel.config.ConfigurationInfo;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.config.NoSuchStoreException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.config.NoSuchStoreException;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.kernel.repository.Version;
+import org.apache.geronimo.kernel.util.XmlUtil;
 import org.apache.geronimo.system.plugin.PluginInstaller;
-import org.apache.geronimo.system.plugin.PluginMetadata;
+import org.apache.geronimo.system.plugin.PluginInstallerGBean;
+import org.apache.geronimo.system.plugin.model.PluginListType;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Text;
@@ -196,78 +198,16 @@
         return false;
     }
 
-    private void generateConfigFile(HttpServletRequest request, Kernel kernel, PrintWriter out) throws ParserConfigurationException, NoSuchStoreException, TransformerException {
-        ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
-        PluginInstaller installer = getInstaller(kernel);
-        DocumentBuilderFactory factory = XmlUtil.newDocumentBuilderFactory();
-        factory.setNamespaceAware(true);
-        DocumentBuilder builder = factory.newDocumentBuilder();
-        Document doc = builder.newDocument();
-        Element root = doc.createElementNS("http://geronimo.apache.org/xml/ns/plugins-1.1", "geronimo-plugin-list");
-        root.setAttribute("xmlns", "http://geronimo.apache.org/xml/ns/plugins-1.1");
-        doc.appendChild(root);
-        List stores = mgr.listStores();
-        for (int i = 0; i < stores.size(); i++) {
-            AbstractName name = (AbstractName) stores.get(i);
-            List configs = mgr.listConfigurations(name);
-            for (int j = 0; j < configs.size(); j++) {
-                ConfigurationInfo info = (ConfigurationInfo) configs.get(j);
-                PluginMetadata data = installer.getPluginMetadata(info.getConfigID());
-                Element config = doc.createElement("plugin");
-                root.appendChild(config);
-                createText(doc, config, "name", data.getName());
-                createText(doc, config, "module-id", data.getModuleId().toString());
-                createText(doc, config, "category", "Geronimo Deployments");
-                createText(doc, config, "description", data.getCategory().equals("Unknown") ? "Automatically generated plugin metadata" : data.getDescription());
-                if(data.getPluginURL() != null) {
-                    createText(doc, config, "url", data.getPluginURL());
-                }
-                if(data.getAuthor() != null) {
-                    createText(doc, config, "author", data.getAuthor());
-                }
-                for (int k = 0; k < data.getLicenses().length; k++) {
-                    PluginMetadata.License license = data.getLicenses()[k];
-                    Element lic = doc.createElement("license");
-                    lic.setAttribute("osi-approved", Boolean.toString(license.isOsiApproved()));
-                    createText(doc, lic, license.getName());
-                    config.appendChild(lic);
-                }
-                // Skip hash since the CAR will be re-exported anyway and the file will be different
-                PluginMetadata.geronimoVersions[] versions = data.getGeronimoVersions();
-                for (int k = 0; k < versions.length; k++) {
-                    PluginMetadata.geronimoVersions ver = versions[k];
-                    writeGeronimoVersion(doc, config, ver);
-                }
-                String[] jvmVersions = data.getJvmVersions();
-                for (int k = 0; k < versions.length; k++) {
-                    String ver = jvmVersions[k];
-                    createText(doc, config, "jvm-version", ver);
-                }
-                for (int k = 0; k < data.getPrerequisites().length; k++) {
-                    PluginMetadata.Prerequisite prereq = data.getPrerequisites()[k];
-                    writePrerequisite(doc, config, prereq);
-                }
-                for (int k = 0; k < data.getDependencies().length; k++) {
-                    String dep = data.getDependencies()[k];
-                    createText(doc, config, "dependency", dep);
-                }
-                for (int k = 0; k < data.getObsoletes().length; k++) {
-                    String obs = data.getObsoletes()[k];
-                    createText(doc, config, "obsoletes", obs);
-                }
-                // Skip repositories since we want the download to come from here
-            }
-        }
+    private void generateConfigFile(HttpServletRequest request, Kernel kernel, PrintWriter out) throws NoSuchStoreException, JAXBException, XMLStreamException {
         String repo = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+request.getServletPath();
         if(!repo.endsWith("/")) repo += "/";
-        createText(doc, root, "default-repository", repo);
-        TransformerFactory xfactory = XmlUtil.newTransformerFactory();
-        Transformer xform = xfactory.newTransformer();
-        xform.setOutputProperty(OutputKeys.INDENT, "yes");
-        xform.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
-        xform.transform(new DOMSource(doc), new StreamResult(out));
+        ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
+        PluginInstaller installer = getInstaller(kernel);
+        PluginListType pluginList = installer.createPluginListForRepositories(mgr, repo);
+        PluginInstallerGBean.writePluginList(pluginList, out);
     }
 
+
     private PluginInstaller getInstaller(Kernel kernel) {
         Set names = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
         if(names.size() == 0) {
@@ -307,41 +247,6 @@
         xform.transform(new DOMSource(doc), new StreamResult(writer));
     }
 
-    private void writePrerequisite(Document doc, Element config, PluginMetadata.Prerequisite req) {
-        Element prereq = doc.createElement("prerequisite");
-        config.appendChild(prereq);
-        createText(doc, prereq, "id", req.getModuleId().toString());
-        createText(doc, prereq, "resource-type", req.getResourceType());
-        createText(doc, prereq, "description", req.getDescription());
-    }
-    
-    private void writeGeronimoVersion(Document doc, Element config, PluginMetadata.geronimoVersions ver){
-    	Element ger = doc.createElement("geronimo-versions");
-        createText(doc, ger, "version", ver.getVersion());
-        if (ver.getModuleId() != null){
-        	createText(doc, ger, "module-id", ver.getModuleId());
-        }
-        if (ver.getRepository() != null) {
-        	String[] repos = ver.getRepository();
-        	for ( int i=0; i < repos.length; i++ ) {
-        		createText(doc, ger, "source-repository", repos[i]);
-        	}
-        }
-        if (ver.getPreReqs() != null){
-            for (int j = 0; j < ver.getPreReqs().length; j++) {
-                PluginMetadata.Prerequisite prereq = ver.getPreReqs()[j];
-                Element pre = doc.createElement("prerequisite");
-                createText(doc, pre, "id", prereq.getModuleId().toString());
-                if(prereq.getResourceType() != null) {
-                    createText(doc, pre, "resource-type", prereq.getResourceType());
-                }
-                if(prereq.getDescription() != null) {
-                    createText(doc, pre, "description", prereq.getDescription());
-                }
-                ger.appendChild(pre);
-            }
-        }
-    }
 
     private void createText(Document doc, Element parent, String name, String text) {
         Element child = doc.createElement(name);
@@ -350,8 +255,4 @@
         child.appendChild(node);
     }
 
-    private void createText(Document doc, Element parent, String text) {
-        Text node = doc.createTextNode(text);
-        parent.appendChild(node);
-    }
 }

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=572762&r1=572761&r2=572762&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 Tue Sep  4 11:03:01 2007
@@ -19,24 +19,24 @@
 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.HashMap;
 import java.util.List;
 import java.util.Map;
+
 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.PluginList;
-import org.apache.geronimo.system.plugin.PluginMetadata;
-import java.util.Collections;
-import java.util.Collection;
-import java.util.Iterator;
+import org.apache.geronimo.system.plugin.model.PluginListType;
+import org.apache.geronimo.system.plugin.model.PluginType;
 
 /**
  * Handler for the import export list screen.
@@ -44,7 +44,6 @@
  * @version $Rev$ $Date$
  */
 public class ListHandler extends BaseImportExportHandler {
-    private final static Log log = LogFactory.getLog(ListHandler.class);
 
     public ListHandler() {
         super(LIST_MODE, "/WEB-INF/view/car/list.jsp");
@@ -80,29 +79,32 @@
     }
 
     private boolean loadFromRepository(RenderRequest request, String repository, String username, String password) throws IOException, PortletException {
-        PluginList data;
+        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);
         }
-        Map results = new HashMap();
-        if(data == null || data.getPlugins() == null) {
+        Map<String, List<PluginType>> results = new HashMap<String, List<PluginType>>();
+        if(data == null || data.getPlugin() == null) {
             return false;
         }
-        for (int i = 0; i < data.getPlugins().length; i++) {
-            PluginMetadata metadata = data.getPlugins()[i];
-            List values = (List) results.get(metadata.getCategory());
+        for (PluginType metadata: data.getPlugin()) {
+            List<PluginType> values = results.get(metadata.getCategory());
             if(values == null) {
-                values = new ArrayList();
+                values = new ArrayList<PluginType>();
                 results.put(metadata.getCategory(), values);
             }
             values.add(metadata);
         }
-        Collection values = results.values();
-        for (Iterator it = values.iterator(); it.hasNext();) {
-            List list = (List) it.next();
-            Collections.sort(list);
+        Collection<List<PluginType>> values = results.values();
+        for (List<PluginType> value : values) {
+            Collections.sort(value, new Comparator<PluginType>() {
+
+                public int compare(PluginType o1, PluginType o2) {
+                    return o1.getName().compareTo(o2.getName());
+                }
+            });
         }
         request.setAttribute("categories", results);
         request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, data);

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=572762&r1=572761&r2=572762&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 Tue Sep  4 11:03:01 2007
@@ -18,18 +18,22 @@
 
 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;
+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;
 
 /**
  * Handler for the screen that shows you plugin details before you go on and
@@ -62,19 +66,22 @@
         String repo = request.getParameter("repository");
         String user = request.getParameter("repo-user");
         String pass = request.getParameter("repo-pass");
-        PluginMetadata config = null;
+        PluginType config = null;
+        PluginArtifactType instance = null;
         try {
-            PluginList list = (PluginList) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
+            PluginListType list = (PluginListType) 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)) {
+            for (PluginType metadata: list.getPlugin()) {
+                for (PluginArtifactType testInstance: metadata.getPluginArtifact()) {
+                if(PluginInstallerGBean.toArtifact(testInstance.getModuleId()).toString().equals(configId)) {
                     config = metadata;
+                    instance = testInstance;
                     break;
                 }
+                }
             }
         } catch (FailedLoginException e) {
             throw new PortletException("Invalid login for Maven repository '"+repo+"'", e);
@@ -84,7 +91,9 @@
         }
         request.setAttribute("configId", configId);
         request.setAttribute("plugin", config);
-        request.setAttribute("gerVersions",config.getGeronimoVersions());
+        request.setAttribute("pluginArtifact", instance);
+//        request.setAttribute("gerVersions", instance.getGeronimoVersion());
+//        request.setAttribute("jvmVersions", instance.getJvmVersion());
         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/index.jsp
URL: http://svn.apache.org/viewvc/geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/index.jsp?rev=572762&r1=572761&r2=572762&view=diff
==============================================================================
--- geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/index.jsp (original)
+++ geronimo/plugins/console/trunk/console-base-portlets/src/main/webapp/WEB-INF/view/car/index.jsp Tue Sep  4 11:03:01 2007
@@ -45,12 +45,13 @@
     <c:if test="${!empty repositories}"><br /></c:if>
     <i>(<a href="<portlet:actionURL portletMode="view"><portlet:param name="mode" value="updateList-before" /><portlet:param name="repository" value="${repository}" /></portlet:actionURL>">Update Repository List</a>
      or <a href="<portlet:actionURL portletMode="view"><portlet:param name="mode" value="addRepository-before" /><portlet:param name="repository" value="${repository}" /></portlet:actionURL>">Add Repository</a>)</i>
+    <br/>
     <%--<input type="text" name="repository" value="${repository}" size="30" maxlength="200" />--%>
     <c:if test="${!empty repositories}">
-      <input type="submit" value="Search for Plugins" />
-      <br /><b>Optional Authentication:</b>
-         User: <input type="text" name="username" value="${repouser}" size="12" maxlength="200" />
-         Password: <input type="password" name="password" value="${repopass}" size="12" maxlength="200" />
+      <input type="submit" value="Show Plugins in selected repository" />
+      <br /><b>Optional Authentication:</b><br/>
+         User: <input type="text" name="username" value="${repouser}" size="12" maxlength="200" /><br/>
+         Password: <input type="password" name="password" value="${repopass}" size="12" maxlength="200" /><br/>
     </c:if>
 </form>
 

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=572762&r1=572761&r2=572762&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 Tue Sep  4 11:03:01 2007
@@ -16,44 +16,55 @@
 --%>
 <%@ 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"%>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
 <portlet:defineObjects/>
-<p>These are the Geronimo plugins available in the selected repository.  The entries
-that are hyperlinks may be installed into the local server.  The other entries are
-already available in the local server.</p>
+<p>These are the Geronimo plugins available in the selected repository. They may or may not already be installed in the geronimo server.</p>
 
 <p><b>Available Plugins:</b></p>
 
 <c:forEach var="category" items="${categories}">
-  <p>${category.key}</p>
-  <ul>
-    <c:forEach var="entry" items="${category.value}">
-      <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)
+    <p>Category: ${category.key}</p>
+    <ul>
+        <c:forEach var="entry" items="${category.value}">
+            <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>
-                          </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>
-          <li><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>">${entry.name}<c:if test="${entry.name ne entry.moduleId}"> (${entry.version})</c:if></a></li>
-        </c:otherwise>
-      </c:choose>
-    </c:forEach>
-  </ul>
+                              (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:forEach>
+    </ul>
 </c:forEach>
 
 <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/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=572762&r1=572761&r2=572762&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 Tue Sep  4 11:03:01 2007
@@ -30,7 +30,7 @@
   </tr>
   <tr>
     <th align="right" valign="top">Module ID:</th>
-    <td>${plugin.moduleId}</td>
+    <td>${pluginArtifact.moduleId.groupId}/${pluginArtifact.moduleId.artifactId}/${pluginArtifact.moduleId.version}/${pluginArtifact.moduleId.type}</td>
   </tr>
   <tr>
     <th align="right" valign="top">Group:</th>
@@ -38,7 +38,7 @@
   </tr>
   <tr>
     <th align="right" valign="top">Description:</th>
-    <td>${plugin.HTMLDescription}</td>
+    <td>${plugin.description}</td>
   </tr>
   <tr>
     <th align="right" valign="top">Author:</th>
@@ -46,12 +46,12 @@
   </tr>
   <tr>
     <th align="right" valign="top">Web Site:</th>
-    <td><a href="${plugin.pluginURL}">${plugin.pluginURL}</a></td>
+    <td><a href="${plugin.url}">${plugin.url}</a></td>
   </tr>
-  <c:forEach var="license" items="${plugin.licenses}">
+  <c:forEach var="license" items="${plugin.license}">
       <tr>
         <th align="right" valign="top">License:</th>
-        <td>${license.name}
+        <td>${license.value}
           <c:choose>
               <c:when test="${license.osiApproved}">(Open Source)</c:when>
               <c:otherwise>(Proprietary)</c:otherwise>
@@ -63,12 +63,12 @@
     <th align="right" valign="top">Geronimo-Versions:</th>
     <td>
       <c:choose>
-        <c:when test="${empty gerVersions}">
+        <c:when test="${empty pluginArtifact.geronimoVersion}">
           <i>None</i>
         </c:when>
         <c:otherwise>
-          <c:forEach var="geronimoVersions" items="${gerVersions}">
-            <b>${geronimoVersions.version}</b>
+          <c:forEach var="geronimoVersion" items="${pluginArtifact.geronimoVersion}">
+            <b>${geronimoVersion}</b>
           </c:forEach>
         </c:otherwise>
       </c:choose>
@@ -79,11 +79,11 @@
     <th align="right" valign="top">JVM Versions:</th>
     <td>
       <c:choose>
-          <c:when test="${empty plugin.jvmVersions}">
+          <c:when test="${empty pluginArtifact.jvmVersion}">
             <i>Any</i>
           </c:when>
           <c:otherwise>
-            ${fn:join(plugin.jvmVersions, ", ")}
+            ${fn:join(pluginArtifact.jvmVersion, ", ")}
           </c:otherwise>
       </c:choose>
     </td>
@@ -91,8 +91,8 @@
   <tr>
     <th align="right" valign="top">Dependencies:</th>
     <td>
-      <c:forEach var="dependency" items="${plugin.dependencies}">
-        ${fn:replace(dependency, "//", "/*/")}<br />
+      <c:forEach var="dependency" items="${pluginArtifact.dependency}">
+        ${dependency.groupId}/${dependency.artifactId}/${dependency.version}/${dependency.type}<br />
       </c:forEach>
     </td>
   </tr>
@@ -100,16 +100,18 @@
     <th align="right" valign="top">Prerequisites:</th>
     <td>
       <c:choose>
-        <c:when test="${empty plugin.prerequisites}">
+        <c:when test="${empty pluginArtifact.prerequisite}">
           <i>None</i>
         </c:when>
         <c:otherwise>
-          <c:forEach var="prereq" items="${plugin.prerequisites}">
-            <b>${prereq.moduleIdWithStars}</b> (${prereq.resourceType})<br/>
+          <c:forEach var="prereq" items="${pluginArtifact.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>
@@ -148,12 +150,12 @@
     <th align="right" valign="top">Obsoletes:</th>
     <td>
       <c:choose>
-        <c:when test="${empty plugin.obsoletes}">
+        <c:when test="${empty pluginArtifact.obsoletes}">
           <i>None</i>
         </c:when>
         <c:otherwise>
-          <c:forEach var="module" items="${plugin.obsoletes}">
-            ${fn:replace(module, "//", "/*/")}<br />
+          <c:forEach var="module" items="${pluginArtifact.obsoletes}">
+            ${module.groupId}/${module.artifactId}/${module.version}/${module.type}<br />
           </c:forEach>
         </c:otherwise>
       </c:choose>
@@ -162,7 +164,7 @@
 
 </table>
 
-<c:if test="${plugin.eligible}">
+<%--<c:if test="${plugin.eligible}">--%>
 <form name="<portlet:namespace/>PluginForm" action="<portlet:actionURL/>">
     <input type="hidden" name="configId" value="${configId}" />
     <input type="hidden" name="mode" value="viewForDownload-after" />
@@ -171,6 +173,6 @@
     <input type="hidden" name="repo-pass" value="${repopass}" />
     <input type="submit" value="Continue" />
 </form>
-</c:if>
+<%--</c:if>--%>
 
 <p><a href="<portlet:actionURL portletMode="view"><portlet:param name="mode" value="index-before" /></portlet:actionURL>">Cancel</a></p>



Mime
View raw message