geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r396025 - in /geronimo/branches/1.1/applications/console-standard/src: conf/ java/org/apache/geronimo/console/jmsmanager/wizard/ java/org/apache/geronimo/console/util/
Date Fri, 21 Apr 2006 22:27:27 GMT
Author: ammulder
Date: Fri Apr 21 15:27:24 2006
New Revision: 396025

URL: http://svn.apache.org/viewcvs?rev=396025&view=rev
Log:
Fix JMS portlet to save and deploy (GERONIMO-1802) and add proper
  dependency reference

Modified:
    geronimo/branches/1.1/applications/console-standard/src/conf/jms-resource-providers.properties
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/JMSProviderData.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ListScreenHandler.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/SelectProviderHandler.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java

Modified: geronimo/branches/1.1/applications/console-standard/src/conf/jms-resource-providers.properties
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/conf/jms-resource-providers.properties?rev=396025&r1=396024&r2=396025&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/conf/jms-resource-providers.properties
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/conf/jms-resource-providers.properties
Fri Apr 21 15:27:24 2006
@@ -1,3 +1,3 @@
 provider.activemq.name=ActiveMQ
-provider.activemq.rar=activemq/activemq-ra/${activemq_version}/rar
-provider.activemq.dependency=geronimo/activemq-broker/${geronimo_version}/car
+provider.activemq.rar=activemq/activemq-ra//rar
+provider.activemq.dependency=geronimo/activemq-broker//car

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java?rev=396025&r1=396024&r2=396025&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java
Fri Apr 21 15:27:24 2006
@@ -48,6 +48,7 @@
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.console.MultiPageAbstractHandler;
 import org.apache.geronimo.console.MultiPageModel;
+import org.apache.geronimo.deployment.service.jsr88.EnvironmentData;
 import org.apache.geronimo.deployment.tools.loader.ConnectorDeployable;
 import org.apache.geronimo.connector.deployment.jsr88.Connector15DCBRoot;
 import org.apache.geronimo.connector.deployment.jsr88.ConnectorDCB;
@@ -59,6 +60,7 @@
 import org.apache.geronimo.connector.deployment.jsr88.AdminObjectDCB;
 import org.apache.geronimo.connector.deployment.jsr88.AdminObjectInstance;
 import org.apache.geronimo.naming.deployment.jsr88.GBeanLocator;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -483,12 +485,31 @@
                 final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
                 Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
                 ConnectorDCB connector = (ConnectorDCB) root.getDConfigBean(ddBeanRoot.getChildBean(root.getXpaths()[0])[0]);
-//TODO FIXME configid
-//                connector.setConfigID("console-jms-"+data.instanceName);
-//                if(!isEmpty(data.dependency)) {
-//                    connector.setParentID(data.dependency);
-//                }
 
