continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r574668 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/
Date Tue, 11 Sep 2007 19:10:11 GMT
Author: evenisse
Date: Tue Sep 11 12:10:10 2007
New Revision: 574668

URL: http://svn.apache.org/viewvc?rev=574668&view=rev
Log:
Fix projectgroup summary

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-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=574668&r1=574667&r2=574668&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
Tue Sep 11 12:10:10 2007
@@ -475,6 +475,9 @@
     BuildDefinition getDefaultBuildDefinition( int projectId )
         throws ContinuumException;
 
+    public BuildDefinition getDefaultBuildDefinitionForProjectGroup( int projectGroupId )
+        throws ContinuumException;
+
     BuildDefinition addBuildDefinitionToProject( int projectId, BuildDefinition buildDefinition
)
         throws ContinuumException;
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=574668&r1=574667&r2=574668&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
Tue Sep 11 12:10:10 2007
@@ -844,22 +844,11 @@
         throws ContinuumException
     {
         BuildDefinition groupDefaultBD = null;
-        try
-        {
-            groupDefaultBD = store.getDefaultBuildDefinitionForProjectGroup( projectGroupId
);
-        }
-        catch ( ContinuumObjectNotFoundException e )
-        {
-            throw new ContinuumException( "Project Group (id=" + projectGroupId +
-                " doens't have a default build definition, this should be impossible, it
should always have a default definition set." );
-        }
-        catch ( ContinuumStoreException e )
-        {
-            throw new ContinuumException( "Project Group (id=" + projectGroupId +
-                " doens't have a default build definition, this should be impossible, it
should always have a default definition set." );
-        }
+
+        groupDefaultBD = getDefaultBuildDefinitionForProjectGroup( projectGroupId );
 
         int buildDefinitionId = -1;
+
         if ( groupDefaultBD != null )
         {
             buildDefinitionId = groupDefaultBD.getId();
@@ -1987,9 +1976,26 @@
         catch ( ContinuumStoreException cse )
         {
             throw new ContinuumException(
-                "error attempting to access default build definition for project + " + projectId,
cse );
+                "error attempting to access default build definition for project " + projectId,
cse );
         }
+    }
 
+    public BuildDefinition getDefaultBuildDefinitionForProjectGroup( int projectGroupId )
+        throws ContinuumException
+    {
+        try
+        {
+            return store.getDefaultBuildDefinitionForProjectGroup( projectGroupId );
+        }
+        catch ( ContinuumObjectNotFoundException cne )
+        {
+            throw new ContinuumException( "no default build definition for project group",
cne );
+        }
+        catch ( ContinuumStoreException cse )
+        {
+            throw new ContinuumException(
+                "error attempting to access default build definition for project group "
+ projectGroupId, cse );
+        }
     }
 
     public BuildDefinition getBuildDefinition( int buildDefinitionId )

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?rev=574668&r1=574667&r2=574668&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
Tue Sep 11 12:10:10 2007
@@ -111,9 +111,9 @@
     private Collection groupProjects;
 
     private int releaseProjectId;
-    
+
     private Map<String, Integer> buildDefinitions;
-    
+
     private int buildDefinitionId;
 
     public String summary()
@@ -128,12 +128,12 @@
             addActionError( authzE.getMessage() );
             return REQUIRES_AUTHORIZATION;
         }
-        
+
         projectGroup = getProjectGroup( projectGroupId );
 
         List<BuildDefinition> projectGroupBuildDefs = getContinuum().getBuildDefinitionsForProjectGroup(
projectGroupId );
-        int defaultBuildDefinitionId = getContinuum().getDefaultBuildDefinition( projectGroupId
).getId();
-        
+        int defaultBuildDefinitionId = getContinuum().getDefaultBuildDefinitionForProjectGroup(
projectGroupId ).getId();
+
         if (projectGroupBuildDefs != null)
         {
             this.buildDefinitions = new LinkedHashMap<String, Integer>(projectGroupBuildDefs.size());
@@ -152,7 +152,7 @@
         {
             this.buildDefinitions = Collections.EMPTY_MAP;
         }
-        
+
         return SUCCESS;
     }
 



Mime
View raw message