geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r563537 [1/2] - in /geronimo/sandbox/portals: ./ geronimo-console/ geronimo-console/src/main/java/org/apache/geronimo/console/ geronimo-console/src/main/java/org/apache/geronimo/console/apache/jk/ geronimo-console/src/main/java/org/apache/g...
Date Tue, 07 Aug 2007 15:59:32 GMT
Author: pmcmahan
Date: Tue Aug  7 08:59:31 2007
New Revision: 563537

URL: http://svn.apache.org/viewvc?view=rev&rev=563537
Log:
merge recent changes made to the 2.0 branch.  also update to work with assemblies built in
trunk

Added:
    geronimo/sandbox/portals/geronimo-console/src/main/webapp/WEB-INF/view/webmanager/editConnector.jsp
      - copied unchanged from r563220, geronimo/server/branches/2.0/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editConnector.jsp
Modified:
    geronimo/sandbox/portals/geronimo-console/NOTICE.txt
    geronimo/sandbox/portals/geronimo-console/pom.xml
    geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/BasePortlet.java
    geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/apache/jk/ApacheConfigPortlet.java
    geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/apache/jk/BaseApacheHandler.java
    geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
    geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java
    geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
    geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java
    geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/util/PortletManager.java
    geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/webmanager/ConnectorInfo.java
    geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
    geronimo/sandbox/portals/geronimo-console/src/main/webapp/WEB-INF/geronimo-web.xml
    geronimo/sandbox/portals/geronimo-console/src/main/webapp/WEB-INF/view/configmanager/normal.jsp
    geronimo/sandbox/portals/geronimo-console/src/main/webapp/WEB-INF/view/webaccesslogmanager/view.jsp
    geronimo/sandbox/portals/geronimo-console/src/main/webapp/WEB-INF/view/webmanager/connector/normal.jsp
    geronimo/sandbox/portals/pluto-container/src/main/resources/META-INF/geronimo-plugin.xml
    geronimo/sandbox/portals/pom.xml

Modified: geronimo/sandbox/portals/geronimo-console/NOTICE.txt
URL: http://svn.apache.org/viewvc/geronimo/sandbox/portals/geronimo-console/NOTICE.txt?view=diff&rev=563537&r1=563536&r2=563537
==============================================================================
--- geronimo/sandbox/portals/geronimo-console/NOTICE.txt (original)
+++ geronimo/sandbox/portals/geronimo-console/NOTICE.txt Tue Aug  7 08:59:31 2007
@@ -1,5 +1,5 @@
 Apache Geronimo 
