geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r393962 - in /geronimo/branches/1.1: applications/console-core/src/java/org/apache/geronimo/console/util/ applications/console-standard/src/java/org/apache/geronimo/console/ applications/console-standard/src/java/org/apache/geronimo/console...
Date Thu, 13 Apr 2006 22:19:12 GMT
Author: ammulder
Date: Thu Apr 13 15:19:09 2006
New Revision: 393962

URL: http://svn.apache.org/viewcvs?rev=393962&view=rev
Log:
Now, finally, Apache HTTP portlet works.

Modified:
    geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ConfigurationData.java
    geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
    geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/MultiPageModel.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/MultiPagePortlet.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/BaseApacheHandler.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/ConfigHandler.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/WebAppHandler.java
    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/keystores/BaseKeystoreHandler.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/threads/AbstractThreadHandler.java
    geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/index.jsp
    geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/results.jsp
    geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/webApps.jsp
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java

Modified: geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ConfigurationData.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ConfigurationData.java?rev=393962&r1=393961&r2=393962&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ConfigurationData.java
(original)
+++ geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ConfigurationData.java
Thu Apr 13 15:19:09 2006
@@ -18,6 +18,7 @@
 import java.io.Serializable;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.gbean.AbstractName;
 
 /**
@@ -26,13 +27,15 @@
  * @version $Rev: 355877 $ $Date: 2005-12-10 21:48:27 -0500 (Sat, 10 Dec 2005) $
  */
 public class ConfigurationData implements Serializable, Comparable {
+    private final Artifact configID;
     private final State state;
     private final AbstractName parentName;
     private final String childName;
     private final ConfigurationModuleType type;
     private final AbstractName moduleBeanName;
 
-    public ConfigurationData(AbstractName parentName, String childName, State state, ConfigurationModuleType
type, AbstractName moduleBeanName) {
+    public ConfigurationData(Artifact configID, AbstractName parentName, String childName,
State state, ConfigurationModuleType type, AbstractName moduleBeanName) {
+        this.configID = configID;
         this.childName = childName;
         this.parentName = parentName;
         this.state = state;
@@ -62,6 +65,14 @@
 
     public ConfigurationModuleType getType() {
         return type;
+    }
+
+    public Artifact getConfigID() {
+        return configID;
+    }
+
+    public boolean isRunning() {
+        return state.toInt() == State.RUNNING_INDEX;
     }
 
     public int compareTo(Object o) {

Modified: geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java?rev=393962&r1=393961&r2=393962&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
(original)
+++ geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
Thu Apr 13 15:19:09 2006
@@ -48,6 +48,7 @@
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.config.NoSuchStoreException;
 import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.proxy.ProxyManager;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.management.AppClientModule;
@@ -767,10 +768,9 @@
                 List infos = mgr.listConfigurations(storeName);
                 for (Iterator j = infos.iterator(); j.hasNext();) {
                     ConfigurationInfo info = (ConfigurationInfo) j.next();
-                    AbstractName configuration = mgr.getConfiguration(info.getConfigID()).getAbstractName();
+                    AbstractName configuration = Configuration.getConfigurationAbstractName(info.getConfigID());
                     if(type == null || type.getValue() == info.getType().getValue()) {
-
-                        results.add(new ConfigurationData(configuration, null, info.getState(),
info.getType(), kernel.getAbstractNameFor(info.getConfigID())));
+                        results.add(new ConfigurationData(info.getConfigID(), configuration,
null, info.getState(), info.getType(), kernel.getAbstractNameFor(getModuleForConfiguration(info.getConfigID()))));
                     }
                     if(includeChildModules && info.getType().getValue() == ConfigurationModuleType.EAR.getValue())
{
                         J2EEApplication app = (J2EEApplication) getModuleForConfiguration(info.getConfigID());
@@ -803,22 +803,33 @@
                                 //todo: solutions for other module types
                                 moduleName = (String) kernel.getAbstractNameFor(module).getName().get(NameFactory.J2EE_NAME);
                             }
-                            results.add(new ConfigurationData(configuration, moduleName,
info.getState(), moduleType, kernel.getAbstractNameFor(module)));
+                            results.add(new ConfigurationData(info.getConfigID(), configuration,
moduleName, info.getState(), moduleType, kernel.getAbstractNameFor(module)));
                         }
                     }
                 }
             } catch (NoSuchStoreException e) {
                 // we just got this list so this should not happen
                 // in the unlikely event it does, just continue
+            } catch (InvalidConfigException e) {
+                throw new RuntimeException("Bad configID; should never happen");
             }
         }
         Collections.sort(results);
         return (ConfigurationData[]) results.toArray(new ConfigurationData[results.size()]);
     }
 
