continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r447199 - in /maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum: ./ core/action/
Date Mon, 18 Sep 2006 02:45:43 GMT
Author: carlos
Date: Sun Sep 17 19:45:43 2006
New Revision: 447199

URL: http://svn.apache.org/viewvc?view=rev&rev=447199
Log:
Return added/updated object for notifiers and build definitions

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/core/action/AbstractBuildDefinitionContinuumAction.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.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=447199&r1=447198&r2=447199
==============================================================================
--- 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
Sun Sep 17 19:45:43 2006
@@ -1118,7 +1118,7 @@
         return notifier;
     }
 
-    public void updateNotifier( int projectId, ProjectNotifier notifier )
+    public ProjectNotifier updateNotifier( int projectId, ProjectNotifier notifier )
         throws ContinuumException
     {
         Project project = getProjectWithAllDetails( projectId );
@@ -1130,10 +1130,10 @@
 
         updateProject( project );
 
-        addNotifier( projectId, notifier );
+        return addNotifier( projectId, notifier );
     }
 
-    public void updateNotifier( int projectId, int notifierId, Map configuration )
+    public ProjectNotifier updateNotifier( int projectId, int notifierId, Map configuration
)
         throws ContinuumException
     {
         Project project = getProjectWithAllDetails( projectId );
@@ -1147,7 +1147,7 @@
 
         updateProject( project );
 
-        addNotifier( projectId, notifierType, configuration );
+        return addNotifier( projectId, notifierType, configuration );
     }
 
     private Properties createNotifierProperties( Map configuration )
@@ -1177,7 +1177,7 @@
         return notifierProperties;
     }
 
-    public void addNotifier( int projectId, ProjectNotifier notifier )
+    public ProjectNotifier addNotifier( int projectId, ProjectNotifier notifier )
         throws ContinuumException
     {
         ProjectNotifier notif = new ProjectNotifier();
@@ -1201,9 +1201,11 @@
         project.addNotifier( notif );
 
         updateProject( project );
+
+        return notif;
     }
 
-    public void addNotifier( int projectId, String notifierType, Map configuration )
+    public ProjectNotifier addNotifier( int projectId, String notifierType, Map configuration
)
         throws ContinuumException
     {
         ProjectNotifier notifier = new ProjectNotifier();
@@ -1234,7 +1236,7 @@
 
         notifier.setConfiguration( notifierProperties );
 
-        addNotifier( projectId, notifier );
+        return addNotifier( projectId, notifier );
     }
 
     public void removeNotifier( int projectId, int notifierId )
@@ -1346,7 +1348,7 @@
         return projectGroup.getBuildDefinitions();
     }
 
-    public void addBuildDefinitionToProject( int projectId, BuildDefinition buildDefinition
)
+    public BuildDefinition addBuildDefinitionToProject( int projectId, BuildDefinition buildDefinition
)
         throws ContinuumException
     {
         HashMap context = new HashMap();
@@ -1355,6 +1357,8 @@
         context.put( AbstractContinuumAction.KEY_PROJECT_ID, new Integer( projectId ) );
 
         executeAction( "add-build-definition-to-project", context );
+
+        return (BuildDefinition) context.get( AbstractContinuumAction.KEY_BUILD_DEFINITION
);
     }
 
     public void removeBuildDefinitionFromProject( int projectId, int buildDefinitionId )
@@ -1368,7 +1372,7 @@
         executeAction( "remove-build-definition-from-project", context );
     }
 
-    public void updateBuildDefinitionForProject( int projectId, BuildDefinition buildDefinition
)
+    public BuildDefinition updateBuildDefinitionForProject( int projectId, BuildDefinition
buildDefinition )
         throws ContinuumException
     {
         HashMap context = new HashMap();
@@ -1377,9 +1381,11 @@
         context.put( AbstractContinuumAction.KEY_PROJECT_ID, new Integer( projectId ) );
 
         executeAction( "update-build-definition-from-project", context );
+
+        return (BuildDefinition) context.get( AbstractContinuumAction.KEY_BUILD_DEFINITION
);
     }
 
