continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r478905 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-api/src/main/java/org/apache/maven/continuum/store/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java...
Date Fri, 24 Nov 2006 16:13:35 GMT
Author: evenisse
Date: Fri Nov 24 08:13:33 2006
New Revision: 478905

URL: http://svn.apache.org/viewvc?view=rev&rev=478905
Log:
[CONTINUUM-1014] Few patches from acegi branch
- base url autoconfiguration
- projectGroup choice in add maven2 project page
- add maven2 project link in project group page
Submitted by: Lester Ecarma

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
    maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/css/tigris.css

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java Fri Nov 24 08:13:33 2006
@@ -60,6 +60,8 @@
      * @return {@link Collection} <{@link ProjectGroup}>
      */
     public Collection getAllProjectGroupsWithProjects();
+    
+    public Collection getAllProjectGroups();
 
     public ProjectGroup getProjectGroupByProjectId( int projectId )
         throws ContinuumException;
@@ -69,6 +71,18 @@
 
     public void removeProjectGroup( int projectGroupId )
         throws ContinuumException;
+
+    public void addProjectGroup( ProjectGroup projectGroup )
+        throws ContinuumException;
+    
+    public ProjectGroup getProjectGroupWithProjects( int projectGroupId )
+        throws ContinuumException;
+
+    public ProjectGroup getProjectGroupByGroupId( String groupId )
+        throws ContinuumException;
+    
+    public ProjectGroup getProjectGroupByGroupIdWithBuildDetails( String groupId )
+        throws ContinuumException;
     
     // ----------------------------------------------------------------------
     // Project
@@ -83,6 +97,9 @@
     Project getProject( int projectId )
         throws ContinuumException;
 
+    Project getProjectWithBuildDetails( int projectId )
+        throws ContinuumException;
+
     List getAllProjectsWithAllDetails( int start, int end );
 
     Collection getAllProjects( int start, int end )
@@ -112,6 +129,7 @@
 
     boolean isInCheckoutQueue( int projectId )
         throws ContinuumException;
+
     // ----------------------------------------------------------------------
     // Building
     // ----------------------------------------------------------------------
@@ -184,6 +202,9 @@
     ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl )
         throws ContinuumException;
 
