You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by am...@apache.org on 2005/08/07 00:37:33 UTC

svn commit: r230608 - in /geronimo/trunk/applications/console-standard/src: java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java webapp/WEB-INF/portlet.xml webapp/WEB-INF/web.xml

Author: ammulder
Date: Sat Aug  6 15:37:29 2005
New Revision: 230608

URL: http://svn.apache.org/viewcvs?rev=230608&view=rev
Log:
Basic implementation for the Applications/[Module Type] portlets
  GERONIMO-794 (thanks to Joe Bohn)

Modified:
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/portlet.xml
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java?rev=230608&r1=230607&r2=230608&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java Sat Aug  6 15:37:29 2005
@@ -66,6 +66,8 @@
 
     private static final String QUEUETOPIC_URI = "runtimedestination/";
 
+    private static final String CONFIG_INIT_PARAM = "config-type";
+    
     private static final ObjectName deployer = JMXUtil
             .getObjectName(ObjectNameConstants.DEPLOYER_OBJECT_NAME);
 
@@ -134,7 +136,7 @@
             throw new PortletException("Exception", e);
         }
     }
-
+	
     /**
      * Uninstall an application configuration
      *
@@ -175,6 +177,15 @@
             }
         }
     }
+    /**
+     * Check if a configuration should be listed here. This method depends on the "config-type" portlet parameter 
+     * which is set in portle.xml.
+     */
+    private boolean shouldListConfig(ConfigurationInfo info){
+	    String configType = getInitParameter(CONFIG_INIT_PARAM);
+	    if(configType!=null && !info.getType().getName().equalsIgnoreCase(configType)) return false;
+	    else return true;
+    }
 
     /*
      * private URI getConfigID(ActionRequest actionRequest) throws
@@ -205,7 +216,7 @@
                 List infos = configManager.listConfigurations(storeName);
                 for (Iterator j = infos.iterator(); j.hasNext();) {
                     ConfigurationInfo info = (ConfigurationInfo) j.next();
-                    if (!EXCLUDED.contains(info.getConfigID())) {
+                    if (shouldListConfig(info)) {
                         // TODO: Check if this is the right solution
                         // Disregard JMS Queues and Topics &&
                         if (!info.getConfigID().getPath().startsWith(
@@ -225,7 +236,7 @@
             }
         }
         renderRequest.setAttribute("configurations", configInfo);
-        messageInstalled = configInfo.size() == 0 ? "No Installed Applications<br /><br />"
+        messageInstalled = configInfo.size() == 0 ? "No modules found of this type<br /><br />"
                 : "";
         renderRequest.setAttribute("messageInstalled", messageInstalled);
         renderRequest.setAttribute("messageStatus", messageStatus);

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/portlet.xml?rev=230608&r1=230607&r2=230608&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/portlet.xml (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/portlet.xml Sat Aug  6 15:37:29 2005
@@ -561,7 +561,7 @@
         <portlet-name>EARModules</portlet-name>
         <display-name>EAR Modules Portlet</display-name>
 
-        <portlet-class>org.apache.geronimo.console.EmptyPortlet</portlet-class>
+        <portlet-class>org.apache.geronimo.console.configmanager.ConfigManagerPortlet</portlet-class>
 
         <expiration-cache>-1</expiration-cache>
 
@@ -578,6 +578,12 @@
             <short-title>EAR Modules</short-title>
             <keywords>Application EAR Module</keywords>
         </portlet-info>
+        
+        <init-param>
+            <name>config-type</name>
+            <value>EAR</value>
+        </init-param>
+        
     </portlet>
 
     <portlet>
@@ -585,7 +591,7 @@
         <portlet-name>WARModules</portlet-name>
         <display-name>WAR Modules Portlet</display-name>
 
-        <portlet-class>org.apache.geronimo.console.EmptyPortlet</portlet-class>
+        <portlet-class>org.apache.geronimo.console.configmanager.ConfigManagerPortlet</portlet-class>
 
         <expiration-cache>-1</expiration-cache>
 
@@ -602,6 +608,11 @@
             <short-title>WAR Modules</short-title>
             <keywords>Web Application WAR Module</keywords>
         </portlet-info>
+        
+        <init-param>
+            <name>config-type</name>
+            <value>WAR</value>
+        </init-param>
     </portlet>
 
     <portlet>
@@ -609,7 +620,7 @@
         <portlet-name>EJBModules</portlet-name>
         <display-name>EJB Modules Portlet</display-name>
 
-        <portlet-class>org.apache.geronimo.console.EmptyPortlet</portlet-class>
+        <portlet-class>org.apache.geronimo.console.configmanager.ConfigManagerPortlet</portlet-class>
 
         <expiration-cache>-1</expiration-cache>
 
@@ -626,6 +637,11 @@
             <short-title>EJB Modules</short-title>
             <keywords>EJB JAR Module</keywords>
         </portlet-info>
+        
+        <init-param>
+            <name>config-type</name>
+            <value>EJB</value>
+        </init-param>
     </portlet>
 
     <portlet>
@@ -633,7 +649,7 @@
         <portlet-name>RARModules</portlet-name>
         <display-name>RAR Modules Portlet</display-name>
 
-        <portlet-class>org.apache.geronimo.console.EmptyPortlet</portlet-class>
+        <portlet-class>org.apache.geronimo.console.configmanager.ConfigManagerPortlet</portlet-class>
 
         <expiration-cache>-1</expiration-cache>
 
@@ -650,6 +666,11 @@
             <short-title>RAR Modules</short-title>
             <keywords>J2EE Connector RAR Module</keywords>
         </portlet-info>
+        
+        <init-param>
+            <name>config-type</name>
+            <value>RAR</value>
+        </init-param>
     </portlet>
 
     <portlet>
@@ -657,7 +678,7 @@
         <portlet-name>ClientModules</portlet-name>
         <display-name>Client Modules Portlet</display-name>
 
-        <portlet-class>org.apache.geronimo.console.EmptyPortlet</portlet-class>
+        <portlet-class>org.apache.geronimo.console.configmanager.ConfigManagerPortlet</portlet-class>
 
         <expiration-cache>-1</expiration-cache>
 
@@ -674,6 +695,11 @@
             <short-title>Client Modules</short-title>
             <keywords>Application Client JAR Module</keywords>
         </portlet-info>
+        
+        <init-param>
+            <name>config-type</name>
+            <value>CAR</value>
+        </init-param>        
     </portlet>
 
     <portlet>
@@ -681,7 +707,7 @@
         <portlet-name>SystemModules</portlet-name>
         <display-name>System Modules Portlet</display-name>
 
-        <portlet-class>org.apache.geronimo.console.EmptyPortlet</portlet-class>
+        <portlet-class>org.apache.geronimo.console.configmanager.ConfigManagerPortlet</portlet-class>
 
         <expiration-cache>-1</expiration-cache>
 
@@ -698,6 +724,11 @@
             <short-title>System Modules</short-title>
             <keywords>System Module</keywords>
         </portlet-info>
+
+        <init-param>
+            <name>config-type</name>
+            <value>SERVICE</value>
+        </init-param>
     </portlet>
 
 <!-- Security Tab -->

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml?rev=230608&r1=230607&r2=230608&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml Sat Aug  6 15:37:29 2005
@@ -93,7 +93,7 @@
         <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
         <init-param>
             <param-name>portlet-class</param-name>
-            <param-value>org.apache.geronimo.console.EmptyPortlet</param-value>
+            <param-value>org.apache.geronimo.console.configmanager.ConfigManagerPortlet</param-value>
         </init-param>
         <init-param>
             <param-name>portlet-guid</param-name>
@@ -106,7 +106,7 @@
         <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
         <init-param>
             <param-name>portlet-class</param-name>
-            <param-value>org.apache.geronimo.console.EmptyPortlet</param-value>
+            <param-value>org.apache.geronimo.console.configmanager.ConfigManagerPortlet</param-value>
         </init-param>
         <init-param>
             <param-name>portlet-guid</param-name>
@@ -119,7 +119,7 @@
         <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
         <init-param>
             <param-name>portlet-class</param-name>
-            <param-value>org.apache.geronimo.console.EmptyPortlet</param-value>
+            <param-value>org.apache.geronimo.console.configmanager.ConfigManagerPortlet</param-value>
         </init-param>
         <init-param>
             <param-name>portlet-guid</param-name>
@@ -132,7 +132,7 @@
         <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
         <init-param>
             <param-name>portlet-class</param-name>
-            <param-value>org.apache.geronimo.console.EmptyPortlet</param-value>
+            <param-value>org.apache.geronimo.console.configmanager.ConfigManagerPortlet</param-value>
         </init-param>
         <init-param>
             <param-name>portlet-guid</param-name>
@@ -145,7 +145,7 @@
         <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
         <init-param>
             <param-name>portlet-class</param-name>
-            <param-value>org.apache.geronimo.console.EmptyPortlet</param-value>
+            <param-value>org.apache.geronimo.console.configmanager.ConfigManagerPortlet</param-value>
         </init-param>
         <init-param>
             <param-name>portlet-guid</param-name>
@@ -158,7 +158,7 @@
         <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
         <init-param>
             <param-name>portlet-class</param-name>
-            <param-value>org.apache.geronimo.console.EmptyPortlet</param-value>
+            <param-value>org.apache.geronimo.console.configmanager.ConfigManagerPortlet</param-value>
         </init-param>
         <init-param>
             <param-name>portlet-guid</param-name>