continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r733009 - in /continuum/branches/continuum-parallel-builds/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java webapp/WEB-INF/jsp/admin/configurationEdit.jsp
Date Fri, 09 Jan 2009 11:22:29 GMT
Author: oching
Date: Fri Jan  9 03:22:28 2009
New Revision: 733009

URL: http://svn.apache.org/viewvc?rev=733009&view=rev
Log:
-fix validation for number of allowed builds in parallel in configuration page

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

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java?rev=733009&r1=733008&r2=733009&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
Fri Jan  9 03:22:28 2009
@@ -61,8 +61,6 @@
     
     private boolean requireReleaseOutput;
     
-    private boolean requireParallelBuilds;
-    
     public void prepare()
     {
         ConfigurationService configuration = getContinuum().getConfiguration();
@@ -101,7 +99,12 @@
             releaseOutputDirectory = releaseOutputDirectoryFile.getAbsolutePath();
         }
         
-        numberOfAllowedBuildsinParallel = configuration.getNumberOfBuildsInParallel();	
+        numberOfAllowedBuildsinParallel = configuration.getNumberOfBuildsInParallel();
+        
+        if( numberOfAllowedBuildsinParallel == 0 )
+        {
+            numberOfAllowedBuildsinParallel = 1;
+        }
                
         String requireRelease = ServletActionContext.getRequest().getParameter( "requireReleaseOutput"
);
         setRequireReleaseOutput( new Boolean( requireRelease ) );
@@ -125,6 +128,12 @@
     public String save()
         throws ConfigurationStoringException, ContinuumStoreException, ContinuumConfigurationException
     {
+        if( numberOfAllowedBuildsinParallel <= 0 )
+        {
+            addActionError( "Number of Allowed Builds in Parallel must be greater than zero."
);
+            return ERROR;
+        }
+        
         ConfigurationService configuration = getContinuum().getConfiguration();
 
         configuration.setWorkingDirectory( new File( workingDirectory ) );
@@ -244,14 +253,4 @@
 	{
 	    this.numberOfAllowedBuildsinParallel = numberOfAllowedBuildsinParallel;
 	}
-
-	public boolean isRequireParallelBuilds() 
-	{
-	    return requireParallelBuilds;
-	}
-
-	public void setRequireParallelBuilds( boolean requireParallelBuilds ) 
-	{
-	    this.requireParallelBuilds = requireParallelBuilds;
-	}
 }

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp?rev=733009&r1=733008&r2=733009&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
Fri Jan  9 03:22:28 2009
@@ -36,13 +36,11 @@
 
     <s:form action="configuration!save" method="post">
 
-      <c:if test="${!empty actionErrors}">
-        <div class="errormessage">
-          <s:iterator value="actionErrors">
-            <p><s:text name="<s:property/>" /></p>
-          </s:iterator>
-        </div>
-      </c:if>
+    <c:if test="${!empty actionErrors}">
+      <div class="errormessage">
+        <p><s:actionerror/></p>
+      </div>
+    </c:if>
 
       <div class="axial">
 



Mime
View raw message