You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by vi...@apache.org on 2011/08/13 17:20:38 UTC

svn commit: r1157383 - in /geronimo/server/trunk/plugins/console/console-base-portlets: pom.xml src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java

Author: violalu
Date: Sat Aug 13 15:20:38 2011
New Revision: 1157383

URL: http://svn.apache.org/viewvc?rev=1157383&view=rev
Log:
GERONIMO-5582 add web url in eba porlet

Modified:
    geronimo/server/trunk/plugins/console/console-base-portlets/pom.xml
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/pom.xml?rev=1157383&r1=1157382&r2=1157383&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/pom.xml (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/pom.xml Sat Aug 13 15:20:38 2011
@@ -108,6 +108,13 @@
             <scope>provided</scope>
         </dependency>                
         
+        <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-aries</artifactId>  
+            <version>${project.version}</version>         
+            <scope>provided</scope>
+        </dependency>
+            
         <!-- FIXME : this should be replaced by org.apache.aries.util in next release -->
         <dependency>
             <groupId>org.apache.aries.application</groupId>

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java?rev=1157383&r1=1157382&r2=1157383&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java Sat Aug 13 15:20:38 2011
@@ -43,6 +43,7 @@ import org.apache.geronimo.gbean.Abstrac
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.DependencyManager;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.InternalKernelException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
@@ -60,6 +61,9 @@ import org.apache.geronimo.kernel.reposi
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
 import org.apache.geronimo.management.geronimo.WebModule;
 import org.apache.geronimo.web.info.WebAppInfo;
+import org.apache.geronimo.aries.ApplicationGBean;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -299,6 +303,31 @@ public class ConfigManagerPortlet extend
                                 }
                             }
                         }
+                    } else if (info.getType() == ConfigurationModuleType.EBA) {
+                        Configuration config = configManager.getConfiguration(info.getConfigID());
+                        if(config != null){
+                            for(Map.Entry<AbstractName, GBeanData> entry : config.getGBeans().entrySet()) {                               
+                                if(entry.getKey().getNameProperty(NameFactory.J2EE_TYPE).equals("GBean")) {
+                                    try {
+                                        ApplicationGBean applicationGBean = (ApplicationGBean)PortletManager.getKernel().getGBean(entry.getKey());
+                                        long[] bundleIds = applicationGBean.getApplicationContentBundleIds();
+                                        BundleContext bundleContext = config.getBundleContext();
+                                        for (long id : bundleIds){
+                                            Bundle bundle = bundleContext.getBundle(id);
+                                            if (bundle != null && bundle.getHeaders().get("Web-ContextPath") != null){
+                                                details.getContextPaths().add((String)bundle.getHeaders().get("Web-ContextPath"));                                                
+                                            }
+                                        }                                        
+                                    } catch (GBeanNotFoundException e) {                                        
+                                        logger.error("Configuration not found", e);
+                                    } catch (InternalKernelException e) {                                        
+                                        logger.error("Configuration not found", e);
+                                    } catch (IllegalStateException e) {                                        
+                                        logger.error("Configuration not found", e);
+                                    } 
+                                }
+                            }
+                        }
                     } else if (info.getType().equals(ConfigurationModuleType.CAR)) {
                         Configuration config = configManager.getConfiguration(info.getConfigID());
                         details.setClientAppServerSide(config.getOwnedConfigurations().size() > 0);
@@ -423,7 +452,8 @@ public class ConfigManagerPortlet extend
 
     private boolean showWebInfo() {
         return ConfigurationModuleType.WAR.getName().equalsIgnoreCase(moduleType) ||
-               ConfigurationModuleType.EAR.getName().equalsIgnoreCase(moduleType);
+               ConfigurationModuleType.EAR.getName().equalsIgnoreCase(moduleType) ||
+               ConfigurationModuleType.EBA.getName().equalsIgnoreCase(moduleType);
     }
 
     protected void doHelp(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException {