continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r776355 - in /continuum/trunk: continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/ continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ continuum-buildagent/continuum-buildag...
Date Tue, 19 May 2009 15:29:59 GMT
Author: ctan
Date: Tue May 19 15:29:58 2009
New Revision: 776355

URL: http://svn.apache.org/viewvc?rev=776355&view=rev
Log:
[CONTINUUM-2233] fixed cancel current build, remove prepare build queues and remove build queues when distributed build is enabled
merge -r 776353:776354 from 1.3.x branch

Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
    continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
    continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
    continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
    continuum/trunk/continuum-webapp/src/main/resources/struts.xml
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java?rev=776355&r1=776354&r2=776355&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java (original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java Tue May 19 15:29:58 2009
@@ -31,7 +31,7 @@
 {
     String ROLE = DistributedBuildManager.class.getName();
 
-    void cancelDistributedBuild( String buildAgentUrl, int projectGroupId, int scmRootId )
+    void cancelDistributedBuild( String buildAgentUrl )
         throws ContinuumException;
 
     void reload()
@@ -63,16 +63,22 @@
     void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger, int projectGroupId, 
                                String projectGroupName, String scmRootAddress, int scmRootId )
         throws ContinuumException;
- 
-    void removeFromDistributedBuildQueue( int projectGroupId, int scmRootId )
-        throws ContinuumException;
- 
-    void removeFromDistributedBuildQueue( int[] hashCodes )
-        throws ContinuumException;
- 
+
     Map<String, PrepareBuildProjectsTask> getProjectsCurrentlyPreparingBuild()
         throws ContinuumException;
 
     Map<String, BuildProjectTask> getProjectsCurrentlyBuilding()
         throws ContinuumException;
+
+    void removeFromPrepareBuildQueue( String buildAgnetUrl, int projectGroupId, int scmRootId )
+        throws ContinuumException;
+
+    void removeFromPrepareBuildQueue( List<String> hashCodes )
+        throws ContinuumException;
+
+    void removeFromBuildQueue( String buildAgentUrl, int projectId, int buildDefinitionId )
+        throws ContinuumException;
+
+    void removeFromBuildQueue( List<String> hashCodes )
+        throws ContinuumException;
 }
\ No newline at end of file

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java?rev=776355&r1=776354&r2=776355&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java Tue May 19 15:29:58 2009
@@ -94,4 +94,20 @@
         throws ContinuumBuildAgentException;
 
     boolean isProjectGroupInQueue( int projectGroupId );
+
+    boolean isProjectCurrentlyBuilding( int projectId );
+
+    boolean isProjectInBuildQueue( int projectId );
+
+    boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+        throws ContinuumBuildAgentException;
+
+    void removeFromPrepareBuildQueue( List<String> hashCodes )
+        throws ContinuumBuildAgentException;
+
+    boolean removeFromBuildQueue( int projectId, int builddefinitonId )
+        throws ContinuumBuildAgentException;
+
+    void removeFromBuildQueue( List<String> hashCodes )
+        throws ContinuumBuildAgentException;
 }

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java?rev=776355&r1=776354&r2=776355&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java Tue May 19 15:29:58 2009
@@ -30,6 +30,7 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.continuum.buildagent.buildcontext.BuildContext;
 import org.apache.continuum.buildagent.buildcontext.manager.BuildContextManager;
@@ -747,6 +748,106 @@
         return false;
     }
 
+    public boolean isProjectCurrentlyBuilding( int projectId )
+    {
+        try
+        {
+            BuildProjectTask currentBuildTask = buildAgentTaskQueueManager.getCurrentProjectInBuilding();
+
+            if ( currentBuildTask != null && currentBuildTask.getProjectId() == projectId )
+            {
+                return true;
+            }
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while checking if project " + projectId + " is currently building in agent", e );
+        }
+
+        return false;
+    }
+
+    public boolean isProjectInBuildQueue( int projectId )
+    {
+        try
+        {
+            List<BuildProjectTask> buildTasks = buildAgentTaskQueueManager.getProjectsInBuildQueue();
+
+            if ( buildTasks != null )
+            {
+                for ( BuildProjectTask task : buildTasks )
+                {
+                    if ( task.getProjectId() == projectId )
+                    {
+                        return true;
+                    }
+                }
+            }
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while checking if project " + projectId + " is in build queue of agent", e );
+        }
+
+        return false;
+    }
+
+    public boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            return buildAgentTaskQueueManager.removeFromPrepareBuildQueue( projectGroupId, scmRootId );
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while removing projects from prepare build queue", e );
+            throw new ContinuumBuildAgentException( "Error occurred while removing projects from prepare build queue", e );
+        }
+    }
+
+    public void removeFromPrepareBuildQueue( List<String> hashCodes )
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            buildAgentTaskQueueManager.removeFromPrepareBuildQueue( listToIntArray( hashCodes ) );
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while removing projects from prepare build queue", e );
+            throw new ContinuumBuildAgentException( "Error occurred while removing projects from prepare build queue", e );
+        }
+    }
+
+    public boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            return buildAgentTaskQueueManager.removeFromBuildQueue( projectId, buildDefinitionId );
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while removing project from build queue", e );
+            throw new ContinuumBuildAgentException( "Error occurred while removing project from build queue ", e );
+        }
+    }
+
+    public void removeFromBuildQueue( List<String> hashCodes )
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            buildAgentTaskQueueManager.removeFromBuildQueue( listToIntArray( hashCodes ) );
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while removing projects from build queue", e );
+            throw new ContinuumBuildAgentException( "Error occurred while removing project from build queue ", e );
+        }
+    }
+
     private void processProject( String workingDirectory, String pomFilename, boolean autoVersionSubmodules,
                                  List<Map<String, String>> projects )
         throws Exception
