continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r732596 - in /continuum/branches/continuum-parallel-builds/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/admin/ webapp/WEB-INF/jsp/admin/
Date Thu, 08 Jan 2009 03:22:49 GMT
Author: oching
Date: Wed Jan  7 19:22:49 2009
New Revision: 732596

URL: http://svn.apache.org/viewvc?rev=732596&view=rev
Log:
[CONTINUUM-265]
submitted by Jevica Arianne Zurbano

- displays the missing checkboxes
- added duplicate checking when adding build queues
- modified checking of the number of build queues allowed
- fixed the action error display


Modified:
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editParallelBuilds.jsp
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/parallelbuilds.jsp

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java?rev=732596&r1=732595&r2=732596&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
Wed Jan  7 19:22:49 2009
@@ -74,7 +74,7 @@
         throws Exception
     {
         int allowedBuilds = getContinuum().getConfiguration().getNumberOfBuildsInParallel();
-        if ( allowedBuilds < this.buildQueueList.size() )
+        if ( allowedBuilds < ( this.buildQueueList.size() + 1 ) )
         {
             addActionError( "You are only allowed " + allowedBuilds + " number of builds
in parallel." );
             return ERROR;
@@ -83,11 +83,19 @@
         {
             try
             {
-                BuildQueue buildQueue = new BuildQueue();
-                buildQueue.setName( name );
-                BuildQueue addedBuildQueue = getContinuum().addBuildQueue( buildQueue );
-
-                getContinuum().getBuildsManager().addOverallBuildQueue( addedBuildQueue );
+                if ( !isDuplicate( name ) )
+                {
+                    BuildQueue buildQueue = new BuildQueue();
+                    buildQueue.setName( name );
+                    BuildQueue addedBuildQueue = getContinuum().addBuildQueue( buildQueue
);
+    
+                    getContinuum().getBuildsManager().addOverallBuildQueue( addedBuildQueue
);
+                }
+                else
+                {
+                    addActionError( "Build queue name already exists." );
+                    return ERROR;
+                }
             }
             catch ( ContinuumException e )
             {
@@ -179,4 +187,23 @@
     {
         this.message = message;
     }
+    
+    private boolean isDuplicate( String queueName )
+        throws ContinuumException
+    {
+        boolean isExisting = false;
+        
+        List<BuildQueue> buildQueues = getContinuum().getAllBuildQueues();
+        
+        for ( BuildQueue bq : buildQueues )
+        {
+            if ( queueName.equals( bq.getName() ) )
+            {
+                isExisting = true;
+                break;
+            }
+        }
+        
+        return isExisting;
+    }
 }

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp?rev=732596&r1=732595&r2=732596&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp
Wed Jan  7 19:22:49 2009
@@ -89,7 +89,7 @@
               <c:forEach var="element" items="${buildsInQueue}">
                 <c:forEach var="buildTask" items="${element.value}">
                   <tr>                                    
-                    <td width="1%>
+                    <td width="1%">
                       <redback:ifAuthorized permission="continuum-manage-queues">
                         <input type="checkbox" name="selectedBuildTaskHashCodes" value="${buildTask.hashCode}"
/>                                      
                       </redback:ifAuthorized>
@@ -252,7 +252,7 @@
               <c:forEach var="element" items="${checkoutsInQueue}">
                 <c:forEach var="checkoutTask" items="${element.value}">
                   <tr>
-                    <td width="1%>
+                    <td width="1%">
                       <redback:ifAuthorized permission="continuum-manage-queues">
                         <input type="checkbox" name="selectedCheckOutTaskHashCodes" value="${checkoutTask.hashCode}"
/>                                      
                       </redback:ifAuthorized>

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editParallelBuilds.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editParallelBuilds.jsp?rev=732596&r1=732595&r2=732596&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editParallelBuilds.jsp
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editParallelBuilds.jsp
Wed Jan  7 19:22:49 2009
@@ -36,9 +36,7 @@
 
     <c:if test="${!empty actionErrors}">
       <div class="errormessage">
-        <s:iterator value="actionErrors">
-          <p><s:text name="<s:property/>" /></p>
-        </s:iterator>
+        <p><s:actionerror/></p>
       </div>
     </c:if>
     

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/parallelbuilds.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/parallelbuilds.jsp?rev=732596&r1=732595&r2=732596&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/parallelbuilds.jsp
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/parallelbuilds.jsp
Wed Jan  7 19:22:49 2009
@@ -33,6 +33,7 @@
       <h3>
         <s:text name="parallel.build.queues.section.title"/>
       </h3>
+      
       <c:if test="${not empty buildQueueList}">
       <ec:table items="buildQueueList"
               var="buildQueue"



Mime
View raw message