geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1071183 - in /geronimo/server/trunk: framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ plugins/console/console-...
Date Wed, 16 Feb 2011 09:29:50 GMT
Author: genspring
Date: Wed Feb 16 09:29:50 2011
New Revision: 1071183

URL: http://svn.apache.org/viewvc?rev=1071183&view=rev
Log:
GERONIMO-5769 Web Application Bundles (WABs) do not show up in admin console

Modified:
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationModuleType.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/portlet.xml
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/web.xml
    geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/KernelManagementHelper.java
    geronimo/server/trunk/plugins/console/console-tomcat/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/wab/geronimo-web-extender/src/main/java/org/apache/geronimo/osgi/web/extender/WebApplication.java

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationModuleType.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationModuleType.java?rev=1071183&r1=1071182&r2=1071183&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationModuleType.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationModuleType.java
Wed Feb 16 09:29:50 2011
@@ -46,8 +46,10 @@ public class ConfigurationModuleType imp
     public static final ConfigurationModuleType SPR = new ConfigurationModuleType("SPR",
6);
     
     public static final ConfigurationModuleType EBA = new ConfigurationModuleType("EBA",
7);
+    
+    public static final ConfigurationModuleType WAB = new ConfigurationModuleType("WAB",
8);
 
-    private static final ConfigurationModuleType[] fromInt = {EAR, EJB, CAR, RAR, WAR, SERVICE,
SPR,EBA};
+    private static final ConfigurationModuleType[] fromInt = {EAR, EJB, CAR, RAR, WAR, SERVICE,
SPR, EBA, WAB};
 
     private final String name;
 

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=1071183&r1=1071182&r2=1071183&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
Wed Feb 16 09:29:50 2011
@@ -210,6 +210,7 @@ public class ConfigManagerPortlet extend
         List<ModuleDetails> moduleDetails = new ArrayList<ModuleDetails>();
         ConfigurationManager configManager = PortletManager.getConfigurationManager();
         List<ConfigurationInfo> infos = configManager.listConfigurations();
+    
         for (ConfigurationInfo info : infos) {
             if (ConfigurationModuleType.WAR.getName().equalsIgnoreCase(moduleType)) {
 
@@ -306,8 +307,50 @@ public class ConfigManagerPortlet extend
                     ice.printStackTrace();
                 }
                 moduleDetails.add(details);
+            }  
+            
+        }            
+            
+            // hack to display WAB because WAB can't be get from configManager.listConfigurations();
+            
+        if (ConfigurationModuleType.WAB.getName().equalsIgnoreCase(moduleType)) {
+            
+            Artifact wabQuery = Artifact.createPartial("///" + ConfigurationModuleType.WAB.getName().toLowerCase());
+
+            Artifact[] runningWABs = configManager.getRunning(wabQuery);
+
+            if (runningWABs != null && runningWABs.length > 0) {
+
+                for (Artifact wab : runningWABs) {
+                    ModuleDetails details = new ModuleDetails(wab, ConfigurationModuleType.WAB,
State.RUNNING);
+                    try {
+                        AbstractName configObjName = Configuration.getConfigurationAbstractName(wab);
+                        boolean loaded = loadModule(configManager, configObjName);
+
+                        WebModule webModule = (WebModule) PortletManager.getModule(renderRequest,
wab);
+
+                        if (webModule != null) {
+                            details.getContextPaths().add(webModule.getContextPath());
+                            details.setDisplayName(webModule.getDisplayName());
+                        }
+
+                        if (showDependencies) {
+                            addDependencies(details, configObjName);
+                        }
+                        if (loaded) {
+                            unloadModule(configManager, configObjName);
+                        }
+                    } catch (InvalidConfigException ice) {
+                        // Should not occur
+                        ice.printStackTrace();
+                    }
+                    moduleDetails.add(details);
+                }
+
             }
         }
+
+        
         Collections.sort(moduleDetails);
         renderRequest.setAttribute("configurations", moduleDetails);
         renderRequest.setAttribute("showWebInfo", Boolean.valueOf(showWebInfo()));
@@ -414,6 +457,7 @@ public class ConfigManagerPortlet extend
 
     private boolean showWebInfo() {
         return ConfigurationModuleType.WAR.getName().equalsIgnoreCase(moduleType) ||
+               ConfigurationModuleType.WAB.getName().equalsIgnoreCase(moduleType) ||
                ConfigurationModuleType.EAR.getName().equalsIgnoreCase(moduleType);
     }
 

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/portlet.xml?rev=1071183&r1=1071182&r2=1071183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/portlet.xml
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/portlet.xml
Wed Feb 16 09:29:50 2011
@@ -400,6 +400,30 @@ limitations under the License.
         </init-param>
     </portlet>
     <portlet>