@@ -913,4 +1014,18 @@
             return null;
         }
     }
+
+    private int[] listToIntArray( List<String> strings )
+    {
+        if ( strings == null || strings.isEmpty() )
+        {
+            return new int[0];
+        }
+        int[] array = new int[0];
+        for ( String intString : strings )
+        {
+            array = ArrayUtils.add( array, Integer.parseInt( intString ) );
+        }
+        return array;
+    }
 }

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java?rev=776355&r1=776354&r2=776355&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java Tue May 19 15:29:58 2009
@@ -61,5 +61,15 @@
     List<BuildProjectTask> getProjectsInBuildQueue()
         throws TaskQueueManagerException;
 
-    //removeProjectFrom
+    boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+        throws TaskQueueManagerException;
+
+    void removeFromPrepareBuildQueue( int[] hashCodes )
+        throws TaskQueueManagerException;
+
+    boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+        throws TaskQueueManagerException;
+
+    void removeFromBuildQueue( int[] hashCodes )
+        throws TaskQueueManagerException;
 }

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java?rev=776355&r1=776354&r2=776355&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java Tue May 19 15:29:58 2009
@@ -21,6 +21,7 @@
 
 import java.util.List;
 
+import org.apache.commons.lang.ArrayUtils;
 import org.apache.continuum.buildagent.taskqueue.PrepareBuildProjectsTask;
 import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
@@ -60,8 +61,24 @@
     public void cancelBuild()
         throws TaskQueueManagerException
     {
-        removeProjectsFromBuildQueue();
-        cancelCurrentBuild();
+        Task task = getBuildTaskQueueExecutor().getCurrentTask();
+
+        if ( task != null )
+        {
+            if ( task instanceof BuildProjectTask )
+            {
+                log.info( "Cancelling current build task of project " + ( (BuildProjectTask) task ).getProjectId() );
+                getBuildTaskQueueExecutor().cancelTask( task );
+            }
+            else
+            {
+                log.warn( "Current task not a BuildProjectTask - not cancelling" );
+            }
+        }
+        else
+        {
+            log.warn( "No task running - not cancelling" );
+        }
     }
 
     public TaskQueue getBuildQueue()
@@ -114,30 +131,6 @@
         }
     }
 
-    private boolean cancelCurrentBuild()
-        throws TaskQueueManagerException
-    {
-        Task task = getBuildTaskQueueExecutor().getCurrentTask();
-
-        if ( task != null )
-        {
-            if ( task instanceof BuildProjectTask )
-            {
-                log.info( "Cancelling current build task" );
-                return getBuildTaskQueueExecutor().cancelTask( task );
-            }
-            else
-            {
-                log.warn( "Current task not a BuildProjectTask - not cancelling" );
-            }
-        }
-        else
-        {
-            log.warn( "No task running - not cancelling" );
-        }
-        return false;
-    }
-
     public TaskQueueExecutor getBuildTaskQueueExecutor()
         throws TaskQueueManagerException
     {
@@ -297,6 +290,78 @@
         return null;
     }
 
