continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r384875 - in /maven/continuum/branches/continuum-1.0.x/continuum-web/src/main: java/org/apache/maven/continuum/web/tool/RequestUtil.java resources/META-INF/plexus/components.xml resources/templates/screens/ProjectBuild.vm
Date Fri, 10 Mar 2006 17:54:49 GMT
Author: evenisse
Date: Fri Mar 10 09:54:48 2006
New Revision: 384875

URL: http://svn.apache.org/viewcvs?rev=384875&view=rev
Log:
[CONTINUUM-469] Allow build output to be downloaded as text

Added:
    maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/RequestUtil.java
  (with props)
Modified:
    maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm

Added: maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/RequestUtil.java
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/RequestUtil.java?rev=384875&view=auto
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/RequestUtil.java
(added)
+++ maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/RequestUtil.java
Fri Mar 10 09:54:48 2006
@@ -0,0 +1,57 @@
+package org.apache.maven.continuum.web.tool;
+
+import org.codehaus.plexus.summit.pull.RequestTool;
+import org.codehaus.plexus.summit.rundata.RunData;
+
+import javax.servlet.http.HttpServletRequest;
+
+/*
+ * Copyright 2004-2006 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.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class RequestUtil
+    implements RequestTool
+{
+    private RunData data;
+
+    public String getParameter( String paramName )
+    {
+        return getRequest().getParameter( paramName );
+    }
+
+    public HttpServletRequest getRequest()
+    {
+        return data.getRequest();
+    }
+
+    public String getContextPath()
+    {
+        return data.getContextPath();
+    }
+
+    public void setRunData( RunData data )
+    {
+        this.data = data;
+    }
+
+    public void refresh()
+    {
+        // empty
+    }
+}

Propchange: maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/RequestUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/RequestUtil.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/resources/META-INF/plexus/components.xml?rev=384875&r1=384874&r2=384875&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/resources/META-INF/plexus/components.xml
Fri Mar 10 09:54:48 2006
@@ -63,6 +63,13 @@
         </requirement>
       </requirements>
     </component>
+
+    <component>
+      <role>requestUtil</role>
+      <implementation>org.apache.maven.continuum.web.tool.RequestUtil</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+    </component>
+
     <!--
     |
     | Customized PullTools Service
@@ -74,6 +81,11 @@
       <implementation>org.codehaus.plexus.summit.pull.DefaultPullService</implementation>
       <configuration>
         <tools>
+          <tool>
+            <name>requestUtil</name>
+            <role>requestUtil</role>
+            <scope>request</scope>
+          </tool>
           <tool>
             <name>link</name>
             <role>linktool</role>

Modified: maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm?rev=384875&r1=384874&r2=384875&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
Fri Mar 10 09:54:48 2006
@@ -117,6 +117,8 @@
   <h3>Output</h3>
   <div class="axial">
   #if ( $output && $output != "" )
+    <a href="$requestUtil.getContextPath()/servlet/browse?file=$requestUtil.getParameter('id')/${requestUtil.getParameter('buildId')}.log.txt">Download
as text</a>
+    <br><br>
     <div style="width:100%; height:500px; overflow:auto; border-style: solid; border-width:
1px">
       <code><pre>$output</pre></code>
     </div>



Mime
View raw message