continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r358819 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ continuum-webapp/src...
Date Fri, 23 Dec 2005 15:46:33 GMT
Author: evenisse
Date: Fri Dec 23 07:46:15 2005
New Revision: 358819

URL: http://svn.apache.org/viewcvs?rev=358819&view=rev
Log:
Add add/edit/delete build definition

Added:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddBuildDefinitionAction.java
  (with props)
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionEditAction.java
  (with props)
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteBuildDefinitionAction.java
  (with props)
    maven/continuum/trunk/continuum-webapp/src/main/webapp/buildDefinitionEdit.jsp   (with
props)
    maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteBuildDefinition.jsp   (with
props)
Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml
    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/deleteProject.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/projectEdit.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=358819&r1=358818&r2=358819&view=diff
==============================================================================
--- 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 Dec 23 07:46:15 2005
@@ -176,7 +176,13 @@
     BuildDefinition getBuildDefinition( int projectId, int buildDefinitionId )
         throws ContinuumException;
 
+    void updateBuildDefinition( BuildDefinition buildDefinition, int projectId )
+        throws ContinuumException;
+
     void updateBuildDefinition( int projectId, int buildDefinitionId, Map configuration )
+        throws ContinuumException;
+
+    void addBuildDefinition( int projectId, BuildDefinition buildDefinition )
         throws ContinuumException;
 
     void addBuildDefinition( int projectId, Map configuration )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=358819&r1=358818&r2=358819&view=diff
==============================================================================
--- 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 Dec 23 07:46:15 2005
@@ -965,36 +965,56 @@
         return buildDefinition;
     }
 
-    public void updateBuildDefinition( int projectId, int buildDefinitionId, Map configuration
)
+    public void updateBuildDefinition( BuildDefinition buildDefinition, int projectId )
         throws ContinuumException
     {
-        BuildDefinition buildDefinition = getBuildDefinition( projectId, buildDefinitionId
);
+        BuildDefinition bd = getBuildDefinition( projectId, buildDefinition.getId() );
 
-        buildDefinition.setBuildFile( (String) configuration.get( "buildFile" ) );
+        bd.setBuildFile( buildDefinition.getBuildFile() );
 
-        buildDefinition.setGoals( (String) configuration.get( "goals" ) );
+        bd.setGoals( buildDefinition.getGoals() );
 
-        buildDefinition.setArguments( (String) configuration.get( "arguments" ) );
+        bd.setArguments( buildDefinition.getArguments() );
 
-        Schedule schedule = getSchedule( new Integer( (String) configuration.get( "schedule"
) ).intValue() );
+        Schedule schedule = getSchedule( buildDefinition.getSchedule().getId() );
 
-        buildDefinition.setSchedule( schedule );
+        bd.setSchedule( schedule );
 
-        if ( convertBoolean( (String) configuration.get( "defaultForProject" ) ) &&
!buildDefinition.isDefaultForProject() )
+        if ( buildDefinition.isDefaultForProject() && !bd.isDefaultForProject() )
         {
-            buildDefinition.setDefaultForProject( true );
+            bd.setDefaultForProject( true );
             
-            BuildDefinition bd = getDefaultBuildDefinition( projectId );
+            BuildDefinition defaultBd = getDefaultBuildDefinition( projectId );
 
-            if ( bd != null )
+            if ( defaultBd != null )
             {
-                bd.setDefaultForProject( false );
+                defaultBd.setDefaultForProject( false );
 
-                storeBuildDefinition( bd );
+                storeBuildDefinition( defaultBd );
             }
         }
 
-        storeBuildDefinition( buildDefinition );
+        storeBuildDefinition( bd );
+    }
+
+    public void updateBuildDefinition( int projectId, int buildDefinitionId, Map configuration
)
+        throws ContinuumException
+    {
+        BuildDefinition buildDefinition = getBuildDefinition( projectId, buildDefinitionId
);
+
+        buildDefinition.setBuildFile( (String) configuration.get( "buildFile" ) );
+
+        buildDefinition.setGoals( (String) configuration.get( "goals" ) );
+
+        buildDefinition.setArguments( (String) configuration.get( "arguments" ) );
+
+        Schedule schedule = getSchedule( new Integer( (String) configuration.get( "schedule"
) ).intValue() );
+
+        buildDefinition.setSchedule( schedule );
+
+        buildDefinition.setDefaultForProject( true );
+
+        updateBuildDefinition( buildDefinition, projectId );
     }
 
     public BuildDefinition storeBuildDefinition( BuildDefinition buildDefinition )