-Copyright 2003-2006 The Apache Software Foundation
+Copyright 2003-2007 The Apache Software Foundation
 
 This product includes software developed by
 The Apache Software Foundation (http://www.apache.org/).

Modified: geronimo/sandbox/portals/geronimo-console/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/portals/geronimo-console/pom.xml?view=diff&rev=563537&r1=563536&r2=563537
==============================================================================
--- geronimo/sandbox/portals/geronimo-console/pom.xml (original)
+++ geronimo/sandbox/portals/geronimo-console/pom.xml Tue Aug  7 08:59:31 2007
@@ -38,39 +38,32 @@
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-upgrade</artifactId>
-            <version>${geronimoVersion}</version>
             <scope>provided</scope>
-<!-- should look into providing geronimo-upgrade in the minimal assembly
--->
+<!-- should look into providing geronimo-upgrade in the minimal assembly -->
         </dependency>
 
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-converter</artifactId>
-            <version>${geronimoVersion}</version>
             <scope>provided</scope>
-<!-- should look into providing geronimo-converter in the minimal assembly
--->
+<!-- should look into providing geronimo-converter in the minimal assembly -->
         </dependency>
 
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-connector-builder</artifactId>
-            <version>${geronimoVersion}</version>
             <scope>provided</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-security-builder</artifactId>
-            <version>${geronimoVersion}</version>
             <scope>provided</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-deploy-jsr88</artifactId>
-            <version>${geronimoVersion}</version>
             <scope>provided</scope>
         </dependency>
 

Modified: geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/BasePortlet.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/BasePortlet.java?view=diff&rev=563537&r1=563536&r2=563537
==============================================================================
--- geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/BasePortlet.java
(original)
+++ geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/BasePortlet.java
Tue Aug  7 08:59:31 2007
@@ -76,10 +76,13 @@
     public final static Object getProperty(Object target, String name) {
         Class cls = target.getClass();
         String getter = "get"+Character.toUpperCase(name.charAt(0))+name.substring(1);
+        String booleanGetter = "is"+Character.toUpperCase(name.charAt(0))+name.substring(1);
         Method[] list = cls.getMethods();
         for (int i = 0; i < list.length; i++) {
             Method method = list[i];
-            if(method.getName().equals(getter) && method.getParameterTypes().length
== 0 && Modifier.isPublic(method.getModifiers()) &&
+            String methodName = method.getName();
+            if( (methodName.equals(getter) || methodName.equals(booleanGetter))
+                && method.getParameterTypes().length == 0 && Modifier.isPublic(method.getModifiers())
&&
                     !Modifier.isStatic(method.getModifiers())) {
                 try {
                     return method.invoke(target, new Object[0]);

Modified: geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/apache/jk/ApacheConfigPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/apache/jk/ApacheConfigPortlet.java?view=diff&rev=563537&r1=563536&r2=563537
==============================================================================
--- geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/apache/jk/ApacheConfigPortlet.java
(original)
+++ geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/apache/jk/ApacheConfigPortlet.java
Tue Aug  7 08:59:31 2007
@@ -16,12 +16,18 @@
  */
 package org.apache.geronimo.console.apache.jk;
 
+import java.io.IOException;
+
+import org.apache.geronimo.console.MultiPageAbstractHandler;
 import org.apache.geronimo.console.MultiPagePortlet;
-import org.apache.geronimo.console.MultiPageModel;
+import org.apache.geronimo.console.apache.jk.BaseApacheHandler.ApacheModel;
 
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequest;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
 
 /**
  * Portlet that helps you configure Geronimo for Apache 2 with mod_jk
@@ -38,11 +44,37 @@
         addHelper(new ResultsHandler(), config);
     }
 
+    public void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws
IOException, PortletException {
+        if(WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
+            return;
+        }
+        String mode = renderRequest.getParameter(MODE_KEY);
+        ApacheModel model = (ApacheModel)getModel(renderRequest);
+        if(mode == null || mode.equals("")) {
+            mode = getDefaultMode();
+        }
+        MultiPageAbstractHandler handler = (MultiPageAbstractHandler)helpers.get(mode);
+        try {
+            if(handler != null) {
+                handler.renderView(renderRequest, renderResponse, model);
+            }
+        } catch (Throwable e) {
+            
+        }
+        // decode the paths in model object
+        model.setLogFilePath(model.getLogFilePath());
+        model.setWorkersPath(model.getWorkersPath());
+        renderRequest.setAttribute(getModelJSPVariableName(), model);
+        if(handler != null) {
+            handler.getView().include(renderRequest, renderResponse);
+        }
+    }
+
     protected String getModelJSPVariableName() {
         return "model";
     }
 
-    protected MultiPageModel getModel(PortletRequest request) {
+    protected ApacheModel getModel(PortletRequest request) {
         return new BaseApacheHandler.ApacheModel(request);
     }
 }

Modified: geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/apache/jk/BaseApacheHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/apache/jk/BaseApacheHandler.java?view=diff&rev=563537&r1=563536&r2=563537
==============================================================================
--- geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/apache/jk/BaseApacheHandler.java
(original)
+++ geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/apache/jk/BaseApacheHandler.java
Tue Aug  7 08:59:31 2007
@@ -160,17 +160,21 @@
         private String logFilePath;
         private String workersPath;
         private List webApps = new ArrayList();
+        // list of encodings for special chars
+        private String[][] ENCODINGS = {{":", "0x0"},{"\\", "0x1"}};
 
         public ApacheModel(PortletRequest request) {
             Map map = request.getParameterMap();
             os = request.getParameter("os");
-            logFilePath = request.getParameter("logFilePath");
+            // logFilePath and workersPath need to be encoded before saving
+            // and decoded after fetching
+            logFilePath = encodePath(request.getParameter("logFilePath"));
             if(logFilePath == null) {
-                logFilePath = PortletManager.getCurrentServer(request).getServerInfo().resolve("var/log/apache_mod_jk.log").getPath();
+                logFilePath = encodePath(PortletManager.getCurrentServer(request).getServerInfo().resolve("var/log/apache_mod_jk.log").getPath());
             }
-            workersPath = request.getParameter("workersPath");
+            workersPath = encodePath(request.getParameter("workersPath"));
             if(workersPath == null) {
-                workersPath = PortletManager.getCurrentServer(request).getServerInfo().resolve("var/config/workers.properties").getPath();
+                workersPath = encodePath(PortletManager.getCurrentServer(request).getServerInfo().resolve("var/config/workers.properties").getPath());
             }
             String ajp = request.getParameter("addAjpPort");
             if(!isEmpty(ajp)) addAjpPort = new Integer(ajp);
@@ -203,6 +207,30 @@
             }
         }
 
+        private String encodePath(String value) {
+            if(value == null) {
+                return value;
+            }
+            for(int i = 0; i < ENCODINGS.length; i++) {
+                if(value.contains(ENCODINGS[i][0])) {
+                    value = value.replace(ENCODINGS[i][0], ENCODINGS[i][1]);
+                }
+            }
+            return value;
+        }
+        
+        private String decodePath(String value) {
+            if(value == null) {
+                return value;
+            }
+            for(int i = 0; i < ENCODINGS.length; i++) {
+                if(value.contains(ENCODINGS[i][1])) {
+                    value = value.replace(ENCODINGS[i][1], ENCODINGS[i][0]);
+                }
+            }
+            return value;
+        }
+        
         public String getOs() {
             return os;
         }
@@ -220,7 +248,7 @@
         }
 
         public String getLogFilePath() {
-            return logFilePath;
+            return decodePath(logFilePath);
         }
 
         public void setLogFilePath(String logFilePath) {
@@ -228,7 +256,7 @@
         }
 
         public String getWorkersPath() {
-            return workersPath;
+            return decodePath(workersPath);
         }
 
         public void setWorkersPath(String workersPath) {

Modified: geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java?view=diff&rev=563537&r1=563536&r2=563537
==============================================================================
--- geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
(original)
+++ geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
Tue Aug  7 08:59:31 2007
@@ -282,7 +282,6 @@
                     WebModule webModule = (WebModule) PortletManager.getModule(renderRequest,
info.getConfigID());
                     if (webModule != null) {
                         details.setContextPath(webModule.getContextPath());
-                        details.setUrlFor(webModule.getURLFor());
                     }
                 }
                 try {
@@ -384,7 +383,6 @@
         private final Artifact configId;
         private final ConfigurationModuleType type;
         private final State state;
-        private URL urlFor;             // only relevant for webapps
         private String contextPath;     // only relevant for webapps
         private List parents = new ArrayList();
         private List children = new ArrayList();
@@ -419,16 +417,8 @@
             return state;
         }
 
-        public URL getUrlFor() {
-            return urlFor;
-        }
-
         public String getContextPath() {
             return contextPath;
-        }
-
-        public void setUrlFor(URL urlFor) {
-            this.urlFor = urlFor;
         }
 
         public void setContextPath(String contextPath) {

Modified: geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java?view=diff&rev=563537&r1=563536&r2=563537
==============================================================================
--- geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java
(original)
+++ geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java
Tue Aug  7 08:59:31 2007
@@ -53,7 +53,11 @@
         renderRequest.setAttribute("configFile", log.getConfigFileName());
 //        renderRequest.setAttribute("configuration", LogHelper.getConfiguration());
         renderRequest.setAttribute("logLevel", log.getRootLoggerLevel());
-        renderRequest.setAttribute("refreshPeriod", new Integer(log.getRefreshPeriodSeconds()));
+        try{
+            renderRequest.setAttribute("refreshPeriod", new Integer(log.getRefreshPeriodSeconds()));
+        }catch(NumberFormatException e){
+            //ignore
+        }
 
         normalView.include(renderRequest, renderRespose);
     }
@@ -78,7 +82,12 @@
 
         if ("update".equals(action)) {
             if (refreshPeriod != null) {
-                int refreshPeriodInt = Integer.parseInt(refreshPeriod);
+                int refreshPeriodInt = 0;
+                try{
+                    refreshPeriodInt = Integer.parseInt(refreshPeriod);
+                }catch(NumberFormatException e){
+                    //ignore
+                }
                 if (refreshPeriodInt != log.getRefreshPeriodSeconds()) {
                     log.setRefreshPeriodSeconds(refreshPeriodInt);
                 }
@@ -91,4 +100,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}

Modified: geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java?view=diff&rev=563537&r1=563536&r2=563537
==============================================================================
--- geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
(original)
+++ geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/LogViewerPortlet.java
Tue Aug  7 08:59:31 2007
@@ -71,10 +71,11 @@
         for (int i = 0; i < files.length; i++) {
             files[i] = new LogFile(logFiles[i]);
         }
-        Criteria criteria;
-        if ("refresh".equals(action)) {
-            criteria = (Criteria) renderRequest.getPortletSession(true).getAttribute(CRITERIA_KEY,
PortletSession.PORTLET_SCOPE);
-        } else {
+        Criteria criteria = (Criteria) renderRequest.getPortletSession(true).getAttribute(CRITERIA_KEY,
PortletSession.PORTLET_SCOPE);
+        
+        if (criteria == null || (action != null && !"refresh".equals(action))) {
+            if(criteria == null)
+                criteria = new Criteria();
             String startPos = renderRequest.getParameter("startPos");
             String endPos = renderRequest.getParameter("endPos");
             String maxRows = renderRequest.getParameter("maxRows");
@@ -85,19 +86,26 @@
             if(logFile == null || logFile.equals("")) {
                 logFile = logFiles[0];
             }
-            if(logLevel == null || logLevel.equals("")) {
-                logLevel = "WARN";
+            
+            criteria.level = logLevel == null || logLevel.equals("") ? criteria.level : logLevel;
+            try{
+                criteria.max = maxRows == null || maxRows.equals("") ? criteria.max : Integer.parseInt(maxRows);
+            }catch(NumberFormatException e){
+                //ignore
             }
-            if(maxRows == null || maxRows.equals("")) {
-                maxRows = "10";
+            try{
+                criteria.start = startPos == null || startPos.equals("") ? null : new Integer(startPos);
+            }catch(NumberFormatException e){
+            //ignore
             }
-            criteria = new Criteria();
-            criteria.max = Integer.parseInt(maxRows);
-            criteria.start = startPos == null || startPos.equals("") ? null : new Integer(startPos);
-            criteria.stop = endPos == null || endPos.equals("") ? null : new Integer(endPos);
+            try{
+                criteria.stop = endPos == null || endPos.equals("") ? null : new Integer(endPos);
+            }catch(NumberFormatException e){
+                //ignore
+                }
             criteria.logFile = logFile;
             criteria.stackTraces = stackTraces != null && !stackTraces.equals("");
-            criteria.level = logLevel;
+            
             criteria.text = searchString == null || searchString.equals("") ? null : searchString;
             renderRequest.getPortletSession(true).setAttribute(CRITERIA_KEY, criteria, PortletSession.PORTLET_SCOPE);
         }
@@ -133,11 +141,11 @@
     }
 
     private static class Criteria implements Serializable {
-        int max;
+        int max = 10;
         Integer start;
         Integer stop;
         String text;
-        String level;
+        String level = "WARN";
         String logFile;
         boolean stackTraces;
     }
@@ -165,4 +173,4 @@
             return name;
         }
     }
-}
\ No newline at end of file
+}

Modified: geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java?view=diff&rev=563537&r1=563536&r2=563537
==============================================================================
--- geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java
(original)
+++ geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java
Tue Aug  7 08:59:31 2007
@@ -33,10 +33,12 @@
 import javax.portlet.PortletContext;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletSession;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 import java.io.IOException;
+import java.io.Serializable;
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -49,6 +51,7 @@
  * @version $Rev$ $Date$
  */
 public class WebAccessLogViewerPortlet extends BasePortlet {
+    private final static String CRITERIA_KEY = "org.apache.geronimo.console.web.log.CRITERIA";
     private final static Log log = LogFactory.getLog(WebAccessLogViewerPortlet.class);
     private static final int DEFAULT_MAX_RESULTS = 10;
 
@@ -70,7 +73,10 @@
         }
 
         WebManager[] managers = PortletManager.getCurrentServer(renderRequest).getWebManagers();
-
+        
+        Criteria criteria = (Criteria) renderRequest.getPortletSession(true).getAttribute(CRITERIA_KEY,
PortletSession.PORTLET_SCOPE);
+        
+        
         //todo: new
         Map products = new LinkedHashMap();
         String chosen = renderRequest.getParameter("selectedContainer");
@@ -127,17 +133,38 @@
         }
 
         String action = renderRequest.getParameter("action");
-        if ("refresh".equals(action)) {
-            //todo: currently refreshes on every request; that's pretty slow.
+        if (criteria == null || (action != null && !"refresh".equals(action))) {
+            if(criteria == null)
+                criteria = new Criteria();
+            
+            String fromDate = renderRequest.getParameter("fromDate");
+            String toDate = renderRequest.getParameter("toDate");
+            String requestHost = renderRequest.getParameter("requestHost");
+            String authUser = renderRequest.getParameter("authUser");
+            String method = renderRequest.getParameter("requestMethod");
+            String uri = renderRequest.getParameter("requestedURI");
+            String result = renderRequest.getParameter("startResult");
+            Integer max = criteria.maxResult;
+            try{
+                max = Integer.parseInt(renderRequest.getParameter("maxResult"));
+            }catch(NumberFormatException e){
+            //ignore
+            }
+            String ignoreDates = renderRequest.getParameter("ignoreDates");
+            
+            criteria.fromDate = fromDate == null || fromDate.equals("") ? null : fromDate;
+            criteria.toDate = toDate == null || toDate.equals("") ? null : toDate;
+            criteria.requestHost = requestHost == null || requestHost.equals("") ? null :
requestHost;
+            criteria.authUser = authUser == null || authUser.equals("") ? null : authUser;
+            criteria.requestMethod = method == null || method.equals("") ? null : method;
+            criteria.requestedURI = uri == null || uri.equals("") ? null : uri;
+            criteria.startResult = result == null || result.equals("") ? null : result;
+            criteria.maxResult = max;
+            criteria.ignoreDates = ignoreDates != null && !ignoreDates.equals("");
 
         }
+        String fromDateStr = criteria.fromDate;
+        String toDateStr = criteria.toDate;
 
-        String fromDateStr = new String();
-        String toDateStr = new String();
-        if (renderRequest.getParameter("ignoreDates") == null){
-            fromDateStr = (String) renderRequest.getParameter("fromDate");
-            toDateStr = (String) renderRequest.getParameter("toDate");
-        }
-        
         Calendar cal1 = Calendar.getInstance(), cal2 = Calendar.getInstance();
         // If not all dates were passed we assume than no fields were passed and just
         // filter on the current date.
@@ -154,32 +181,28 @@
             cal2.set(Calendar.MILLISECOND, cal2.getMaximum(Calendar.MILLISECOND));
 
             WebAccessLog.SearchResults matchingItems = chosenLog.getMatchingItems(logToSearch,
-                                        null, null, null, null, cal1.getTime(), cal2.getTime(),
null, Integer.valueOf(DEFAULT_MAX_RESULTS - 1));
+                                        null, null, null, null, cal1.getTime(), cal2.getTime(),
null, Integer.valueOf(criteria.maxResult.intValue()-1));
             renderRequest.setAttribute("logs", matchingItems.getResults());
             renderRequest.setAttribute("logLength", new Integer(matchingItems.getLineCount()));
-            renderRequest.setAttribute("maxResult", Integer.valueOf(DEFAULT_MAX_RESULTS));
+            renderRequest.setAttribute("maxResult", criteria.maxResult);
+            renderRequest.setAttribute("ignoreDates", Boolean.valueOf(criteria.ignoreDates));
+            
         } else {
             // Get other search criteria
-            String requestHost = (String) renderRequest.getParameter("requestHost");
-            String authUser = (String) renderRequest.getParameter("authUser");
-            String requestMethod = (String) renderRequest.getParameter("requestMethod");
-            String requestedURI = (String) renderRequest.getParameter("requestedURI");
-            String startResult = (String) renderRequest.getParameter("startResult");
-            String maxResult = (String) renderRequest.getParameter("maxResult");
+            String requestHost = criteria.requestHost;
+            String authUser = criteria.authUser;
+            String requestMethod = criteria.requestMethod;
+            String requestedURI = criteria.requestedURI;
+            String startResult = criteria.startResult;
             Integer iStartResult = null;
-            Integer iMaxResult = Integer.valueOf(DEFAULT_MAX_RESULTS);
+            Integer iMaxResult = criteria.maxResult;
             try{
                 iStartResult = Integer.valueOf(startResult);
             }catch(NumberFormatException e){
                 //ignore
             }
-            try{
-                iMaxResult = Integer.valueOf(maxResult);
-            }catch(NumberFormatException e){
-                //ignore
-            }
             
-            boolean ignoreDates = renderRequest.getParameter("ignoreDates") != null;
+            boolean ignoreDates = criteria.ignoreDates;
             if (ignoreDates) {
                 WebAccessLog.SearchResults matchingItems = chosenLog.getMatchingItems(logToSearch,
                                                 requestHost, authUser, requestMethod, requestedURI,
null, null, iStartResult, Integer.valueOf(iMaxResult.intValue()-1));
@@ -233,7 +256,7 @@
                 renderRequest.setAttribute("logs", matchingItems.getResults());
                 renderRequest.setAttribute("logLength", new Integer(matchingItems.getLineCount()));
             }
-            if (ignoreDates) renderRequest.setAttribute("ignoreDates", new Boolean(ignoreDates));
+            renderRequest.setAttribute("ignoreDates", new Boolean(ignoreDates));
             renderRequest.setAttribute("requestHost", requestHost);
             renderRequest.setAttribute("authUser", authUser);
             renderRequest.setAttribute("requestMethod", requestMethod);
@@ -243,6 +266,7 @@
         }
         renderRequest.setAttribute("toDate", toDateStr);
         renderRequest.setAttribute("fromDate", fromDateStr);
+        renderRequest.getPortletSession(true).setAttribute(CRITERIA_KEY, criteria, PortletSession.PORTLET_SCOPE);
         searchView.include(renderRequest, renderRespose);
     }
 
@@ -263,6 +287,17 @@
 
         actionResponse.setRenderParameters(actionRequest.getParameterMap());
         
+    }
+    private static class Criteria implements Serializable {
+        Integer maxResult = new Integer(DEFAULT_MAX_RESULTS);
+        String fromDate = null;
+        String toDate = null;
+        boolean ignoreDates = false;
+        String requestHost = null;
+        String authUser = null;
+        String requestMethod = "ANY";
+        String requestedURI = null;
+        String startResult = null;
     }
 
 }

Modified: geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/util/PortletManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/util/PortletManager.java?view=diff&rev=563537&r1=563536&r2=563537
==============================================================================
--- geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/util/PortletManager.java
(original)
+++ geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/util/PortletManager.java
Tue Aug  7 08:59:31 2007
@@ -55,6 +55,7 @@
 import org.apache.geronimo.management.geronimo.JMSConnector;
 import org.apache.geronimo.management.geronimo.JMSManager;
 import org.apache.geronimo.management.geronimo.JVM;
+import org.apache.geronimo.management.geronimo.NetworkConnector;
 import org.apache.geronimo.management.geronimo.ResourceAdapter;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 import org.apache.geronimo.management.geronimo.WebAccessLog;
@@ -248,33 +249,27 @@
         return (WebContainer) helper.getObject(containerName);
     }
 
