continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmora...@apache.org
Subject svn commit: r780709 - in /continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache: continuum/web/action/admin/PurgeConfigurationAction.java maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
Date Mon, 01 Jun 2009 16:31:31 GMT
Author: jmorales
Date: Mon Jun  1 16:31:31 2009
New Revision: 780709

URL: http://svn.apache.org/viewvc?rev=780709&view=rev
Log:
[CONTINUUM-2195] [CONTINUUM-2236] .Scheduler is updated when update or add a purgeConfiguration
or buildDefinition with schedule. Also delete schedules that are not associated with a buildDefinition
or purgeConfiguration when execute job process. I have created two groups for jobs whe add
a job to scheduler:
- PurgeConfiguration group.
- BuildDefinitionGroup.

Modified:
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java?rev=780709&r1=780708&r2=780709&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java
Mon Jun  1 16:31:31 2009
@@ -35,15 +35,19 @@
 import org.apache.continuum.purge.PurgeConfigurationService;
 import org.apache.continuum.repository.RepositoryService;
 import org.apache.continuum.taskqueue.manager.TaskQueueManager;
+import org.apache.maven.continuum.build.settings.SchedulesActivationException;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.security.ContinuumRoleConstants;
 import org.apache.maven.continuum.web.action.ContinuumConfirmAction;
+import org.apache.maven.continuum.web.action.ScheduleAction;
 import org.apache.struts2.ServletActionContext;
 import org.codehaus.plexus.redback.rbac.Resource;
 import org.codehaus.redback.integration.interceptor.SecureAction;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.codehaus.redback.integration.interceptor.SecureActionException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @author Maria Catherine Tan
@@ -55,6 +59,8 @@
     extends ContinuumConfirmAction
     implements Preparable, SecureAction
 {
+    private static final Logger logger = LoggerFactory.getLogger( PurgeConfigurationAction.class
);
+
     private static final String PURGE_TYPE_REPOSITORY = "repository";
 
     private static final String PURGE_TYPE_DIRECTORY = "directory";
@@ -117,6 +123,7 @@
      */
     private RepositoryService repositoryService;
 
+    @Override
     public void prepare()
         throws Exception
     {
@@ -153,6 +160,7 @@
         directoryTypes.add( PURGE_DIRECTORY_BUILDOUTPUT );
     }
 
+    @Override
     public String input()
         throws Exception
     {
@@ -258,6 +266,11 @@
             updateDefaultPurgeConfiguration();
         }
 
+        if ( purgeConfig.isEnabled() && purgeConfig.getSchedule() != null )
+        {
+            getContinuum().activePurgeSchedule( purgeConfig.getSchedule() );
+        }
+
         return SUCCESS;
     }
 
@@ -379,11 +392,13 @@
         this.enabled = enabled;
     }
 
+    @Override
     public boolean isConfirmed()
     {
         return this.confirmed;
     }
 
+    @Override
     public void setConfirmed( boolean confirmed )
     {
         this.confirmed = confirmed;

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java?rev=780709&r1=780708&r2=780709&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
Mon Jun  1 16:31:31 2009
@@ -76,6 +76,7 @@
     //  Webwork Methods
     // ------------------------------------------------------- 
 
+    @Override
     public void prepare()
         throws Exception
     {
@@ -90,6 +91,7 @@
         this.setBuildDefinitions( getContinuum().getBuildDefinitionService().getAllTemplates()
);
     }
 
+    @Override
     public String input()
         throws Exception
     {
@@ -217,6 +219,7 @@
     public String saveBuildDefinition()
         throws Exception
     {
+        Schedule schedule = null;
         if ( buildDefinition.getProfile() != null )
         {
             Profile profile = getContinuum().getProfileService().getProfile( buildDefinition.getProfile().getId()
);
@@ -233,7 +236,8 @@
         {
             if ( buildDefinition.getSchedule().getId() > 0 )
             {
-                buildDefinition.setSchedule( getContinuum().getSchedule( buildDefinition.getSchedule().getId()
) );
+                schedule = getContinuum().getSchedule( buildDefinition.getSchedule().getId()
);
+                buildDefinition.setSchedule( schedule );
             }
         }
 
@@ -246,6 +250,11 @@
             this.buildDefinition =
                 this.getContinuum().getBuildDefinitionService().addBuildDefinition( buildDefinition
);
         }
+        
+        if ( schedule != null )
+        {
+            getContinuum().activeBuildDefinitionSchedule( schedule );
+        }
 
         return SUCCESS;
     }



Mime
View raw message