+    public boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+        throws TaskQueueManagerException
+    {
+        List<PrepareBuildProjectsTask> tasks = getProjectsInPrepareBuildQueue();
+
+        if ( tasks != null )
+        {
+            for ( PrepareBuildProjectsTask task : tasks )
+            {
+                if ( task.getProjectGroupId() == projectGroupId && task.getScmRootId() == scmRootId )
+                {
+                    return getPrepareBuildQueue().remove( task );
+                }
+            }
+        }
+
+        return false;
+    }
+
+    public void removeFromPrepareBuildQueue( int[] hashCodes )
+        throws TaskQueueManagerException
+    {
+        List<PrepareBuildProjectsTask> tasks = getProjectsInPrepareBuildQueue();
+
+        if ( tasks != null )
+        {
+            for ( PrepareBuildProjectsTask task : tasks )
+            {
+                if ( ArrayUtils.contains( hashCodes, task.getHashCode() ) )
+                {
+                    getPrepareBuildQueue().remove( task );
+                }
+            }
+        }
+    }
+
+    public boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+        throws TaskQueueManagerException
+    {
+        List<BuildProjectTask> tasks = getProjectsInBuildQueue();
+
+        if ( tasks != null )
+        {
+            for ( BuildProjectTask task : tasks )
+            {
+                if ( task.getProjectId() == projectId && task.getBuildDefinitionId() == buildDefinitionId )
+                {
+                    return getBuildQueue().remove( task );
+                }
+            }
+        }
+
+        return false;
+    }
+
+    public void removeFromBuildQueue( int[] hashCodes )
+        throws TaskQueueManagerException
+    {
+        List<BuildProjectTask> tasks = getProjectsInBuildQueue();
+
+        if ( tasks != null )
+        {
+            for ( BuildProjectTask task : tasks )
+            {
+                if ( ArrayUtils.contains( hashCodes, task.getHashCode() ) )
+                {
+                    getBuildQueue().remove( task );
+                }
+            }
+        }
+    }
+
     public void contextualize( Context context )
         throws ContextException
     {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java?rev=776355&r1=776354&r2=776355&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java Tue May 19 15:29:58 2009
@@ -436,46 +436,6 @@
         return map;
     }
 
-    public void removeFromDistributedBuildQueue( int projectGroupId, int scmRootId )
-        throws ContinuumException
-    {
-        try
-        {
-            OverallDistributedBuildQueue distributedBuildQueue = getOverallDistributedBuildQueueByGroupAndScmRoot( projectGroupId, scmRootId );
-
-            if ( distributedBuildQueue != null )
-            {
-                distributedBuildQueue.removeFromDistributedBuildQueue( projectGroupId, scmRootId );
-            }
-        }
-        catch ( TaskQueueException e )
-        {
-            log.error( "Error occurred while removing projectGroupId=" + projectGroupId + 
-                       " scmRootId=" + scmRootId + " from distributed build queue", e );
-            throw new ContinuumException( "Error occurred while removing projectGroupId=" + projectGroupId + 
-                                          " scmRootId=" + scmRootId + " from distributed build queue", e );
-        }
-    }
-
-    public void removeFromDistributedBuildQueue( int[] hashCodes )
-        throws ContinuumException
-    {
-        for ( int i = 0; i < hashCodes.length; i++ )
-        {
-            try
-            {
-                OverallDistributedBuildQueue distributedBuildQueue = getOverallDistributedBuildQueueByHashCode( hashCodes[i] );
-
-                distributedBuildQueue.removeFromDistributedBuildQueueByHashCode( hashCodes[i] );
-            }
-            catch ( TaskQueueException e )
-            {
-                log.error( "Error occurred while removing projects from distributed build queue", e );
-                throw new ContinuumException( "Error occcurred while removing projects from distributed build queue", e );
-            }
-        }
-    }
-
     public boolean isBuildAgentBusy( String buildAgentUrl )
     {
         synchronized ( overallDistributedBuildQueues )
@@ -494,53 +454,24 @@
         }
     }
 
-    public void cancelDistributedBuild( String buildAgentUrl, int projectGroupId, int scmRootId )
+    public void cancelDistributedBuild( String buildAgentUrl )
         throws ContinuumException
     {
-        synchronized ( overallDistributedBuildQueues )
+        try
         {
-            OverallDistributedBuildQueue distributedBuildQueue = overallDistributedBuildQueues.get( buildAgentUrl );
-
-            if ( distributedBuildQueue != null )
-            {
-                if ( distributedBuildQueue.getDistributedBuildTaskQueueExecutor().getCurrentTask() != null )
-                {
-                    PrepareBuildProjectsTask task = (PrepareBuildProjectsTask)
-                        distributedBuildQueue.getDistributedBuildTaskQueueExecutor().getCurrentTask();
-
-                    if ( task.getProjectGroupId() == projectGroupId && 
-                         task.getProjectScmRootId() == scmRootId )
-                    {
-                        log.info( "Cancelling task for projectGroupId=" + projectGroupId + " scmRootId=" + scmRootId );
-                        distributedBuildQueue.getDistributedBuildTaskQueueExecutor().cancelTask( task );
+            SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
 
-                        try
-                        {
-                            SlaveBuildAgentTransportClient client =
-                                new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
-                            client.cancelBuild();
-                        }
-                        catch ( Exception e )
-                        {
-                            log.error( "Error while cancelling build in build agent '" + buildAgentUrl + "'" );
-                            throw new ContinuumException(
-                                "Error while cancelling build in build agent '" + buildAgentUrl + "'", e );
-                        }
-                    }
-                    else
-                    {
-                        log.info( "current task not for project group " + projectGroupId + " with scm root id " + scmRootId );
-                    }
-                }
-                else
-                {
-                    log.info( "no current task in build agent '" + buildAgentUrl + "'" );
-                }
-            }
-            else
-            {
-                log.info( "no distributed build queue for build agent '" + buildAgentUrl + "'" );
-            }
+            client.cancelBuild();
+        }
+        catch ( MalformedURLException e )
+        {
+            log.error( "Error cancelling build in build agent: Invalid build agent url " + buildAgentUrl );
+            throw new ContinuumException( "Error cancelling build in build agent: Invalid build agent url " + buildAgentUrl );
+        }
+        catch ( Exception e )
+        {
+            log.error( "Error occurred while cancelling build in build agent " + buildAgentUrl, e );
+            throw new ContinuumException( "Error occurred while cancelling build in build agent " + buildAgentUrl, e );
         }
     }
 