-    public static WebConnector createWebConnector(PortletRequest request, AbstractName managerName,
AbstractName containerName, String name, String protocol, String host, int port) {
+    public static NetworkConnector[] getNetworkConnectors(PortletRequest request, AbstractName
managerName) {
         ManagementHelper helper = getManagementHelper(request);
         WebManager manager = (WebManager) helper.getObject(managerName);
-        return manager.addConnector((WebContainer) helper.getObject(containerName), name,
protocol, host, port);
+        return manager.getConnectors();
     }
 
-    public static WebConnector[] getWebConnectors(PortletRequest request, AbstractName managerName)
{
+    public static NetworkConnector[] getNetworkConnectors(PortletRequest request, AbstractName
managerName, String protocol) {
         ManagementHelper helper = getManagementHelper(request);
         WebManager manager = (WebManager) helper.getObject(managerName);
-        return (WebConnector[]) manager.getConnectors();
+        return manager.getConnectors(protocol);
     }
 
-    public static WebConnector[] getWebConnectors(PortletRequest request, AbstractName managerName,
String protocol) {
+    public static NetworkConnector getNetworkConnector(PortletRequest request, AbstractName
connectorName) {
         ManagementHelper helper = getManagementHelper(request);
-        WebManager manager = (WebManager) helper.getObject(managerName);
-        return (WebConnector[]) manager.getConnectors(protocol);
-    }
-
-    public static WebConnector getWebConnector(PortletRequest request, AbstractName connectorName)
{
-        ManagementHelper helper = getManagementHelper(request);
-        return (WebConnector) helper.getObject(connectorName);
+        return (NetworkConnector) helper.getObject(connectorName);
     }
 
-    public static WebConnector[] getWebConnectorsForContainer(PortletRequest request, AbstractName
managerName, AbstractName containerName, String protocol) {
+    public static NetworkConnector[] getNetworkConnectorsForContainer(PortletRequest request,
AbstractName managerName, AbstractName containerName, String protocol) {
         ManagementHelper helper = getManagementHelper(request);
         WebManager manager = (WebManager) helper.getObject(managerName);
-        return (WebConnector[]) manager.getConnectorsForContainer(containerName, protocol);
+        return manager.getConnectorsForContainer(containerName, protocol);
     }
 
     public static JMSBroker getJMSBroker(PortletRequest request, AbstractName brokerName)
{

Modified: geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/webmanager/ConnectorInfo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/webmanager/ConnectorInfo.java?view=diff&rev=563537&r1=563536&r2=563537
==============================================================================
--- geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/webmanager/ConnectorInfo.java
(original)
+++ geronimo/sandbox/portals/geronimo-console/src/main/java/org/apache/geronimo/console/webmanager/ConnectorInfo.java
Tue Aug  7 08:59:31 2007
@@ -23,7 +23,7 @@
 
 public class ConnectorInfo implements Serializable {
     private String description;
-    private String displayName;
+    private String uniqueName;
     private String connectorURI;
     private String protocol;
     private int port;
@@ -49,16 +49,16 @@
         return connectorURI;
     }
 
-    public String getDisplayName() {
-        return displayName;
+    public String getUniqueName() {
+        return uniqueName;
     }
 
     public void setConnectorURI(String connectorURI) {
         this.connectorURI = connectorURI;
     }
 
-    public void setDisplayName(String displayName) {
-        this.displayName = displayName;
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
     }
 
     public int getPort() {



Mime
View raw message