@@ -1010,23 +1030,11 @@
         }
     }
 
-    public void addBuildDefinition( int projectId, Map configuration )
+    public void addBuildDefinition( int projectId, BuildDefinition buildDefinition )
         throws ContinuumException
     {
-        BuildDefinition buildDefinition = new BuildDefinition();
-
-        buildDefinition.setBuildFile( (String) configuration.get( "buildFile" ) );
-
-        buildDefinition.setGoals( (String) configuration.get( "goals" ) );
-
-        buildDefinition.setArguments( (String) configuration.get( "arguments" ) );
-
-        Schedule schedule = getSchedule( new Integer( (String) configuration.get( "schedule"
) ).intValue() );
-
-        if ( convertBoolean( (String) configuration.get( "defaultForProject" ) ) )
+        if ( buildDefinition.isDefaultForProject() )
         {
-            buildDefinition.setDefaultForProject( true );
-            
             BuildDefinition bd = getDefaultBuildDefinition( projectId );
 
             if ( bd != null )
@@ -1037,13 +1045,34 @@
             }
         }
 
-        buildDefinition.setSchedule( schedule );
-
         Project project = getProjectWithAllDetails( projectId );
 
         project.addBuildDefinition( buildDefinition );
 
         updateProject( project );
+    }
+
+    public void addBuildDefinition( int projectId, Map configuration )
+        throws ContinuumException
+    {
+        BuildDefinition buildDefinition = new BuildDefinition();
+
+        buildDefinition.setBuildFile( (String) configuration.get( "buildFile" ) );
+
+        buildDefinition.setGoals( (String) configuration.get( "goals" ) );
+
+        buildDefinition.setArguments( (String) configuration.get( "arguments" ) );
+
+        Schedule schedule = getSchedule( new Integer( (String) configuration.get( "schedule"
) ).intValue() );
+
+        buildDefinition.setSchedule( schedule );
+
+        if ( convertBoolean( (String) configuration.get( "defaultForProject" ) ) )
+        {
+            buildDefinition.setDefaultForProject( true );
+        }
+
+        addBuildDefinition( projectId, buildDefinition );
     }
 
     public void removeBuildDefinition( int projectId, int buildDefinitionId )

