continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r732874 - in /continuum/branches/continuum-distributed-builds/continuum-webapp/src/main: java/org/apache/continuum/web/action/admin/BuildAgentAction.java resources/localization/Continuum.properties webapp/WEB-INF/jsp/admin/editBuildAgent.jsp
Date Thu, 08 Jan 2009 23:42:09 GMT
Author: ctan
Date: Thu Jan  8 15:42:09 2009
New Revision: 732874

URL: http://svn.apache.org/viewvc?rev=732874&view=rev
Log:
check for duplicate build agent when adding new one

Modified:
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildAgent.jsp

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java?rev=732874&r1=732873&r2=732874&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
Thu Jan  8 15:42:09 2009
@@ -57,6 +57,8 @@
 
     private String message;
 
+    private String type;
+
     public String input()
         throws Exception
     {
@@ -69,9 +71,14 @@
                 if ( agent.getUrl().equals( buildAgent.getUrl() ) )
                 {
                     buildAgent = agent;
+                    type = "edit";
                 }
             }
         }
+        else
+        {
+            type = "new";
+        }
 
         return INPUT;
     }
@@ -135,6 +142,14 @@
         {
             configuration.addBuildAgent( buildAgent );
         }
+        else
+        {
+            if ( type.equals( "new" ) )
+            {
+                addActionError( getResourceBundle().getString( "buildAgent.error.duplicate"
) );
+                return INPUT;
+            }
+        }
 
         distributedBuildManager.reload();
 
@@ -233,4 +248,14 @@
     {
         this.message = message;
     }
+
+    public String getType()
+    {
+        return type;
+    }
+
+    public void setType( String type )
+    {
+        this.type = type;
+    }
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=732874&r1=732873&r2=732874&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/localization/Continuum.properties
Thu Jan  8 15:42:09 2009
@@ -970,6 +970,8 @@
 buildAgent.url.label = Build Agent URL
 buildAgent.description.label = Description
 buildAgent.enabled.label = Enabled
+buildAgent.error.doesnotexist = Build agent does not exist
+buildAgent.error.duplicate = Build agent already exists
 
 # ----------------------------------------------------------------------
 # Page: View BuildAgent

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildAgent.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildAgent.jsp?rev=732874&r1=732873&r2=732874&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildAgent.jsp
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildAgent.jsp
Thu Jan  8 15:42:09 2009
@@ -41,8 +41,9 @@
             </c:if>
             
             <table>
+              <s:hidden name="type"/>
               <c:choose>
-                <c:when test="${empty buildAgent.url}">
+                <c:when test="${type=='new'}">
                   <s:textfield label="%{getText('buildAgent.url.label')}" name="buildAgent.url"
required="true"/>
                 </c:when>
                 <c:otherwise>



Mime
View raw message