geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r555767 - in /geronimo/server/trunk: applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/car/ applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/car/ modules/geronimo-system/src/...
Date Thu, 12 Jul 2007 21:07:22 GMT
Author: pmcmahan
Date: Thu Jul 12 14:07:21 2007
New Revision: 555767

URL: http://svn.apache.org/viewvc?view=rev&rev=555767
Log:
GERONIMO-2757 add geronimo-versions to exported plugins.  Patch submitted by Jason Warner.

Modified:
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/car/pluginParams.jsp
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java?view=diff&rev=555767&r1=555766&r2=555767
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java
Thu Jul 12 14:07:21 2007
@@ -75,39 +75,10 @@
                 log.warn("Unable to edit plugin metadata containing more than one license!
 Additional license data will not be editable.");
             }
         }
-        //request.setAttribute("gerVersions", combine(data.getGeronimoVersions()));
+        //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) {
-        	for (int i = 0; i < gerVers.length; i++) {
-        		PluginMetadata.geronimoVersions ver = gerVers[i];
-        		String prefix = "geronimo-versions" + (i+1);
-        		request.setAttribute(prefix +"Version", ver.getVersion());
-                if (ver.getModuleId() != null) {
-                    request.setAttribute(prefix +"ModuleID", ver.getModuleId().toString());
-                }
-                String[] repos = ver.getRepository();
-                if (repos != null && repos.length > 0) {
-                	for ( int j=0; j < repos.length; j++ ) {
-                		String repo = repos[j];
-                		String prefixes = "repo" + (j+1);
-                		request.setAttribute(prefixes, repo);
-                	}
-                }
-                PluginMetadata.Prerequisite[] reqs = ver.getPreReqs();
-                if(reqs != null && reqs.length > 0) {
-                    for (int j = 0; j < reqs.length; j++) {
-                        PluginMetadata.Prerequisite req = reqs[j];
-                        String prefixes = "prereq" + (j+1);
-                        request.setAttribute(prefixes, req.getModuleId().toString());
-                        if (req.getResourceType() != null) {
-                            request.setAttribute(prefixes +"type", req.getResourceType());
-                        }
-                        if (req.getDescription() != null) {
-                            request.setAttribute(prefixes +"desc", req.getDescription());
-                        }
-                    }
-                }
-        	}
+            request.setAttribute("geronimoVersion",gerVers[0].getVersion());
         }
         request.setAttribute("jvmVersions", combine(data.getJvmVersions()));
         request.setAttribute("dependencies", combine(data.getDependencies()));
@@ -154,54 +125,14 @@
             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;
+        String version = request.getParameter("geronimoVersion");
         List gerVersions = new ArrayList();
-        int counter = 1;
-        while(true) {
-        	String prefix = "geronimo-versions" + counter;
-        	++counter;
-        	String id = request.getParameter(prefix);
-        	if (id == null || id.trim() == "") {
-        		break;
-        	}
-        	String version = request.getParameter(prefix+"Version");
-        	String moduleId = request.getParameter(prefix+"ModuleID");
-        	String repository = request.getParameter(prefix+"Repo");
-        	List repos = new ArrayList();
-        	int repoCounter = 1;
-        	while(true) {
-        		String prefixes = "repo" + repoCounter;
-        		++repoCounter;
-        		String versionRepo = request.getParameter(prefixes);
-        		if(versionRepo == null || versionRepo.trim().equals("")) {
-        			break;
-        		}
-        		repos.add(versionRepo);
-        	}
-        		
-        	int preCounter = 1;
-        	List prereqs = new ArrayList();
-            while(true) {
-                String prefixes = "prereq" + preCounter;
-                ++preCounter;
-                String prereq = request.getParameter(prefixes);
-                if(prereq == null || prereq.trim().equals("")) {
-                    break;
-                }
-                String type = request.getParameter(prefixes+"type");
-                String desc = request.getParameter(prefixes+"desc");
-                if(type != null && type.trim().equals("")) {
-                    type = null;
-                }
-                if(desc != null && desc.trim().equals("")) {
-                    desc = null;
-                }
-                prereqs.add(new PluginMetadata.Prerequisite(Artifact.create(id), false, type,
desc));
-            }
-            gerVersions.add(new PluginMetadata.geronimoVersions(version, moduleId, (String[])repos.toArray(new
String[repos.size()]), (PluginMetadata.Prerequisite[])prereqs.toArray(new PluginMetadata.Prerequisite[prereqs.size()])));
     	
-        }
+        gerVersions.add(new PluginMetadata.geronimoVersions(version,null,null,null));
         metadata.setGeronimoVersions((PluginMetadata.geronimoVersions[])gerVersions.toArray(new
PluginMetadata.geronimoVersions[gerVersions.size()]));
         List prereqs = new ArrayList();
-        counter = 1;
+        int counter = 1;
         while(true) {
             String prefix = "prereq" + counter;
             ++counter;

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/car/pluginParams.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/car/pluginParams.jsp?view=diff&rev=555767&r1=555766&r2=555767
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/car/pluginParams.jsp
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/car/pluginParams.jsp
Thu Jul 12 14:07:21 2007
@@ -145,18 +145,15 @@
           </tr>
         <!-- ENTRY FIELD: Geronimo Versions -->
           <tr>
-            <th style="min-width: 140px"><div align="right">Geronimo Versions:</div></th>
-            <td><textarea rows="5" cols="60" name="gerVersions">${gerVersions}</textarea></td>
+            <th style="min-width: 140px"><div align="right">Geronimo Version:</div></th>
+            <td><input type="text" cols="30" name="geronimoVersion" value="${geronimoVersion}"/></td>
           </tr>
           <tr>
             <td></td>
             <td>
-              An optional list of Geronimo versions supported by this plugin.  If no values
-              are listed, the plugin can be installed in any version of Geronimo.  Otherwise,
-              list one acceptable Geronimo version per line, like
-              "1.1&nbsp;\n&nbsp;1.1.1&nbsp;\n&nbsp;1.1.2&nbsp;\n&nbsp;..."
-              (ideally, of course, this means you've actually tested the plugin with each
-              Geronimo version listed here).
+              The Geronimo Version element is the version of geronimo that this plugin will
+              be running on.  It is a required element and take on values such as 2.0-SNAPSHOT
+              and 2.0-M2
             </td>
           </tr>
         <!-- ENTRY FIELD: JVM Versions -->

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?view=diff&rev=555767&r1=555766&r2=555767
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Thu Jul 12 14:07:21 2007
@@ -1869,6 +1869,12 @@
             if (gerVersions.getModuleId() != null){
             	addTextChild(doc, ger, "module-id", gerVersions.getModuleId());
             }
+            if (gerVersions.getRepository() != null) {
+                String[] repos = gerVersions.getRepository();
+                for ( int j=0; j < repos.length; j++) {
+                        addTextChild(doc, ger, "source-repository", repos[j]);
+                }
+            }
             if (gerVersions.getPreReqs() != null){
                 for (int j = 0; j < gerVersions.getPreReqs().length; j++) {
                     PluginMetadata.Prerequisite prereq = gerVersions.getPreReqs()[j];
@@ -1882,12 +1888,6 @@
                     }
                     ger.appendChild(pre);
                 }
-            }
-            if (gerVersions.getRepository().length > 0) {
-            	String[] repos = gerVersions.getRepository();
-            	for ( int j=0; j < repos.length; j++) {
-            		addTextChild(doc, ger, "repository", repos[j]);
-            	}
             }
             config.appendChild(ger);
         }



Mime
View raw message