continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r442519 - in /maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum: DefaultContinuum.java initialization/DefaultContinuumInitializer.java
Date Tue, 12 Sep 2006 08:28:49 GMT
Author: carlos
Date: Tue Sep 12 01:28:48 2006
New Revision: 442519

URL: http://svn.apache.org/viewvc?view=rev&rev=442519
Log:
Move default group operations from ContinuumStore to Continuum

Modified:
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?view=diff&rev=442519&r1=442518&r2=442519
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Tue Sep 12 01:28:48 2006
@@ -937,14 +937,7 @@
 
         context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
 
-        try
-        {
-            context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT_GROUP, store.getDefaultProjectGroup()
);
-        }
-        catch ( ContinuumStoreException e )
-        {
-            throw new ContinuumException( "Error getting the default project group to work
with" );
-        }
+        context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT_GROUP, getDefaultProjectGroup()
);
 
         executeAction( "validate-project", context );
 
@@ -2558,4 +2551,24 @@
             return "unknown";
         }
     }
+
+    private ProjectGroup getDefaultProjectGroup()
+        throws ContinuumException
+    {
+        try
+        {
+            return store.getProjectGroupByGroupId( Continuum.DEFAULT_PROJECT_GROUP_GROUP_ID
);
+        }
+        catch ( ContinuumObjectNotFoundException e )
+        {
+            throw new ContinuumException(
+                                          "Continuum is not properly initialized, default
project group does not exist",
+                                          e );
+        }
+        catch ( ContinuumStoreException ex )
+        {
+            throw logAndCreateException( "Exception while getting default project group.",
ex );
+        }
+    }
+
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java?view=diff&rev=442519&r1=442518&r2=442519
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
Tue Sep 12 01:28:48 2006
@@ -19,6 +19,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.model.system.ContinuumUser;
@@ -319,7 +320,7 @@
 
         group.setName( "Default Project Group" );
 
-        group.setGroupId( ContinuumStore.DEFAULT_GROUP_ID );
+        group.setGroupId( Continuum.DEFAULT_PROJECT_GROUP_GROUP_ID );
 
         group.setDescription( "Contains all projects that do not have a group of their own"
);
 



Mime
View raw message