@@ -692,6 +623,102 @@
         return "";
     }
 
+    public void removeFromPrepareBuildQueue( String buildAgentUrl, int projectGroupId, int scmRootId )
+        throws ContinuumException
+    {
+        try
+        {
+            SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+            client.removeFromPrepareBuildQueue( projectGroupId, scmRootId );
+        }
+        catch ( MalformedURLException e )
+        {
+            log.error( "Unable to remove projectGroupId=" + projectGroupId + " scmRootId=" + scmRootId + 
+                       " from prepare build queue: Invalid build agent url " + buildAgentUrl );
+            throw new ContinuumException( "Unable to remove projectGroupId=" + projectGroupId + " scmRootId=" + scmRootId + 
+                                          " from prepare build queue: Invalid build agent url " + buildAgentUrl );
+        }
+        catch ( Exception e )
+        {
+            log.error( "Error occurred while removing projectGroupId=" + projectGroupId + " scmRootId=" + scmRootId + 
+                       " from prepare build queue of agent " + buildAgentUrl, e );
+            throw new ContinuumException( "Error occurred while removing projectGroupId=" + projectGroupId + " scmRootId=" +
+                                          scmRootId + " from prepare build queue of agent " + buildAgentUrl, e );
+        }
+    }
+
+    public void removeFromBuildQueue( String buildAgentUrl, int projectId, int buildDefinitionId )
+        throws ContinuumException
+    {
+        try
+        {
+            SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+            client.removeFromBuildQueue( projectId, buildDefinitionId );
+        }
+        catch ( MalformedURLException e )
+        {
+            log.error( "Unable to remove project " + projectId + 
+                       " from build queue: Invalid build agent url " + buildAgentUrl );
+            throw new ContinuumException( "Unable to remove project " + projectId + 
+                                          " from build queue: Invalid build agent url " + buildAgentUrl );
+        }
+        catch ( Exception e )
+        {
+            log.error( "Error occurred while removing project " + projectId +
+                       " from build queue of agent " + buildAgentUrl, e );
+            throw new ContinuumException( "Error occurred while removing project " + projectId + 
+                                          " from build queue of agent " + buildAgentUrl, e );
+        }
+    }
+
+    public void removeFromPrepareBuildQueue( List<String> hashCodes )
+        throws ContinuumException
+    {
+        synchronized ( overallDistributedBuildQueues )
+        {
+            for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
+            {
+                try
+                {
+                    SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                    client.removeFromPrepareBuildQueue( hashCodes );
+                }
+                catch ( MalformedURLException e )
+                {
+                    log.error( "Error trying to remove projects from prepare build queue. Invalid build agent url: " + buildAgentUrl );
+                }
+                catch ( Exception e )
+                {
+                    log.error( "Error trying to remove projects from prepare build queue of agent " + buildAgentUrl, e );
+                }
+            }
+        }
+    }
+
+    public void removeFromBuildQueue( List<String> hashCodes )
+        throws ContinuumException
+    {
+        synchronized ( overallDistributedBuildQueues )
+        {
+            for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
+            {
+                try
+                {
+                    SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                    client.removeFromBuildQueue( hashCodes );
+                }
+                catch ( MalformedURLException e )
+                {
+                    log.error( "Error trying to remove projects from build queue. Invalid build agent url: " + buildAgentUrl );
+                }
+                catch ( Exception e )
+                {
+                    log.error( "Error trying to remove projects from build queue of agent " + buildAgentUrl, e );
+                }
+            }
+        }
+    }
+
     private String getBuildAgent( int projectId )
         throws ContinuumException
     {
@@ -704,16 +731,24 @@
     
                 if ( overallDistributedBuildQueue != null )
                 {
-                    PrepareBuildProjectsTask task = 
-                        (PrepareBuildProjectsTask) overallDistributedBuildQueue.getDistributedBuildTaskQueueExecutor().getCurrentTask();
-    
-                    for ( Integer id : task.getProjectsBuildDefinitionsMap().keySet() )
+                    try
                     {
-                        if ( projectId == id )
+                        SlaveBuildAgentTransportClient client = 
+                            new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                        
+                        if ( client.isProjectCurrentlyBuilding( projectId ) )
                         {
                             return buildAgentUrl;
                         }
                     }
+                    catch ( MalformedURLException e )
+                    {
+                        log.warn( "Unable to check if project " + projectId + " is currently building in agent: Invalid build agent url" + buildAgentUrl );
+                    }
+                    catch ( Exception e )
+                    {
+                        log.warn( "Unable to check if project " + projectId + " is currently building in agent", e );
+                    }
                 }
             }
         }