-    public void addBuildDefinitionToProjectGroup( int projectGroupId, BuildDefinition buildDefinition
)
+    public BuildDefinition addBuildDefinitionToProjectGroup( int projectGroupId, BuildDefinition
buildDefinition )
         throws ContinuumException
     {
         HashMap context = new HashMap();
@@ -1388,6 +1394,8 @@
         context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, new Integer( projectGroupId
) );
 
         executeAction( "add-build-definition-to-project-group", context );
+
+        return (BuildDefinition) context.get( AbstractContinuumAction.KEY_BUILD_DEFINITION
);
     }
 
     public void removeBuildDefinitionFromProjectGroup( int projectGroupId, int buildDefinitionId
)
@@ -1401,7 +1409,7 @@
         executeAction( "remove-build-definition-from-project-group", context );
     }
 
-    public void updateBuildDefinitionForProjectGroup( int projectGroupId, BuildDefinition
buildDefinition )
+    public BuildDefinition updateBuildDefinitionForProjectGroup( int projectGroupId, BuildDefinition
buildDefinition )
         throws ContinuumException
     {
         HashMap context = new HashMap();
@@ -1410,6 +1418,8 @@
         context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, new Integer( projectGroupId
) );
 
         executeAction( "update-build-definition-from-project-group", context );
+
+        return (BuildDefinition) context.get( AbstractContinuumAction.KEY_BUILD_DEFINITION
);
     }
 
     public void removeBuildDefinition( int projectId, int buildDefinitionId )

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java?view=diff&rev=447199&r1=447198&r2=447199
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
Sun Sep 17 19:45:43 2006
@@ -1,17 +1,5 @@
 package org.apache.maven.continuum.core.action;
 
-import org.apache.maven.continuum.ContinuumException;
-import org.apache.maven.continuum.initialization.DefaultContinuumInitializer;
-import org.apache.maven.continuum.model.project.BuildDefinition;
-import org.apache.maven.continuum.model.project.ProjectGroup;
-import org.apache.maven.continuum.model.project.Schedule;
-import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.store.ContinuumStore;
-import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
-
-import java.util.Iterator;
-import java.util.List;
 /*
  * Copyright 2005 The Apache Software Foundation.
  *
@@ -28,11 +16,24 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.initialization.DefaultContinuumInitializer;
+import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.apache.maven.continuum.model.project.Schedule;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.store.ContinuumStore;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
+
+import java.util.Iterator;
+import java.util.List;
+
 /**
  * AbstractBuildDefinitionContinuumAction:
  *
- * @author: Jesse McConnell <jmcconnell@apache.org>
- * @version: $Id$
+ * @author Jesse McConnell <jmcconnell@apache.org>
+ * @version $Id$
  */
 public abstract class AbstractBuildDefinitionContinuumAction
     extends AbstractContinuumAction
@@ -127,7 +128,7 @@
      * @param buildDefinition
      * @throws ContinuumException
      */
