continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wsm...@apache.org
Subject svn commit: r690438 - /continuum/branches/continuum-1.2.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
Date Sat, 30 Aug 2008 01:42:30 GMT
Author: wsmoak
Date: Fri Aug 29 18:42:29 2008
New Revision: 690438

URL: http://svn.apache.org/viewvc?rev=690438&view=rev
Log:
fix commit -r678249 (getting the root project in the group for the project website - CONTINUUM-801)
merged r690191 from trunk

Modified:
    continuum/branches/continuum-1.2.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java

Modified: continuum/branches/continuum-1.2.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?rev=690438&r1=690437&r2=690438&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
(original)
+++ continuum/branches/continuum-1.2.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
Fri Aug 29 18:42:29 2008
@@ -38,6 +38,7 @@
 import org.codehaus.plexus.redback.role.RoleManagerException;
 import org.codehaus.plexus.redback.users.User;
 import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.dag.CycleDetectedException;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -158,18 +159,35 @@
         }
 
         if ( projectGroup != null )
-        {
+        {        	
             if ( projectGroup.getProjects() != null && projectGroup.getProjects().size()
> 0 )
             {
                 int nbMaven2Projects = 0;
                 int nbMaven1Projects = 0;
                 int nbAntProjects = 0;
                 int nbShellProjects = 0;
+                
+                // get the projects according to build order (first project in the group
is the root project)            
+                try
+                {                	
+                	Project rootProject =
+                            ( getContinuum().getProjectsInBuildOrder( getContinuum().getProjectsInGroupWithDependencies(
+                                projectGroupId ) ) ).get( 0 );
+                	if( "maven2".equals( rootProject.getExecutorId() ) || "maven-1".equals(
rootProject.getExecutorId() ) )
+                	{
+                		url = rootProject.getUrl();
+                	}
+                }
+                catch ( CycleDetectedException e ) 
+                {
+                    // ignore. url won't be displayed if null
+                }
+                
                 for ( Object o : projectGroup.getProjects() )
                 {
                     Project p = (Project) o;
                     if ( "maven2".equals( p.getExecutorId() ) )
-                    {
+                    {   
                         nbMaven2Projects += 1;
                     }
                     else if ( "maven-1".equals( p.getExecutorId() ) )
@@ -184,11 +202,6 @@
                     {
                         nbShellProjects += 1;
                     }
-                    
-                    if( p.getId() == 1 )
-                    {
-                    	url = p.getUrl();
-                    }
                 }
 
                 int nbActualPreferredProject = nbMaven2Projects;



Mime
View raw message