continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r726973 - in /continuum/branches/continuum-parallel-builds/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ScheduleAction.java webapp/WEB-INF/jsp/editSchedule.jsp
Date Tue, 16 Dec 2008 06:00:40 GMT
Author: oching
Date: Mon Dec 15 22:00:39 2008
New Revision: 726973

URL: http://svn.apache.org/viewvc?rev=726973&view=rev
Log:
[CONTINUUM-265]
submitted by Gwen Harold Autencio
-attach build queue to schedule

Modified:
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/editSchedule.jsp

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java?rev=726973&r1=726972&r2=726973&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
Mon Dec 15 22:00:39 2008
@@ -21,14 +21,17 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
 import org.apache.continuum.dao.BuildQueueDao;
+
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildQueue;
 import org.apache.maven.continuum.model.project.Schedule;
+import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.web.exception.AuthenticationRequiredException;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
 import org.apache.maven.model.Build;
@@ -93,7 +96,6 @@
     {
     	super.prepare();
         buildQueues = buildQueueDao.getAllBuildQueues();
-        schedulesBuildQueue = new ArrayList<BuildQueue>();
     }
 
     public String summary()
@@ -112,9 +114,9 @@
         {
             addActionError( e.getMessage() );
             return REQUIRES_AUTHENTICATION;
-        }        buildQueueIds = new ArrayList<String>();
-        
-        
+
+        } 
+        buildQueueIds = new ArrayList<String>();
 
         schedules = getContinuum().getSchedules();
 
@@ -124,6 +126,7 @@
     public String input()
         throws ContinuumException
     {
+    	
         try
         {
             checkManageSchedulesAuthorization();
@@ -160,7 +163,7 @@
             name = schedule.getName();
             delay = schedule.getDelay();
             maxJobExecutionTime = schedule.getMaxJobExecutionTime();
-         
+
         }
         else
         {
@@ -219,8 +222,9 @@
         schedule.setDescription( description );
         schedule.setName( name );
         schedule.setMaxJobExecutionTime( maxJobExecutionTime );
-        schedule.setBuildQueues( schedulesBuildQueue );	
-        
+
+        schedule.setBuildQueues( getBuildQueuesFromSelectedBuildQueues() );
+
         return schedule;
     }
 
@@ -289,6 +293,29 @@
 
         return SUCCESS;
     }
+    
+    private List<BuildQueue> getBuildQueuesFromSelectedBuildQueues()
+    {
+        if ( this.buildQueueIds == null )
+        {
+            return Collections.EMPTY_LIST;
+        }
+        List<BuildQueue> selectedBuildQueue = new ArrayList<BuildQueue>();
+        for ( String buildQueueId : buildQueueIds )
+        {
+        	try
+        	{
+        	    BuildQueue buildQueue = buildQueueDao.getBuildQueueByName( buildQueueId ) ;

+        	}
+        	catch ( ContinuumStoreException e)
+        	{
+        	    addActionError( e.getMessage() );
+        	}
+            
+            selectedBuildQueue.add( buildQueue );
+        }
+        return selectedBuildQueue;
+    }
 
     public Collection getSchedules()
     {
@@ -473,7 +500,7 @@
 
 	public List<String> getBuildQueueIds() 
 	{
-	    return buildQueueIds;
+		return buildQueueIds == null ? Collections.EMPTY_LIST : buildQueueIds;
 	}
 
 	public void setBuildQueueIds(List<String> buildQueueIds) 
@@ -500,6 +527,5 @@
 	{
 	    this.schedulesBuildQueue = schedulesBuildQueue;
 	}
-	
-	
 }
+

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/editSchedule.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/editSchedule.jsp?rev=726973&r1=726972&r2=726973&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/editSchedule.jsp
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/editSchedule.jsp
Mon Dec 15 22:00:39 2008
@@ -20,6 +20,7 @@
 <%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
 <%@ taglib uri="/struts-tags" prefix="s" %>
 <%@ taglib uri="continuum" prefix="c1" %>
+
 <html>
   <s:i18n name="localization.Continuum">
 <head>
@@ -71,10 +72,10 @@
             <s:textfield label="%{getText('schedule.quietPeriod.label')}" name="delay">
                 <s:param name="desc"><p><s:text name="schedule.quietPeriod.message"/></p></s:param>
             </s:textfield>
-            
-            <s:select label="Build Queues" id="schedulesBuildQueue" name="schedulesBuildQueue"
headerKey="-1" listValue="name" multiple="true" size="4" 
-                      listKey="id" headerValue="--Build Queues--" list="buildQueues" />
-                        
+    	
+            <s:select label="Add Build Queue" id="buildQueueIds" name="buildQueueIds"
headerKey="-1" listKey="name" listValue="name" multiple="true"
+                headerValue="--Build Queues--" list="buildQueues" />
+                                       
             <s:checkbox label="%{getText('schedule.enabled.label')}" name="active" value="active"
fieldValue="true">
                 <s:param name="desc"><p><s:text name="schedule.enabled.message"/></p></s:param>
             </s:checkbox>
@@ -93,3 +94,4 @@
 </body>
 </s:i18n>
 </html>
+



Mime
View raw message