+    ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId )
+        throws ContinuumException;
+
     /**
      * Add a Maven 1 project to the list of projects. 
      * 
@@ -197,6 +218,9 @@
     void updateProject( Project project )
         throws ContinuumException;
 
+    void updateProjectGroup( ProjectGroup projectGroup )
+        throws ContinuumException;
+
     Project getProjectWithCheckoutResult( int projectId )
         throws ContinuumException;
 
@@ -213,22 +237,22 @@
     ProjectNotifier getNotifier( int projectId, int notifierId )
         throws ContinuumException;
 
-    ProjectNotifier getGroupNotifier( int projectGroupId, int notifierId )
+    ProjectNotifier updateNotifier( int projectId, ProjectNotifier notifier )
         throws ContinuumException;
 
-    ProjectNotifier updateNotifier( int projectId, ProjectNotifier notifier )
+    ProjectNotifier addNotifier( int projectId, ProjectNotifier notifier )
         throws ContinuumException;
 
-    ProjectNotifier updateGroupNotifier( int projectGroupId, ProjectNotifier notifier )
+    void removeNotifier( int projectId, int notifierId )
         throws ContinuumException;
 
-    ProjectNotifier addNotifier( int projectId, ProjectNotifier notifier )
+    ProjectNotifier getGroupNotifier( int projectGroupId, int notifierId )
         throws ContinuumException;
 
-    ProjectNotifier addGroupNotifier( int projectGroupId, ProjectNotifier notifier )
+    ProjectNotifier updateGroupNotifier( int projectGroupId, ProjectNotifier notifier )
         throws ContinuumException;
 
-    void removeNotifier( int projectId, int notifierId )
+    ProjectNotifier addGroupNotifier( int projectGroupId, ProjectNotifier notifier )
         throws ContinuumException;
 
     void removeGroupNotifier( int projectGroupId, int notifierId )

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java (original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java Fri Nov 24 08:13:33 2006
@@ -111,6 +111,8 @@
         throws ContinuumStoreException;
 
     Collection getAllProjectGroupsWithProjects();
+    
+    Collection getAllProjectGroups();
 
     List getAllProjectsByName();
 
@@ -184,6 +186,9 @@
     ProjectGroup getProjectGroupWithBuildDetails( int projectGroupId )
         throws ContinuumObjectNotFoundException, ContinuumStoreException;
 
+    List getProjectsInGroup( int projectGroupId )
+        throws ContinuumObjectNotFoundException, ContinuumStoreException;
+    
     ProjectGroup getProjectGroupWithProjects( int projectGroupId )
         throws ContinuumObjectNotFoundException, ContinuumStoreException;
 
@@ -201,6 +206,9 @@
         throws ContinuumObjectNotFoundException, ContinuumStoreException;
 
     ProjectGroup getProjectGroupByGroupId( String groupId )
+        throws ContinuumStoreException, ContinuumObjectNotFoundException;
+
+    ProjectGroup getProjectGroupByGroupIdWithBuildDetails( String groupId )
         throws ContinuumStoreException, ContinuumObjectNotFoundException;
 
     ProjectGroup getProjectGroupByGroupIdWithProjects( String groupId )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Fri Nov 24 08:13:33 2006
@@ -216,6 +216,19 @@
         throw new ContinuumException( "invalid group id" );
     }
 
+    public ProjectGroup getProjectGroupWithProjects( int projectGroupId )
+        throws ContinuumException
+    {
+        try
+        {
+            return store.getProjectGroupWithProjects( projectGroupId );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new ContinuumException( "could not find project group containing " + projectGroupId );
+        }
+    }
+    
     public ProjectGroup getProjectGroupByProjectId( int projectId )
         throws ContinuumException
     {
@@ -236,6 +249,105 @@
 
         store.removeProjectGroup( projectGroup );
     }
+    
+    public void addProjectGroup( ProjectGroup projectGroup )
+        throws ContinuumException
+    {
+        ProjectGroup pg = null;
+        
+        try
+        {
+            pg = store.getProjectGroupByGroupId( projectGroup.getGroupId() );
+        }
+        catch ( ContinuumObjectNotFoundException e )
+        {
+            //since we want to add a new project group, we should be getting 
+            //this exception
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new ContinuumException( "Unable to add the requested project group", e );
+        }
+        
+        if ( pg == null )
+        {
+
+            ProjectGroup new_pg = store.addProjectGroup( projectGroup );
+            
+            try
+            {
+                addBuildDefinitionToProjectGroup( new_pg.getId(), getDefaultBuildDefinition() );
+            }
+            catch ( ContinuumStoreException e )
+            {
+                throw new ContinuumException( "Error adding default build definition to the requested project group", e );
+            }
+            
+            getLogger().info( "Added new project group: " + new_pg.getName() );
+        }
+        else
+        {
+            throw new ContinuumException( "Unable to add the requested project group: groupId already exists." );
+        }
+    }
+    
+    private BuildDefinition getDefaultBuildDefinition()
+        throws ContinuumStoreException
+    {
+        BuildDefinition bd = new BuildDefinition();
+
+        bd.setDefaultForProject( true );
+
+        bd.setGoals( "clean install" );
+
+        bd.setArguments( "--batch-mode --non-recursive" );
+
+        bd.setBuildFile( "pom.xml" );
+
+        bd.setSchedule( store.getScheduleByName( DefaultContinuumInitializer.DEFAULT_SCHEDULE_NAME ) );
+
+        return bd;
+    }
+    
+    public Collection getAllProjectGroups()
+    {
+        return store.getAllProjectGroups();
+    }
+    
+    public ProjectGroup getProjectGroupByGroupId( String groupId )
+        throws ContinuumException
+    {
+        try
+        {
+            return store.getProjectGroupByGroupId( groupId );
+        }
+        catch ( ContinuumObjectNotFoundException e )
+        {
+            throw new ContinuumException( "Unable to find project group", e);
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new ContinuumException( "Error retrieving", e);
+        }
+    }
+    
+    public ProjectGroup getProjectGroupByGroupIdWithBuildDetails( String groupId )
+        throws ContinuumException
+    {
+        try
+        {
+            return store.getProjectGroupByGroupIdWithBuildDetails( groupId );
+        }
+        catch ( ContinuumObjectNotFoundException e )
+        {
+            throw new ContinuumException( "Unable to find project group", e);
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new ContinuumException( "Error retrieving", e);
+        }
+    }
+
 
     // ----------------------------------------------------------------------
     // Projects
@@ -423,6 +535,19 @@
         }
     }
 
+    public Project getProjectWithBuildDetails( int projectId )
+        throws ContinuumException
+    {
+        try
+        {
+            return store.getProjectWithBuildDetails( projectId );
+        }
+        catch ( ContinuumStoreException ex )
+        {
+            throw logAndCreateException( "Exception while getting project '" + projectId + "'.", ex );
+        }
+    }
+
     public Collection getAllProjects( int start, int end )
         throws ContinuumException
     {
@@ -506,24 +631,59 @@
         }
 
         //Map buildDefinitionsIds = store.getDefaultBuildDefinitions();
+        
+        BuildDefinition groupDefaultBD = null;
+        try
+        {
+            groupDefaultBD = store.getDefaultBuildDefinitionForProjectGroup( projectGroupId );
+        }
+        catch ( ContinuumObjectNotFoundException e )
+        {
+            throw new ContinuumException(
+                                         "Project Group (id="
+                                             + projectGroupId
+                                             + " doens't have a default build definition, this should be impossible, it should always have a default definition set." );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new ContinuumException(
+                                         "Project Group (id="
+                                             + projectGroupId
+                                             + " doens't have a default build definition, this should be impossible, it should always have a default definition set." );
+        }
 
         for ( Iterator i = projectsList.iterator(); i.hasNext(); )
         {
             Project project = (Project) i.next();
 
-            Integer buildDefId = null;
+            int buildDefId = groupDefaultBD.getId();
 
+            BuildDefinition projectDefaultBD = null;
             try
             {
-                buildDefId = new Integer( store.getDefaultBuildDefinition( project.getId() ).getId() );
+                projectDefaultBD = store.getDefaultBuildDefinitionForProject( project.getId() );
+            }
+            catch ( ContinuumObjectNotFoundException e )
+            {
+                getLogger().debug( e.getMessage() );
             }
             catch ( ContinuumStoreException e )
             {
-                throw new ContinuumException(
-                    "Project (id=" + project.getId() + " doens't have a default build definition, this should be impossible, parent should have default definition set." );
+                getLogger().debug( e.getMessage() );
+            }
+
+            if( projectDefaultBD != null )
+            {
+                buildDefId = projectDefaultBD.getId();
+                getLogger().debug( "Project " + project.getId() + " has own default build definition, will use it instead of group's.");
+            }
+            else if( !"maven2".equals( project.getExecutorId() ) )
+            {
+                getLogger().debug( "Project " + project.getId() + " is not a maven2 project, will not be included in group build.");
+                continue;
             }
 
-            buildProject( project, buildDefId.intValue(), ContinuumProjectState.TRIGGER_FORCED );
+            buildProject( project, buildDefId, ContinuumProjectState.TRIGGER_FORCED );
         }
     }
 
@@ -866,6 +1026,12 @@
         return executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID );
     }
 
+    public ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId )
+        throws ContinuumException
+    {
+        return executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID, projectGroupId );
+    }
+
     // ----------------------------------------------------------------------
     // Shell projects
     // ----------------------------------------------------------------------
@@ -942,7 +1108,15 @@
      * @throws ContinuumException
      */
     private ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
-                                                                                   String projectBuilderId )
+                                                                                  String projectBuilderId )
+        throws ContinuumException
+    {
+        return executeAddProjectsFromMetadataActivity( metadataUrl, projectBuilderId, -1 );
+    }
+
+    private ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
+                                                                                  String projectBuilderId,
+                                                                                  int projectGroupId )
         throws ContinuumException
     {
         Map context = new HashMap();
@@ -1005,33 +1179,36 @@
 
         try
         {
-            try
-            {
-                projectGroup = store.getProjectGroupByGroupIdWithProjects( projectGroup.getGroupId() );
-
-                getLogger().info(
-                    "Using existing project group with the group id: '" + projectGroup.getGroupId() + "'." );
-            }
-            catch ( ContinuumObjectNotFoundException e )
-            {
-                getLogger().info( "Creating project group with the group id: '" + projectGroup.getGroupId() + "'." );
-
-                Map pgContext = new HashMap();
-
-                pgContext.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
-
-                pgContext.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT_GROUP, projectGroup );
-
-                executeAction( "validate-project-group", pgContext );
-
-                executeAction( "store-project-group", pgContext );
-
-                int projectGroupId = AbstractContinuumAction.getProjectGroupId( pgContext );
-
-
-
-                projectGroup = store.getProjectGroupWithProjects( projectGroupId );
+            if (projectGroupId == -1) {
+                try
+                {
+                    projectGroup = store.getProjectGroupByGroupId( projectGroup.getGroupId() );
+    
+                    projectGroupId = projectGroup.getId();
+    
+                    getLogger().info(
+                                      "Using existing project group with the group id: '" + projectGroup.getGroupId()
+                                          + "'." );
+                }
+                catch ( ContinuumObjectNotFoundException e )
+                {
+                    getLogger().info( "Creating project group with the group id: '" + projectGroup.getGroupId() + "'." );
+    
+                    Map pgContext = new HashMap();
+    
+                    pgContext.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
+    
+                    pgContext.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT_GROUP, projectGroup );
+    
+                    executeAction( "validate-project-group", pgContext );
+    
+                    executeAction( "store-project-group", pgContext );
+    
+                    projectGroupId = AbstractContinuumAction.getProjectGroupId( pgContext );
+                }
             }
+    
+            projectGroup = store.getProjectGroupWithBuildDetails( projectGroupId );
 
             /* add the project group loaded from database, which has more info, like id */
             result.getProjectGroups().remove( 0 );
@@ -1220,6 +1397,7 @@
         return notifierProperties;
     }
     */
