geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r389296 - in /geronimo/trunk: applications/console-framework/ applications/console-framework/src/java/ applications/console-framework/src/java/org/ applications/console-framework/src/java/org/apache/ applications/console-framework/src/java/...
Date Mon, 27 Mar 2006 21:50:13 GMT
Author: jgenender
Date: Mon Mar 27 13:50:11 2006
New Revision: 389296

URL: http://svn.apache.org/viewcvs?rev=389296&view=rev
Log:
GERONIMO-1705 and GERONIMO-973

Added:
    geronimo/trunk/applications/console-framework/src/java/
    geronimo/trunk/applications/console-framework/src/java/org/
    geronimo/trunk/applications/console-framework/src/java/org/apache/
    geronimo/trunk/applications/console-framework/src/java/org/apache/geronimo/
    geronimo/trunk/applications/console-framework/src/java/org/apache/geronimo/console/
    geronimo/trunk/applications/console-framework/src/java/org/apache/geronimo/console/servlet/
    geronimo/trunk/applications/console-framework/src/java/org/apache/geronimo/console/servlet/ContextForwardServlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DownloadInfo.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DownloadMonitor.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/servlet/
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/servlet/ForwardDispatchFilter.java
Modified:
    geronimo/trunk/applications/console-framework/project.xml
    geronimo/trunk/applications/console-framework/src/webapp/WEB-INF/web.xml
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DriverDownloader.java
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/dwr.xml
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/infomanager/svrInfoNormal.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml
    geronimo/trunk/configs/console-jetty/src/plan/plan.xml
    geronimo/trunk/configs/console-tomcat/src/plan/plan.xml

Modified: geronimo/trunk/applications/console-framework/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-framework/project.xml?rev=389296&r1=389295&r2=389296&view=diff
==============================================================================
--- geronimo/trunk/applications/console-framework/project.xml (original)
+++ geronimo/trunk/applications/console-framework/project.xml Mon Mar 27 13:50:11 2006
@@ -103,5 +103,11 @@
         </dependency>
 
     </dependencies>
+
+    <build>
+        <sourceDirectory>src/java</sourceDirectory>
+    </build>
+
+
 </project>
 

Added: geronimo/trunk/applications/console-framework/src/java/org/apache/geronimo/console/servlet/ContextForwardServlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-framework/src/java/org/apache/geronimo/console/servlet/ContextForwardServlet.java?rev=389296&view=auto
==============================================================================
--- geronimo/trunk/applications/console-framework/src/java/org/apache/geronimo/console/servlet/ContextForwardServlet.java
(added)
+++ geronimo/trunk/applications/console-framework/src/java/org/apache/geronimo/console/servlet/ContextForwardServlet.java
Mon Mar 27 13:50:11 2006
@@ -0,0 +1,73 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.console.servlet;
+
+import java.io.IOException;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.UnavailableException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Servlet that forwards GET and POST requests to a servlet
+ * in an alternate context. The servlet path and alternate
+ * context are passed in as configuration parameters (e.g.
+ * via <config-param> elements in the web.xml).
+ */
+public class ContextForwardServlet extends HttpServlet {
+
+    // name of the configuration parameter containing the context path
+    public static final String CONTEXT_PATH = "context-path";
+    // name of the configuration parameter containing the servlet path
+    public static final String SERVLET_PATH = "servlet-path";
+
+    private ServletContext forwardContext;
+    private String servletPath;
+
+    public void init(ServletConfig config) throws ServletException {
+        super.init(config);
+        String contextPath = config.getInitParameter(CONTEXT_PATH);
+        servletPath = config.getInitParameter(SERVLET_PATH);
+        if (contextPath == null || servletPath == null) {
+            throw new UnavailableException("context-path and servlet-path " +
+                    "must be provided as configuration parameters");
+        }
+        forwardContext = getServletContext().getContext(contextPath);
+    }
+
+    public void doGet(HttpServletRequest req, HttpServletResponse resp)
+            throws ServletException, IOException {
+        doPost(req, resp);
+    }
+
+    public void doPost(HttpServletRequest req, HttpServletResponse resp)
+            throws ServletException, IOException {
+        String dispatchURI = servletPath + req.getPathInfo();
+        String queryString = req.getQueryString();
+        if (queryString != null) {
+            dispatchURI += "?" + queryString;
+        }
+        RequestDispatcher dispatcher = forwardContext.getRequestDispatcher(dispatchURI);
+        dispatcher.forward(req, resp);
+    }
+}