Modified: continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java?rev=776355&r1=776354&r2=776355&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java (original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java Tue May 19 15:29:58 2009
@@ -105,4 +105,22 @@
 
     public Boolean isProjectGroupInQueue( int projectGroupId )
         throws Exception;
+
+    public Boolean isProjectCurrentlyBuilding( int projectId )
+        throws Exception;
+
+    public Boolean isProjectInBuildQueue( int projectId )
+        throws Exception;
+
+    public Boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+        throws Exception;
+
+    public Boolean removeFromPrepareBuildQueue( List<String> hashCodes )
+        throws Exception;
+
+    public Boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+        throws Exception;
+
+    public Boolean removeFromBuildQueue( List<String> hashCodes )
+        throws Exception;    
 }

Modified: continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java?rev=776355&r1=776354&r2=776355&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java (original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java Tue May 19 15:29:58 2009
@@ -531,4 +531,121 @@
 
         return result;
     }
+
+    public Boolean isProjectCurrentlyBuilding( int projectId )
+        throws Exception
+    {
+        Boolean result;
+
+        try
+        {
+            result = slave.isProjectCurrentlyBuilding( projectId );
+            log.info( "Checking if project " + projectId + " is currently building in agent" );
+        }
+        catch ( Exception e )
+        {
+            log.error( "Failed to check if project " + projectId + " is currently building in agent", e );
+            throw new Exception( "Failed to check if project " + projectId + " is currently building in agent", e );
+        }
+
+        return result;
+    }
+
+    public Boolean isProjectInBuildQueue( int projectId )
+        throws Exception
+    {
+        Boolean result;
+
+        try
+        {
+            result = slave.isProjectInBuildQueue( projectId );
+            log.info( "Checking if project " + projectId + "is in build queue of agent" );
+        }
+        catch ( Exception e )
+        {
+            log.error( "Failed to check if project " + projectId + " is in build queue of agent", e );
+            throw new Exception( "Failed to check if project " + projectId + " is in build queue of agent", e );
+        }
+
+        return result;
+    }
+
+    public Boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+        throws Exception
+    {
+        Boolean result;
+
+        try
+        {
+            result = slave.removeFromPrepareBuildQueue( projectGroupId, scmRootId );
+            log.info( "Removing projectGroupId=" + projectGroupId + " scmRootId=" + scmRootId +
+                      " from prepare build queue of agent" );
+        }
+        catch ( Exception e )
+        {
+            log.error( "Failed to remove projectGroupId=" + projectGroupId + " scmRootId=" + scmRootId +
+                       " from prepare build queue of agent", e );
+            throw new Exception( "Failed to remove projectGroupId=" + projectGroupId + " scmRootId=" + scmRootId +
+                                 " from prepare build queue of agent", e );
+        }
+
+        return result;
+    }
+
+    public Boolean removeFromPrepareBuildQueue( List<String> hashCodes )
+        throws Exception
+    {
+        Boolean result;
+
+        try
+        {
+            result = slave.removeFromPrepareBuildQueue( hashCodes );
+            log.info( "Removing projects from prepare build queue of agent" );
+        }
+        catch ( Exception e )
+        {
+            log.error( "Failed to remove projects from prepare build queue of agent", e );
+            throw new Exception( "Failed to remove projects from prepare build queue of agent", e );
+        }
+
+        return result;
+    }
+
+    public Boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+        throws Exception
+    {
+        Boolean result;
+
+        try
+        {
+            result = slave.removeFromBuildQueue( projectId, buildDefinitionId );
+            log.info( "Removing project " + projectId + " from build queue of agent" );
+        }
+        catch ( Exception e )
+        {
+            log.error( "Failed to remove project " + projectId + " from build queue of agent", e );
+            throw new Exception( "Failed to remove project " + projectId + " from build queue of agent", e );
+        }
+
+        return result;
+    }
+
+    public Boolean removeFromBuildQueue( List<String> hashCodes )
+        throws Exception
+    {
+        Boolean result;
+
+        try
+        {
+            result = slave.removeFromBuildQueue( hashCodes );
+            log.info( "Removing projects from build queue of agent" );
+        }
+        catch ( Exception e )
+        {
+            log.error( "Failed to remove projects from build queue of agent", e );
+            throw new Exception( "Failed to remove projects from build queue of agent", e );
+        }
+
+        return result;
+    }
 }

