continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r485611 - /maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
Date Mon, 11 Dec 2006 11:17:30 GMT
Author: evenisse
Date: Mon Dec 11 03:17:29 2006
New Revision: 485611

URL: http://svn.apache.org/viewvc?view=rev&rev=485611
Log:
Re-add the possibility to add a project in the group defined in pom

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java?view=diff&rev=485611&r1=485610&r2=485611
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
Mon Dec 11 03:17:29 2006
@@ -45,6 +45,8 @@
 
     private static final long serialVersionUID = -3965565189557706469L;
 
+    private static final int DEFINED_BY_POM_GROUP_ID = -1;
+
     private String pomUrl;
 
     private File pomFile;
@@ -59,19 +61,13 @@
 
     private String projectGroupName;
 
-    private int selectedProjectGroup = -1;
+    private int selectedProjectGroup = DEFINED_BY_POM_GROUP_ID;
 
     private boolean disableGroupSelection;
 
     public String execute()
         throws ContinuumException
     {
-        if ( selectedProjectGroup == -1 )
-        {
-            addActionError( "add.project.nogroup.error" );
-            return doDefault();
-        }
-        
         if ( !StringUtils.isEmpty( pomUrl ) )
         {
             try
@@ -154,6 +150,12 @@
     {
         Collection allProjectGroups = getContinuum().getAllProjectGroups();
         projectGroups = new ArrayList();
+
+        ProjectGroup defaultGroup = new ProjectGroup();
+        defaultGroup.setId( DEFINED_BY_POM_GROUP_ID );
+        defaultGroup.setName( "Defined by POM" );
+        projectGroups.add( defaultGroup );
+
         for ( Iterator i = allProjectGroups.iterator(); i.hasNext(); )
         {
             ProjectGroup pg = (ProjectGroup) i.next();
@@ -163,16 +165,16 @@
                 projectGroups.add( pg );
             //}
         }
-        
+
         if ( session.get( "lastViewedProjectGroup" ) != null )
         {
             selectedProjectGroup = ( (Integer) session.get( "lastViewedProjectGroup" ) ).intValue();
         }
         else
         {
-            selectedProjectGroup = -1;
+            selectedProjectGroup = DEFINED_BY_POM_GROUP_ID;
         }
-        if ( disableGroupSelection == true && selectedProjectGroup != -1 )
+        if ( disableGroupSelection == true && selectedProjectGroup != DEFINED_BY_POM_GROUP_ID
)
         {
             try
             {
@@ -269,7 +271,7 @@
 
     public SecureActionBundle getSecureActionBundle()
         throws SecureActionException
-        {
+    {
         SecureActionBundle bundle = new SecureActionBundle();
         bundle.setRequiresAuthentication( true );
         bundle.addRequiredAuthorization( ContinuumRoleConstants.CONTINUUM_ADD_GROUP_OPERATION
);
@@ -277,5 +279,4 @@
 
         return bundle;
     }
-
 }



Mime
View raw message