+    
     public ProjectNotifier addNotifier( int projectId, ProjectNotifier notifier )
         throws ContinuumException
     {
@@ -1317,6 +1495,7 @@
         return addNotifier( projectId, notifier );
     }
     */
+
     public void removeNotifier( int projectId, int notifierId )
         throws ContinuumException
     {
@@ -2457,6 +2636,19 @@
         }
     }
 
+    public void updateProjectGroup( ProjectGroup projectGroup )
+        throws ContinuumException
+    {
+        try
+        {
+            store.updateProjectGroup( projectGroup );
+        }
+        catch ( ContinuumStoreException cse )
+        {
+            throw logAndCreateException( "Error while updating project group.", cse );
+        }
+    }
+
     public void removeNotifier( ProjectNotifier notifier )
         throws ContinuumException
     {
@@ -2573,7 +2765,7 @@
     {
         try
         {
-            return store.getProjectGroupWithProjects( projectGroupId ).getProjects();
+            return store.getProjectsInGroup( projectGroupId );
         }
         catch ( ContinuumObjectNotFoundException e )
         {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java Fri Nov 24 08:13:33 2006
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.model.system.SystemConfiguration;
@@ -129,6 +130,23 @@
         return schedule;
     }
 
+    private BuildDefinition getDefaultBuildDefinition() 
+        throws ContinuumStoreException
+    {
+        BuildDefinition bd = new BuildDefinition();
+        
+        bd.setDefaultForProject( true );
+    
+        bd.setGoals( "clean install" );
+    
+        bd.setArguments( "--batch-mode --non-recursive" );
+    
+        bd.setBuildFile( "pom.xml" );
+    
+        bd.setSchedule( store.getScheduleByName( DefaultContinuumInitializer.DEFAULT_SCHEDULE_NAME ) );
+        
+        return bd;
+    }
 
     private void createDefaultProjectGroup()
         throws ContinuumStoreException
@@ -147,6 +165,8 @@
             group.setGroupId( Continuum.DEFAULT_PROJECT_GROUP_GROUP_ID );
 
             group.setDescription( "Contains all projects that do not have a group of their own" );
+            
+            group.getBuildDefinitions().add( getDefaultBuildDefinition() );
 
             group = store.addProjectGroup( group );
         }

Modified: maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java (original)
+++ maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java Fri Nov 24 08:13:33 2006
@@ -733,6 +733,11 @@
     {
         return getAllObjectsDetached( ProjectGroup.class, "name ascending", PROJECTGROUP_PROJECTS_FETCH_GROUP );
     }
+    
+    public Collection getAllProjectGroups()
+    {
+        return getAllObjectsDetached( ProjectGroup.class, "name ascending", null );
+    }
 
     public List getAllProjectsByName()
     {
@@ -1091,6 +1096,39 @@
         }
     }
 
+    public List getProjectsInGroup( int projectGroupId )
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
+    {
+        PersistenceManager pm = getPersistenceManager();
+
+        Transaction tx = pm.currentTransaction();
+
+        try
+        {
+            tx.begin();
+
+            Extent extent = pm.getExtent( Project.class, true );
+
+            Query query = pm.newQuery( extent, "projectGroup.id == " + projectGroupId );
+
+            query.setOrdering( "name ascending" );
+
+            pm.getFetchPlan().addGroup( PROJECTGROUP_PROJECTS_FETCH_GROUP );
+
+            List result = (List) query.execute();
+
+            result = (List) pm.detachCopyAll( result );
+
+            tx.commit();
+
+            return result;
+        }
+        finally
+        {
+            rollback( tx );
+        }
+    }
+
     public ProjectGroup getProjectGroupWithProjects( int projectGroupId )
         throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
@@ -1185,6 +1223,12 @@
         throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         return (ProjectGroup) getObjectFromQuery( ProjectGroup.class, "groupId", groupId, null );