Modified: continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java?rev=776355&r1=776354&r2=776355&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java (original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java Tue May 19 15:29:58 2009
@@ -405,4 +405,82 @@
     {
         return continuumBuildAgentService.isProjectGroupInQueue( projectGroupId );
     }
+
+    public Boolean isProjectCurrentlyBuilding( int projectId )
+        throws Exception
+    {
+        return continuumBuildAgentService.isProjectCurrentlyBuilding( projectId );
+    }
+
+    public Boolean isProjectInBuildQueue( int projectId )
+        throws Exception
+    {
+        return continuumBuildAgentService.isProjectInBuildQueue( projectId );
+    }
+
+    public Boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+        throws Exception
+    {
+        try
+        {
+            return continuumBuildAgentService.removeFromPrepareBuildQueue( projectGroupId, scmRootId );
+        }
+        catch ( ContinuumBuildAgentException e )
+        {
+            log.error( "Failed to remove projects from prepare build queue" );
+             throw e;
+        }
+    }
+
+    public Boolean removeFromPrepareBuildQueue( List<String> hashCodes )
+        throws Exception
+    {
+        Boolean result;
+
+        try
+        {
+            continuumBuildAgentService.removeFromPrepareBuildQueue( hashCodes );
+            result = Boolean.TRUE;
+        }
+        catch ( ContinuumBuildAgentException e )
+        {
+            log.error( "Failed to remove projects from prepare build queue" );
+            throw e;
+        }
+
+        return result;
+    }
+
+    public Boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+        throws Exception
+    {
+        try
+        {
+            return continuumBuildAgentService.removeFromBuildQueue( projectId, buildDefinitionId );
+        }
+        catch ( ContinuumBuildAgentException e )
+        {
+            log.error( "Failed to remove project from build queue" );
+            throw e;
+        }
+    }
+
+    public Boolean removeFromBuildQueue( List<String> hashCodes )
+        throws Exception
+    {
+        Boolean result;
+
+        try
+        {
+            continuumBuildAgentService.removeFromBuildQueue( hashCodes );
+            result = Boolean.TRUE;
+        }
+        catch ( ContinuumBuildAgentException e )
+        {
+            log.error( "Failed to remove projects from build queue" );
+            throw e;
+        }
+
+        return result;
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java?rev=776355&r1=776354&r2=776355&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java Tue May 19 15:29:58 2009
@@ -107,6 +107,9 @@
                 buildResult = ContinuumBuildConstant.getBuildResult( map, null );
 
                 buildOutput = ContinuumBuildConstant.getBuildOutput( map );
+
+                state =
+                    StateGenerator.generate( buildResult.getState(), ServletActionContext.getRequest().getContextPath() );
             }
             changeSet = null;
 

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java?rev=776355&r1=776354&r2=776355&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java Tue May 19 15:29:58 2009
@@ -25,18 +25,12 @@
 import java.util.Set;
 
 import org.apache.commons.lang.ArrayUtils;
-import org.apache.continuum.builder.distributed.executor.DistributedBuildTaskQueueExecutor;
-import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
 import org.apache.continuum.buildmanager.BuildManagerException;
-import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.taskqueue.CheckOutTask;
 import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
-import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
-import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
-import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.security.ContinuumRoleConstants;
 import org.apache.maven.continuum.web.action.ContinuumActionSupport;
 import org.apache.maven.continuum.web.bean.BuildProjectQueue;
@@ -46,7 +40,7 @@
 import org.apache.maven.continuum.web.model.DistributedBuildSummary;
 import org.apache.maven.continuum.web.model.DistributedPrepareBuildSummary;
 import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.taskqueue.TaskQueueException;
+import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.redback.integration.interceptor.SecureAction;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.codehaus.redback.integration.interceptor.SecureActionException;
@@ -67,6 +61,8 @@
 
     private static final String DISTRIBUTED_BUILD_SUCCESS = "distributed-build-success";
 
+    private List<String> selectedPrepareBuildTaskHashCodes;
+
     private List<String> selectedBuildTaskHashCodes;
 
     private List<String> selectedCheckOutTaskHashCodes;
@@ -94,16 +90,13 @@
     private List<DistributedBuildSummary> currentDistributedBuilds = new ArrayList<DistributedBuildSummary>();
 
     private List<DistributedBuildSummary> distributedBuildQueues = new ArrayList<DistributedBuildSummary>();
+
     private String buildAgentUrl;
 
     private int projectGroupId;
 
     private int scmRootId;
 
-    private List<String> selectedDistributedBuildTaskHashCodes;
-
-    private List<String> selectedDistributedPrepareBuildTaskHashCodes;
-
     // -----------------------------------------------------
     //  webwork
     // -----------------------------------------------------
@@ -474,7 +467,53 @@
             return REQUIRES_AUTHENTICATION;
         }
 
