continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r571512 - in /maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action: ProjectViewAction.java component/BuildDefinitionSummaryAction.java
Date Fri, 31 Aug 2007 16:32:36 GMT
Author: evenisse
Date: Fri Aug 31 09:32:35 2007
New Revision: 571512

URL: http://svn.apache.org/viewvc?rev=571512&view=rev
Log:
[CONTINUUM-1041] Fix build definition summary when the project and the group have both a default
build definition. Now only the project one is printed as default

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java?rev=571512&r1=571511&r2=571512&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java
Fri Aug 31 09:32:35 2007
@@ -45,16 +45,16 @@
     public String execute()
         throws ContinuumException
     {
+        projectGroup = getProjectGroup();
+
         try
         {
-            checkViewProjectGroupAuthorization( getProjectGroup().getName() );
+            checkViewProjectGroupAuthorization( projectGroup.getName() );
         }
         catch ( AuthorizationRequiredException e )
         {
             return REQUIRES_AUTHORIZATION;
         }
-
-        projectGroup = getProjectGroup();
 
         project = getContinuum().getProjectWithAllDetails( projectId );
         return SUCCESS;

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java?rev=571512&r1=571511&r2=571512&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
Fri Aug 31 09:32:35 2007
@@ -49,11 +49,13 @@
 
     private ProjectGroup projectGroup;
 
-    private List projectBuildDefinitionSummaries = new ArrayList();
+    private List<BuildDefinitionSummary> projectBuildDefinitionSummaries = new ArrayList<BuildDefinitionSummary>();
 
-    private List groupBuildDefinitionSummaries = new ArrayList();
+    private List<BuildDefinitionSummary> groupBuildDefinitionSummaries = new ArrayList<BuildDefinitionSummary>();
 
-    private List allBuildDefinitionSummaries = new ArrayList();
+    private List<BuildDefinitionSummary> allBuildDefinitionSummaries = new ArrayList<BuildDefinitionSummary>();
+
+    private boolean containsDefaultBDForProject = false;
 
     //profileName
 
@@ -70,6 +72,8 @@
             groupBuildDefinitionSummaries = gatherGroupBuildDefinitionSummaries( projectGroupId
);
             projectBuildDefinitionSummaries = gatherProjectBuildDefinitionSummaries( projectId
);
 
+            fixDefaultBuildDefinitions();
+
             allBuildDefinitionSummaries.addAll( groupBuildDefinitionSummaries );
             allBuildDefinitionSummaries.addAll( projectBuildDefinitionSummaries );
         }
@@ -121,10 +125,26 @@
         return SUCCESS;
     }
 
-    private List gatherProjectBuildDefinitionSummaries( int projectId )
+    private void fixDefaultBuildDefinitions()
+    {
+        for ( BuildDefinitionSummary bds : projectBuildDefinitionSummaries )
+        {
+            if ( bds.isIsDefault() )
+            {
+                containsDefaultBDForProject = true;
+            }
+        }
+
+        for ( BuildDefinitionSummary bds : groupBuildDefinitionSummaries )
+        {
+            bds.setIsDefault( false );
+        }
+    }
+
+    private List<BuildDefinitionSummary> gatherProjectBuildDefinitionSummaries( int
projectId )
         throws ContinuumException
     {
-        List summaryList = new ArrayList();
+        List<BuildDefinitionSummary> summaryList = new ArrayList<BuildDefinitionSummary>();
 
         Project project = getContinuum().getProjectWithAllDetails( projectId );
         for ( Iterator i = project.getBuildDefinitions().iterator(); i.hasNext(); )
@@ -140,10 +160,10 @@
         return summaryList;
     }
 
-    private List gatherGroupBuildDefinitionSummaries( int projectGroupId )
+    private List<BuildDefinitionSummary> gatherGroupBuildDefinitionSummaries( int projectGroupId
)
         throws ContinuumException
     {
-        List summaryList = new ArrayList();
+        List<BuildDefinitionSummary> summaryList = new ArrayList<BuildDefinitionSummary>();
 
         projectGroup = getContinuum().getProjectGroupWithBuildDetails( projectGroupId );
 
@@ -213,27 +233,27 @@
         return projectBuildDefinitionSummaries;
     }
 
-    public void setProjectBuildDefinitionSummaries( List projectBuildDefinitionSummaries
)
+    public void setProjectBuildDefinitionSummaries( List<BuildDefinitionSummary> projectBuildDefinitionSummaries
)
     {
         this.projectBuildDefinitionSummaries = projectBuildDefinitionSummaries;
     }
 
-    public List getGroupBuildDefinitionSummaries()
+    public List<BuildDefinitionSummary> getGroupBuildDefinitionSummaries()
     {
         return groupBuildDefinitionSummaries;
     }
 
-    public void setGroupBuildDefinitionSummaries( List groupBuildDefinitionSummaries )
+    public void setGroupBuildDefinitionSummaries( List<BuildDefinitionSummary> groupBuildDefinitionSummaries
)
     {
         this.groupBuildDefinitionSummaries = groupBuildDefinitionSummaries;
     }
 
-    public List getAllBuildDefinitionSummaries()
+    public List<BuildDefinitionSummary> getAllBuildDefinitionSummaries()
     {
         return allBuildDefinitionSummaries;
     }
 
-    public void setAllBuildDefinitionSummaries( List allBuildDefinitionSummaries )
+    public void setAllBuildDefinitionSummaries( List<BuildDefinitionSummary> allBuildDefinitionSummaries
)
     {
         this.allBuildDefinitionSummaries = allBuildDefinitionSummaries;
     }



Mime
View raw message