geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r399534 [4/4] - in /geronimo/branches/1.1: applications/console-standard/src/java/org/apache/geronimo/console/car/ applications/console-standard/src/webapp/WEB-INF/view/car/ configs/console-jetty/src/conf/ configs/console-tomcat/src/conf/ c...
Date Thu, 04 May 2006 04:09:23 GMT
Copied: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginList.java (from r399072, geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationList.java)
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginList.java?p2=geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginList.java&p1=geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationList.java&r1=399072&r2=399534&rev=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationList.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginList.java Wed May  3 21:09:17 2006
@@ -14,7 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.geronimo.system.configuration;
+package org.apache.geronimo.system.plugin;
 
 import java.io.Serializable;
 import java.net.URL;
@@ -29,31 +29,28 @@
  *
  * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
  */
-public class ConfigurationList implements Serializable {
-    private final URL mainRepository;
-    private final URL[] backupRepositories;
-    private final ConfigurationMetadata[] configurations;
-
-    public ConfigurationList(URL mainRepository, URL[] backupRepositories, ConfigurationMetadata[] configurations) {
-        this.mainRepository = mainRepository;
-        this.backupRepositories = backupRepositories;
-        this.configurations = configurations;
+public class PluginList implements Serializable {
+    private final URL[] repositories;
+    private final PluginMetadata[] plugins;
+
+    public PluginList(URL[] repositories, PluginMetadata[] plugins) {
+        this.repositories = repositories;
+        this.plugins = plugins;
     }
 
-    public static ConfigurationList createInstallList(ConfigurationList all, Artifact[] selectedConfigIDs) {
-        URL mainRepository = all.mainRepository;
-        URL[] backupRepositories = all.backupRepositories;
+    public static PluginList createInstallList(PluginList all, Artifact[] selectedConfigIDs) {
+        URL[] repositories = all.repositories;
         List list = new ArrayList();
         Set set = new HashSet();
         for (int i = 0; i < selectedConfigIDs.length; i++) {
             Artifact artifact = selectedConfigIDs[i];
             set.add(artifact);
         }
-        for (int i = 0; i < all.getConfigurations().length; i++) {
-            ConfigurationMetadata metadata = all.getConfigurations()[i];
-            if(set.contains(metadata.getConfigId())) {
+        for (int i = 0; i < all.getPlugins().length; i++) {
+            PluginMetadata metadata = all.getPlugins()[i];
+            if(set.contains(metadata.getModuleId())) {
                 if(metadata.isInstalled() || !metadata.isEligible()) {
-                    throw new IllegalArgumentException("Cannot install "+metadata.getConfigId());
+                    throw new IllegalArgumentException("Cannot install "+metadata.getModuleId());
                 }
                 list.add(metadata);
             }
@@ -61,19 +58,18 @@
         if(list.size() == 0) {
             return null;
         }
-        ConfigurationMetadata[] configurations = (ConfigurationMetadata[]) list.toArray(new ConfigurationMetadata[list.size()]);
-        return new ConfigurationList(mainRepository, backupRepositories, configurations);
+        PluginMetadata[] configurations = (PluginMetadata[]) list.toArray(new PluginMetadata[list.size()]);
+        return new PluginList(repositories, configurations);
     }
 
-    public static ConfigurationList createInstallList(ConfigurationList all, Artifact selectedConfigID) {
-        URL mainRepository = all.mainRepository;
-        URL[] backupRepositories = all.backupRepositories;
-        ConfigurationMetadata target = null;
-        for (int i = 0; i < all.getConfigurations().length; i++) {
-            ConfigurationMetadata metadata = all.getConfigurations()[i];
-            if(selectedConfigID.equals(metadata.getConfigId())) {
+    public static PluginList createInstallList(PluginList all, Artifact selectedConfigID) {
+        URL[] repositories = all.repositories;
+        PluginMetadata target = null;
+        for (int i = 0; i < all.getPlugins().length; i++) {
+            PluginMetadata metadata = all.getPlugins()[i];
+            if(selectedConfigID.equals(metadata.getModuleId())) {
                 if(metadata.isInstalled() || !metadata.isEligible()) {
-                    throw new IllegalArgumentException("Cannot install "+metadata.getConfigId());
+                    throw new IllegalArgumentException("Cannot install "+metadata.getModuleId());
                 }
                 target = metadata;
                 break;
@@ -82,18 +78,14 @@
         if(target == null) {
             return null;
         }
-        return new ConfigurationList(mainRepository, backupRepositories, new ConfigurationMetadata[]{target});
+        return new PluginList(repositories, new PluginMetadata[]{target});
     }
 
-    public URL getMainRepository() {
-        return mainRepository;
+    public URL[] getRepositories() {
+        return repositories;
     }
 
-    public URL[] getBackupRepositories() {
-        return backupRepositories;
-    }
-
-    public ConfigurationMetadata[] getConfigurations() {
-        return configurations;
+    public PluginMetadata[] getPlugins() {
+        return plugins;
     }
 }

Copied: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java (from r399072, geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationMetadata.java)
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java?p2=geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java&p1=geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationMetadata.java&r1=399072&r2=399534&rev=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationMetadata.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java Wed May  3 21:09:17 2006
@@ -14,9 +14,10 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.geronimo.system.configuration;
+package org.apache.geronimo.system.plugin;
 
 import java.io.Serializable;
+import java.net.URL;
 import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
@@ -25,26 +26,34 @@
  *
  * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
  */
-public class ConfigurationMetadata implements Serializable, Comparable {
-    private final Artifact configId;
+public class PluginMetadata implements Serializable, Comparable {
     private final String name;
-    private final String description;
+    private final Artifact moduleId;
     private final String category;
-    private final boolean installed;
-    private final boolean eligible;
-    private String[] dependencies;
-    private String[] obsoletes;
+    private final String description;
+    private final String pluginURL;
+    private final String author;
     private License[] licenses;
+    private final Hash hash;
     private String[] geronimoVersions;
     private String[] jvmVersions;
-    private String[] forceStart;
     private Prerequisite[] prerequisites;
+    private String[] dependencies;
+    private String[] forceStart;
+    private String[] obsoletes;
+    private URL[] repositories;
+
+    private final boolean installed;
+    private final boolean eligible;
 
-    public ConfigurationMetadata(Artifact configId, String name, String description, String category, boolean installed, boolean eligible) {
-        this.configId = configId;
+    public PluginMetadata(String name, Artifact moduleId, String category, String description, String pluginURL, String author, Hash hash, boolean installed, boolean eligible) {
         this.name = name;
-        this.description = description;
+        this.moduleId = moduleId;
         this.category = category;
+        this.description = description;
+        this.pluginURL = pluginURL;
+        this.author = author;
+        this.hash = hash;
         this.installed = installed;
         this.eligible = eligible;
     }
@@ -65,8 +74,8 @@
      * Gets the Config ID for this configuration, which is a globally unique
      * identifier.
      */
-    public Artifact getConfigId() {
-        return configId;
+    public Artifact getModuleId() {
+        return moduleId;
     }
 
     /**
@@ -97,7 +106,7 @@
     }
 
     public String getVersion() {
-        return configId.getVersion() == null ? "unknown version" : configId.getVersion().toString();
+        return moduleId.getVersion() == null ? "unknown version" : moduleId.getVersion().toString();
     }
 
     /**
@@ -130,6 +139,22 @@
         return geronimoVersions;
     }
 
+    public String getAuthor() {
+        return author;
+    }
+
+    public Hash getHash() {
+        return hash;
+    }
+
+    public String getPluginURL() {
+        return pluginURL;
+    }
+
+    public URL[] getRepositories() {
+        return repositories;
+    }
+
     public void setGeronimoVersions(String[] geronimoVersions) {
         this.geronimoVersions = geronimoVersions;
     }
@@ -154,6 +179,10 @@
         return prerequisites;
     }
 
+    public void setRepositories(URL[] repositories) {
+        this.repositories = repositories;
+    }
+
     public void setPrerequisites(Prerequisite[] prerequisites) {
         this.prerequisites = prerequisites;
     }
@@ -164,7 +193,7 @@
 
 
     public int compareTo(Object o) {
-        ConfigurationMetadata other = (ConfigurationMetadata) o;
+        PluginMetadata other = (PluginMetadata) o;
         int test = category.compareTo(other.category);
         if(test != 0) return test;
         test = name.compareTo(other.name);
@@ -190,28 +219,46 @@
         }
     }
 
+    public static class Hash implements Serializable {
+        private final String type; // MD5 or SHA-1
+        private final String value;
+
+        public Hash(String type, String value) {
+            this.type = type;
+            this.value = value;
+        }
+
+        public String getType() {
+            return type;
+        }
+
+        public String getValue() {
+            return value;
+        }
+    }
+
     public static class Prerequisite implements Serializable {
-        private final Artifact configId;
+        private final Artifact moduleId;
         private final String resourceType;
         private final String description;
         private final boolean present;
 
-        public Prerequisite(Artifact configId, boolean present) {
-            this.configId = configId;
+        public Prerequisite(Artifact moduleId, boolean present) {
+            this.moduleId = moduleId;
             this.present = present;
             resourceType = null;
             description = null;
         }
 
-        public Prerequisite(Artifact configId, boolean present, String resourceType, String description) {
-            this.configId = configId;
+        public Prerequisite(Artifact moduleId, boolean present, String resourceType, String description) {
+            this.moduleId = moduleId;
             this.present = present;
             this.resourceType = resourceType;
             this.description = description;
         }
 
-        public Artifact getConfigId() {
-            return configId;
+        public Artifact getModuleId() {
+            return moduleId;
         }
 
         public String getResourceType() {
@@ -226,30 +273,30 @@
             return present;
         }
 
-        public String getConfigIdWithStars() {
+        public String getModuleIdWithStars() {
             StringBuffer buf = new StringBuffer();
-            if(configId.getGroupId() == null) {
+            if(moduleId.getGroupId() == null) {
                 buf.append("*");
             } else {
-                buf.append(configId.getGroupId());
+                buf.append(moduleId.getGroupId());
             }
             buf.append("/");
-            if(configId.getArtifactId() == null) {
+            if(moduleId.getArtifactId() == null) {
                 buf.append("*");
             } else {
-                buf.append(configId.getArtifactId());
+                buf.append(moduleId.getArtifactId());
             }
             buf.append("/");
-            if(configId.getVersion() == null) {
+            if(moduleId.getVersion() == null) {
                 buf.append("*");
             } else {
-                buf.append(configId.getVersion());
+                buf.append(moduleId.getVersion());
             }
             buf.append("/");
-            if(configId.getType() == null) {
+            if(moduleId.getType() == null) {
                 buf.append("*");
             } else {
-                buf.append(configId.getType());
+                buf.append(moduleId.getType());
             }
             return buf.toString();
         }

Added: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginRepositoryDownloader.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginRepositoryDownloader.java?rev=399534&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginRepositoryDownloader.java (added)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginRepositoryDownloader.java Wed May  3 21:09:17 2006
@@ -0,0 +1,146 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.system.plugin;
+
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.util.List;
+import java.util.ArrayList;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+
+/**
+ * An implementation of PluginRepositoryList that downloads plugins from
+ * an Apache web site.
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class PluginRepositoryDownloader implements PluginRepositoryList {
+    private final static Log log = LogFactory.getLog(PluginRepositoryDownloader.class);
+    private List downloadRepositories = new ArrayList();
+    private List userRepositories = new ArrayList();
+    private Kernel kernel;
+    private AbstractName name;
+    private URL repositoryList;
+
+    public PluginRepositoryDownloader(List downloadRepositories, List userRepositories, URL repositoryList, Kernel kernel, AbstractName name) {
+        if(downloadRepositories != null) this.downloadRepositories = downloadRepositories;
+        if(userRepositories != null) this.userRepositories = userRepositories;
+        this.repositoryList = repositoryList;
+        this.kernel = kernel;
+        this.name = name;
+    }
+
+    /**
+     * The list of repositories that were downloaded from central.
+     */
+    public void setDownloadRepositories(List downloadRepositories) {
+        this.downloadRepositories = downloadRepositories;
+        if(this.downloadRepositories == null) this.downloadRepositories = new ArrayList();
+    }
+
+    /**
+     * Any repositories that the user added manually
+     */
+    public void setUserRepositories(List userRepositories) {
+        this.userRepositories = userRepositories;
+        if(this.userRepositories == null) this.userRepositories = new ArrayList();
+    }
+
+    /**
+     * Gets the union of centrally-listed repositories and user-added repositories.
+     */
+    public URL[] getRepositories() {
+        List list = new ArrayList();
+        for (int i = 0; i < downloadRepositories.size(); i++) {
+            String url = (String) downloadRepositories.get(i);
+            try {
+                list.add(new URL(url));
+            } catch (MalformedURLException e) {
+                log.error("Unable to format plugin repository URL "+url, e);
+            }
+        }
+        for (int i = 0; i < userRepositories.size(); i++) {
+            String url = (String) userRepositories.get(i);
+            try {
+                list.add(new URL(url));
+            } catch (MalformedURLException e) {
+                log.error("Unable to format plugin repository URL "+url, e);
+            }
+        }
+        return (URL[]) list.toArray(new URL[list.size()]);
+    }
+
+    /**
+     * Go download a fresh copy of the repository list.
+     */
+    public void refresh() {
+        try {
+            BufferedReader in = new BufferedReader(new InputStreamReader(repositoryList.openStream()));
+            String line;
+            List list = new ArrayList();
+            while((line = in.readLine()) != null) {
+                line = line.trim();
+                if(!line.equals("") && !line.startsWith("#")) {
+                    list.add(line);
+                }
+            }
+            in.close();
+            kernel.setAttribute(name, "downloadRepositories", list);
+        } catch (Exception e) {
+            log.error("Unable to save download repositories", e);
+        }
+    }
+
+    /**
+     * Adds a new repository that the user put in manually.
+     */
+    public void addUserRepository(URL repo) {
+        userRepositories.add(repo.toString());
+        try {
+            kernel.setAttribute(name, "userRepositories", userRepositories);
+        } catch (Exception e) {
+            log.error("Unable to save user repositories", e);
+        }
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(PluginRepositoryDownloader.class);
+
+        infoFactory.addAttribute("downloadRepositories", List.class, true);
+        infoFactory.addAttribute("userRepositories", List.class, true);
+        infoFactory.addAttribute("repositoryList", URL.class, true);
+        infoFactory.addAttribute("kernel", Kernel.class, false);
+        infoFactory.addAttribute("abstractName", AbstractName.class, false);
+        infoFactory.addInterface(PluginRepositoryList.class);
+        infoFactory.setConstructor(new String[]{"downloadRepositories","userRepositories","repositoryList","kernel","abstractName"});
+
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}

Propchange: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginRepositoryDownloader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginRepositoryList.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginRepositoryList.java?rev=399534&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginRepositoryList.java (added)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginRepositoryList.java Wed May  3 21:09:17 2006
@@ -0,0 +1,30 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.system.plugin;
+
+import java.net.URL;
+
+/**
+ * Interface for a service that lists available plugin repositories.
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public interface PluginRepositoryList {
+    public URL[] getRepositories();
+    public void refresh();
+    public void addUserRepository(URL repo);
+}

Propchange: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginRepositoryList.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/util/PluginRepositoryExporter.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/util/PluginRepositoryExporter.java?rev=399534&r1=399533&r2=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/util/PluginRepositoryExporter.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/util/PluginRepositoryExporter.java Wed May  3 21:09:17 2006
@@ -19,10 +19,13 @@
 import java.io.FileWriter;
 import java.io.IOException;
 import java.net.URI;
+import java.net.URL;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.SortedSet;
+import java.util.Properties;
+import java.util.HashMap;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
@@ -35,21 +38,24 @@
 import org.apache.geronimo.kernel.config.IOUtil;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Version;
-import org.apache.geronimo.system.configuration.ConfigInstallerGBean;
-import org.apache.geronimo.system.configuration.ConfigurationArchiveData;
-import org.apache.geronimo.system.configuration.ConfigurationInstaller;
-import org.apache.geronimo.system.configuration.ConfigurationMetadata;
 import org.apache.geronimo.system.configuration.RepositoryConfigurationStore;
+import org.apache.geronimo.system.configuration.ConfigurationStoreUtil;
 import org.apache.geronimo.system.repository.Maven1Repository;
 import org.apache.geronimo.system.repository.Maven2Repository;
 import org.apache.geronimo.system.repository.CopyArtifactTypeHandler;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.system.plugin.PluginInstallerGBean;
+import org.apache.geronimo.system.plugin.PluginInstaller;
+import org.apache.geronimo.system.plugin.PluginMetadata;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.w3c.dom.Text;
 import org.xml.sax.SAXException;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
 
 /**
  * A utility that exports a repository of plugins.
@@ -57,13 +63,19 @@
  * @version $Rev: 355877 $ $Date: 2005-12-10 21:48:27 -0500 (Sat, 10 Dec 2005) $
  */
 public class PluginRepositoryExporter {
+    private final static String NAMESPACE = "http://geronimo.apache.org/xml/ns/plugins-1.1";
     private Maven1Repository sourceRepo;
     private Maven2Repository destRepo;
-    private Version targetVersion;
-    private ConfigInstallerGBean installer;
+    private Map targetVersions;
+    private PluginInstallerGBean installer;
     private File pluginList;
+    private File schema;
 
-    public PluginRepositoryExporter(String inPath, String outPath, String version) throws IOException {
+    public PluginRepositoryExporter(String inPath, String outPath, String schema) throws IOException {
+        this.schema = new File(schema);
+        if(!this.schema.isFile() || !this.schema.canRead()) {
+            throw new IllegalArgumentException("Bad schema file "+this.schema.getAbsolutePath());
+        }
         File inFile = new File(inPath);
         if(!inFile.isDirectory() || !inFile.canRead()) {
             throw new IllegalArgumentException("Bad source repo directory "+inFile.getAbsolutePath());
@@ -87,7 +99,14 @@
         sourceRepo = new Maven1Repository(inFile);
         destRepo = new Maven2Repository(outFile);
         destRepo.setTypeHandler("car", new CopyArtifactTypeHandler());
-        targetVersion = new Version(version);
+        Properties props = new Properties();
+        props.load(PluginRepositoryExporter.class.getResourceAsStream("/META-INF/product-versions.properties"));
+        targetVersions = new HashMap();
+        for (Iterator it = props.keySet().iterator(); it.hasNext();) {
+            String product = (String) it.next();
+            String version = props.getProperty(product);
+            targetVersions.put(product, new Version(version));
+        }
         RepositoryConfigurationStore store = new RepositoryConfigurationStore(destRepo);
         ServerInfo info = new ServerInfo() {
             public String getBaseDirectory() {
@@ -111,7 +130,7 @@
             }
 
             public String getVersion() {
-                return targetVersion.toString();
+                return null;
             }
 
             public File resolve(final String filename) {
@@ -126,7 +145,7 @@
                 return null;
             }
         };
-        installer = new ConfigInstallerGBean(null, destRepo, store, info, null);
+        installer = new PluginInstallerGBean(null, destRepo, store, info, null);
     }
 
     public void execute() throws IOException {
@@ -134,10 +153,12 @@
         try {
             for (Iterator it = list.iterator(); it.hasNext();) {
                 Artifact artifact = (Artifact) it.next();
-                if(((artifact.getGroupId().equals("geronimo") && artifact.getVersion().equals(targetVersion)) ||
+                if(((artifact.getGroupId().equals("geronimo")) ||
                         artifact.getGroupId().equals("activemq") ||
-                        artifact.getGroupId().equals("openejb")
+                        artifact.getGroupId().equals("openejb") ||
+                        artifact.getGroupId().equals("tranql")
                         )
+                        && artifact.getVersion().equals(targetVersions.get(artifact.getGroupId()))
                         && !artifact.getType().equals("pom") && !artifact.getType().equals("distribution") && !artifact.getType().equals("plugin") && !artifact.getType().equals("javadoc.jar")) {
                     System.out.println("Copying "+artifact);
                     if(destRepo.contains(artifact)) {
@@ -159,6 +180,7 @@
             TransformerFactory xfactory = TransformerFactory.newInstance();
             Transformer xform = xfactory.newTransformer();
             xform.setOutputProperty(OutputKeys.INDENT, "yes");
+            xform.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
             System.out.println("Writing geronimo-plugins.xml file...");
             FileWriter out = new FileWriter(pluginList);
             xform.transform(new DOMSource(doc), new StreamResult(out));
@@ -225,30 +247,63 @@
     }
 
 
-    private Document generateConfigFile(ConfigurationInstaller installer, Collection plugins) throws ParserConfigurationException {
+    private Document generateConfigFile(PluginInstaller installer, Collection plugins) throws ParserConfigurationException {
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        factory.setNamespaceAware(true);
+        factory.setValidating(true);
+        factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
+                             "http://www.w3.org/2001/XMLSchema");
+        factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource",
+                             schema.getName());
         DocumentBuilder builder = factory.newDocumentBuilder();
+        builder.setEntityResolver(new EntityResolver() {
+            public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
+                System.out.println("RESOLVING PUB "+publicId+" SYS "+systemId);
+                return null;
+            }
+        });
         Document doc = builder.newDocument();
-        Element root = doc.createElement("geronimo-plugin-list");
+        Element root = doc.createElementNS(NAMESPACE, "geronimo-plugin-list");
+        root.setAttribute("xmlns", NAMESPACE);
         doc.appendChild(root);
         for (Iterator it = plugins.iterator(); it.hasNext();) {
             Artifact plugin = (Artifact) it.next();
             System.out.println("Including plugin data for "+plugin);
-            ConfigurationArchiveData pluginData = installer.getPluginMetadata(plugin);
-            ConfigurationMetadata data = pluginData.getConfiguration();
-            Element config = doc.createElement("configuration");
+            PluginMetadata data = installer.getPluginMetadata(plugin);
+            if(data == null) {
+                throw new IllegalArgumentException("Invalid plugin file; Log4J output for a specific error.");
+            }
+            File file = destRepo.getLocation(plugin);
+            Element config = doc.createElement("plugin");
             root.appendChild(config);
             createText(doc, config, "name", data.getName());
-            createText(doc, config, "config-id", data.getConfigId().toString());
+            createText(doc, config, "module-id", data.getModuleId().toString());
             createText(doc, config, "category", data.getCategory());
             createText(doc, config, "description", data.getDescription());
+            if(data.getPluginURL() != null) {
+                createText(doc, config, "url", data.getPluginURL());
+            }
+            if(data.getAuthor() != null) {
+                createText(doc, config, "author", data.getAuthor());
+            }
             for (int i = 0; i < data.getLicenses().length; i++) {
-                ConfigurationMetadata.License license = data.getLicenses()[i];
+                PluginMetadata.License license = data.getLicenses()[i];
                 Element lic = doc.createElement("license");
                 lic.appendChild(doc.createTextNode(license.getName()));
                 lic.setAttribute("osi-approved", license.isOsiApproved() ? "true" : "false");
                 config.appendChild(lic);
             }
+            if(data.getHash() != null) {
+                Element hash = doc.createElement("hash");
+                hash.setAttribute("type", data.getHash().getType());
+                hash.appendChild(doc.createTextNode(data.getHash().getValue()));
+                config.appendChild(hash);
+            } else if(file.isFile() && file.canRead()) {
+                Element hash = doc.createElement("hash");
+                hash.setAttribute("type", "SHA-1");
+                hash.appendChild(doc.createTextNode(ConfigurationStoreUtil.getActualChecksum(file)));
+                config.appendChild(hash);
+            }
             for (int i = 0; i < data.getGeronimoVersions().length; i++) {
                 String version = data.getGeronimoVersions()[i];
                 createText(doc, config, "geronimo-version", version);
@@ -258,7 +313,7 @@
                 createText(doc, config, "jvm-version", version);
             }
             for (int i = 0; i < data.getPrerequisites().length; i++) {
-                ConfigurationMetadata.Prerequisite prereq = data.getPrerequisites()[i];
+                PluginMetadata.Prerequisite prereq = data.getPrerequisites()[i];
                 writePrerequisite(doc, config, prereq);
             }
             for (int i = 0; i < data.getDependencies().length; i++) {
@@ -269,15 +324,22 @@
                 String version = data.getObsoletes()[i];
                 createText(doc, config, "obsoletes", version);
             }
+            // Skip the repository, we'll specify that at the top level
+//            for (int i = 0; i < data.getRepositories().length; i++) {
+//                URL url = data.getRepositories()[i];
+//                createText(doc, config, "source-repository", url.toString());
+//            }
         }
-        createText(doc, root, "backup-repository", "http://www.ibiblio.org/maven2/");
+        Version ger = (Version) targetVersions.get("geronimo");
+        createText(doc, root, "default-repository", "http://www.geronimoplugins.com/repository/geronimo-"+ger.getMajorVersion()+"."+ger.getMinorVersion());
+        createText(doc, root, "default-repository", "http://www.ibiblio.org/maven2/");
         return doc;
     }
 
-    private void writePrerequisite(Document doc, Element config, ConfigurationMetadata.Prerequisite data) {
+    private void writePrerequisite(Document doc, Element config, PluginMetadata.Prerequisite data) {
         Element prereq = doc.createElement("prerequisite");
         config.appendChild(prereq);
-        createText(doc, prereq, "id", data.getConfigId().toString());
+        createText(doc, prereq, "id", data.getModuleId().toString());
         createText(doc, prereq, "resource-type",data.getResourceType());
         createText(doc, prereq, "description",data.getDescription());
     }

Copied: geronimo/branches/1.1/modules/system/src/schema/plugins-1.1.xsd (from r399072, geronimo/branches/1.1/modules/system/src/schema/config-list.xsd)
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/schema/plugins-1.1.xsd?p2=geronimo/branches/1.1/modules/system/src/schema/plugins-1.1.xsd&p1=geronimo/branches/1.1/modules/system/src/schema/config-list.xsd&r1=399072&r2=399534&rev=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/schema/config-list.xsd (original)
+++ geronimo/branches/1.1/modules/system/src/schema/plugins-1.1.xsd Wed May  3 21:09:17 2006
@@ -17,22 +17,22 @@
 -->
 
 <xs:schema
-        targetNamespace="http://geronimo.apache.org/xml/ns/config-list-1.0"
-        xmlns:list="http://geronimo.apache.org/xml/ns/config-list-1.0"
+        targetNamespace="http://geronimo.apache.org/xml/ns/plugins-1.1"
+        xmlns:list="http://geronimo.apache.org/xml/ns/plugins-1.1"
         xmlns:xs="http://www.w3.org/2001/XMLSchema"
         elementFormDefault="qualified"
         attributeFormDefault="unqualified"
         >
     <xs:annotation>
         <xs:documentation>
-            Schema for a list of Geronimo configurations available at some
-            external site (namely, a Maven 2 repository).
+            Schema for a list of Geronimo plugins available at some external site
+            (namely, a Maven 2 repository).
         </xs:documentation>
     </xs:annotation>
 
     <!--   Top-level elements   -->
 
-    <xs:element name="geronimo-plugin-list" type="list:config-listType">
+    <xs:element name="geronimo-plugin-list" type="list:plugin-listType">
         <xs:annotation>
             <xs:documentation>
                 The geronimo-plugin-list root element is used for the config file present
@@ -42,46 +42,50 @@
             </xs:documentation>
         </xs:annotation>
     </xs:element>
-    <xs:element name="geronimo-plugin" type="list:configuration-descriptorType">
+    <xs:element name="geronimo-plugin" type="list:pluginType">
         <xs:annotation>
             <xs:documentation>
-                The geronimo-configuration root element is used as the config file
-                submitted with an individual Geronimo configuration to the plugin
-                repository. It will be merged into the plugin list for the repository
-                when the submitted plugin is accepted.
-
-                It is also used for the metadata packed into a configuration when
-                a configuration archive is downloaded from an online repository
-                for local installation, in which case it should be packed into the
-                archive at META-INF/geronimo-plugin.xml
+                The geronimo-plugin root element is used as the config file submitted
+                with an individual Geronimo plugin to the plugin repository. It will be
+                merged into the plugin list for the repository when the submitted plugin
+                is accepted.
+
+                It is also used for the metadata packed into a plugin when a plugin archive
+                is downloaded from an online repository for local installation, in which
+                case it should be packed into the archive at META-INF/geronimo-plugin.xml
             </xs:documentation>
         </xs:annotation>
     </xs:element>
 
     <!--   Data types used in this schema   -->
 
-    <!-- Format for a list of available configurations provided by a remote repository -->
-    <xs:complexType name="config-listType">
+    <!-- Format for a list of available plugins provided by a remote repository -->
+    <xs:complexType name="plugin-listType">
         <xs:sequence>
-            <xs:element name="configuration" type="list:configurationType" minOccurs="0" maxOccurs="unbounded">
+            <xs:element name="plugin" type="list:pluginType" minOccurs="0" maxOccurs="unbounded">
                 <xs:annotation>
                     <xs:documentation>
-                        The list of configurations available in the current plugin repository.
+                        The list of plugins available in the current plugin repository.
                     </xs:documentation>
                 </xs:annotation>
             </xs:element>
-            <xs:element name="backup-repository" type="xs:string" minOccurs="0" maxOccurs="unbounded">
+            <xs:element name="default-repository" type="xs:string" minOccurs="0" maxOccurs="unbounded">
                 <xs:annotation>
                     <xs:documentation>
-                        Each backup-repository is a URL to check for any dependencies that
-                        were not found in the current repository. That can be used, for
-                        example, to host Geronimo configurations at one site and common
-                        third-party JARs at another.
+                        Each default-repository is a URL to check for any dependencies that
+                        need to be downloaded.  Different values can be used, for example, to
+                        host Geronimo plugins at one site and common third-party JARs at
+                        another site, or to maintain a plugin list at a site that is not
+                        actually a repository.
 
-                        The repository where this file came from will be checked first for
-                        every artifact, and if an artifact is not found there, each of the
-                        repositories listed here will be checked in the order listed until
-                        the artifact is found.
+                        The URL where this fill is downloaded from must list itself as the
+                        first default-repository if it wants to be checked for file
+                        downloads in addition to hosting the plugin list.  For every
+                        dnwload, each of the repositories listed here will be checked in
+                        the order listed until the artifact is found.  However, if a
+                        plugin in the list includes its own source-repository list, those
+                        repositories will be used instead of these list-level repositories
+                        when downloading that plugin or its dependencies.
 
                         Note that while the primary repository may be protected by HTTP
                         Basic authentication, the backup repositories must either use the
@@ -92,46 +96,43 @@
         </xs:sequence>
     </xs:complexType>
 
-    <xs:complexType name="configurationType">
+    <xs:complexType name="pluginType">
         <xs:sequence>
             <xs:element name="name" type="xs:string">
                 <xs:annotation>
                     <xs:documentation>
-                        A human-readable name for this configuration. This will be used to identify
-                        the configuration to a user when giving them a list of configurations to
-                        select from.
+                        A human-readable name for this plugin. This will be used to identify
+                        the plugin to a user when giving them a list of plugins to select from.
                     </xs:documentation>
                 </xs:annotation>
             </xs:element>
-            <xs:element name="config-id" type="xs:string" minOccurs="0">
+            <xs:element name="module-id" type="xs:string" minOccurs="0">
                 <xs:annotation>
                     <xs:documentation>
-                        The Geronimo configId for this configuration, which uniquely identifies
+                        The Geronimo moduleId for this plugins, which uniquely identifies
                         it, and also is used to construct a path to download it if necessary.
 
-                        If no config-id is provided, that means this is a plugin group, which is
+                        If no module-id is provided, that means this is a plugin group, which is
                         just a list of other plugins to install.  The prerequisites must still be
-                        met, but then the dependencies listed for this configuration will be
-                        treated as the list of actual configuraitons to install.  NOTE: for plugin
-                        lists, each of the dependencies must be a full config-id; entries without
-                        a version number for example will not work.
+                        met, but then the dependencies listed for this plugin will be treated as
+                        the list of actual plugins to install.
                     </xs:documentation>
                 </xs:annotation>
             </xs:element>
             <xs:element name="category" type="xs:string">
                 <xs:annotation>
                     <xs:documentation>
-                        A category name for this configuration. The user interface typically groups
-                        configurations by their category name, so this should match the value for other
-                        configurations in the same category.
+                        A category name for this plugin. The user interface typically groups
+                        plugins by their category name, so this should match the value for other
+                        plugins in the same category.
                     </xs:documentation>
                 </xs:annotation>
             </xs:element>
             <xs:element name="description" type="xs:string">
                 <xs:annotation>
                     <xs:documentation>
-                        A description of this component. This will be displayed when the user
-                        looks for more information about this component. It typically includes
+                        A description of this plugin. This will be displayed when the user
+                        looks for more information about this plugin. It typically includes
                         a description of what it does, what if any third-party software it's
                         based on, why it would be interesting to use it, etc.
 
@@ -142,6 +143,25 @@
                     </xs:documentation>
                 </xs:annotation>
             </xs:element>
+            <xs:element name="url" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>
+                        The URL for a site that contains more detailed information about this
+                        plugin.  The plugin repository has access to the basic information
+                        provided in this file, but a plugin may have a home page with more
+                        detailed information, documentation, source code, etc.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="author" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>
+                        Names the author of the plugin.  This may be a person, a company, an
+                        open source project, or whatever.  Basically, this gives some idea who
+                        submitted the plugin, perhaps where to go for support, etc.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
             <xs:element name="license" type="list:licenseType" minOccurs="0" maxOccurs="unbounded">
                 <xs:annotation>
                     <xs:documentation>
@@ -161,14 +181,24 @@
                     </xs:documentation>
                 </xs:annotation>
             </xs:element>
+            <xs:element name="hash" type="list:hashType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>
+                        A hash value (typically MD5 or SHA-1) that applies to the plugin download
+                        file.  This can be used to confirm that a plugin download was complete, and
+                        to ensure that the file downloaded is the same as the file originally
+                        posted to the repository.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
             <xs:element name="geronimo-version" type="xs:string" minOccurs="0" maxOccurs="unbounded">
                 <xs:annotation>
                     <xs:documentation>
-                        Indicates a version of the Geronimo base server that this component can run in.
-                        If no geronimo-version is listed, that means the component can run in any version
+                        Indicates a version of the Geronimo base server that this plugin can run in.
+                        If no geronimo-version is listed, that means the plugin can run in any version
                         of Geronimo so long as the prerequisites, parents, and dependencies are present.
                         If one or more geronimo-version elements are listed, then the current version of
-                        Geronimo must match one of them in order for this component to be installable.
+                        Geronimo must match one of them in order for this plugin to be installable.
 
                         This is applied as an exact match: 1.2 does not match 1.2.1 or 1.2-SNAPSHOT
                     </xs:documentation>
@@ -177,15 +207,15 @@
             <xs:element name="jvm-version" type="xs:string" minOccurs="0" maxOccurs="unbounded">
                 <xs:annotation>
                     <xs:documentation>
-                        Indicates a version of the JVM that this component can run in. If no jvm-version
-                        is listed, that means the component can run in any version of the JVM supported
+                        Indicates a version of the JVM that this plugin can run in. If no jvm-version
+                        is listed, that means the plugin can run in any version of the JVM supported
                         by Geronimo so long as the prerequisites, parents, and dependencies are present.
                         If one or more jvm-version elements are listed, then the JVM that Geronimo is
-                        currently running on must match one of them in order for this component to be
+                        currently running on must match one of them in order for this plugin to be
                         installable. (It does not stop you from restarting Geronimo on a different JVM
                         version once the components is already installed.)
 
-                        This is not normally used, but must be for components that use CORBA or
+                        This is not normally used, but must be for plugins that use CORBA or
                         serialized QNames, etc.
 
                         This is applied as a prefix match: 1.4 matches 1.4.2 or 1.4.2_10
@@ -195,10 +225,10 @@
             <xs:element name="prerequisite" type="list:prerequisiteType" minOccurs="0" maxOccurs="unbounded">
                 <xs:annotation>
                     <xs:documentation>
-                        A dependency of this configuration that must be previously installed if this
-                        configuration is to be considered to be installable. This is generally the
-                        same as the dependency element (for example, it may refer to a configuration
-                        by configId or a JAR by repository ID) except that the dependency will not
+                        A dependency of this plugin that must be previously installed if this
+                        plugin is to be considered to be installable. This is generally the
+                        same as the dependency element (for example, it may refer to a plugin
+                        by moduleId or a JAR by repository ID) except that the dependency will not
                         be downloaded on demand and must have been previously installed.
 
                         This is currently used for a web application to specify the web container it
@@ -212,7 +242,7 @@
 
                         It is also used when a user must set something up (like a database pool or
                         security realm) to point to a custom resource in their environment before the
-                        component can be installed.
+                        plugin can be installed.
 
                         This is applied as an exact match, except that the version number may be
                         omitted, in which case any matching version of the dependency will work.
@@ -220,21 +250,17 @@
                         It has an optional resource-type attribute indicating to the user what type
                         of prerequisite this is (for cases where they're expected to set something up
                         as opposed to just downloading a JAR). e.g. it could be set to "JDBC Pool".
+                        Likewise there is an option description to provide more detailed guidance for
+                        how to resolve the prerequisite.
                     </xs:documentation>
                 </xs:annotation>
             </xs:element>
             <xs:element name="dependency" type="xs:string" minOccurs="0" maxOccurs="unbounded">
                 <xs:annotation>
                     <xs:documentation>
-                        The configId of another configuration or the repository ID of a 3rd party JAR
-                        that this configuration depends on. That means that the dependency must be
-                        downloaded and installed if this configuration is selected.
-
-                        Note: If the dependency referred to here is a configuration, it may have
-                        additional dependencies that will need to be downloaded and installed. If the
-                        dependency referred to here is just a JAR, it will not be consulted for
-                        transitive dependencies -- it's assumed that a configuration lists all the
-                        JARs it actually depends on.
+                        The moduleId of another plugin or Geronimo module, or the repository ID of
+                        a 3rd party JAR that this plugin depends on. That means that the dependency
+                        must be downloaded and installed if this plugin is selected.
 
                         This is applied as an exact match, except that the version number may be
                         omitted, in which case any matching version of the dependency will work.
@@ -244,22 +270,43 @@
             <xs:element name="obsoletes" type="xs:string" minOccurs="0" maxOccurs="unbounded">
                 <xs:annotation>
                     <xs:documentation>
-                        The configId of another configuration that this configuration replaces.
-                        That can be used, for example, to replace a less functional configuration
+                        The moduleId of another plugin or Geronimo module that this plugin replaces.
+                        That can be used, for example, to replace a less functional module
                         with a more functional one, or to upgrade a component to a newer version.
 
                         This is applied as an exact match, except that the version number may be
-                        omitted, in which case any matching version of the configuration will be
+                        omitted, in which case any matching version of the module or plugin will be
                         replaced.  Be aware that omitting the version number may cause a
-                        configuration to be downgraded, so you may choose to explicitly list all
+                        plugin to be downgraded, so you may choose to explicitly list all
                         lesser versions.  That may not be desirable either, though.  If the
                         server has foo-1.0.2 installed and you install foo-1.0.1, would you
                         rather have it downgrade or end up with both installed?
 
                         NOTE: currently the "obsoletes" entries are only processed on the
-                        configuration(s) passed directly to the ConfigurationInstaller (not on
-                        dependencies that are brought down as a result).  That means that a
-                        plugin group must list obsoletes for all its components, etc.
+                        plugin(s) passed directly to the PluginInstaller (not on dependencies that
+                        are brought down as a result).  That means that a plugin group must list
+                        obsoletes for all its components, etc.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="source-repository" type="xs:string" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>
+                        The base URL for the repository that this plugin should be downloaded from.
+                        The repositories listed here will be consulted in the order listed every
+                        time something needs to be downloaded, and the search will stop at the
+                        first repository that holds any matching plugin or JAR.
+
+                        In a normal plugin list, the repositories are specified at the list level,
+                        and do not need to be repeated at the plugin level.  However, any values
+                        specified at the plugin level replace the values specified at the list
+                        level.  This can be used to maintain a single list of plugins from multiple
+                        sources.
+
+                        This value is required if this is not a plugin list but metadata for a
+                        single plugin included in a plugin file downloaded from a repository.
+                        Otherwise, the installer would not know where to download any dependencies
+                        from.
                     </xs:documentation>
                 </xs:annotation>
             </xs:element>
@@ -269,7 +316,7 @@
     <xs:complexType name="licenseType">
         <xs:annotation>
             <xs:documentation>
-                See configurationType/license above
+                See pluginType/license above
             </xs:documentation>
         </xs:annotation>
 
@@ -293,7 +340,7 @@
     <xs:complexType name="dependencyType">
         <xs:annotation>
             <xs:documentation>
-                See configurationType/dependency above
+                See pluginType/dependency above
             </xs:documentation>
         </xs:annotation>
 
@@ -302,14 +349,14 @@
                 <xs:attribute name="start" use="optional" type="xs:boolean" default="false">
                     <xs:annotation>
                         <xs:documentation>
-                            Normally when a configuration dependency is installed it will not
-                            be started.  The user may be prompted to start the configuration
+                            Normally when a plugin dependency is installed it will not
+                            be started.  The user may be prompted to start the plugin
                             with whatever tool kicked off the install to begin with.
 
-                            This attribute may be set to "true" to force the dependency to
+                            This attribute may be set to "true" to force the plugin to
                             be started after it is installed.  NOTE: this currently only
-                            affects the dependencies of the configurations actually passed to
-                            the Configuration Installer (not nested dependencies).  This
+                            affects the dependencies of the plugins actually passed to
+                            the PluginInstaller (not nested dependencies).  This
                             means it's primarily useful for plugin lists.
                         </xs:documentation>
                     </xs:annotation>
@@ -318,14 +365,38 @@
         </xs:simpleContent>
     </xs:complexType>
 
+    <xs:complexType name="hashType">
+        <xs:annotation>
+            <xs:documentation>
+                See pluginType/hash above
+            </xs:documentation>
+        </xs:annotation>
+
+        <xs:simpleContent>
+            <xs:extension base="xs:string">
+                <xs:attribute name="type" use="required" type="xs:string">
+                    <xs:annotation>
+                        <xs:documentation>
+                            Indicates the type of hash.  The values presently supported are:
+
+                                  MD5
+                                  SHA-1
+
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:attribute>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
     <xs:complexType name="prerequisiteType">
         <xs:sequence>
             <xs:element name="id" type="xs:string">
                 <xs:annotation>
                     <xs:documentation>
-                        The Config ID of the prerequisite. This is used to check whether
+                        The Module ID of the prerequisite. This is used to check whether
                         it's available on the server that you're downloading the plugin
-                        into. It may omit some portions of the Config ID to be more
+                        into. It may omit some portions of the Module ID to be more
                         accomodating (e.g. "*/MyDBPool/*/*" to identify a database pool
                         instead of "console/MyDBPool/1.0/car").
 
@@ -353,11 +424,11 @@
                         could say "console/myapp-pool/*/jar" is a prerequisite with resource
                         type "JDBC Pool" and then the user should understand that they can
                         install your plugin if they create a JDBC pool called "myapp-pool"
-                        in the console, or manually deploy a pool with configId
+                        in the console, or manually deploy a pool with moduleId
                         "console/myapp-pool/(something)/jar"
 
                         Another option in that case would be to use a dependency on a JDBC
-                        pool configuration you provide, but then it would have to use the
+                        pool plugins you provide, but then it would have to use the
                         system database (and run a DDL script on the first connect) in order
                         to be installable in an arbitrary Geronimo server. That would be a
                         better approach for demonstration applications, whereas the
@@ -381,52 +452,6 @@
                         pool with the name "SomeAppPool" and then run the associated create
                         script from http://someapp.com/db-scripts/ before installing this
                         plugin.
-                    </xs:documentation>
-                </xs:annotation>
-            </xs:element>
-        </xs:sequence>
-    </xs:complexType>
-
-    <!-- Format for the config file for a single configuration download -->
-    <xs:complexType name="configuration-descriptorType">
-        <xs:sequence>
-            <xs:element name="configuration" type="list:configurationType">
-                <xs:annotation>
-                    <xs:documentation>
-                        The metadata for this configuration
-                    </xs:documentation>
-                </xs:annotation>
-            </xs:element>
-            <xs:element name="source-repository" type="xs:string" minOccurs="0">
-                <xs:annotation>
-                    <xs:documentation>
-                        The base URL for the repository that this configuration was
-                        downloaded from.  This will be used as the primary
-                        repository for downloading additional dependencies, etc.
-
-                        If this descriptor is being put together for submission to
-                        a repository, etc. then this value may be omitted.  When an
-                        individual configuration is downloaded from a repository
-                        for offline installation, it must be present.
-                    </xs:documentation>
-                </xs:annotation>
-            </xs:element>
-            <xs:element name="backup-repository" type="xs:string" minOccurs="0" maxOccurs="unbounded">
-                <xs:annotation>
-                    <xs:documentation>
-                        Each backup-repository is a URL to check for any dependencies that
-                        were not found in the current repository. That can be used, for
-                        example, to host Geronimo configurations at one site and common
-                        third-party JARs at another.
-
-                        The repository where this file came from will be checked first for
-                        every artifact, and if an artifact is not found there, each of the
-                        repositories listed here will be checked in the order listed until
-                        the artifact is found.
-
-                        Note that while the primary repository may be protected by HTTP
-                        Basic authentication, the backup repositories must either use the
-                        same username and password as the primary or use no authentication.
                     </xs:documentation>
                 </xs:annotation>
             </xs:element>

Modified: geronimo/branches/1.1/modules/system/src/test-data/geronimo-plugins.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/test-data/geronimo-plugins.xml?rev=399534&r1=399533&r2=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/test-data/geronimo-plugins.xml (original)
+++ geronimo/branches/1.1/modules/system/src/test-data/geronimo-plugins.xml Wed May  3 21:09:17 2006
@@ -1,33 +1,35 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<geronimo-plugin-list>
-
-<configuration>
+<geronimo-plugin-list xmlns="http://geronimo.apache.org/xml/ns/plugins-1.1">
+<plugin>
 <name>DayTrader Performance Testing App (Jetty/Derby)</name>
-<config-id>geronimo/daytrader-derby-jetty/1.1-SNAPSHOT/car</config-id>
+<module-id>geronimo/daytrader-derby-jetty/1.1-SNAPSHOT/car</module-id>
 <category>Examples</category>
+<description>Test Data</description>
 <geronimo-version>1.1-SNAPSHOT</geronimo-version>
 <prerequisite><id>geronimo/jetty/*/car</id><description>
 		This is a web application or web-related module, configured for the Jetty web container.  It will not run on Tomcat versions of Geronimo.  If you need a Tomcat version of this application, you'll need to get it from another Tomcat Geronimo installation.
 </description></prerequisite>
 <dependency>geronimo/j2ee-server/1.1-SNAPSHOT/car</dependency>
 <dependency>geronimo/geronimo-daytrader-derby-db/1.1-SNAPSHOT/jar</dependency>
-</configuration>
+</plugin>
 
-<configuration>
+<plugin>
 <name>DayTrader Client (Jetty/Derby)</name>
-<config-id>geronimo/daytrader-derby-jetty-streamer-client/1.1-SNAPSHOT/car</config-id>
+<module-id>geronimo/daytrader-derby-jetty-streamer-client/1.1-SNAPSHOT/car</module-id>
 <category>Examples</category>
+<description>Test Data</description>
 <geronimo-version>1.1-SNAPSHOT</geronimo-version>
 <prerequisite><id>geronimo/jetty/*/car</id><description>
 		This is a web application or web-related module, configured for the Jetty web container.  It will not run on Tomcat versions of Geronimo.  If you need a Tomcat version of this application, you'll need to get it from another Tomcat Geronimo installation.
 </description></prerequisite>
 <dependency>geronimo/client/1.1-SNAPSHOT/car</dependency>
-</configuration>
+</plugin>
 
-<configuration>
+<plugin>
 <name>Jakarta JSP Examples (Jetty)</name>
-<config-id>geronimo/jsp-examples-jetty/1.1-SNAPSHOT/car</config-id>
+<module-id>geronimo/jsp-examples-jetty/1.1-SNAPSHOT/car</module-id>
 <category>Examples</category>
+<description>Test Data</description>
 <geronimo-version>1.1-SNAPSHOT</geronimo-version>
 <prerequisite><id>geronimo/jetty/*/car</id><description>
 		This is a web application or web-related module, configured for the Jetty web container.  It will not run on Tomcat versions of Geronimo.  If you need a Tomcat version of this application, you'll need to get it from another Tomcat Geronimo installation.
@@ -35,12 +37,13 @@
 <dependency>commons-collections/commons-collections/3.1/jar</dependency>
 <dependency>geronimo/j2ee-server/1.1-SNAPSHOT/car</dependency>
 <dependency>geronimo/jetty/1.1-SNAPSHOT/car</dependency>
-</configuration>
+</plugin>
 
-<configuration>
+<plugin>
 <name>LDAP Demo Web App (Jetty)</name>
-<config-id>geronimo/ldap-demo-jetty/1.1-SNAPSHOT/car</config-id>
+<module-id>geronimo/ldap-demo-jetty/1.1-SNAPSHOT/car</module-id>
 <category>Examples</category>
+<description>Test Data</description>
 <geronimo-version>1.1-SNAPSHOT</geronimo-version>
 <prerequisite><id>geronimo/jetty/*/car</id><description>
 		This is a web application or web-related module, configured for the Jetty web container.  It will not run on Tomcat versions of Geronimo.  If you need a Tomcat version of this application, you'll need to get it from another Tomcat Geronimo installation.
@@ -48,33 +51,36 @@
 <dependency>geronimo/ldap-realm/1.1-SNAPSHOT/car</dependency>
 <dependency>geronimo/j2ee-server/1.1-SNAPSHOT/car</dependency>
 <dependency>geronimo/jetty/1.1-SNAPSHOT/car</dependency>
-</configuration>
+</plugin>
 
-<configuration>
+<plugin>
 <name>LDAP Demo Security Realm</name>
-<config-id>geronimo/ldap-realm/1.1-SNAPSHOT/car</config-id>
+<module-id>geronimo/ldap-realm/1.1-SNAPSHOT/car</module-id>
 <category>Examples</category>
+<description>Test Data</description>
 <geronimo-version>1.1-SNAPSHOT</geronimo-version>
 <jvm-version>1.5</jvm-version>
 <dependency>geronimo/j2ee-security/1.1-SNAPSHOT/car</dependency>
-</configuration>
+</plugin>
 
-<configuration>
+<plugin>
 <name>Jakarta Servlet Examples (Jetty)</name>
-<config-id>geronimo/servlets-examples-jetty/1.1-SNAPSHOT/car</config-id>
+<module-id>geronimo/servlets-examples-jetty/1.1-SNAPSHOT/car</module-id>
 <category>Examples</category>
+<description>Test Data</description>
 <geronimo-version>1.1-SNAPSHOT</geronimo-version>
 <prerequisite><id>geronimo/jetty/*/car</id><description>
 		This is a web application or web-related module, configured for the Jetty web container.  It will not run on Tomcat versions of Geronimo.  If you need a Tomcat version of this application, you'll need to get it from another Tomcat Geronimo installation.
 </description></prerequisite>
 <dependency>geronimo/j2ee-server/1.1-SNAPSHOT/car</dependency>
 <dependency>geronimo/jetty/1.1-SNAPSHOT/car</dependency>
-</configuration>
+</plugin>
 
-<configuration>
+<plugin>
 <name>jUDDI Server 0.9rc4 for Geronimo</name>
-<config-id>geronimo/uddi-jetty/1.1-SNAPSHOT/car</config-id>
+<module-id>geronimo/uddi-jetty/1.1-SNAPSHOT/car</module-id>
 <category>Integration</category>
+<description>Test Data</description>
 <geronimo-version>1.1-SNAPSHOT</geronimo-version>
 <prerequisite><id>geronimo/jetty/*/car</id><description>
 		This is a web application or web-related module, configured for the Jetty web container.  It will not run on Tomcat versions of Geronimo.  If you need a Tomcat version of this application, you'll need to get it from another Tomcat Geronimo installation.
@@ -83,12 +89,13 @@
 <dependency>juddi/juddi/0.9rc4/jar</dependency>
 <dependency>geronimo/geronimo-uddi-db/1.1-SNAPSHOT/jar</dependency>
 <dependency>geronimo/j2ee-server/1.1-SNAPSHOT/car</dependency>
-</configuration>
+</plugin>
 
-<configuration>
+<plugin>
 <name>Geronimo Admin Console (Jetty)</name>
-<config-id>geronimo/webconsole-jetty/1.1-SNAPSHOT/car</config-id>
+<module-id>geronimo/webconsole-jetty/1.1-SNAPSHOT/car</module-id>
 <category>Core Geronimo</category>
+<description>Test Data</description>
 <geronimo-version>1.1-SNAPSHOT</geronimo-version>
 <prerequisite><id>geronimo/jetty/*/car</id><description>
 		This is a web application or web-related module, configured for the Jetty web container.  It will not run on Tomcat versions of Geronimo.  If you need a Tomcat version of this application, you'll need to get it from another Tomcat Geronimo installation.
@@ -115,12 +122,13 @@
 <dependency>geronimo/geronimo-converter/1.1-SNAPSHOT/jar</dependency>
 <dependency>geronimo/geronimo-util/1.1-SNAPSHOT/jar</dependency>
 <dependency>geronimo/geronimo-jetty/1.1-SNAPSHOT/jar</dependency>
-</configuration>
+</plugin>
 
-<configuration>
+<plugin>
 <name>Geronimo Remote Deployment Support (Jetty)</name>
-<config-id>geronimo/remote-deploy-jetty/1.1-SNAPSHOT/car</config-id>
+<module-id>geronimo/remote-deploy-jetty/1.1-SNAPSHOT/car</module-id>
 <category>Core Geronimo</category>
+<description>Test Data</description>
 <geronimo-version>1.1-SNAPSHOT</geronimo-version>
 <prerequisite><id>geronimo/jetty/*/car</id><description>
 		This is a web application or web-related module, configured for the Jetty web container.  It will not run on Tomcat versions of Geronimo.  If you need a Tomcat version of this application, you'll need to get it from another Tomcat Geronimo installation.
@@ -129,12 +137,13 @@
 <dependency>xmlbeans/xbean/2.0.0/jar</dependency>
 <dependency>geronimo/j2ee-server/1.1-SNAPSHOT/car</dependency>
 <dependency>geronimo/jetty/1.1-SNAPSHOT/car</dependency>
-</configuration>
+</plugin>
 
-<configuration>
+<plugin>
 <name>Geronimo JMX Debug Tool (Jetty)</name>
-<config-id>geronimo/jmxdebug-jetty/1.1-SNAPSHOT/car</config-id>
+<module-id>geronimo/jmxdebug-jetty/1.1-SNAPSHOT/car</module-id>
 <category>Core Geronimo</category>
+<description>Test Data</description>
 <geronimo-version>1.1-SNAPSHOT</geronimo-version>
 <prerequisite><id>geronimo/jetty/*/car</id><description>
 		This is a web application or web-related module, configured for the Jetty web container.  It will not run on Tomcat versions of Geronimo.  If you need a Tomcat version of this application, you'll need to get it from another Tomcat Geronimo installation.
@@ -142,27 +151,31 @@
 <dependency>commons-collections/commons-collections/3.1/jar</dependency>
 <dependency>geronimo/j2ee-server/1.1-SNAPSHOT/car</dependency>
 <dependency>geronimo/jetty/1.1-SNAPSHOT/car</dependency>
-</configuration>
+</plugin>
 
-<configuration>
+<plugin>
 <name>Geronimo Welcome App (Jetty)</name>
-<config-id>geronimo/welcome-jetty/1.1-SNAPSHOT/car</config-id>
+<module-id>geronimo/welcome-jetty/1.1-SNAPSHOT/car</module-id>
 <category>Core Geronimo</category>
+<description>Test Data</description>
 <geronimo-version>1.1-SNAPSHOT</geronimo-version>
 <prerequisite><id>geronimo/jetty/*/car</id><description>
 		This is a web application or web-related module, configured for the Jetty web container.  It will not run on Tomcat versions of Geronimo.  If you need a Tomcat version of this application, you'll need to get it from another Tomcat Geronimo installation.
 </description></prerequisite>
 <dependency>geronimo/j2ee-server/1.1-SNAPSHOT/car</dependency>
 <dependency>geronimo/jetty/1.1-SNAPSHOT/car</dependency>
-</configuration>
+</plugin>
 
-<configuration>
+<plugin>
 <name>Apache Directory 0.92 for Geronimo</name>
-<config-id>geronimo/directory/1.1-SNAPSHOT/car</config-id>
+<module-id>geronimo/directory/1.1-SNAPSHOT/car</module-id>
 <category>Security</category>
+<description>Test Data</description>
 <geronimo-version>1.1-SNAPSHOT</geronimo-version>
 <dependency>geronimo/j2ee-server/1.1-SNAPSHOT/car</dependency>
 <dependency>geronimo/geronimo-directory/1.1-SNAPSHOT/jar</dependency>
-</configuration>
+</plugin>
+
+<default-repository>http://nowhere.com/</default-repository>
 
 </geronimo-plugin-list>

Copied: geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/plugin/PluginInstallerTest.java (from r399072, geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/ConfigInstallerTest.java)
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/plugin/PluginInstallerTest.java?p2=geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/plugin/PluginInstallerTest.java&p1=geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/ConfigInstallerTest.java&r1=399072&r2=399534&rev=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/ConfigInstallerTest.java (original)
+++ geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/plugin/PluginInstallerTest.java Wed May  3 21:09:17 2006
@@ -14,7 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.geronimo.system.configuration;
+package org.apache.geronimo.system.plugin;
 
 import java.io.File;
 import java.io.IOException;
@@ -46,20 +46,22 @@
 import org.apache.geronimo.system.threads.ThreadPool;
 
 /**
- * Tests the config installer GBean
+ * Tests the plugin installer GBean
  *
  * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
  */
-public class ConfigInstallerTest extends TestCase {
+public class PluginInstallerTest extends TestCase {
+    private URL fakeRepo;
     private URL testRepo;
-    private ConfigurationInstaller installer;
+    private PluginInstaller installer;
 
     protected void setUp() throws Exception {
         super.setUp();
+        fakeRepo = new URL("http://nowhere.com/");
         String url = getClass().getResource("/geronimo-plugins.xml").toString();
         int pos = url.lastIndexOf("/");
         testRepo = new URL(url.substring(0, pos));
-        installer = new ConfigInstallerGBean(new MockConfigManager(), new MockRepository(), new MockConfigStore(),
+        installer = new PluginInstallerGBean(new MockConfigManager(), new MockRepository(), new MockConfigStore(),
                 new BasicServerInfo("."), new ThreadPool() {
             public int getPoolSize() {
                 return 0;
@@ -72,16 +74,16 @@
     }
 
     public void testParsing() throws Exception {
-        ConfigurationList list = installer.listConfigurations(testRepo, null, null);
-        assertEquals(0, list.getBackupRepositories().length);
-        assertEquals(testRepo, list.getMainRepository());
-        assertTrue(list.getConfigurations().length > 0);
+        PluginList list = installer.listPlugins(testRepo, null, null);
+        assertEquals(1, list.getRepositories().length);
+        assertEquals(fakeRepo, list.getRepositories()[0]);
+        assertTrue(list.getPlugins().length > 0);
         int prereqCount = 0;
-        for (int i = 0; i < list.getConfigurations().length; i++) {
-            ConfigurationMetadata metadata = list.getConfigurations()[i];
+        for (int i = 0; i < list.getPlugins().length; i++) {
+            PluginMetadata metadata = list.getPlugins()[i];
             prereqCount += metadata.getPrerequisites().length;
             for (int j = 0; j < metadata.getPrerequisites().length; j++) {
-                ConfigurationMetadata.Prerequisite prerequisite = metadata.getPrerequisites()[j];
+                PluginMetadata.Prerequisite prerequisite = metadata.getPrerequisites()[j];
                 assertFalse(prerequisite.isPresent());
             }
         }



Mime
View raw message