-        getContinuum().getDistributedBuildManager().cancelDistributedBuild( buildAgentUrl, projectGroupId, scmRootId );
+        getContinuum().getDistributedBuildManager().cancelDistributedBuild( buildAgentUrl );
+
+        return SUCCESS;
+    }
+
+    public String removeDistributedPrepareBuildEntry()
+        throws Exception
+    {
+        try
+        {
+            checkManageQueuesAuthorization();
+        }
+        catch ( AuthorizationRequiredException authzE )
+        {
+            addActionError( authzE.getMessage() );
+            return REQUIRES_AUTHORIZATION;
+        }
+        catch ( AuthenticationRequiredException e )
+        {
+            addActionError( e.getMessage() );
+            return REQUIRES_AUTHENTICATION;
+        }
+
+        getContinuum().getDistributedBuildManager().removeFromPrepareBuildQueue( buildAgentUrl, projectGroupId, scmRootId );
+
+        return SUCCESS;
+    }
+
+    public String removeDistributedPrepareBuildEntries()
+        throws Exception
+    {
+        try
+        {
+            checkManageQueuesAuthorization();
+        }
+        catch ( AuthorizationRequiredException authzE )
+        {
+            addActionError( authzE.getMessage() );
+            return REQUIRES_AUTHORIZATION;
+        }
+        catch ( AuthenticationRequiredException e )
+        {
+            addActionError( e.getMessage() );
+            return REQUIRES_AUTHENTICATION;
+        }
+
+        getContinuum().getDistributedBuildManager().removeFromPrepareBuildQueue(  this.getSelectedPrepareBuildTaskHashCodes() );
 
         return SUCCESS;
     }
@@ -497,7 +536,7 @@
             return REQUIRES_AUTHENTICATION;
         }
 
-        getContinuum().getDistributedBuildManager().removeFromDistributedBuildQueue( projectGroupId, scmRootId );
+        getContinuum().getDistributedBuildManager().removeFromBuildQueue( buildAgentUrl, projectId, buildDefinitionId );
 
         return SUCCESS;
     }
@@ -520,8 +559,7 @@
             return REQUIRES_AUTHENTICATION;
         }
 
-        getContinuum().getDistributedBuildManager().removeFromDistributedBuildQueue(
-            listToIntArray( this.getSelectedDistributedBuildTaskHashCodes() ) );
+        getContinuum().getDistributedBuildManager().removeFromBuildQueue( this.getSelectedBuildTaskHashCodes() );
 
         return SUCCESS;
     }
@@ -718,33 +756,23 @@
         this.buildAgentUrl = buildAgentUrl;
     }
 
-    public List<String> getSelectedDistributedBuildTaskHashCodes()
-    {
-        return selectedDistributedBuildTaskHashCodes;
-    }
-
-    public void setSelectedDistributedBuildTaskHashCodes( List<String> selectedDistributedBuildTaskHashCodes )
-    {
-        this.selectedDistributedBuildTaskHashCodes = selectedDistributedBuildTaskHashCodes;
-    }
-
-    public List<String> getSelectedDistributedPrepareBuildTaskHashCodes()
+    public void setProjectGroupId( int projectGroupId )
     {
-        return selectedDistributedPrepareBuildTaskHashCodes;
+        this.projectGroupId = projectGroupId;
     }
 
-    public void setSelectedDistributedPrepareBuildTaskHashCodes( List<String> selectedDistributedPrepareBuildTaskHashCodes )
+    public void setScmRootId( int scmRootId )
     {
-        this.selectedDistributedPrepareBuildTaskHashCodes = selectedDistributedPrepareBuildTaskHashCodes;
+        this.scmRootId = scmRootId;
     }
 
-    public void setProjectGroupId( int projectGroupId )
+    public void setSelectedPrepareBuildTaskHashCodes( List<String> selectedPrepareBuildTaskHashCodes )
     {
-        this.projectGroupId = projectGroupId;
+        this.selectedPrepareBuildTaskHashCodes = selectedPrepareBuildTaskHashCodes;
     }
 
-    public void setScmRootId( int scmRootId )
+    public List<String> getSelectedPrepareBuildTaskHashCodes()
     {
-        this.scmRootId = scmRootId;
+        return selectedPrepareBuildTaskHashCodes;
     }
 }

Modified: continuum/trunk/continuum-webapp/src/main/resources/struts.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/struts.xml?rev=776355&r1=776354&r2=776355&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/struts.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/struts.xml Tue May 19 15:29:58 2009
@@ -842,7 +842,7 @@
         <param name="actionName">displayQueues</param>
       </result>
     </action>
-    
+
     <action name="removeDistributedBuildEntry" class="queues" method="removeDistributedBuildEntry">
       <result name="success" type="redirect-action">
         <param name="actionName">displayQueues</param>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp?rev=776355&r1=776354&r2=776355&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp Tue May 19 15:29:58 2009
@@ -36,7 +36,7 @@
         </div>
       </c:if>
       
