continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r555676 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java resources/localization/Continuum.properties
Date Thu, 12 Jul 2007 16:10:22 GMT
Author: evenisse
Date: Thu Jul 12 09:10:21 2007
New Revision: 555676

URL: http://svn.apache.org/viewvc?view=rev&rev=555676
Log:
[CONTINUUM-1119] Add a message when the groupId already exist

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java?view=diff&rev=555676&r1=555675&r2=555676
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
Thu Jul 12 09:10:21 2007
@@ -22,6 +22,9 @@
 import com.opensymphony.xwork.Validateable;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
+import org.apache.maven.continuum.store.ContinuumStore;
+import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
 
 import java.util.Iterator;
@@ -34,6 +37,11 @@
     extends ContinuumActionSupport
     implements Validateable
 {
+    /**
+     * @plexus.requirement role-hint="jdo"
+     */
+    private ContinuumStore store;
+
     private String name;
 
     private String groupId;
@@ -71,6 +79,24 @@
         else if ( groupId != null && groupId.trim().equals( "" ) )
         {
             addActionError( "projectGroup.error.groupId.cannot.be.spaces" );
+        }
+        else
+        {
+            try
+            {
+                if ( store.getProjectGroupByGroupId( groupId ) != null )
+                {
+                    addActionError( "projectGroup.error.groupId.already.exists" );
+                }
+            }
+            catch ( ContinuumObjectNotFoundException e )
+            {
+                //since we want to add a new project group, we should be getting
+                //this exception
+            }
+            catch ( ContinuumStoreException e )
+            {
+            }
         }
     }
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?view=diff&rev=555676&r1=555675&r2=555676
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Thu Jul 12 09:10:21 2007
@@ -154,6 +154,7 @@
 projectGroup.error.name.already.exists = Project Group Name already exists.
 projectGroup.error.groupId.required = Project Group ID required.
 projectGroup.error.groupId.cannot.be.spaces = Project Group ID cannot contain spaces only.
+projectGroup.error.groupId.already.exists = Project Group ID already exists.
 
 # ----------------------------------------------------------------------
 # Page: Edit Project Group



Mime
View raw message