-    protected void updateBuildDefinitionInList( List buildDefinitions, BuildDefinition buildDefinition
)
+    protected BuildDefinition updateBuildDefinitionInList( List buildDefinitions, BuildDefinition
buildDefinition )
         throws ContinuumException
     {
         try
@@ -173,6 +174,8 @@
                 storedDefinition.setSchedule( schedule );
 
                 store.storeBuildDefinition( storedDefinition );
+
+                return storedDefinition;
             }
             else
             {

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java?view=diff&rev=447199&r1=447198&r2=447199
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
Sun Sep 17 19:45:43 2006
@@ -1,11 +1,7 @@
 package org.apache.maven.continuum.core.action;
 
-import org.apache.maven.continuum.model.project.BuildDefinition;
-import org.apache.maven.continuum.model.project.Project;
-
-import java.util.Map;
 /*
- * Copyright 2005 The Apache Software Foundation.
+ * Copyright 2005-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,11 +16,16 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.project.Project;
+
+import java.util.Map;
+
 /**
  * AddBuildDefinitionToProjectAction:
  *
- * @author: Jesse McConnell <jmcconnell@apache.org>
- * @version: $Id$
+ * @author Jesse McConnell <jmcconnell@apache.org>
+ * @version $Id$
  *
  * @plexus.component
  *   role="org.codehaus.plexus.action.Action"
@@ -33,12 +34,12 @@
 public class AddBuildDefinitionToProjectAction
     extends AbstractBuildDefinitionContinuumAction
 {
-    
+
     public void execute( Map map )
         throws Exception
     {
         BuildDefinition buildDefinition = getBuildDefinition( map );
-        int projectId =  getProjectId( map );
+        int projectId = getProjectId( map );
 
         Project project = store.getProjectWithAllDetails( projectId );
 
@@ -47,5 +48,7 @@
         project.addBuildDefinition( buildDefinition );
 
         store.updateProject( project );
+
+        map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
     }
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java?view=diff&rev=447199&r1=447198&r2=447199
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java
Sun Sep 17 19:45:43 2006
@@ -1,11 +1,7 @@
 package org.apache.maven.continuum.core.action;
 
-import org.apache.maven.continuum.model.project.BuildDefinition;
-import org.apache.maven.continuum.model.project.ProjectGroup;
-
-import java.util.Map;
 /*
- * Copyright 2005 The Apache Software Foundation.
+ * Copyright 2005-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,11 +16,16 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.project.ProjectGroup;
+
+import java.util.Map;
+
 /**
  * AddBuildDefinitionToProjectAction:
  *
- * @author: Jesse McConnell <jmcconnell@apache.org>
- * @version: $Id$
+ * @author Jesse McConnell <jmcconnell@apache.org>
+ * @version $Id$
  *
  * @plexus.component
  *   role="org.codehaus.plexus.action.Action"
@@ -47,5 +48,7 @@
         projectGroup.addBuildDefinition( buildDefinition );
 
         store.updateProjectGroup( projectGroup );
+
+        map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
     }
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java?view=diff&rev=447199&r1=447198&r2=447199
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java
Sun Sep 17 19:45:43 2006
@@ -1,9 +1,5 @@
 package org.apache.maven.continuum.core.action;
 
-import org.apache.maven.continuum.model.project.BuildDefinition;
-import org.apache.maven.continuum.model.project.Project;
-
-import java.util.Map;
 /*
  * Copyright 2005 The Apache Software Foundation.
  *
@@ -20,11 +16,16 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.project.Project;
+
+import java.util.Map;
+
 /**
  * AddBuildDefinitionToProjectAction:
  *
- * @author: Jesse McConnell <jmcconnell@apache.org>
- * @version: $Id$
+ * @author Jesse McConnell <jmcconnell@apache.org>
+ * @version $Id$
  * @plexus.component role="org.codehaus.plexus.action.Action"
  * role-hint="update-build-definition-from-project"
  */
@@ -41,8 +42,10 @@
         Project project = store.getProjectWithAllDetails( projectId );
 
         resolveDefaultBuildDefinitionsForProject( buildDefinition, project );
-        
+
         updateBuildDefinitionInList( project.getBuildDefinitions(), buildDefinition );
+
+        map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
     }
 
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java?view=diff&rev=447199&r1=447198&r2=447199
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java
Sun Sep 17 19:45:43 2006
@@ -1,11 +1,7 @@
 package org.apache.maven.continuum.core.action;
 
-import org.apache.maven.continuum.model.project.BuildDefinition;
-import org.apache.maven.continuum.model.project.ProjectGroup;
-
-import java.util.Map;
 /*
- * Copyright 2005 The Apache Software Foundation.
+ * Copyright 2005-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,11 +16,16 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.project.ProjectGroup;
+
+import java.util.Map;
+
 /**
  * AddBuildDefinitionToProjectAction:
  *
- * @author: Jesse McConnell <jmcconnell@apache.org>
- * @version: $Id$
+ * @author Jesse McConnell <jmcconnell@apache.org>
+ * @version $Id$
  *
  * @plexus.component
  *   role="org.codehaus.plexus.action.Action"
@@ -38,12 +39,14 @@
         throws Exception
     {
         BuildDefinition buildDefinition = getBuildDefinition( map );
-        int projectGroupId =  getProjectGroupId( map );
+        int projectGroupId = getProjectGroupId( map );
 
         ProjectGroup projectGroup = store.getProjectGroupWithBuildDetails( projectGroupId
);
 
         resolveDefaultBuildDefinitionsForProjectGroup( buildDefinition, projectGroup );
 
         updateBuildDefinitionInList( projectGroup.getBuildDefinitions(), buildDefinition
);
+
+        map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
     }
 }



Mime
View raw message