-      <s:form id="removeForm" action="none" method="post">
+      <form id="queuesForm" action="none" method="post">
         <div id="h3">
           <h3><s:text name="distributedBuilds.currentPrepareBuild.section.title"/></h3>
           <c:if test="${not empty currentDistributedPrepareBuilds}">
@@ -77,8 +77,6 @@
                 <ec:column property="buildAgentUrl" title="distributedBuild.table.agentUrl"/>
                 <ec:column property="cancelEntry" title="&nbsp;" width="1%">
                   <s:url id="cancelUrl" action="cancelDistributedBuild" method="cancelDistributedBuild" namespace="/">
-                    <s:param name="projectId">${pageScope.currentBuild.projectId}</s:param>
-                    <s:param name="buildDefinitionId">${pageScope.currentBuild.buildDefinitionId}</s:param>
                     <s:param name="buildAgentUrl">${pageScope.currentBuild.buildAgentUrl}</s:param>
                   </s:url>
                   <redback:ifAuthorized permission="continuum-manage-queues">
@@ -95,6 +93,8 @@
             <s:text name="distributedBuilds.empty"/>
           </c:if>
         </div>
+      </form>
+      <form id="removePrepareBuildForm" action="removeDistributedPrepareBuildEntries.action" method="post">
         <div id="h3">
           <h3>
             <s:text name="distributedBuilds.prepareBuildQueue.section.title"/>
@@ -110,8 +110,8 @@
                       filterable="false">
               <ec:row>
                 <redback:ifAuthorized permission="continuum-manage-queues">
-                  <ec:column alias="selectedDistributedPrepareBuildTaskHashCodes" title="&nbsp;" style="width:5px" filterable="false" sortable="false" width="1%" headerCell="selectAll">
-                    <input type="checkbox" name="selectedDistributedPrepareBuildTaskHashCodes" value="${pageScope.prepareBuildQueue.hashCode}" />
+                  <ec:column alias="selectedPrepareBuildTaskHashCodes" title="&nbsp;" style="width:5px" filterable="false" sortable="false" width="1%" headerCell="selectAll">
+                    <input type="checkbox" name="selectedPrepareBuildTaskHashCodes" value="${pageScope.prepareBuildQueue.hashCode}" />
                   </ec:column>              
                 </redback:ifAuthorized>
                 <ec:column property="projectGroupName" title="distributedPrepareBuild.table.projectGroupName"/>
@@ -140,14 +140,15 @@
               <tbody>
                 <tr>
                   <td>
-                    <input type="submit" value="<s:text name="distributedPrepareBuilds.removeEntries"/>"
-                           onclick="document.forms.removeForm.action='removeDistributedPrepareBuildEntries.action';document.forms.removeForm.submit();" /> 
+                    <input type="button" name="remove-prepare-build-queues" value="<s:text name="distributedPrepareBuilds.removeEntries"/>" onclick="document.forms.removePrepareBuildForm.submit();" /> 
                   </td>
                 </tr>
               </tbody>
             </table>
           </div>
         </c:if>
+      </form>
+      <form id="removeBuildForm" action="removeDistributedBuildEntries.action" method="post">
         <div id="h3">
           <h3>
             <s:text name="distributedBuilds.buildQueue.section.title"/>
@@ -163,8 +164,8 @@
                       filterable="false">
               <ec:row>
                 <redback:ifAuthorized permission="continuum-manage-queues">
-                  <ec:column alias="selectedDistributedBuildTaskHashCodes" title="&nbsp;" style="width:5px" filterable="false" sortable="false" width="1%" headerCell="selectAll">
-                    <input type="checkbox" name="selectedDistributedBuildTaskHashCodes" value="${pageScope.buildQueue.hashCode}" />
+                  <ec:column alias="selectedBuildTaskHashCodes" title=" " style="width:5px" filterable="false" sortable="false" headerCell="selectAll">
+                    <input type="checkbox" name="selectedBuildTaskHashCodes" value="${pageScope.buildQueue.hashCode}" />
                   </ec:column>              
                 </redback:ifAuthorized>
                 <ec:column property="projectName" title="distributedBuild.table.projectName"/>
@@ -194,15 +195,14 @@
               <tbody>
                 <tr>
                   <td>
-                    <input type="submit" value="<s:text name="distributedBuilds.removeEntries"/>"
-                           onclick="document.forms.removeForm.action='removeDistributedBuildEntries.action';document.forms.removeForm.submit();" /> 
+                    <input type="button" name="remove-build-queues" value="<s:text name="distributedBuilds.removeEntries"/>" onclick="document.forms.removeBuildForm.submit();" /> 
                   </td>
                 </tr>
               </tbody>
             </table>
           </div>
         </c:if>
-      </s:form>
+      </form>
     </body>
   </s:i18n>
 </html>
\ No newline at end of file



Mime
View raw message