+    }
+
+    public ProjectGroup getProjectGroupByGroupIdWithBuildDetails( String groupId )
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
+    {
+        return (ProjectGroup) getObjectFromQuery( ProjectGroup.class, "groupId", groupId, PROJECT_BUILD_DETAILS_FETCH_GROUP );
     }
 
     public ProjectGroup getProjectGroupByGroupIdWithProjects( String groupId )

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java Fri Nov 24 08:13:33 2006
@@ -36,7 +36,7 @@
     extends AddMavenProjectAction
 {
 
-    protected ContinuumProjectBuildingResult doExecute( String pomUrl )
+    protected ContinuumProjectBuildingResult doExecute( String pomUrl, int selectedProjectGroup )
         throws ContinuumException
     {
         return getContinuum().addMavenOneProject( pomUrl );

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=478905&r1=478904&r2=478905
==============================================================================
--- 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 Fri Nov 24 08:13:33 2006
@@ -18,9 +18,13 @@
 
 import java.io.File;
 import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Iterator;
 
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.codehaus.plexus.util.StringUtils;
 
@@ -41,13 +45,56 @@
     private File pomFile;
 
     private String pom = null;
+    
+    private String username;
+    
+    private String password;
+
+    private Collection projectGroups;
+
+    private String projectGroupName;
+
+    private int selectedProjectGroup = -1;
+
+    private boolean disableGroupSelection;
 
     public String execute()
         throws ContinuumException
     {
+        if ( selectedProjectGroup == -1 )
+        {
+            addActionError( "add.project.nogroup.error" );
+            return doDefault();
+        }
+        
         if ( !StringUtils.isEmpty( pomUrl ) )
         {
-            pom = pomUrl;
+            try
+            {
+                URL url = new URL( pomUrl );
+                if ( pomUrl.startsWith( "http" ) && !StringUtils.isEmpty( username ) )
+                {
+                    StringBuffer urlBuffer = new StringBuffer();
+                    urlBuffer.append( url.getProtocol() ).append( "://" );
+                    urlBuffer.append( username ).append( ':' ).append( password ).append( '@' ).append( url.getHost() );
+                    if ( url.getPort() != -1 )
+                    {
+                        urlBuffer.append( url.getPort() );
+                    }
+                    urlBuffer.append( url.getPath() );
+                    
+                    pom = urlBuffer.toString();
+                }
+                else
+                {
+                    pom = pomUrl;
+                }
+            }
+            catch ( MalformedURLException e )
+            {
+                addActionError( "add.project.unknown.error" );
+                return doDefault();
+            }
         }
         else
         {
@@ -67,11 +114,11 @@
             {
                 // no url or file was filled
                 addActionError( "add.project.field.required.error" );
-                return INPUT;
+                return doDefault();
             }
         }
 
-        ContinuumProjectBuildingResult result = doExecute( pom );
+        ContinuumProjectBuildingResult result = doExecute( pom, selectedProjectGroup );
 
         if ( result.hasErrors() )
         {
@@ -82,7 +129,7 @@
                 addActionError( (String) it.next() );
             }
 
-            return INPUT;
+            return doDefault();
         }
 
         return SUCCESS;
@@ -92,13 +139,46 @@
      * Subclasses must implement this method calling the appropiate operation on the continuum service.
      * 
      * @param pomUrl url of the pom specified by the user
+     * @param selectedProjectGroup project group id selected by the user
      * @return result of adding the pom to continuum
      */
-    protected abstract ContinuumProjectBuildingResult doExecute( String pomUrl )
+    protected abstract ContinuumProjectBuildingResult doExecute( String pomUrl, int selectedProjectGroup )
         throws ContinuumException;
 
     public String doDefault()
     {
+        Collection allProjectGroups = getContinuum().getAllProjectGroups();
+        projectGroups = new ArrayList();
+        for ( Iterator i = allProjectGroups.iterator(); i.hasNext(); )
+        {
+            ProjectGroup pg = (ProjectGroup) i.next();
+            //TODO: must implement same functionality using plexus-security
+            //if ( pg.getPermissions().isWrite() )
+            //{
+                projectGroups.add( pg );
+            //}
+        }
+        
+        if ( session.get( "lastViewedProjectGroup" ) != null )
+        {
+            selectedProjectGroup = ( (Integer) session.get( "lastViewedProjectGroup" ) ).intValue();
+        }
+        else
+        {
+            selectedProjectGroup = -1;
+        }
+        if ( disableGroupSelection == true && selectedProjectGroup != -1 )
+        {
+            try
+            {
+                projectGroupName = getContinuum().getProjectGroup( selectedProjectGroup ).getName();
+            }
+            catch ( ContinuumException e )
+            {
+                e.printStackTrace();
+            }
+        }
+
         return INPUT;
     }
 
@@ -130,5 +210,55 @@
     public void setPomUrl( String pomUrl )
     {
         this.pomUrl = pomUrl;
+    }
+
+    public void setPassword( String password )
+    {
+        this.password = password;
+    }
+
+    public String getUsername()
+    {
+        return username;
+    }
+
+    public void setUsername( String username )
+    {
+        this.username = username;
+    }
+
+    public Collection getProjectGroups()
+    {
+        return projectGroups;
+    }
+
+    public String getProjectGroupName()
+    {
+        return projectGroupName;
+    }
+
+    public void setProjectGroupName( String projectGroupName )
+    {
+        this.projectGroupName = projectGroupName;
+    }
+
+    public int getSelectedProjectGroup()
+    {
+        return selectedProjectGroup;
+    }
+
+    public void setSelectedProjectGroup( int selectedProjectGroup )
+    {
+        this.selectedProjectGroup = selectedProjectGroup;
+    }
+
+    public boolean isDisableGroupSelection()
+    {
+        return this.disableGroupSelection;
+    }
+
+    public void setDisableGroupSelection( boolean disableGroupSelection )
+    {
+        this.disableGroupSelection = disableGroupSelection;
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java Fri Nov 24 08:13:33 2006
@@ -36,15 +36,15 @@
     extends AddMavenProjectAction
 {
 
-    protected ContinuumProjectBuildingResult doExecute( String pomUrl )
+    protected ContinuumProjectBuildingResult doExecute( String pomUrl, int selectedProjectGroup )
         throws ContinuumException
     {
-        return getContinuum().addMavenTwoProject( pomUrl );
+        return getContinuum().addMavenTwoProject( pomUrl, selectedProjectGroup );
     }
 
     public String doDefault()
     {
-        return INPUT;
+        return super.doDefault();
     }
 
     /**

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java Fri Nov 24 08:13:33 2006
@@ -26,6 +26,7 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.List;
 
 /**
  * BuildDefinitionAction:
@@ -109,8 +110,13 @@
             }
             else
             {
-                Project project = (Project) getContinuum().getProjectGroup( projectGroupId ).getProjects().get( 0 );
-                executor = project.getExecutorId();
+                List projects = getContinuum().getProjectGroup( projectGroupId ).getProjects();
+                
+                if( projects.size() > 0 )
+                {
+                    Project project = (Project) projects.get( 0 );
+                    executor = project.getExecutorId();
+                }
             }
         }
 
@@ -125,7 +131,20 @@
             defaultBuildDefinition = buildDefinition.isDefaultForProject();
         }
 
-        return SUCCESS;
+        return INPUT;
+    }
+
+    public String saveBuildDefinition()
+        throws ContinuumException
+    {
+        if (projectId != 0)
+        {
+            return saveToProject();
+        }
+        else
+        {
+            return saveToGroup();
+        }
     }
 
     public String saveToProject()
@@ -157,13 +176,20 @@
     {
         try
         {
+            BuildDefinition newBuildDef = getBuildDefinitionFromInput();
+            
+            if ( getContinuum().getBuildDefinitionsForProjectGroup( projectGroupId ).size() == 0 )
+            {
+                newBuildDef.setDefaultForProject( true );
+            }
+            
             if ( buildDefinitionId == 0 )
             {
-                getContinuum().addBuildDefinitionToProjectGroup( projectGroupId, getBuildDefinitionFromInput() );
+                getContinuum().addBuildDefinitionToProjectGroup( projectGroupId, newBuildDef );
             }
             else
             {
-                getContinuum().updateBuildDefinitionForProjectGroup( projectGroupId, getBuildDefinitionFromInput() );
+                getContinuum().updateBuildDefinitionForProjectGroup( projectGroupId, newBuildDef );
             }
         }
         catch ( ContinuumActionException cae )
@@ -172,7 +198,7 @@
             return INPUT;
         }
 
-        return SUCCESS;
+        return "success_group";
     }
 
     public String removeFromProject()

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java Fri Nov 24 08:13:33 2006
@@ -24,6 +24,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.web.bean.ProjectGroupUserBean;
 import org.apache.maven.continuum.ContinuumException;
@@ -70,8 +71,20 @@
 
     private ProjectGroup projectGroup;
 
+    private String name;
+
+    private String description;
+
+    private Map projects = new HashMap();
+
+    private Map projectGroups = new HashMap();
+
     private boolean confirmed;
     
+    private boolean projectInCOQueue = false;
+
+    private Collection projectList;
+
     private List projectGroupUsers;
     
     private String filterProperty;
@@ -84,6 +97,7 @@
         throws ContinuumException
     {
         projectGroup = getContinuum().getProjectGroup( projectGroupId );
+        session.put( "lastViewedProjectGroup", new Integer( projectGroupId ) );
 
         return SUCCESS;
     }
@@ -126,6 +140,87 @@
         return SUCCESS;
     }
 
+    public String edit()
+        throws ContinuumException
+    {
+        projectGroup = getProjectGroup( projectGroupId );
+
+        name = projectGroup.getName();
+
+        description = projectGroup.getDescription();
+
+        projectList = getContinuum().getProjectsInGroup( projectGroupId );
+        
+        if( projectList != null )
+        {
+            Iterator proj = projectList.iterator();
+            
+            while ( proj.hasNext() )
+            {
+                Project p = (Project) proj.next();
+                if ( getContinuum().isInCheckoutQueue( p.getId() ) )
+                {
+                    projectInCOQueue = true;
+                }
+                projects.put( p, new Integer( p.getProjectGroup().getId() ) );
+            }
+        }
+
+        Iterator proj_group = getContinuum().getAllProjectGroupsWithProjects().iterator();
+        while ( proj_group.hasNext() )
+        {
+            ProjectGroup pg = (ProjectGroup) proj_group.next();
+            projectGroups.put( new Integer( pg.getId() ), pg.getName() );
+        }
+
+        return SUCCESS;
+    }
+
+    public String save()
+        throws ContinuumException
+    {
+        projectGroup = getContinuum().getProjectGroupWithProjects( projectGroupId );
+
+        projectGroup.setName( name );
+
+        projectGroup.setDescription( description );
+
+        getContinuum().updateProjectGroup( projectGroup );
+
+        Iterator keys = projects.keySet().iterator();
+        while ( keys.hasNext() )
+        {
+            String key = (String) keys.next();
+
+            String [] id = (String []) projects.get( key );
+            
+            int projectId = Integer.parseInt( key );
+
+            Project project = null;
+            Iterator i = projectGroup.getProjects().iterator();
+            while( i.hasNext() )
+            {
+                project = (Project) i.next();
+                if( projectId == project.getId() )
+                {
+                    break;
+                }
+            }
+            
+            ProjectGroup newProjectGroup = getProjectGroup( new Integer (id[0]).intValue() );
+            
+            if ( newProjectGroup.getId() != projectGroup.getId() )
+            {
+                getLogger().info( "Moving project " + project.getName() + " to project group "
+                                      + newProjectGroup.getName() );
+                project.setProjectGroup( newProjectGroup );
+                getContinuum().updateProject( project );
+            }
+        }
+
+        return SUCCESS;
+    }
+
     public String build()
         throws ContinuumException
     {
@@ -224,6 +319,12 @@
         return projectGroup;
     }
 
+    public ProjectGroup getProjectGroup( int projectGroupId )
+        throws ContinuumException
+    {
+        return getContinuum().getProjectGroup( projectGroupId );
+    }
+
     public void setProjectGroup( ProjectGroup projectGroup )
     {
         this.projectGroup = projectGroup;
@@ -239,6 +340,60 @@
         this.confirmed = confirmed;
     }
 
+    public String getDescription()
+    {
+        return description;
+    }
+
+    public void setDescription( String description )
+    {
+        this.description = description;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+    public Map getProjects()
+    {
+        return projects;
+    }
+
+    public void setProjects( Map projects )
+    {
+        this.projects = projects;
+    }
+
+    public Map getProjectGroups()
+    {
+        return projectGroups;
+    }
+
+    public void setProjectGroups( Map projectGroups )
+    {
+        this.projectGroups = projectGroups;
+    }
+
+    public boolean isProjectInCOQueue()
+    {
+        return projectInCOQueue;
+    }
+
+    public void setProjectInCOQueue( boolean projectInQueue )
+    {
+        this.projectInCOQueue = projectInQueue;
+    }
+
+    public Collection getProjectList()
+    {
+        return projectList;
+    }
     public List getProjectGroupUsers()
     {
         return projectGroupUsers;

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java Fri Nov 24 08:13:33 2006
@@ -18,6 +18,7 @@
 
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectGroup;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -36,6 +37,11 @@
     private int projectId;
 
     /**
+     * Target {@link ProjectGroup} to view.
+     */
+    private ProjectGroup projectGroup;
+
+    /**
      * Identifier for the target {@link ProjectGroup} to obtain for 
      * viewing.
      */
@@ -44,6 +50,8 @@
     public String execute()
         throws ContinuumException
     {
+        projectGroup = getContinuum().getProjectGroup( projectGroupId );
+
         project = getContinuum().getProjectWithAllDetails( projectId );
 
         return SUCCESS;
@@ -81,4 +89,16 @@
     {
         this.projectGroupId = projectGroupId;
     }
+
+    /**
+     * Returns the {@link ProjectGroup} instance obtained for 
+     * the specified project group Id, or null if it were not set.
+     * 
+     * @return the projectGroup
+     */
+    public ProjectGroup getProjectGroup()
+    {
+        return projectGroup;
+    }
+
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java Fri Nov 24 08:13:33 2006
@@ -49,14 +49,16 @@
     private int nbErrors;
 
     private List summary;
+    
+    private List projects;
 
     public String execute()
         throws ContinuumException
     {
-        Collection projects;
+        Collection projectsInGroup;
 
         //TODO: Create a summary jpox request so code will be more simple and performance will be better
-        projects = getContinuum().getProjectsInGroup( projectGroupId );
+        projectsInGroup = getContinuum().getProjectsInGroup( projectGroupId );
 
         Map buildResults = getContinuum().getLatestBuildResults();
 
@@ -64,7 +66,7 @@
 
         summary = new ArrayList();
 
-        for ( Iterator i = projects.iterator(); i.hasNext(); )
+        for ( Iterator i = projectsInGroup.iterator(); i.hasNext(); )
         {
             Project project = (Project) i.next();
 
@@ -150,6 +152,10 @@
         return summary;
     }
 
+    public void setProjects( List projects )
+    {
+        this.projects = projects;
+    }
 
     public int getProjectGroupId()
     {

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java Fri Nov 24 08:13:33 2006
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+import com.opensymphony.webwork.ServletActionContext;
 import com.opensymphony.xwork.Preparable;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.configuration.ConfigurationStoringException;
@@ -32,8 +33,10 @@
 import org.codehaus.plexus.security.user.User;
 import org.codehaus.plexus.security.user.UserManager;
 import org.codehaus.plexus.security.user.UserNotFoundException;
+import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
+import javax.servlet.http.HttpServletRequest;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -89,6 +92,14 @@
         buildOutputDirectory = configuration.getBuildOutputDirectory().getAbsolutePath();
 
         baseUrl = configuration.getUrl();
+
+        if ( StringUtils.isEmpty( baseUrl ) )
+        {
+            HttpServletRequest request = ServletActionContext.getRequest();
+            baseUrl = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+                + request.getContextPath();
+            getLogger().info( "baseUrl='" + baseUrl + "'" );
+        }
 
         companyLogo = configuration.getCompanyLogo();
 

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=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties Fri Nov 24 08:13:33 2006
@@ -25,6 +25,10 @@
 # Page: Top
 # ----------------------------------------------------------------------
 top.logo.default = [Your company logo here]
+# ----------------------------------------------------------------------
+# Page: Bottom
+# ----------------------------------------------------------------------
+bottom.version.number = ${pom.parent.parent.version}
 
 # ----------------------------------------------------------------------
 # Page: Menu
@@ -43,6 +47,7 @@
 menu.administration.users = Users
 menu.administration.userGroups = User Groups
 menu.account.options = My account
+user.edit.account = Edit user info
 
 # ----------------------------------------------------------------------
 # Page: error
@@ -91,6 +96,30 @@
 groups.manage.label = Manage Group
 
 # ----------------------------------------------------------------------
+# Page: Add Project Group
+# ----------------------------------------------------------------------
+projectGroup.add.page.title = Continuum - Add Continuum Project Group
+projectGroup.add.section.title = Add Continuum Project Group
+projectGroup.add.name.label = Project Group Name
+projectGroup.add.groupId.label = Project Group Id
+projectGroup.add.description.label = Description
+projectGroup.error.name.required = Project Group Name required.
+projectGroup.error.name.already.exists = Project Group Name already exists.
+projectGroup.error.groupId.required = Project Group ID required.
+
+# ----------------------------------------------------------------------
+# Page: Edit Project Group
+# ----------------------------------------------------------------------
+projectGroup.edit.page.title = Continuum - Update Continuum Project Group
+projectGroup.edit.section.title = Update Continuum Project Group
+projectGroup.edit.name.label = Project Group Name
+projectGroup.edit.groupId.label = Project Group Id
+projectGroup.edit.description.label = Description
+projectGroup.edit.project.name = Project Name
+projectGroup.edit.move.to.group = Move to Group
+project.in.checkout.queue.error = Cannot edit this project group. Projects that are members of this project group are still being checked out from scm.
+
+# ----------------------------------------------------------------------
 # Page: Configuration
 # ----------------------------------------------------------------------
 configuration.page.title = Continuum - Configuration
@@ -138,6 +167,7 @@
 add.project.artifact.not.found.error = Missing artifact trying to build the POM. Check that its parent POM is available or add it first in Continuum.
 add.project.project.building.error = Unknown error trying to build POM.
 add.project.unknown.error = The specified resource cannot be accessed. Please try again later or contact your administrator.
+add.project.nogroup.error = No project group specified.
 
 # ----------------------------------------------------------------------
 # Page: AddMavenOneProject
@@ -157,11 +187,14 @@
 add.m2.project.page.title = Continuum - Add Maven 2 Project
 add.m2.project.section.title = Add Maven 2.0+ Project
 add.m2.project.m2PomUrl.label = POM Url
-add.m2.project.m2PomUrl.message =  Enter the URL to the Maven 2 POM
+add.m2.project.m2PomUrl.username.label = Username
+add.m2.project.m2PomUrl.password.label = Password
+add.m2.project.m2PomUrl.message =  Enter the URL to the Maven 2 POM. Provide the username and password if it is a secured resource.
 add.m2.project.m2PomUrl.error = You must enter a valid URL
 add.m2.project.m2PomFile.label = Upload POM
 add.m2.project.m2PomFile.message =  Enter the local filename of the Maven 2 POM to upload (works only for a single project without modules).
 add.m2.project.m2PomFile.error = You must enter a valid URL
+add.m2.project.projectGroup = Project Group
 
 # ----------------------------------------------------------------------
 # Page: AddProject (ant or shell)
@@ -227,6 +260,7 @@
 projectView.notifier.events = Events
 projectView.notifier.from = From
 projectView.dependencies = Dependencies
+projectView.dependency.name = Name
 projectView.dependency.groupId = Group Id
 projectView.dependency.artifactId = Artifact Id
 projectView.dependency.version = Version
@@ -337,6 +371,12 @@
 buildResult.buildError = Build Error
 buildResult.buildOutput = Output
 buildResult.noOutput = No output.
+buildResult.changes = Changes
+buildResult.noChanges = No changes
+buildResult.changes.author = Author
+buildResult.changes.date = Date
+buildResult.changes.comment = Comment
+buildResult.changes.files = Files
 buildResult.scmResult.changes = SCM Changes
 buildResult.scmResult.noChanges = No SCM changes
 buildResult.scmResult.changes.author = Author

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Fri Nov 24 08:13:33 2006
@@ -178,6 +178,11 @@
       <result name="success">/WEB-INF/jsp/buildDefinitionEdit.jsp</result>
     </action>
 
+    <action name="saveBuildDefinition" class="buildDefinition" method="saveBuildDefinition">
+      <result name="success" type="chain">projectView</result>
+      <result name="success_group" type="chain">projectGroupBuildDefinition</result>
+    </action>
+
     <action name="saveProjectBuildDefinition" class="buildDefinition" method="saveToProject">
       <result name="input">/WEB-INF/jsp/buildDefinitionEdit.jsp</result>
       <result name="success" type="chain">projectView</result>
@@ -229,6 +234,20 @@
       <result name="success" type="redirect-action">
         <param name="actionName">groupSummary</param>
       </result>
+    </action>
+    
+    <action name="addProjectGroup" class="addProjectGroup">
+      <result name="input">/WEB-INF/jsp/projectGroupAdd.jsp</result>
+      <result name="success" type="chain">groupSummary</result>
+    </action>
+    
+    <action name="editProjectGroup" class="projectGroup" method="edit">
+        <result name="success">/WEB-INF/jsp/projectGroupEdit.jsp</result>
+    </action>
+    
+    <action name="saveProjectGroup" class="projectGroup" method="save">
+      <result name="success" type="chain">projectGroupSummary</result>
+      <result name="input">/WEB-INF/jsp/projectGroupEdit.jsp</result>
     </action>
 
     <!--

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp Fri Nov 24 08:13:33 2006
@@ -22,7 +22,21 @@
                         <table>
                           <tbody>
                             <ww:textfield label="%{getText('add.m2.project.m2PomUrl.label')}" name="m2PomUrl">
-                                <ww:param name="desc"><p><ww:text name="add.m2.project.m2PomUrl.message"/></p></ww:param>
+                                <ww:param name="desc">
+                                <table cellspacing="0" cellpadding="0">
+                                  <tbody>
+                                    <tr>
+                                      <td><ww:text name="add.m2.project.m2PomUrl.username.label"/>: </td>
+                                      <td><input type="text" name="username" size="20" id="addMavenTwoProject_username"/><td>
+                                    </tr>  
+                                    <tr>
+                                      <td><ww:text name="add.m2.project.m2PomUrl.password.label"/>: </td>
+                                      <td><input type="password" name="password" size="20" id="addMavenTwoProject_password"/><td>
+                                    </tr>  
+                                  </tbody>
+                                </table>  
+                                  <p><ww:text name="add.m2.project.m2PomUrl.message"/></p>
+                                </ww:param>
                             </ww:textfield>
                             <ww:label>
                               <ww:param name="after"><strong><ww:text name="or"/></strong></ww:param>
@@ -30,6 +44,14 @@
                             <ww:file label="%{getText('add.m2.project.m2PomFile.label')}" name="m2PomFile">
                                 <ww:param name="desc"><p><ww:text name="add.m2.project.m2PomFile.message"/></p></ww:param>
                             </ww:file>
+                            <ww:if test="disableGroupSelection == true">
+                              <ww:hidden name="selectedProjectGroup"/>
+                              <ww:hidden name="disableGroupSelection"/>
+                              <ww:textfield label="%{getText('add.m2.project.projectGroup')}" name="projectGroupName" disabled="true"/>
+                            </ww:if>
+                            <ww:else>
+                              <ww:select label="%{getText('add.m2.project.projectGroup')}" name="selectedProjectGroup" list="projectGroups" listKey="id" listValue="name"/>
+                            </ww:else>
                           </tbody>
                         </table>
                         <div class="functnbar3">

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp Fri Nov 24 08:13:33 2006
@@ -11,54 +11,62 @@
         <h3><ww:text name="buildDefinition.section.title"/></h3>
 
         <div class="axial">
-
-
-
-          <ww:if test="${projectId != 0}">
-            <ww:url id="actionUrl" action="saveProjectBuildDefinition" includeContext="false" />
-          </ww:if>
-          <ww:else>
-            <ww:url id="actionUrl" action="saveGroupBuildDefinition" includeContext="false" />
-          </ww:else>
-
-
-
-          <ww:form action="%{actionUrl}" method="post" validate="true">
-
-            <ww:hidden name="buildDefinitionId"/>
-            <ww:hidden name="projectId"/>
-            <ww:hidden name="projectGroupId"/>
-
-            <table>
-              <tbody>
-                <ww:if test="executor == 'ant'">
-                  <ww:textfield label="%{getText('buildDefinition.buildFile.ant.label')}" name="buildFile"  required="true"/>
-                </ww:if>
-                <ww:elseif test="executor == 'shell'">
-                  <ww:textfield label="%{getText('buildDefinition.buildFile.shell.label')}" name="buildFile" required="true"/>
-                </ww:elseif>
-                <ww:else>
-                  <ww:textfield label="%{getText('buildDefinition.buildFile.maven.label')}" name="buildFile" required="true"/>
-                </ww:else>
-
-                <ww:if test="executor == 'ant'">
-                  <ww:textfield label="%{getText('buildDefinition.goals.ant.label')}" name="goals"/>
-                </ww:if>
-                <ww:elseif test="executor == 'shell'">
-                </ww:elseif>
-                <ww:else>
-                  <ww:textfield label="%{getText('buildDefinition.goals.maven.label')}" name="goals"/>
-                </ww:else>
-
-                <ww:textfield label="%{getText('buildDefinition.arguments.label')}" name="arguments"/>
-                <ww:checkbox label="Build Fresh" name="buildFresh" value="buildFresh" fieldValue="true"/>
-                <ww:checkbox label="%{getText('buildDefinition.defaultForProject.label')}"  name="defaultBuildDefinition" value="defaultBuildDefinition" fieldValue="true"/>
-                <ww:select label="%{getText('buildDefinition.schedule.label')}" name="scheduleId" list="schedules"/>
-              </tbody>
-            </table>
-            <div class="functnbar3">
-              <c1:submitcancel value="%{getText('save')}" cancel="%{getText('cancel')}"/>
-            </div>
+          <ww:form action="saveBuildDefinition" method="post" validate="true">
+            <c:choose>
+            
+              <c:when test="${!empty actionErrors}">
+                <div class="errormessage">
+                  <c:forEach items="${actionErrors}" var="actionError">
+                    <p><ww:text name="${actionError}"/></p>
+                  </c:forEach>
+                </div>
+                <input type="button" value="Back" onClick="history.go(-1)">
+              </c:when>
+  
+              <c:when test="${empty actionErrors}">
+                <ww:hidden name="buildDefinitionId"/>
+                <ww:hidden name="projectId"/>
+                <ww:hidden name="projectGroupId"/>
+    
+                <table>
+                  <tbody>
+                    <ww:if test="executor == 'ant'">
+                      <ww:textfield label="%{getText('buildDefinition.buildFile.ant.label')}" name="buildFile"  required="true"/>
+                    </ww:if>
+                    <ww:elseif test="executor == 'shell'">
+                      <ww:textfield label="%{getText('buildDefinition.buildFile.shell.label')}" name="buildFile" required="true"/>
+                    </ww:elseif>
+                    <ww:else>
+                      <ww:textfield label="%{getText('buildDefinition.buildFile.maven.label')}" name="buildFile" required="true"/>
+                    </ww:else>
+    
+                    <ww:if test="executor == 'ant'">
+                      <ww:textfield label="%{getText('buildDefinition.goals.ant.label')}" name="goals"/>
+                    </ww:if>
+                    <ww:elseif test="executor == 'shell'">
+                    </ww:elseif>
+                    <ww:else>
+                      <ww:textfield label="%{getText('buildDefinition.goals.maven.label')}" name="goals"/>
+                    </ww:else>
+    
+                    <ww:textfield label="%{getText('buildDefinition.arguments.label')}" name="arguments"/>
+                    <ww:if test="defaultBuildDefinition == true">
+                      <ww:label label="%{getText('buildDefinition.defaultForProject.label')}" value="true"/>
+                      <ww:hidden name="defaultBuildDefinition" value="true"/>
+                    </ww:if>
+                    <ww:checkbox label="Build Fresh" name="buildFresh" value="buildFresh" fieldValue="true"/>
+                    <ww:else>
+                      <ww:checkbox label="%{getText('buildDefinition.defaultForProject.label')}"  name="defaultBuildDefinition" value="defaultBuildDefinition" fieldValue="true"/>
+                    </ww:else>
+                    <ww:select label="%{getText('buildDefinition.schedule.label')}" name="scheduleId" list="schedules"/>
+                  </tbody>
+                </table>
+                <div class="functnbar3">
+                  <c1:submitcancel value="%{getText('save')}" cancel="%{getText('cancel')}"/>
+                </div>
+              </c:when>
+            
+            </c:choose>
           </ww:form>
         </div>
       </div>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp Fri Nov 24 08:13:33 2006
@@ -38,6 +38,9 @@
         <ec:column property="numSuccesses" title="Build&nbsp;Status" width="1%" style="white-space: nowrap" cell="org.apache.maven.continuum.web.view.BuildStatusCell"/>
       </ec:row>
     </ec:table>
+    <pss:ifAnyAuthorized permissions="continuum-add-group">
+      <a href="<ww:url  action='addProjectGroup' method='input' namespace='/' />">Add a Project Group</a>
+    </pss:ifAnyAuthorized>
     </div>        
   </body>
 </ww:i18n>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp Fri Nov 24 08:13:33 2006
@@ -70,8 +70,18 @@
       </pss:ifAuthorized>
       </div>
     </div>
-
   </pss:ifAnyAuthorized>
+
+  <c:if test="${sessionScope.securitySession.authenticated}">
+  <div id="projectmenu" class="toolgroup">
+    <div class="label"><ww:text name="menu.account.options"/></div>
+    <ww:url id="accountUrl" action="account" namespace="/security" includeParams="none"/>
+    <div class="body">
+      <ww:a href="%{accountUrl}"><ww:text name="user.edit.account"/></ww:a>
+    </div>
+  </div>
+  </c:if>
+
   <div id="projectmenu" class="toolgroup">
     <div class="label">Legend</div>
     <div id="legend">

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp Fri Nov 24 08:13:33 2006
@@ -37,33 +37,50 @@
       <h3>Project Group Actions</h3>
 
       <div class="functnbar3">
-                    <table>
-               <tr>
-                    <td>
-                      <pss:ifAuthorized permission="continuum-build-group" resource="${projectGroup.name}">
-                        <form action="buildProjectGroup.action" method="post">
-                            <input type="hidden" name="projectGroupId" value="<ww:property value="projectGroupId"/>"/>
-                            <input type="submit" name="build" value="<ww:text name="build"/>"/>
-                        </form>
-                        </pss:ifAuthorized>
-                    </td>
-                    <td>
-                      <pss:ifAuthorized permission="continuum-remove-group" resource="${projectGroup.name}">
-                        <form action="removeProjectGroup.action" method="post">
-                            <input type="hidden" name="projectGroupId" value="<ww:property value="projectGroupId"/>"/>
-                            <input type="submit" name="remove" value="<ww:text name="delete"/>"/>
-                        </form>
-                      </pss:ifAuthorized>
-                    </td>                    
-                </tr>
-            </table>
-        </div>
+        <table>
+          <tr>
+            <td>
+              <pss:ifAuthorized permission="continuum-build-group" resource="${projectGroup.name}">
+                <form action="buildProjectGroup.action" method="post">
+                    <input type="hidden" name="projectGroupId" value="<ww:property value="projectGroupId"/>"/>
+                    <input type="submit" name="build" value="<ww:text name="Build"/>"/>
+                </form>
+                </pss:ifAuthorized>
+            <td>
+                <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroup.name}">
+                <form action="editProjectGroup.action" method="post">
+                    <input type="hidden" name="projectGroupId" value="<ww:property value="projectGroupId"/>"/>
+                    <input type="submit" name="edit" value="<ww:text name="Edit"/>"/>
+                </form>
+                </pss:ifAuthorized>
+            </td>
+            <td>
+              <pss:ifAuthorized permission="continuum-remove-group" resource="${projectGroup.name}">
+                <form action="removeProjectGroup.action" method="post">
+                    <input type="hidden" name="projectGroupId" value="<ww:property value="projectGroupId"/>"/>
+                    <input type="submit" name="remove" value="<ww:text name="Remove"/>"/>
+                </form>
+              </pss:ifAuthorized>
+            </td>
+          </tr>
+        </table>
+      </div>
     </pss:ifAnyAuthorized>
    
     <ww:action name="projectSummary" executeResult="true" namespace="component">
       <ww:param name="projectGroupId" value="%{projectGroupId}"/>
       <ww:param name="projectGroupName" value="%{projectGroup.name}"/>
     </ww:action>
+    
+    <div class="functnbar3">
+      <pss:ifAnyAuthorized permissions="continuum-add-project-to-group" resource="${projectGroup.name}">
+          <c:url var="addM2ProjectUrl" value="/addMavenTwoProject!default.action">
+            <c:param name="disableGroupSelection" value="true"/>
+          </c:url>
+          <a href="<c:out value='${addM2ProjectUrl}'/>"><ww:text name="add.m2.project.section.title"/></a>
+      </pss:ifAnyAuthorized>
+    </div>
+
   </div>
   </body>
 </ww:i18n>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/css/tigris.css
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/css/tigris.css?view=diff&rev=478905&r1=478904&r2=478905
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/css/tigris.css (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/css/tigris.css Fri Nov 24 08:13:33 2006
@@ -898,6 +898,18 @@
   padding: 10px 0px 8px 0px;
 }
 
+.composite #main #bodycol .app h2 {
+	font-size: small;
+}
+
+.securityTable th {
+    font-size: x-small;
+}
+
+.securityTable td {
+    font-size: 13px;
+}
+
 /*
 * Some extensions
 */
@@ -913,4 +925,4 @@
 /* CSS sibling selector - highlight error text input */
 tr [errorFor]+tr td input {
   border: 1px solid red;
-}
\ No newline at end of file
+}



Mime
View raw message