+    /**
+     * Gets a JSR-77 Module (WebModule, EJBModule, etc.) for the specified configuration.
+     * Note: this only works if the configuration is running at the time you ask.
+     *
+     * @return The Module, or null if the configuration is not running.
+     */
     public J2EEDeployedObject getModuleForConfiguration(Artifact configuration) {
         ConfigurationManager manager = ConfigurationUtil.getConfigurationManager(kernel);
         Configuration config = manager.getConfiguration(configuration);
+        if(config == null) {
+            return null; // The configuration is not running, so we can't get its contents
+        }
         ConfigurationModuleType type = config.getModuleType();
         AbstractName result;
         try {

Modified: geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java?rev=393962&r1=393961&r2=393962&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java
(original)
+++ geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java
Thu Apr 13 15:19:09 2006
@@ -116,5 +116,11 @@
     Object[] findByInterface(Class iface);
     AbstractName getNameFor(Object component);
     ConfigurationData[] getConfigurations(ConfigurationModuleType type, boolean includeChildModules);
+    /**
+     * Gets a JSR-77 Module (WebModule, EJBModule, etc.) for the specified configuration.
+     * Note: this only works if the configuration is running at the time you ask.
+     *
+     * @return The Module, or null if the configuration is not running.
+     */
     J2EEDeployedObject getModuleForConfiguration(Artifact configuration);
 }

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/MultiPageModel.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/MultiPageModel.java?rev=393962&r1=393961&r2=393962&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/MultiPageModel.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/MultiPageModel.java
Thu Apr 13 15:19:09 2006
@@ -17,6 +17,7 @@
 package org.apache.geronimo.console;
 
 import javax.portlet.ActionResponse;
+import javax.portlet.PortletSession;
 
 /**
  * Interface for models for multi-page portlets.
@@ -24,5 +25,5 @@
  * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
  */
 public interface MultiPageModel {
-    public void save(ActionResponse response);
+    public void save(ActionResponse response, PortletSession session);
 }

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/MultiPagePortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/MultiPagePortlet.java?rev=393962&r1=393961&r2=393962&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/MultiPagePortlet.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/MultiPagePortlet.java
Thu Apr 13 15:19:09 2006
@@ -123,7 +123,7 @@
         if(mode != null) {
             actionResponse.setRenderParameter(MODE_KEY, mode);
         }
-        model.save(actionResponse);
+        model.save(actionResponse, actionRequest.getPortletSession(true));
     }
 
     protected void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws
IOException, PortletException {

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/BaseApacheHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/BaseApacheHandler.java?rev=393962&r1=393961&r2=393962&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/BaseApacheHandler.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/BaseApacheHandler.java
Thu Apr 13 15:19:09 2006
@@ -22,9 +22,12 @@
 import java.util.Map;
 import javax.portlet.ActionResponse;
 import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
 import org.apache.geronimo.console.MultiPageAbstractHandler;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.gbean.AbstractName;
 
 /**
  * The base class for all handlers for this portlet
@@ -52,12 +55,12 @@
         private String contextRoot;
         private String webAppDir;
 
-        public WebAppData(String parentConfigId, String childName, String moduleBeanName,
boolean enabled, String dynamicPattern, boolean serveStaticContent) {
-            this.parentConfigId = parentConfigId;
+        public WebAppData(Artifact parentConfigId, String childName, AbstractName moduleBeanName,
boolean enabled, String dynamicPattern, boolean serveStaticContent) {
+            this.parentConfigId = parentConfigId.toString();
             this.enabled = enabled;
             this.dynamicPattern = dynamicPattern;
             this.serveStaticContent = serveStaticContent;
-            this.moduleBeanName = moduleBeanName;
+            this.moduleBeanName = moduleBeanName == null ? null : moduleBeanName.toString();
             this.childName = childName;
         }
 
@@ -80,9 +83,9 @@
             response.setRenderParameter(prefix+"dynamicPattern", dynamicPattern);
             response.setRenderParameter(prefix+"enabled", Boolean.toString(enabled));
             response.setRenderParameter(prefix+"serveStaticContent", Boolean.toString(serveStaticContent));
-            if(contextRoot != null) response.setRenderParameter(prefix+"contextRoot", contextRoot);
-            if(webAppDir != null) response.setRenderParameter(prefix+"webAppDir", webAppDir);
-            if(childName != null) response.setRenderParameter(prefix+"childName", childName);
+            if(!isEmpty(contextRoot)) response.setRenderParameter(prefix+"contextRoot", contextRoot);
+            if(!isEmpty(webAppDir)) response.setRenderParameter(prefix+"webAppDir", webAppDir);
+            if(!isEmpty(childName)) response.setRenderParameter(prefix+"childName", childName);
         }
 
         public boolean isEnabled() {
@@ -142,11 +145,16 @@
         }
 
         public String getName() {
-            return childName == null ? parentConfigId : childName;
+            return isEmpty(childName) ? parentConfigId : childName;
+        }
+
+        public boolean isRunning() {
+            return webAppDir != null;
         }
     }
 
     public final static class ApacheModel implements MultiPageModel {
+        public final static String WEB_APP_SESSION_KEY = "console.apache.jk.WebApps";
         private String os;
         private Integer addAjpPort;
         private String logFilePath;
@@ -167,25 +175,31 @@
             String ajp = request.getParameter("addAjpPort");
             if(!isEmpty(ajp)) addAjpPort = new Integer(ajp);
             int index = 0;
+            boolean found = false;
             while(true) {
                 String key = "webapp."+(index++)+".";
                 if(!map.containsKey(key+"configId")) {
                     break;
                 }
+                found = true;
                 WebAppData data = new WebAppData(request, key);
                 webApps.add(data);
             }
+            if(!found) {
+                List list = (List) request.getPortletSession(true).getAttribute(WEB_APP_SESSION_KEY);
+                if(list != null) {
+                    webApps = list;
+                }
+            }
         }
 
-        public void save(ActionResponse response) {
+        public void save(ActionResponse response, PortletSession session) {
             if(!isEmpty(os)) response.setRenderParameter("os", os);
             if(!isEmpty(logFilePath)) response.setRenderParameter("logFilePath", logFilePath);
             if(!isEmpty(workersPath)) response.setRenderParameter("workersPath", workersPath);
             if(addAjpPort != null) response.setRenderParameter("addAjpPort", addAjpPort.toString());
-            for (int i = 0; i < webApps.size(); i++) {
-                WebAppData data = (WebAppData) webApps.get(i);
-                String key = "webapp."+i+".";
-                data.save(response, key);
+            if(webApps.size() > 0) {
+                session.setAttribute(WEB_APP_SESSION_KEY, webApps);
             }
         }
 

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/ConfigHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/ConfigHandler.java?rev=393962&r1=393961&r2=393962&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/ConfigHandler.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/ConfigHandler.java
Thu Apr 13 15:19:09 2006
@@ -35,7 +35,8 @@
         super(BASIC_CONFIG_MODE, "/WEB-INF/view/apache/jk/config.jsp");
     }
 
-    public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel
model) throws PortletException, IOException {
+    public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel
mpm) throws PortletException, IOException {
+        request.getPortletSession(true).removeAttribute(ApacheModel.WEB_APP_SESSION_KEY);
         return getMode();
     }
 

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/WebAppHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/WebAppHandler.java?rev=393962&r1=393961&r2=393962&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/WebAppHandler.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/apache/jk/WebAppHandler.java
Thu Apr 13 15:19:09 2006
@@ -54,21 +54,19 @@
             List list = model.getWebApps();
             for (int i = 0; i < webApps.length; i++) {
                 ConfigurationData app = webApps[i];
-log.error("*********** "+app.getType()+": "+app.getParentName()+" / "+app.getChildName());
-                if(!app.getState().isRunning()) {
-                    continue;
-                }
-                WebModule web = (WebModule) PortletManager.getManagedBean(request, app.getModuleBeanName());
-                WebAppData data = new WebAppData(app.getParentName().toString(), app.getChildName(),
app.getModuleBeanName().toString(), false, null, false);
-                data.setContextRoot(web.getContextPath());
-                String path;
-                if(web.getWARDirectory().getProtocol().equals("file")) {
-                    path = web.getWARDirectory().getPath();
-                } else {
-                    path = "WARMustBeUnpacked";
-                }
+                WebAppData data = new WebAppData(app.getParentName().getArtifact(), app.getChildName(),
app.getModuleBeanName() == null ? null : app.getModuleBeanName(), false, null, false);
+                if (app.isRunning()) {
+                    WebModule web = (WebModule) PortletManager.getManagedBean(request, app.getModuleBeanName());
+                    data.setContextRoot(web.getContextPath());
+                    String path;
+                    if(web.getWARDirectory().getProtocol().equals("file")) {
+                        path = web.getWARDirectory().getPath();
+                    } else {
+                        path = "WARMustBeUnpacked";
+                    }
 
-                data.setWebAppDir(path);
+                    data.setWebAppDir(path);
+                }
                 list.add(data);
             }
         }

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=393962&r1=393961&r2=393962&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
Thu Apr 13 15:19:09 2006
@@ -31,6 +31,7 @@
 import javax.portlet.PortletRequestDispatcher;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
 import java.io.BufferedOutputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
@@ -165,7 +166,7 @@
             }
         }
 
-        public void save(ActionResponse response) {
+        public void save(ActionResponse response, PortletSession session) {
             if(!isEmpty(rarURI)) response.setRenderParameter(RAR_FILE_PARAMETER, rarURI);
             if(!isEmpty(dependency)) response.setRenderParameter(DEPENDENCY_PARAMETER, dependency);
             if(!isEmpty(instanceName)) response.setRenderParameter(INSTANCE_NAME_PARAMETER,
instanceName);

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/keystores/BaseKeystoreHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/keystores/BaseKeystoreHandler.java?rev=393962&r1=393961&r2=393962&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/keystores/BaseKeystoreHandler.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/keystores/BaseKeystoreHandler.java
Thu Apr 13 15:19:09 2006
@@ -28,6 +28,7 @@
 import java.util.Map;
 import javax.portlet.ActionResponse;
 import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.console.MultiPageAbstractHandler;
@@ -63,7 +64,7 @@
         public KeystoreModel(PortletRequest request) {
         }
 
-        public void save(ActionResponse response) {
+        public void save(ActionResponse response, PortletSession session) {
         }
     }
 
@@ -168,172 +169,4 @@
             return result;
         }
     }
-
-//    public final static class WebAppData implements Serializable {
-//        private String configId;
-//        private boolean enabled;
-//        private String dynamicPattern;
-//        private boolean serveStaticContent;
-//        private String contextRoot;
-//        private String webAppDir;
-//
-//        public WebAppData(String configId, boolean enabled, String dynamicPattern, boolean
serveStaticContent) {
-//            this.configId = configId;
-//            this.enabled = enabled;
-//            this.dynamicPattern = dynamicPattern;
-//            this.serveStaticContent = serveStaticContent;
-//        }
-//
-//        public WebAppData(PortletRequest request, String prefix) {
-//            configId = request.getParameter(prefix+"configId");
-//            dynamicPattern = request.getParameter(prefix+"dynamicPattern");
-//            String test = request.getParameter(prefix+"enabled");
-//            enabled = test != null && !test.equals("") && !test.equals("false");
-//            test = request.getParameter(prefix+"serveStaticContent");
-//            serveStaticContent = test != null && !test.equals("") && !test.equals("false");
-//            contextRoot = request.getParameter(prefix+"contextRoot");
-//            webAppDir = request.getParameter(prefix+"webAppDir");
-//        }
-//
-//        public void save(ActionResponse response, String prefix) {
-//            response.setRenderParameter(prefix+"configId", configId);
-//            response.setRenderParameter(prefix+"dynamicPattern", dynamicPattern);
-//            response.setRenderParameter(prefix+"enabled", Boolean.toString(enabled));
-//            response.setRenderParameter(prefix+"serveStaticContent", Boolean.toString(serveStaticContent));
-//            if(contextRoot != null) response.setRenderParameter(prefix+"contextRoot", contextRoot);
-//            if(webAppDir != null) response.setRenderParameter(prefix+"webAppDir", webAppDir);
-//        }
-//
-//        public boolean isEnabled() {
-//            return enabled;
-//        }
-//
-//        public void setEnabled(boolean enabled) {
-//            this.enabled = enabled;
-//        }
-//
-//        public String getConfigId() {
-//            return configId;
-//        }
-//
-//        public void setConfigId(String configId) {
-//            this.configId = configId;
-//        }
-//
-//        public String getDynamicPattern() {
-//            return dynamicPattern;
-//        }
-//
-//        public void setDynamicPattern(String dynamicPattern) {
-//            this.dynamicPattern = dynamicPattern;
-//        }
-//
-//        public boolean isServeStaticContent() {
-//            return serveStaticContent;
-//        }
-//
-//        public void setServeStaticContent(boolean serveStaticContent) {
-//            this.serveStaticContent = serveStaticContent;
-//        }
-//
-//        public String getContextRoot() {
-//            return contextRoot;
-//        }
-//
-//        public void setContextRoot(String contextRoot) {
-//            this.contextRoot = contextRoot;
-//        }
-//
-//        public String getWebAppDir() {
-//            return webAppDir;
-//        }
-//
-//        public void setWebAppDir(String webAppDir) {
-//            this.webAppDir = webAppDir;
-//        }
-//    }
-//
-//    public final static class ApacheModel implements MultiPageModel {
-//        private String os;
-//        private Integer addAjpPort;
-//        private String logFilePath;
-//        private String workersPath;
-//        private List webApps = new ArrayList();
-//
-//        public ApacheModel(PortletRequest request) {
-//            Map map = request.getParameterMap();
-//            os = request.getParameter("os");
-//            logFilePath = request.getParameter("logFilePath");
-//            if(logFilePath == null) {
-//                logFilePath = PortletManager.getServerInfo(request).resolve("var/log/apache_mod_jk.log").getPath();
-//            }
-//            workersPath = request.getParameter("workersPath");
-//            if(workersPath == null) {
-//                workersPath = PortletManager.getServerInfo(request).resolve("var/config/workers.properties").getPath();
-//            }
-//            String ajp = request.getParameter("addAjpPort");
-//            if(!isEmpty(ajp)) addAjpPort = new Integer(ajp);
-//            int index = 0;
-//            while(true) {
-//                String key = "webapp."+(index++)+".";
-//                if(!map.containsKey(key+"configId")) {
-//                    break;
-//                }
-//                BaseKeystoreHandler.WebAppData data = new BaseKeystoreHandler.WebAppData(request,
key);
-//                webApps.add(data);
-//            }
-//        }
-//
-//        public void save(ActionResponse response) {
-//            if(!isEmpty(os)) response.setRenderParameter("os", os);
-//            if(!isEmpty(logFilePath)) response.setRenderParameter("logFilePath", logFilePath);
-//            if(!isEmpty(workersPath)) response.setRenderParameter("workersPath", workersPath);
-//            if(addAjpPort != null) response.setRenderParameter("addAjpPort", addAjpPort.toString());
-//            for (int i = 0; i < webApps.size(); i++) {
-//                BaseKeystoreHandler.WebAppData data = (BaseKeystoreHandler.WebAppData)
webApps.get(i);
-//                String key = "webapp."+i+".";
-//                data.save(response, key);
-//            }
-//        }
-//
-//        public String getOs() {
-//            return os;
-//        }
-//
-//        public void setOs(String os) {
-//            this.os = os;
-//        }
-//
-//        public Integer getAddAjpPort() {
-//            return addAjpPort;
-//        }
-//
-//        public void setAddAjpPort(Integer addAjpPort) {
-//            this.addAjpPort = addAjpPort;
-//        }
-//
-//        public String getLogFilePath() {
-//            return logFilePath;
-//        }
-//
-//        public void setLogFilePath(String logFilePath) {
-//            this.logFilePath = logFilePath;
-//        }
-//
-//        public String getWorkersPath() {
-//            return workersPath;
-//        }
-//
-//        public void setWorkersPath(String workersPath) {
-//            this.workersPath = workersPath;
-//        }
-//
-//        public List getWebApps() {
-//            return webApps;
-//        }
-//
-//        public void setWebApps(List webApps) {
-//            this.webApps = webApps;
-//        }
-//    }
 }

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/threads/AbstractThreadHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/threads/AbstractThreadHandler.java?rev=393962&r1=393961&r2=393962&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/threads/AbstractThreadHandler.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/threads/AbstractThreadHandler.java
Thu Apr 13 15:19:09 2006
@@ -17,6 +17,7 @@
 
 import javax.portlet.ActionResponse;
 import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.console.MultiPageAbstractHandler;
@@ -46,7 +47,7 @@
             abstractName = request.getParameter(AbstractThreadHandler.ABSTRACT_NAME_PARAMETER);
         }
 
-        public void save(ActionResponse response) {
+        public void save(ActionResponse response, PortletSession session) {
             if(!isEmpty(abstractName)) response.setRenderParameter(AbstractThreadHandler.ABSTRACT_NAME_PARAMETER,
abstractName);
         }
     }

Modified: geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/index.jsp
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/index.jsp?rev=393962&r1=393961&r2=393962&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/index.jsp
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/index.jsp
Thu Apr 13 15:19:09 2006
@@ -10,7 +10,8 @@
     <li>Create a <tt>workers.properties</tt> configuration file to point
Apache to the
        Geronimo AJP connector</li>
     <li>Add Apache configuration information indicating which URLs should be sent to
-       Geronimo and whether Apache should server static content</li>
+       Geronimo and whether Apache should serve static content (leaving only
+       dynamic content within the web application to Geronimo)</li>
 </ol>
 <p>By answering a few questions here, we can give you specific guidance and generate
   configuration information you can use.</p>

Modified: geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/results.jsp
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/results.jsp?rev=393962&r1=393961&r2=393962&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/results.jsp
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/results.jsp
Thu Apr 13 15:19:09 2006
@@ -8,14 +8,6 @@
 <input type="hidden" name="addAjpPort" value="${model.addAjpPort}"/>
 <input type="hidden" name="workersPath" value="${model.workersPath}"/>
 <input type="hidden" name="logFilePath" value="${model.logFilePath}"/>
-<c:forEach var="webApp" items="${model.webApps}" varStatus="status">
-    <input type="hidden" name="webapp.${status.index}.configId" value="${webApp.configId}"/>
-    <input type="hidden" name="webapp.${status.index}.enabled" value="${webApp.enabled}"/>
-    <input type="hidden" name="webapp.${status.index}.dynamicPattern" value="${webApp.dynamicPattern}"/>
-    <input type="hidden" name="webapp.${status.index}.serveStaticContent" value="${webApp.serveStaticContent}"/>
-    <input type="hidden" name="webapp.${status.index}.contextRoot" value="${webApp.contextRoot}"/>
-    <input type="hidden" name="webapp.${status.index}.webAppDir" value="${webApp.webAppDir}"/>
-</c:forEach>
 
 
 <p><b>Apache mod_jk</b> -- Configuration Results</p>
@@ -44,14 +36,7 @@
         location.  To install, find the following RPM on your install media and
         run a command like this:</p>
         <pre>
-rpm -Uvh <c:choose>
-            <c:when test="${model.os == 'Fedora Core 4'}">mod_jk-1.2.6-3jpp_4fc.i586.rpm</c:when>
-            <c:when test="${model.os == 'SuSE Pro 9.0'}">apache2-jakarta-tomcat-connectors-4.1.27-32.i586.rpm</c:when>
-            <c:when test="${model.os == 'SuSE Pro 9.1'}">apache2-jakarta-tomcat-connectors-5.0.19-13.i586.rpm</c:when>
-            <c:when test="${model.os == 'SuSE Pro 9.2'}">mod_jk-ap20-4.1.30-3.i586.rpm</c:when>
-            <c:when test="${model.os == 'SuSE Pro 9.3'}">mod_jk-ap20-4.1.30-3.i586.rpm</c:when>
-            <c:when test="${model.os == 'SuSE Linux 10.0'}">mod_jk-ap20-4.1.30-3.i586.rpm</c:when>
-</c:choose>
+rpm -Uvh <c:choose><c:when test="${model.os == 'Fedora Core 4'}">mod_jk-1.2.6-3jpp_4fc.i586.rpm</c:when><c:when
test="${model.os == 'SuSE Pro 9.0'}">apache2-jakarta-tomcat-connectors-4.1.27-32.i586.rpm</c:when><c:when
test="${model.os == 'SuSE Pro 9.1'}">apache2-jakarta-tomcat-connectors-5.0.19-13.i586.rpm</c:when><c:when
test="${model.os == 'SuSE Pro 9.2'}">mod_jk-ap20-4.1.30-3.i586.rpm</c:when><c:when
test="${model.os == 'SuSE Pro 9.3'}">mod_jk-ap20-4.1.30-3.i586.rpm</c:when><c:when
test="${model.os == 'SuSE Linux 10.0'}">mod_jk-ap20-4.1.30-3.i586.rpm</c:when></c:choose>
         </pre>
         <p>Once the <tt>mod_jk</tt> RPM is installed, you can activate
it by
    <c:choose>
@@ -133,4 +118,8 @@
 
 <p>With those steps completed, Apache should be ready to go!  Start Geronimo and restart
Apache
 and try accessing a Geronimo web application through an Apache URL.  If there are any problems,
-check the Apache error log, and the mod_jk error log (at ${model.logFilePath}).</p>
\ No newline at end of file
+check the Apache error log, and the mod_jk error log (at ${model.logFilePath}).</p>
+
+<p><a href="<portlet:actionURL portletMode="view">
+              <portlet:param name="mode" value="index-before" />
+            </portlet:actionURL>">Done</a></p>

Modified: geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/webApps.jsp
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/webApps.jsp?rev=393962&r1=393961&r2=393962&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/webApps.jsp
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/apache/jk/webApps.jsp
Thu Apr 13 15:19:09 2006
@@ -16,14 +16,16 @@
 </dl>
 
 <!-- FORM TO COLLECT DATA FOR THIS PAGE -->
-<form name="<portlet:namespace/>ApacheForm" action="<portlet:actionURL/>">
+<form name="<portlet:namespace/>ApacheForm" action="<portlet:actionURL/>"
method="POST">
     <input type="hidden" name="mode" value="webapp-after"/>
     <input type="hidden" name="os" value="${model.os}"/>
     <input type="hidden" name="addAjpPort" value="${model.addAjpPort}"/>
     <input type="hidden" name="workersPath" value="${model.workersPath}"/>
     <input type="hidden" name="logFilePath" value="${model.logFilePath}"/>
 <c:forEach var="webApp" items="${model.webApps}" varStatus="status">
-    <input type="hidden" name="webapp.${status.index}.configId" value="${webApp.configId}"/>
+    <input type="hidden" name="webapp.${status.index}.configId" value="${webApp.parentConfigId}"/>
+    <input type="hidden" name="webapp.${status.index}.moduleBeanName" value="${webApp.moduleBeanName}"/>
+    <input type="hidden" name="webapp.${status.index}.childName" value="${webApp.childName}"/>
     <input type="hidden" name="webapp.${status.index}.contextRoot" value="${webApp.contextRoot}"/>
     <input type="hidden" name="webapp.${status.index}.webAppDir" value="${webApp.webAppDir}"/>
 </c:forEach>
@@ -34,13 +36,20 @@
             <th>Static Content</th>
             <th>Dynamic Paths</th>
         </tr>
-      <c:forEach var="web" items="${webApps}" varStatus="status">
+      <c:forEach var="web" items="${model.webApps}" varStatus="status">
         <tr>
-            <td>${web.configID}</td>
+            <td>${web.name}</td>
+        <c:choose>
+          <c:when test="${web.running}">
             <td align="center"><input type="checkbox" name="webapp.${status.index}.enabled"<c:if
test="${model.webApps[status.index].enabled}"> checked="checked"</c:if> /></td>
             <td align="center"><input type="checkbox" name="webapp.${status.index}.serveStaticContent"<c:if
test="${model.webApps[status.index].serveStaticContent}"> checked="checked"</c:if>
/></td>
             <td><input type="text" name="webapp.${status.index}.dynamicPattern"
size="20" maxlength="250"
                        value="${model.webApps[status.index].dynamicPattern}"/></td>
+          </c:when>
+          <c:otherwise>
+            <td colspan="3"><i>Web app is not running</i></td>
+          </c:otherwise>
+        </c:choose>
         </tr>
       </c:forEach>
 

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java?rev=393962&r1=393961&r2=393962&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
(original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
Thu Apr 13 15:19:09 2006
@@ -141,7 +141,7 @@
 
     public synchronized Configuration getConfiguration(Artifact configurationId) {
         ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(configurationId);
-        return configurationStatus.getConfiguration();
+        return configurationStatus == null ? null : configurationStatus.getConfiguration();
     }
 
     public synchronized boolean isLoaded(Artifact configurationId) {



Mime
View raw message