Modified: geronimo/trunk/applications/console-framework/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-framework/src/webapp/WEB-INF/web.xml?rev=389296&r1=389295&r2=389296&view=diff
==============================================================================
--- geronimo/trunk/applications/console-framework/src/webapp/WEB-INF/web.xml (original)
+++ geronimo/trunk/applications/console-framework/src/webapp/WEB-INF/web.xml Mon Mar 27 13:50:11
2006
@@ -30,6 +30,20 @@
         <servlet-class>org.apache.pluto.portalImpl.Servlet</servlet-class>
     </servlet>
 
+    <servlet>
+        <display-name>DWR Forward Servlet</display-name>
+        <servlet-name>dwr-forward</servlet-name>
+        <servlet-class>org.apache.geronimo.console.servlet.ContextForwardServlet</servlet-class>
+        <init-param>
+           <param-name>context-path</param-name>
+           <param-value>/console-standard</param-value>
+        </init-param>
+        <init-param>
+           <param-name>servlet-path</param-name>
+           <param-value>/dwr</param-value>
+        </init-param>
+    </servlet>
+
     <servlet-mapping>
         <servlet-name>se-console</servlet-name>
         <url-pattern>/portal/*</url-pattern>
@@ -38,10 +52,15 @@
         <servlet-name>se-console</servlet-name>
         <url-pattern>/secure/*</url-pattern>
     </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>dwr-forward</servlet-name>
+        <url-pattern>/dwr/*</url-pattern>
+    </servlet-mapping>
 
     <security-constraint>
         <web-resource-collection>
             <web-resource-name></web-resource-name>
+            <url-pattern>/dwr/*</url-pattern>
             <url-pattern>/portal/*</url-pattern>
             <http-method>GET</http-method>
             <http-method>POST</http-method>

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java?rev=389296&r1=389295&r2=389296&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
(original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
Mon Mar 27 13:50:11 2006
@@ -276,19 +276,28 @@
                 DriverDownloader downloader = new DriverDownloader();
                 WriteableRepository repo = PortletManager.getWritableRepositories(actionRequest)[0];
                 try {
-                    downloader.loadDriver(repo, found, new FileWriteMonitor() {
+                    DownloadInfo downloadInfo = new DownloadInfo();
+                    final PortletSession session = actionRequest.getPortletSession();
+                    session.setAttribute(DownloadInfo.DOWNLOAD_INFO_KEY, downloadInfo, PortletSession.APPLICATION_SCOPE);
+                    downloader.loadDriver(repo, found, downloadInfo, new FileWriteMonitor()
{
                         public void writeStarted(String fileDescription) {
                             System.out.println("Downloading "+fileDescription);
+                            DownloadInfo downloadInfo = (DownloadInfo)session.getAttribute(DownloadInfo.DOWNLOAD_INFO_KEY);
+                            downloadInfo.setDownloadStarted(true);
                         }
 
                         public void writeProgress(int bytes) {
                             System.out.print("\rDownload progress: "+(bytes/1024)+"kB");
                             System.out.flush();
+                            DownloadInfo downloadInfo = (DownloadInfo)session.getAttribute(DownloadInfo.DOWNLOAD_INFO_KEY);
+                            downloadInfo.setBytesDownloaded(bytes);
                         }
 
                         public void writeComplete(int bytes) {
                             System.out.println();
                             System.out.println("Finished downloading "+bytes+"b");
+                            DownloadInfo downloadInfo = (DownloadInfo)session.getAttribute(DownloadInfo.DOWNLOAD_INFO_KEY);
+                            downloadInfo.setDownloadFinished(true);
                         }
                     });
                     data.jar1 = found.getRepositoryURI();

Added: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DownloadInfo.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DownloadInfo.java?rev=389296&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DownloadInfo.java
(added)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DownloadInfo.java
Mon Mar 27 13:50:11 2006
@@ -0,0 +1,56 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.console.databasemanager.wizard;
+
+public class DownloadInfo
+{
+    public static final String DOWNLOAD_INFO_KEY = "downloadInfo";
+    private boolean downloadStarted = false;
+    private boolean downloadFinished = false;
+    private long bytesDownloaded = 0;
+    private long totalBytes = -1;
+    
+    public DownloadInfo()
+    {
+    }
+    public boolean isDownloadFinished() {
+        return downloadFinished;
+    }
+    public void setDownloadFinished(boolean downloadFinished) {
+        this.downloadFinished = downloadFinished;
+    }
+    public boolean isDownloadStarted() {
+        return downloadStarted;
+    }
+    public void setDownloadStarted(boolean downloadStarted) {
+        this.downloadStarted = downloadStarted;
+    }
+    public long getBytesDownloaded() {
+        return bytesDownloaded;
+    }
+    public void setBytesDownloaded(long bytesDownloaded) {
+        this.bytesDownloaded = bytesDownloaded;
+    }
+    public long getTotalBytes() {
+        return totalBytes;
+    }
+    public void setTotalBytes(long totalBytes) {
+        this.totalBytes = totalBytes;
+    }
+}
+

Added: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DownloadMonitor.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DownloadMonitor.java?rev=389296&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DownloadMonitor.java
(added)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DownloadMonitor.java
Mon Mar 27 13:50:11 2006
@@ -0,0 +1,37 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.console.databasemanager.wizard;
+
+import javax.servlet.http.HttpSession;
+
+import uk.ltd.getahead.dwr.ExecutionContext;
+
+public class DownloadMonitor
+{
+    public DownloadInfo getDownloadInfo()
+    {
+        HttpSession session = ExecutionContext.get().getSession();
+        
+        if (session.getAttribute(DownloadInfo.DOWNLOAD_INFO_KEY) != null) {
+            return (DownloadInfo) session.getAttribute(DownloadInfo.DOWNLOAD_INFO_KEY);
+        } else {
+            return new DownloadInfo();
+        }
+    }
+}
+

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DriverDownloader.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DriverDownloader.java?rev=389296&r1=389295&r2=389296&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DriverDownloader.java
(original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DriverDownloader.java
Mon Mar 27 13:50:11 2006
@@ -26,6 +26,7 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
+import java.net.URLConnection;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;
@@ -116,7 +117,7 @@
     /**
      * Downloads a driver and loads it into the local repository.
      */