Added: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddBuildDefinitionAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddBuildDefinitionAction.java?rev=358819&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddBuildDefinitionAction.java
(added)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddBuildDefinitionAction.java
Fri Dec 23 07:46:15 2005
@@ -0,0 +1,250 @@
+package org.apache.maven.continuum.web.action;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.project.Profile;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.Schedule;
+
+import com.opensymphony.xwork.ActionSupport;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class AddBuildDefinitionAction
+    extends ActionSupport
+{
+    private Continuum continuum;
+
+    private Project project;
+
+    private int projectId;
+
+    private int buildDefinitionId;
+
+    private boolean defaultForProject;
+
+    private String goals;
+
+    private String arguments;
+
+    private String buildFile;
+
+    private int scheduleId;
+
+    private String scheduleName;
+
+    private Map schedulesMap;
+
+//    private Profile profile;
+
+    public String execute()
+    {
+        try
+        {
+            BuildDefinition bd = new BuildDefinition();
+
+            bd.setGoals( goals );
+
+            bd.setBuildFile( buildFile );
+
+            bd.setArguments( arguments );
+
+            bd.setDefaultForProject( defaultForProject );
+
+            Schedule schedule = continuum.getSchedule( scheduleId );
+
+            bd.setSchedule( schedule );
+
+            continuum.addBuildDefinition( projectId, bd );
+        }
+        catch ( ContinuumException e )
+        {
+            addActionMessage( "Can't update build definition (id=" + buildDefinitionId +
") for project " + projectId + " : " + e.getMessage() );
+
+            e.printStackTrace();
+
+            return ERROR;
+        }
+
+        return SUCCESS;
+    }
+
+    public String doDefault()
+    {
+        try
+        {
+            project = continuum.getProject( projectId );
+        }
+        catch ( ContinuumException e )
+        {
+            addActionMessage( "Can't get project informations for project " + projectId +
" : " + e.getMessage() );
+
+            e.printStackTrace();
+
+            return ERROR;
+        }
+
+        try
+        {
+            initSchedulesMap();
+        }
+        catch ( ContinuumException e )
+        {
+            addActionMessage( "Can't get schedules list : " + e.getMessage() );
+
+            e.printStackTrace();
+
+            return ERROR;
+        }
+
+        return INPUT;
+    }
+
+    private void initSchedulesMap()
+        throws ContinuumException
+    {
+        Collection schedules = continuum.getSchedules();
+
+        for ( Iterator i = schedules.iterator(); i.hasNext(); )
+        {
+            Schedule schedule = (Schedule) i.next();
+
+            if ( schedulesMap == null )
+            {
+                schedulesMap = new HashMap();
+            }
+
+            schedulesMap.put( new Integer( schedule.getId() ), schedule.getName() );
+        }
+    }
+
+    private BuildDefinition getBuildDefinition()
+        throws ContinuumException
+    {
+        return continuum.getBuildDefinition( projectId, buildDefinitionId );
+    }
+
+    public Project getProject()
+    {
+        return project;
+    }
+
+    public int getProjectId()
+    {
+        return projectId;
+    }
+
+    public void setProjectId( int projectId )
+    {
+        this.projectId = projectId;
+    }
+
+    public int getBuildDefinitionId()
+    {
+        return buildDefinitionId;
+    }
+
+    public void setBuildDefinitionId( int buildDefinitionId )
+    {
+        this.buildDefinitionId = buildDefinitionId;
+    }
+
+    public boolean isDefaultForProject()
+    {
+        return defaultForProject;
+    }
+
+    public void setDefaultForProject( boolean defaultForProject )
+    {
+        this.defaultForProject = defaultForProject;
+    }
+
+    public String getGoals()
+    {
+        return goals;
+    }
+
+    public void setGoals( String goals )
+    {
+        this.goals = goals;
+    }
+
+    public String getArguments()
+    {
+        return arguments;
+    }
+
+    public void setArguments( String arguments )
+    {
+        this.arguments = arguments;
+    }
+
+    public String getBuildFile()
+    {
+        return buildFile;
+    }
+
+    public void setBuildFile( String buildFile )
+    {
+        this.buildFile = buildFile;
+    }
+
+    public int getScheduleId()
+    {
+        return scheduleId;
+    }
+
+    public void setScheduleId( int scheduleId )
+    {
+        this.scheduleId = scheduleId;
+    }
+
+    public String getScheduleName()
+    {
+        return scheduleName;
+    }
+
+    public void setScheduleName( String scheduleName )
+    {
+        this.scheduleName = scheduleName;
+    }
+
+    public Map getSchedulesMap()
+    {
+        if ( schedulesMap == null )
+        {
+            try
+            {
+                initSchedulesMap();
+            }
+            catch( ContinuumException e )
+            {
+            }
+        }
+        return schedulesMap;
+    }
+}

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddBuildDefinitionAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddBuildDefinitionAction.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionEditAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionEditAction.java?rev=358819&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionEditAction.java
(added)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionEditAction.java
Fri Dec 23 07:46:15 2005
@@ -0,0 +1,268 @@
+package org.apache.maven.continuum.web.action;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.project.Profile;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.Schedule;
+
+import com.opensymphony.xwork.ActionSupport;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class BuildDefinitionEditAction
+    extends ActionSupport
+{
+    private Continuum continuum;
+
+    private BuildDefinition bd;
+
+    private Project project;
+
+    private int projectId;
+
+    private int buildDefinitionId;
+
+    private boolean defaultForProject;
+
+    private String goals;
+
+    private String arguments;
+
+    private String buildFile;
+
+    private int scheduleId;
+
+    private String scheduleName;
+
+    private Map schedulesMap;
+
+//    private Profile profile;
+
+    public String execute()
+    {
+        try
+        {
+            bd = getBuildDefinition();
+
+            bd.setGoals( goals );
+
+            bd.setBuildFile( buildFile );
+
+            bd.setArguments( arguments );
+
+            bd.setDefaultForProject( defaultForProject );
+
+            Schedule schedule = continuum.getSchedule( scheduleId );
+
+            bd.setSchedule( schedule );
+
+            continuum.updateBuildDefinition( bd, projectId );
+        }
+        catch ( ContinuumException e )
+        {
+            addActionMessage( "Can't update build definition (id=" + buildDefinitionId +
") for project " + projectId + " : " + e.getMessage() );
+
+            e.printStackTrace();
+
+            return ERROR;
+        }
+
+        return SUCCESS;
+    }
+
+    public String doDefault()
+    {
+        try
+        {
+            project = continuum.getProject( projectId );
+
+            bd = getBuildDefinition();
+        }
+        catch ( ContinuumException e )
+        {
+            addActionMessage( "Can't get build definition informations (id=" + buildDefinitionId
+ ") for project " + projectId + " : " + e.getMessage() );
+
+            e.printStackTrace();
+
+            return ERROR;
+        }
+
+        defaultForProject = bd.isDefaultForProject();
+
+        goals = bd.getGoals();
+
+        arguments = bd.getArguments();
+
+        buildFile = bd.getBuildFile();
+
+        scheduleId = bd.getSchedule().getId();
+
+        scheduleName = bd.getSchedule().getName();
+
+        try
+        {
+            initSchedulesMap();
+        }
+        catch ( ContinuumException e )
+        {
+            addActionMessage( "Can't get schedules list : " + e.getMessage() );
+
+            e.printStackTrace();
+
+            return ERROR;
+        }
+
+//        profile = bd.getProfile();
+
+        return INPUT;
+    }
+
+    private void initSchedulesMap()
+        throws ContinuumException
+    {
+        Collection schedules = continuum.getSchedules();
+
+        for ( Iterator i = schedules.iterator(); i.hasNext(); )
+        {
+            Schedule schedule = (Schedule) i.next();
+
+            if ( schedulesMap == null )
+            {
+                schedulesMap = new HashMap();
+            }
+
+            schedulesMap.put( new Integer( schedule.getId() ), schedule.getName() );
+        }
+    }
+
+    private BuildDefinition getBuildDefinition()
+        throws ContinuumException
+    {
+        return continuum.getBuildDefinition( projectId, buildDefinitionId );
+    }
+
+    public Project getProject()
+    {
+        return project;
+    }
+
+    public int getProjectId()
+    {
+        return projectId;
+    }
+
+    public void setProjectId( int projectId )
+    {
+        this.projectId = projectId;
+    }
+
+    public int getBuildDefinitionId()
+    {
+        return buildDefinitionId;
+    }
+
+    public void setBuildDefinitionId( int buildDefinitionId )
+    {
+        this.buildDefinitionId = buildDefinitionId;
+    }
+
+    public boolean isDefaultForProject()
+    {
+        return defaultForProject;
+    }
+
+    public void setDefaultForProject( boolean defaultForProject )
+    {
+        this.defaultForProject = defaultForProject;
+    }
+
+    public String getGoals()
+    {
+        return goals;
+    }
+
+    public void setGoals( String goals )
+    {
+        this.goals = goals;
+    }
+
+    public String getArguments()
+    {
+        return arguments;
+    }
+
+    public void setArguments( String arguments )
+    {
+        this.arguments = arguments;
+    }
+
+    public String getBuildFile()
+    {
+        return buildFile;
+    }
+
+    public void setBuildFile( String buildFile )
+    {
+        this.buildFile = buildFile;
+    }
+
+    public int getScheduleId()
+    {
+        return scheduleId;
+    }
+
+    public void setScheduleId( int scheduleId )
+    {
+        this.scheduleId = scheduleId;
+    }
+
+    public String getScheduleName()
+    {
+        return scheduleName;
+    }
+
+    public void setScheduleName( String scheduleName )
+    {
+        this.scheduleName = scheduleName;
+    }
+
+    public Map getSchedulesMap()
+    {
+        if ( schedulesMap == null )
+        {
+            try
+            {
+                initSchedulesMap();
+            }
+            catch( ContinuumException e )
+            {
+            }
+        }
+        return schedulesMap;
+    }
+}

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionEditAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionEditAction.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteBuildDefinitionAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteBuildDefinitionAction.java?rev=358819&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteBuildDefinitionAction.java
(added)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteBuildDefinitionAction.java
Fri Dec 23 07:46:15 2005
@@ -0,0 +1,79 @@
+package org.apache.maven.continuum.web.action;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.ContinuumException;
+
+import com.opensymphony.xwork.ActionSupport;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class DeleteBuildDefinitionAction
+    extends ActionSupport
+{
+    private Continuum continuum;
+
+    private int projectId;
+
+    private int buildDefinitionId;
+
+    public String execute()
+    {
+        try
+        {
+            continuum.removeBuildDefinition( projectId, buildDefinitionId );
+        }
+        catch ( ContinuumException e )
+        {
+            addActionMessage( "Can't delete build definition (id=" + projectId + ") for project
" + projectId + " : " + e.getMessage() );
+
+            e.printStackTrace();
+
+            return ERROR;
+        }
+
+        return SUCCESS;
+    }
+
+    public String doDefault()
+    {
+        return "delete";
+    }
+
+    public void setProjectId( int projectId )
+    {
+        this.projectId = projectId;
+    }
+
+    public int getProjectId()
+    {
+        return projectId;
+    }
+
+    public void setBuildDefinitionId( int buildDefinitionId )
+    {
+        this.buildDefinitionId = buildDefinitionId;
+    }
+
+    public int getBuildDefinitionId()
+    {
+        return buildDefinitionId;
+    }
+}
\ No newline at end of file

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteBuildDefinitionAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteBuildDefinitionAction.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java?rev=358819&r1=358818&r2=358819&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
Fri Dec 23 07:46:15 2005
@@ -21,7 +21,6 @@
 import org.apache.maven.continuum.model.project.Project;
 
 import com.opensymphony.xwork.ActionSupport;
-import com.opensymphony.webwork.ServletActionContext;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java?rev=358819&r1=358818&r2=358819&view=diff
==============================================================================
--- 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 Dec 23 07:46:15 2005
@@ -21,7 +21,6 @@
 import org.apache.maven.continuum.model.project.Project;
 
 import com.opensymphony.xwork.ActionSupport;
-import com.opensymphony.webwork.ServletActionContext;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml?rev=358819&r1=358818&r2=358819&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml
Fri Dec 23 07:46:15 2005
@@ -122,6 +122,39 @@
         </requirement>
       </requirements>
     </component>
+    <component>
+      <role>com.opensymphony.xwork.Action</role>
+      <role-hint>buildDefinitionEdit</role-hint>
+      <implementation>org.apache.maven.continuum.web.action.BuildDefinitionEditAction</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.Continuum</role>
+        </requirement>
+      </requirements>
+    </component>
+    <component>
+      <role>com.opensymphony.xwork.Action</role>
+      <role-hint>deleteBuildDefinition</role-hint>
+      <implementation>org.apache.maven.continuum.web.action.DeleteBuildDefinitionAction</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.Continuum</role>
+        </requirement>
+      </requirements>
+    </component>
+    <component>
+      <role>com.opensymphony.xwork.Action</role>
+      <role-hint>addBuildDefinition</role-hint>
+      <implementation>org.apache.maven.continuum.web.action.AddBuildDefinitionAction</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.Continuum</role>
+        </requirement>
+      </requirements>
+    </component>
 
     <!--
      | Components

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=358819&r1=358818&r2=358819&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Fri Dec 23 07:46:15 2005
@@ -134,10 +134,9 @@
 // ----------------------------------------------------------------------
 // Page: DeleteProject
 // ----------------------------------------------------------------------
-delete.page.title = Continuum - Delete Continuum Project
-delete.section.title = Delete Continuum Project
-delete.confirmation.message = Are you sure you want to delete the project "{0}"?
-delete.submit = Delete
+deleteProject.page.title = Continuum - Delete Continuum Project
+deleteProject.section.title = Delete Continuum Project
+deleteProject.confirmation.message = Are you sure you want to delete the project "{0}"?
 
 // ----------------------------------------------------------------------
 // Page: ProjectView
@@ -178,3 +177,24 @@
 projectEdit.project.scmUsername.label = Scm Username
 projectEdit.project.scmPassword.label = Scm Password
 projectEdit.project.scmTag.label = Scm Branch/Tag
+
+// ----------------------------------------------------------------------
+// Page: BuildDefinitionEdit
+// ----------------------------------------------------------------------
+buildDefinition.page.title = Continuum - Add/Edit Build Definition
+buildDefinition.section.title = Add/Edit Build Definition
+buildDefinition.buildFile.ant.label = Ant build filename
+buildDefinition.buildFile.shell.label = Shell executable
+buildDefinition.buildFile.maven.label = POM filename
+buildDefinition.goals.ant.label = Targets
+buildDefinition.goals.maven.label = Goals
+buildDefinition.arguments.label = Arguments
+buildDefinition.defaultForProject.label = Is it default?
+buildDefinition.schedule.label = Schedule
+
+// ----------------------------------------------------------------------
+// Page: DeleteBuildDefinition
+// ----------------------------------------------------------------------
+deleteBuildDefinition.page.title = Continuum - Delete deleteBuildDefinition
+deleteBuildDefinition.section.title = Delete deleteBuildDefinition
+deleteBuildDefinition.confirmation.message = Are you sure you want to delete the build definition
"{0}"?

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml?rev=358819&r1=358818&r2=358819&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Fri Dec 23 07:46:15
2005
@@ -88,5 +88,23 @@
             <result name="input">projectEdit.jsp</result>
             <result name="success" type="chain">projectView</result>
         </action>
+
+        <action name="buildDefinitionEdit"
+                class="buildDefinitionEdit">
+            <result name="input">buildDefinitionEdit.jsp</result>
+            <result name="success" type="chain">projectView</result>
+        </action>
+
+        <action name="deleteBuildDefinition"
+                class="deleteBuildDefinition">
+            <result name="delete">deleteBuildDefinition.jsp</result>
+            <result name="success" type="chain">projectView</result>
+        </action>
+
+        <action name="addBuildDefinition"
+                class="addBuildDefinition">
+            <result name="input">buildDefinitionEdit.jsp</result>
+            <result name="success" type="chain">projectView</result>
+        </action>
     </package>
 </xwork>

Added: maven/continuum/trunk/continuum-webapp/src/main/webapp/buildDefinitionEdit.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/buildDefinitionEdit.jsp?rev=358819&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/buildDefinitionEdit.jsp (added)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/buildDefinitionEdit.jsp Fri Dec
23 07:46:15 2005
@@ -0,0 +1,44 @@
+<%@ taglib uri="webwork" prefix="ww" %>
+<html>
+  <ww:i18n name="localization.Continuum">
+    <head>
+        <title><ww:text name="buildDefinition.page.title"/></title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3><ww:text name="buildDefinition.section.title"/></h3>
+
+        <div class="axial">
+          <ww:form action="buildDefinitionEdit.action" method="post">
+            <input type="hidden" name="buildDefinitionId" value="<ww:property value="buildDefinitionId"/>"/>
+            <input type="hidden" name="projectId" value="<ww:property value="projectId"/>"/>
+
+            <ww:if test="project.executorId == 'ant'">
+              <ww:textfield label="%{getText('buildDefinition.buildFile.ant.label')}"
name="buildFile"/>
+            </ww:if>
+            <ww:elseif test="project.executorId == 'shell'">
+              <ww:textfield label="%{getText('buildDefinition.buildFile.shell.label')}"
name="buildFile"/>
+            </ww:elseif>
+            <ww:else>
+              <ww:textfield label="%{getText('buildDefinition.buildFile.maven.label')}"
name="buildFile"/>
+            </ww:else>
+
+            <ww:if test="project.executorId == 'ant'">
+              <ww:textfield label="%{getText('buildDefinition.goals.ant.label')}" name="goals"/>
+            </ww:if>
+            <ww:elseif test="project.executorId == '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="%{getText('buildDefinition.defaultForProject.label')}"
 name="defaultForProject" value="defaultForProject" fieldValue="true"/>
+            <ww:select label="%{getText('buildDefinition.schedule.label')}" name="scheduleId"
list="schedulesMap"/>
+            <ww:submit value="%{getText('save')}"/>
+          </ww:form>
+        </div>
+      </div>
+    </body>
+  </ww:i18n>
+</html>

Propchange: maven/continuum/trunk/continuum-webapp/src/main/webapp/buildDefinitionEdit.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/webapp/buildDefinitionEdit.jsp
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteBuildDefinition.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteBuildDefinition.jsp?rev=358819&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteBuildDefinition.jsp (added)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteBuildDefinition.jsp Fri Dec
23 07:46:15 2005
@@ -0,0 +1,31 @@
+<%@ taglib uri="webwork" prefix="ww" %>
+<html>
+  <ww:i18n name="localization.Continuum">
+    <head>
+        <title><ww:text name="deleteBuildDefinition.page.title"/></title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3><ww:text name="deleteBuildDefinition.section.title"/></h3>
+
+        <div class="warningmessage">
+          <p>
+            <strong>
+                <ww:text name="deleteBuildDefinition.confirmation.message">
+                    <ww:param><ww:property value="buildDefinitionId"/></ww:param>
+                </ww:text>
+            </strong>
+          </p>
+        </div>
+        <ww:form action="deleteBuildDefinition.action" method="post">
+            <ww:hidden name="buildDefinitionId"/>
+            <ww:hidden name="projectId"/>
+            <div class="functnbar3">
+            <input type="submit" value="<ww:text name="delete"/>"/>
+            <input type="button" name="Cancel" value="<ww:text name="cancel"/>"
onClick="history.back()"/>
+            </div>
+        </ww:form>
+      </div>
+    </body>
+  </ww:i18n>
+</html>

Propchange: maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteBuildDefinition.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteBuildDefinition.jsp
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteProject.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteProject.jsp?rev=358819&r1=358818&r2=358819&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteProject.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteProject.jsp Fri Dec 23 07:46:15
2005
@@ -2,16 +2,16 @@
 <html>
   <ww:i18n name="localization.Continuum">
     <head>
-        <title><ww:text name="delete.page.title"/></title>
+        <title><ww:text name="deleteProject.page.title"/></title>
     </head>
     <body>
       <div id="axial" class="h3">
-        <h3><ww:text name="delete.section.title"/></h3>
+        <h3><ww:text name="deleteProject.section.title"/></h3>
 
         <div class="warningmessage">
           <p>
             <strong>
-                <ww:text name="delete.confirmation.message">
+                <ww:text name="deleteProject.confirmation.message">
                     <ww:param><ww:property value="projectName"/></ww:param>
                 </ww:text>
             </strong>
@@ -20,7 +20,7 @@
         <ww:form action="deleteProject.action" method="post">
             <ww:hidden name="projectId"/>
             <div class="functnbar3">
-            <input type="submit" value="<ww:text name="delete.submit"/>"/>
+            <input type="submit" value="<ww:text name="delete"/>"/>
             <input type="button" name="Cancel" value="<ww:text name="cancel"/>"
onClick="history.back()"/>
             </div>
         </ww:form>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/projectEdit.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/projectEdit.jsp?rev=358819&r1=358818&r2=358819&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/projectEdit.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/projectEdit.jsp Fri Dec 23 07:46:15
2005
@@ -10,7 +10,7 @@
 
         <div class="axial">
           <ww:form action="projectEdit.action" method="post">
-            <input type="hidden" name="projectId" value="<ww:property value="project.id"/>"/>
+            <input type="hidden" name="projectId" value="<ww:property value="projectId"/>"/>
             <ww:textfield label="%{getText('projectEdit.project.name.label')}" name="name"/>
             <ww:textfield label="%{getText('projectEdit.project.version.label')}" name="version"/>
             <ww:textfield label="%{getText('projectEdit.project.scmUrl.label')}" name="scmUrl"/>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp?rev=358819&r1=358818&r2=358819&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp Fri Dec 23 07:46:15
2005
@@ -46,7 +46,7 @@
                   showStatusBar="false"
                   filterable="false"
                   sortable="false">
-          <ec:row highlightRow="true">
+          <ec:row>
             <ec:column property="goals" title="projectView.buildDefinition.goals"/>
             <ec:column property="arguments" title="projectView.buildDefinition.arguments"/>
             <ec:column property="buildFile" title="projectView.buildDefinition.buildFile"/>
@@ -58,10 +58,18 @@
                 PROJECT
             </ec:column>
             <ec:column property="actions" title="&nbsp;">
-                <ww:text name="edit"/>&nbsp;<ww:text name="delete"/>
+                <a href="${pageContext.request.contextPath}/buildDefinitionEdit!default.action?projectId=<ww:property
value="project.id"/>&buildDefinitionId=${pageScope.buildDefinition.id}"><ww:text
name="edit"/></a>
+                &nbsp;
+                <a href="${pageContext.request.contextPath}/deleteBuildDefinition!default.action?projectId=<ww:property
value="project.id"/>&buildDefinitionId=${pageScope.buildDefinition.id}"><ww:text
name="delete"/></a>
             </ec:column>
           </ec:row>
         </ec:table>
+        <div class="functnbar3">
+          <form method="post" action="addBuildDefinition!default.action">
+              <input type="hidden" name="projectId" value="<ww:property value="project.id"/>"/>
+              <input type="submit" name="addBuildDef" value="<ww:text name="add"/>"/>
+          </form>
+        </div>
 
         <h3><ww:text name="projectView.notifiers"/></h3>
         <ww:set name="notifiers" value="project.notifiers" scope="request"/>
@@ -72,7 +80,7 @@
                   showStatusBar="false"
                   filterable="false"
                   sortable="false">
-          <ec:row highlightRow="true">
+          <ec:row>
             <ec:column property="type" title="projectView.notifier.type"/>
             <ec:column property="recipient" title="projectView.notifier.recipient" cell="org.apache.maven.continuum.web.view.projectview.NotifierRecipientCell"/>
             <ec:column property="events" title="projectView.notifier.events" cell="org.apache.maven.continuum.web.view.projectview.NotifierEventCell"/>
@@ -94,7 +102,7 @@
                   showStatusBar="false"
                   filterable="false"
                   sortable="false">
-          <ec:row highlightRow="true">
+          <ec:row>
             <ec:column property="name" title="projectView.dependency.name">
                 ${pageScope.dependency.groupId}:${pageScope.dependency.artifactId}:${pageScope.dependency.version}
             </ec:column>
@@ -109,7 +117,7 @@
                   showStatusBar="false"
                   filterable="false"
                   sortable="false">
-          <ec:row highlightRow="true">
+          <ec:row>
             <ec:column property="name" title="projectView.developer.name"/>
             <ec:column property="email" title="projectView.developer.email"/>
           </ec:row>



Mime
View raw message