+        <description>Portlet for displaying WAB modules</description>
+        <portlet-name>WABModules</portlet-name>
+        <display-name>WAB Modules Portlet</display-name>
+        <portlet-class>org.apache.geronimo.console.configmanager.ConfigManagerPortlet</portlet-class>
+        <expiration-cache>-1</expiration-cache>
+        <supports>
+            <mime-type>text/html</mime-type>
+            <portlet-mode>VIEW</portlet-mode>
+        </supports>
+        <supported-locale>en</supported-locale>
+        <supported-locale>zh</supported-locale>
+        <supported-locale>ja</supported-locale>
+        <resource-bundle>portletinfo</resource-bundle>
+        <portlet-info>
+            <title>Installed WAB Applications</title>
+            <short-title>WAB Modules</short-title>
+            <keywords>WAB Application WAB Module</keywords>
+        </portlet-info>
+        <init-param>
+            <name>config-type</name>
+            <value>WAB</value>
+        </init-param>
+    </portlet>    
+    <portlet>
         <description>Portlet for displaying System modules</description>
         <portlet-name>SystemModules</portlet-name>
         <display-name>System Modules Portlet</display-name>

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/web.xml?rev=1071183&r1=1071182&r2=1071183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/web.xml
Wed Feb 16 09:29:50 2011
@@ -189,6 +189,15 @@ limitations under the License.
         </init-param>
         <load-on-startup>1</load-on-startup>
     </servlet>
+     <servlet>
+        <servlet-name>WABModules</servlet-name>
+        <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
+        <init-param>
+            <param-name>portlet-name</param-name>
+            <param-value>WABModules</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>    
     <servlet>
         <servlet-name>SystemModules</servlet-name>
         <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
@@ -343,6 +352,10 @@ limitations under the License.
         <servlet-name>EBAModules</servlet-name>
         <url-pattern>/PlutoInvoker/EBAModules</url-pattern>
     </servlet-mapping>
+     <servlet-mapping>
+        <servlet-name>WABModules</servlet-name>
+        <url-pattern>/PlutoInvoker/WABModules</url-pattern>
+    </servlet-mapping>    
     <servlet-mapping>
         <servlet-name>SystemModules</servlet-name>
         <url-pattern>/PlutoInvoker/SystemModules</url-pattern>

Modified: geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/KernelManagementHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/KernelManagementHelper.java?rev=1071183&r1=1071182&r2=1071183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/KernelManagementHelper.java
(original)
+++ geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/KernelManagementHelper.java
Wed Feb 16 09:29:50 2011
@@ -505,7 +505,7 @@ public class KernelManagementHelper impl
                 result = config.findGBean(new AbstractNameQuery(EJBModule.class.getName()));
             } else if (type.equals(ConfigurationModuleType.RAR)) {
                 result = config.findGBean(new AbstractNameQuery(ResourceAdapterModule.class.getName()));
-            } else if (type.equals(ConfigurationModuleType.WAR)) {
+            } else if (type.equals(ConfigurationModuleType.WAR)||type.equals(ConfigurationModuleType.WAB))
{
                 result = config.findGBean(new AbstractNameQuery(WebModule.class.getName()));
             } else {
                 return null;

Modified: geronimo/server/trunk/plugins/console/console-tomcat/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-tomcat/src/main/plan/plan.xml?rev=1071183&r1=1071182&r2=1071183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-tomcat/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/console/console-tomcat/src/main/plan/plan.xml Wed Feb 16
09:29:50 2011
@@ -209,7 +209,7 @@
                     <name>PlutoPortalServices</name>
                 </reference>
             </gbean>
-             <gbean name="EBAModules" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
+            <gbean name="EBAModules" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
                 <attribute name="pageTitle">2-2-5/Applications/User Assets/Application
EBAs</attribute>
                 <attribute name="portletContext">/console-base</attribute>
                 <attribute name="portletList">[EBAModules]</attribute>
@@ -218,6 +218,16 @@
                 <reference name="PortalContainerServices">
                     <name>PlutoPortalServices</name>
                 </reference>
+            </gbean>            
+             <gbean name="WABModules" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
+                <attribute name="pageTitle">2-2-6/Applications/User Assets/Application
WABs</attribute>
+                <attribute name="portletContext">/console-base</attribute>
+                <attribute name="portletList">[WABModules]</attribute>
+                <attribute name="icon">/images/ico_jar_16x16.gif</attribute>
+                <attribute name="mode">basic</attribute>
+                <reference name="PortalContainerServices">
+                    <name>PlutoPortalServices</name>
+                </reference>
             </gbean>
             <gbean name="UsersGroups" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
                 <attribute name="pageTitle">4-1/Security/Users and Groups</attribute>

Modified: geronimo/server/trunk/plugins/wab/geronimo-web-extender/src/main/java/org/apache/geronimo/osgi/web/extender/WebApplication.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/wab/geronimo-web-extender/src/main/java/org/apache/geronimo/osgi/web/extender/WebApplication.java?rev=1071183&r1=1071182&r2=1071183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/wab/geronimo-web-extender/src/main/java/org/apache/geronimo/osgi/web/extender/WebApplication.java
(original)
+++ geronimo/server/trunk/plugins/wab/geronimo-web-extender/src/main/java/org/apache/geronimo/osgi/web/extender/WebApplication.java
Wed Feb 16 09:29:50 2011
@@ -39,6 +39,7 @@ import org.apache.geronimo.kernel.Kernel
 import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.config.LifecycleException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
@@ -184,7 +185,7 @@ public class WebApplication implements R
                 BundleDeploymentContext deploymentContext =
                     new BundleDeploymentContext(
                         webModule.getEnvironment(),
-                        webModule.getType(),
+                        ConfigurationModuleType.WAB,
                         naming,
                         configurationManager,
                         bundle.getBundleContext(),



Mime
View raw message