-    public void loadDriver(WriteableRepository repo, DriverInfo driver, FileWriteMonitor
monitor) throws IOException {
+    public void loadDriver(WriteableRepository repo, DriverInfo driver, DownloadInfo downloadInfo,
FileWriteMonitor monitor) throws IOException {
         try {
             int urlIndex = 0;
             if(driver.urls.length > 1) {
@@ -133,7 +134,9 @@
                 int size;
                 int total = 0;
                 int threshold = 10240;
-                InputStream net = url.openStream();
+                URLConnection uc = url.openConnection();
+                downloadInfo.setTotalBytes(uc.getContentLength());
+                InputStream net = uc.getInputStream();
                 JarFile jar = null;
                 File download = null;
                 try {

Added: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/servlet/ForwardDispatchFilter.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/servlet/ForwardDispatchFilter.java?rev=389296&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/servlet/ForwardDispatchFilter.java
(added)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/servlet/ForwardDispatchFilter.java
Mon Mar 27 13:50:11 2006
@@ -0,0 +1,98 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.console.servlet;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+
+/**
+ * Filter that wrappers HTTP requests forwarded from a separate
+ * context via a named request dispatcher.  The wrapped HTTP
+ * requests return attributes from the original request instead
+ * of the forwarded instance of the request. Deployment
+ * descriptors that use this filter should specify "FORWARD" as
+ * the dispatcher type in their filter-mapping elements, as per
+ * the 2.4 Servlet Specification. e.g.
+ * 
+ *     <pre>
+ *     <filter-mapping>
+ *        <filter-name>myfilter</filter-name>
+ *        <servlet-name>myservlet</servlet-name>
+ *        <dispatcher>FORWARD</dispatcher>
+ *     </filter-mapping>
+ *     </pre>
+ *     
+ */
+public class ForwardDispatchFilter implements Filter {
+
+    protected FilterConfig filterConfig;
+    
+    public void init(FilterConfig config) throws ServletException {
+        filterConfig = config;
+    }
+
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
+        if (request instanceof HttpServletRequest) {
+            chain.doFilter(new ForwardRequest((HttpServletRequest)request), response);
+        } else {
+            throw new ServletException("ServletRequest is not an instance of HttpServletRequest");
+        }
+    }
+
+    public void destroy() {}
+    
+    /* An HTTP servlet request wrapper that maps the following
+     * attributes from the original request
+     *  
+     * # javax.servlet.forward.request_uri
+     * # javax.servlet.forward.context_path
+     * # javax.servlet.forward.servlet_path
+     * # javax.servlet.forward.path_info
+     * # javax.servlet.forward.query_string
+     */
+    protected class ForwardRequest extends HttpServletRequestWrapper {
+        HttpServletRequest request;
+        public ForwardRequest(HttpServletRequest req) {
+            super(req);
+            request = req;
+        }
+        public String getRequestURI() {
+            return String.valueOf(request.getAttribute("javax.servlet.forward.request_uri"));

+        }
+        public String getContextPath() {
+            return String.valueOf(request.getAttribute("javax.servlet.forward.context_path"));

+        }
+        public String getServletPath() {
+            return String.valueOf(request.getAttribute("javax.servlet.forward.servlet_path"));

+        }
+        public String getPathInfo() {
+            return String.valueOf(request.getAttribute("javax.servlet.forward.path_info"));

+        }
+        public String getQueryString() {
+            return String.valueOf(request.getAttribute("javax.servlet.forward.query_string"));

+        }
+    }
+}

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/dwr.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/dwr.xml?rev=389296&r1=389295&r2=389296&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/dwr.xml (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/dwr.xml Mon Mar 27 13:50:11
2006
@@ -1,12 +1,15 @@
 <!DOCTYPE dwr PUBLIC
     "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
     "http://www.getahead.ltd.uk/dwr/dwr10.dtd">
-
 <dwr>
   <allow>
     <convert converter="bean" match="org.apache.geronimo.console.jsr77.DynamicServerInfo"/>
     <create creator="new" javascript="Jsr77Stats">
       <param name="class" value="org.apache.geronimo.console.jsr77.Jsr77Lookup"/>
     </create>
+    <create creator="new" javascript="DownloadMonitor">
+      <param name="class" value="org.apache.geronimo.console.databasemanager.wizard.DownloadMonitor"/>
+    </create>
+    <convert converter="bean" match="org.apache.geronimo.console.databasemanager.wizard.DownloadInfo"/>
   </allow>
 </dwr>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp?rev=389296&r1=389295&r2=389296&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp
(original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp
Mon Mar 27 13:50:11 2006
@@ -1,5 +1,49 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<%@ page import="org.apache.geronimo.console.util.PortletManager" %>
+
+<% String dwrForwarderServlet = PortletManager.getConsoleFrameworkServletPath(request)
+ "/../dwr"; %>
+<script type='text/javascript' src='<%= dwrForwarderServlet %>/interface/DownloadMonitor.js'></script>
+<script type='text/javascript' src='<%= dwrForwarderServlet %>/engine.js'></script>
+<script type='text/javascript' src='<%= dwrForwarderServlet %>/util.js'></script>
+
+<script>
+function refreshProgress()
+{
+    DownloadMonitor.getDownloadInfo(updateProgress);
+}
+
+function updateProgress(downloadInfo)
+{
+    if (downloadInfo.downloadStarted) {
+        var kbDownloaded = Math.ceil(downloadInfo.bytesDownloaded / 1024);
+        document.getElementById('progressMeterText').innerHTML = 'Download in progress: '

+              + kbDownloaded
+              + ' Kb downloaded' ;
+        if (downloadInfo.totalBytes > 0) {
+            document.getElementById('progressMeterShell').style.display = 'block';
+            var progressPercent = Math.ceil((downloadInfo.bytesDownloaded / downloadInfo.totalBytes)
* 100);
+            document.getElementById('progressMeterBar').style.width = parseInt(progressPercent
* 3.5) + 'px';
+        } else {
+            // if total bytes are unknown then hide the progress meter since calculating
% complete is not possible
+            document.getElementById('progressMeterShell').style.display = 'none';
+        }
+    }
+    window.setTimeout('refreshProgress()', 1000);
+    return true;
+}
+
+function startProgress()
+{
+    document.getElementById('progressMeter').style.display = 'block';
+    document.getElementById('progressMeterText').innerHTML = 'Download in progress: 0 Kb
downloaded';
+    window.setTimeout("refreshProgress()", 500);
+    document.getElementById('nextButton').disabled=true;
+    document.getElementById('cancelButton').disabled=true;
+    return true;
+}
+</script>
+
 <portlet:defineObjects/>
 
 <p><b>Create Database Pool</b> -- Step 2: Select Driver, JAR, Parameters</p>
@@ -13,7 +57,8 @@
 install the driver by hand (copy it to a directory under geronimo/repository/)</i></p>
 
 <!--   FORM TO COLLECT DATA FOR THIS PAGE   -->
-<form name="<portlet:namespace/>DatabaseForm" action="<portlet:actionURL/>"
method="POST">
+<form name="<portlet:namespace/>DatabaseForm" action="<portlet:actionURL/>"
method="POST"
+onsubmit="startProgress()">
     <input type="hidden" name="mode" value="process-download" />
     <input type="hidden" name="name" value="${pool.name}" />
     <input type="hidden" name="dbtype" value="${pool.dbtype}" />
@@ -57,12 +102,23 @@
       <tr>
         <td></td>
         <td>
-          <input type="submit" value="Next" />
-          <input type="button" value="Cancel" onclick="document.<portlet:namespace/>DatabaseForm.mode.value='params';document.<portlet:namespace/>DatabaseForm.submit();return
false;" />
+          <input type="submit" value="Next" id="nextButton"/>
+          <input id="cancelButton" type="button" value="Cancel" onclick="document.<portlet:namespace/>DatabaseForm.mode.value='params';document.<portlet:namespace/>DatabaseForm.submit();return
false;" />
         </td>
       </tr>
     </table>
+    <div id="progressMeter" style="display: none; padding-top: 5px;">
+        <br/>
+        <div>
+            <div id="progressMeterText"></div>
+            <div id="progressMeterShell" style="display: none; width: 350px; height: 20px;
border: 1px inset; background: #eee; text-align: center;">
+                <div id="progressMeterBar" style="width: 0; height: 20px; border-right:
1px solid #444; background: #9ACB34; text-align: center;"></div>
+            </div>
+        </div>
+    </div>
 </form>
+
+
 <!--   END OF FORM TO COLLECT DATA FOR THIS PAGE   -->
 
 <%--
@@ -92,4 +148,4 @@
   <li><a href="http://www.pointbase.com/products/downloads/">Pointbase</a></li>
   <li><a href="http://www.progress.com/esd/index.ssp">Progress</a></li>
   <li><a href="http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/jdbc.mspx">Microsoft
SQL Server</a></li>
-</ul>
\ No newline at end of file
+</ul>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/infomanager/svrInfoNormal.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/infomanager/svrInfoNormal.jsp?rev=389296&r1=389295&r2=389296&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/infomanager/svrInfoNormal.jsp
(original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/infomanager/svrInfoNormal.jsp
Mon Mar 27 13:50:11 2006
@@ -1,9 +1,12 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<%@ page import="org.apache.geronimo.console.util.PortletManager" %>
+
+<% String dwrForwarderServlet = PortletManager.getConsoleFrameworkServletPath(request)
+ "/../dwr"; %>
+<script type='text/javascript' src='<%= dwrForwarderServlet %>/interface/Jsr77Stats.js'></script>
+<script type='text/javascript' src='<%= dwrForwarderServlet %>/engine.js'></script>
+<script type='text/javascript' src='<%= dwrForwarderServlet %>/util.js'></script>
 
-<script type='text/javascript' src='/console-standard/dwr/interface/Jsr77Stats.js'></script>
-<script type='text/javascript' src='/console-standard/dwr/engine.js'></script>
-<script type='text/javascript' src='/console-standard/dwr/util.js'></script>
 
 <portlet:defineObjects/>
 

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=389296&r1=389295&r2=389296&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 Mon Mar 27 13:50:11
2006
@@ -967,6 +967,27 @@
         <servlet-name>RunSQL</servlet-name>
         <url-pattern>/RunSQL/*</url-pattern>
     </servlet-mapping>
+    
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name></web-resource-name>
+            <url-pattern>/</url-pattern>
+            <http-method>GET</http-method>
+            <http-method>POST</http-method>
+            <http-method>PUT</http-method>
+        </web-resource-collection>
+        <auth-constraint>
+            <role-name>admin</role-name>
+        </auth-constraint>
+    </security-constraint>
+    <login-config>
+        <auth-method>BASIC</auth-method>
+        <realm-name>geronimo-properties-realm</realm-name>
+    </login-config>
+    <security-role>
+        <role-name>admin</role-name>
+    </security-role>
+    
     <servlet-mapping>
         <servlet-name>ImportExport</servlet-name>
         <url-pattern>/ImportExport/*</url-pattern>
@@ -1012,5 +1033,23 @@
         <res-type>javax.sql.DataSource</res-type>
         <res-auth>Container</res-auth>
     </resource-ref> -->
+
+    <!-- 
+    For security reasons requests to the dwr servlet go through
+    the "console" web-app context. The purpose of dwr-filter is
+    to map the attributes such as pathInfo, requestURI, etc. of
+    the original request into the request that is delivered to
+    the dwr-invoker servlet.  The dwr-invoker servlet uses those
+    attributes to create URLs that it sends back to the client.
+     -->    
+    <filter>
+        <filter-name>dwr-filter</filter-name>
+        <filter-class>org.apache.geronimo.console.servlet.ForwardDispatchFilter</filter-class>
+    </filter>
+    <filter-mapping>
+        <filter-name>dwr-filter</filter-name>
+        <servlet-name>dwr-invoker</servlet-name>
+        <dispatcher>FORWARD</dispatcher>
+    </filter-mapping>
 
 </web-app>

Modified: geronimo/trunk/configs/console-jetty/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/configs/console-jetty/src/plan/plan.xml?rev=389296&r1=389295&r2=389296&view=diff
==============================================================================
--- geronimo/trunk/configs/console-jetty/src/plan/plan.xml (original)
+++ geronimo/trunk/configs/console-jetty/src/plan/plan.xml Mon Mar 27 13:50:11 2006
@@ -29,18 +29,6 @@
             <context-root>/console</context-root>
             <context-priority-classloader>false</context-priority-classloader>
             <security-realm-name>geronimo-properties-realm</security-realm-name>
-            <security>
-                <default-principal realm-name="geronimo-properties-realm">
-                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"
name="system"/>
-                </default-principal>
-                <role-mappings>
-                    <role role-name="admin">
-                        <realm realm-name="geronimo-properties-realm">
-                            <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"
name="admin" designated-run-as="true"/>
-                        </realm>
-                    </role>
-                </role-mappings>
-            </security>
         </web-app>
     </module>
 
@@ -49,8 +37,22 @@
         <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0" configId="console-standard">
             <context-root>/console-standard</context-root>
             <context-priority-classloader>false</context-priority-classloader>
+            <security-realm-name>geronimo-properties-realm</security-realm-name>
         </web-app>
     </module>
+
+    <security>
+        <default-principal realm-name="geronimo-properties-realm">
+            <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"
name="system"/>
+        </default-principal>
+        <role-mappings>
+            <role role-name="admin">
+                <realm realm-name="geronimo-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"
name="admin" designated-run-as="true"/>
+                </realm>
+            </role>
+        </role-mappings>
+    </security>
 
     <!-- Console specific server info -->
     <gbean name="PropertiesLoginManager" class="org.apache.geronimo.console.core.security.PropertiesLoginModuleManager">

Modified: geronimo/trunk/configs/console-tomcat/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/configs/console-tomcat/src/plan/plan.xml?rev=389296&r1=389295&r2=389296&view=diff
==============================================================================
--- geronimo/trunk/configs/console-tomcat/src/plan/plan.xml (original)
+++ geronimo/trunk/configs/console-tomcat/src/plan/plan.xml Mon Mar 27 13:50:11 2006
@@ -30,18 +30,6 @@
             <context-priority-classloader>false</context-priority-classloader>
             <cross-context/>
             <security-realm-name>geronimo-properties-realm</security-realm-name>
-            <security>
-                <default-principal realm-name="geronimo-properties-realm">
-                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"
name="system"/>
-                </default-principal>
-                <role-mappings>
-                    <role role-name="admin">
-                        <realm realm-name="geronimo-properties-realm">
-                            <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"
name="admin" designated-run-as="true"/>
-                        </realm>
-                    </role>
-                </role-mappings>
-            </security>
         </web-app>
     </module>
 
@@ -51,9 +39,27 @@
             <context-root>/console-standard</context-root>
             <context-priority-classloader>false</context-priority-classloader>
             <cross-context/>
+            <security-realm-name>geronimo-properties-realm</security-realm-name>
         </web-app>
     </module>
 
+    <security>
+    	<default-principal realm-name="geronimo-properties-realm">
+    		<principal
+    			class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"
+    			name="system" />
+    	</default-principal>
+    	<role-mappings>
+    		<role role-name="admin">
+    			<realm realm-name="geronimo-properties-realm">
+    				<principal
+    					class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"
+    					name="admin" designated-run-as="true" />
+    			</realm>
+    		</role>
+    	</role-mappings>
+    </security>
+
     <!-- Console specific server info -->
     <gbean name="PropertiesLoginManager" class="org.apache.geronimo.console.core.security.PropertiesLoginModuleManager">
         <reference name="ServerInfo">
@@ -84,4 +90,4 @@
         </reference>
     </gbean>
 
-</application>
+</application>
\ No newline at end of file



Mime
View raw message