continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r344149 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ continuum-web/src/main/re...
Date Mon, 14 Nov 2005 16:06:04 GMT
Author: evenisse
Date: Mon Nov 14 08:05:48 2005
New Revision: 344149

URL: http://svn.apache.org/viewcvs?rev=344149&view=rev
Log:
[CONTINUUM-444] link build number to last success build on front page and state icon to last
build

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=344149&r1=344148&r2=344149&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
Mon Nov 14 08:05:48 2005
@@ -105,6 +105,9 @@
     BuildResult getBuildResult( int buildId )
         throws ContinuumException;
 
+    BuildResult getBuildResultByBuildNumber( int projectId, int buildNumber )
+        throws ContinuumException;
+
     String getBuildOutput( int projectId, int buildId )
         throws ContinuumException;
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=344149&r1=344148&r2=344149&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Mon Nov 14 08:05:48 2005
@@ -155,6 +155,39 @@
         }
     }
 
+    public BuildResult getBuildResultByBuildNumber( int projectId, int buildNumber )
+        throws ContinuumException
+    {
+        //TODO : Get build result with a store request
+
+        List buildResults;
+
+        try
+        {
+            buildResults = new ArrayList( store.getProjectWithBuilds( projectId ).getBuildResults()
);
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw logAndCreateException( "Exception while getting build results for project.",
e );
+        }
+
+        Collections.reverse( buildResults );
+
+        Iterator buildResultsIterator = buildResults.iterator();
+
+        for ( Iterator i = buildResults.iterator(); i.hasNext(); )
+        {
+            BuildResult br = (BuildResult) i.next();
+
+            if ( br.getBuildNumber() == buildNumber )
+            {
+                return br;
+            }
+        }
+
+        return null;
+    }
+
     // ----------------------------------------------------------------------
     // Queues
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java?rev=344149&r1=344148&r2=344149&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java
(original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java
Mon Nov 14 08:05:48 2005
@@ -51,15 +51,15 @@
         }
         else if ( state == ContinuumProjectState.OK )
         {
-            return "<img src=\"/continuum/images/icon_success_sml.gif\" alt=\"Success\"/>";
+            return "<img src=\"/continuum/images/icon_success_sml.gif\" alt=\"Success\"
title=\"Success\" border=\"0\" />";
         }
         else if ( state == ContinuumProjectState.FAILED )
         {
-            return "<img src=\"/continuum/images/icon_warning_sml.gif\" alt=\"Failed\"/>";
+            return "<img src=\"/continuum/images/icon_warning_sml.gif\" alt=\"Failed\"
title=\"Failed\" border=\"0\" />";
         }
         else if ( state == ContinuumProjectState.ERROR )
         {
-            return "<img src=\"/continuum/images/icon_error_sml.gif\" alt=\"Error\"/>";
+            return "<img src=\"/continuum/images/icon_error_sml.gif\" alt=\"Error\" title=\"Error\"
border=\"0\" />";
         }
         else if ( state == ContinuumProjectState.BUILDING )
         {

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm?rev=344149&r1=344148&r2=344149&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm Mon
Nov 14 08:05:48 2005
@@ -48,7 +48,13 @@
       <tr class="$css.nextClass">
         <td>
           #if ( $item.state == 1 || $item.state == 2 || $item.state == 3 || $item.state ==
4 )
-            $state.generate( $item )
+            #set ( $latestBuild = $continuum.getLatestBuildResultForProject( $item.id ) )
+            #set ( $generatedState = $state.generate( $item ) )
+            #if ( $latestBuild && $generatedState != "New" )
+              <a href="$link.setPage('ProjectBuild.vm').addQueryData('view','ProjectBuild').addQueryData('buildId',$latestBuild.id).addQueryData('id',$item.id)">$generatedState</a></td>
+            #else
+              $generatedState
+            #end
           #else
             &nbsp;
           #end
@@ -59,7 +65,12 @@
           #if ( $continuum.isInBuildingQueue( $item.id ) )
             <b>In&nbsp;queue</b>
           #elseif ( $item.state == 1 || $item.state == 2 || $item.state == 3 || $item.state
== 4 )
-            $item.buildNumber
+            #if ( $item.buildNumber != 0 )
+              #set ( $build = $continuum.getBuildResultByBuildNumber( $item.id, $item.buildNumber
) )
+              <a href="$link.setPage('ProjectBuild.vm').addQueryData('view','ProjectBuild').addQueryData('buildId',$build.id).addQueryData('id',$item.id)">$item.buildNumber</a>
+            #else
+              $item.buildNumber
+            #end
           #else
             <b>In&nbsp;progress</b>
           #end



Mime
View raw message