+                EnvironmentData environment = new EnvironmentData();
+                connector.setEnvironment(environment);
+                org.apache.geronimo.deployment.service.jsr88.Artifact configId = new org.apache.geronimo.deployment.service.jsr88.Artifact();
+                environment.setConfigId(configId);
+                configId.setGroupId("console.jms");
+                configId.setArtifactId(data.instanceName);
+                configId.setVersion("1.0");
+                configId.setType("rar");
+                if(data.dependency != null && !data.dependency.trim().equals(""))
{
+                    Artifact artifact = Artifact.create(data.dependency.trim());
+                    org.apache.geronimo.deployment.service.jsr88.Artifact dep = new org.apache.geronimo.deployment.service.jsr88.Artifact();
+                    environment.setDependencies(new org.apache.geronimo.deployment.service.jsr88.Artifact[]{dep});
+                    dep.setArtifactId(artifact.getArtifactId());
+                    if(artifact.getGroupId() != null) {
+                        dep.setGroupId(artifact.getGroupId());
+                    }
+                    if(artifact.getGroupId() != null) {
+                        dep.setType(artifact.getType());
+                    }
+                    if(artifact.getVersion() != null) {
+                        dep.setVersion(artifact.getVersion().toString());
+                    }
+                }
+                
                 // Basic settings on RA plan and RA instance
                 ResourceAdapter ra;
                 if(connector.getResourceAdapter().length > 0) {

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/JMSProviderData.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/JMSProviderData.java?rev=396025&r1=396024&r2=396025&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/JMSProviderData.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/JMSProviderData.java
Fri Apr 21 15:27:24 2006
@@ -16,28 +16,31 @@
  */
 package org.apache.geronimo.console.jmsmanager.wizard;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+import javax.portlet.PortletRequest;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.console.util.PortletManager;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
 import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 import org.xml.sax.SAXException;
-
-import java.io.Serializable;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.*;
-import java.util.zip.ZipInputStream;
-import java.util.zip.ZipEntry;
-import java.net.URL;
-import javax.portlet.PortletRequest;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
 
 /**
  * Loads data on JMS providers known to the console.  Reads from a properties

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ListScreenHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ListScreenHandler.java?rev=396025&r1=396024&r2=396025&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ListScreenHandler.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ListScreenHandler.java
Fri Apr 21 15:27:24 2006
@@ -32,6 +32,7 @@
 import javax.management.MalformedObjectNameException;
 import java.io.IOException;
 import java.io.Serializable;
+import java.util.Collections;
 import java.util.List;
 import java.util.ArrayList;
 
@@ -156,6 +157,7 @@
             e.printStackTrace();
         }
 
+        Collections.sort(resources);
         renderRequest.setAttribute("resources", resources);
         // Get the list of JMS providers
         renderRequest.setAttribute("providers", JMSProviderData.getAllProviders());
@@ -223,7 +225,7 @@
 
         public int compareTo(Object o) {
             final JMSResourceSummary pool = (JMSResourceSummary)o;
-            int names = configurationName.compareTo(pool.configurationName);
+            int names = name.toLowerCase().compareTo(pool.name.toLowerCase());
             if(parentName == null) {
                 if(pool.parentName == null) {
                     return names;

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/SelectProviderHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/SelectProviderHandler.java?rev=396025&r1=396024&r2=396025&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/SelectProviderHandler.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/SelectProviderHandler.java
Fri Apr 21 15:27:24 2006
@@ -17,6 +17,7 @@
 package org.apache.geronimo.console.jmsmanager.wizard;
 
 import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.ListableRepository;
 
 import javax.portlet.ActionRequest;
@@ -72,9 +73,12 @@
             final SortedSet artifacts = repo.list();
             outer:
             for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) {
-                String test = iterator.next().toString();
+            	Artifact artifact = (Artifact)iterator.next();
+                String test = artifact.toString();
                 if (!test.endsWith("/rar")) { //todo: may need to change this logic if configId
format changes
                     continue;
+                } else if (repo.getLocation(artifact).isDirectory()) {
+                	continue;
                 }
                 for (int k = 0; k < SKIP_RARS_CONTAINING.length; k++) {
                     String skip = SKIP_RARS_CONTAINING[k];

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java?rev=396025&r1=396024&r2=396025&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
Fri Apr 21 15:27:24 2006
@@ -373,8 +373,17 @@
     }
 
     public static File getRepositoryEntry(PortletRequest request, String repositoryURI) {
-        Repository[] repos = getCurrentServer(request).getRepositories();
+        J2EEServer server = getCurrentServer(request);
+        Repository[] repos = server.getRepositories();
         Artifact uri = Artifact.create(repositoryURI);
+        if(!uri.isResolved()) {
+            Artifact[] all = server.getConfigurationManager().getArtifactResolver().queryArtifacts(uri);
+            if(all.length == 0) {
+                return null;
+            } else {
+                uri = all[all.length-1];
+            }
+        }
         for (int i = 0; i < repos.length; i++) {
             Repository repo = repos[i];
             if (repo.contains(uri)) {



Mime
View raw message