continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r431245 - /maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/
Date Sun, 13 Aug 2006 21:27:25 GMT
Author: carlos
Date: Sun Aug 13 14:27:24 2006
New Revision: 431245

URL: http://svn.apache.org/viewvc?rev=431245&view=rev
Log:
[CONTINUUM-779] Make actions throw exceptions not handled to be intercepted later by webwork
interceptors

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractNotifierEditAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddBuildDefinitionAction.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/AddMavenTwoProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddScheduleAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionEditAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ConfigurationAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteBuildDefinitionAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteNotifierAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/EditScheduleAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.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/java/org/apache/maven/continuum/web/action/ScheduleAction.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/WorkingCopyAction.java

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractNotifierEditAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractNotifierEditAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractNotifierEditAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractNotifierEditAction.java
Sun Aug 13 14:27:24 2006
@@ -49,73 +49,51 @@
     private boolean sendOnWarning;
 
     public String execute()
+        throws ContinuumException
     {
-        try
-        {
-            boolean isNew = false;
+        boolean isNew = false;
 
-            notifier = getNotifier();
+        notifier = getNotifier();
 
-            if ( notifier == null || notifierId == 0 )
-            {
-                notifier = new ProjectNotifier();
+        if ( notifier == null || notifierId == 0 )
+        {
+            notifier = new ProjectNotifier();
 
-                isNew = true;
-            }
+            isNew = true;
+        }
 
-            notifier.setType( notifierType );
+        notifier.setType( notifierType );
 
-            notifier.setSendOnSuccess( sendOnSuccess );
+        notifier.setSendOnSuccess( sendOnSuccess );
 
-            notifier.setSendOnFailure( sendOnFailure );
+        notifier.setSendOnFailure( sendOnFailure );
 
-            notifier.setSendOnError( sendOnError );
+        notifier.setSendOnError( sendOnError );
 
-            notifier.setSendOnWarning( sendOnWarning );
+        notifier.setSendOnWarning( sendOnWarning );
 
-            setNotifierConfiguration( notifier );
+        setNotifierConfiguration( notifier );
 
-            if ( !isNew )
-            {
-                continuum.updateNotifier( projectId, notifier );
-            }
-            else
-            {
-                continuum.addNotifier( projectId, notifier );
-            }
+        if ( !isNew )
+        {
+            continuum.updateNotifier( projectId, notifier );
         }
-        catch ( ContinuumException e )
+        else
         {
-            addActionMessage( "Can't update notifier (id=" + notifierId + ") for project
" + projectId + " : "
-                + e.getMessage() );
-
-            e.printStackTrace();
-
-            return ERROR;
+            continuum.addNotifier( projectId, notifier );
         }
 
         return SUCCESS;
     }
 
     public String doDefault()
+        throws ContinuumException
     {
-        try
-        {
-            notifier = getNotifier();
+        notifier = getNotifier();
 
-            if ( notifier == null )
-            {
-                notifier = new ProjectNotifier();
-            }
-        }
-        catch ( ContinuumException e )
+        if ( notifier == null )
         {
-            addActionMessage( "Can't get notifier informations (id=" + notifierId + ") for
project " + projectId
-                + " : " + e.getMessage() );
-
-            e.printStackTrace();
-
-            return ERROR;
+            notifier = new ProjectNotifier();
         }
 
         notifierType = notifier.getType();

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddBuildDefinitionAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddBuildDefinitionAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddBuildDefinitionAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddBuildDefinitionAction.java
Sun Aug 13 14:27:24 2006
@@ -60,32 +60,11 @@
     //    private Profile profile;
 
     public String execute()
+        throws ContinuumException
     {
-        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() );
+        project = continuum.getProject( projectId );
 
-            e.printStackTrace();
-
-            return ERROR;
-        }
+        initSchedulesMap();
 
         return INPUT;
     }
@@ -194,16 +173,11 @@
     }
 
     public Map getSchedulesMap()
+        throws ContinuumException
     {
         if ( schedulesMap == null )
         {
-            try
-            {
-                initSchedulesMap();
-            }
-            catch ( ContinuumException e )
-            {
-            }
+            initSchedulesMap();
         }
         return schedulesMap;
     }

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?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- 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
Sun Aug 13 14:27:24 2006
@@ -43,6 +43,7 @@
     private String m1Pom = null;
 
     public String execute()
+        throws ContinuumException
     {
         if ( !StringUtils.isEmpty( m1PomUrl ) )
         {
@@ -58,7 +59,8 @@
                 }
                 catch ( MalformedURLException e )
                 {
-                    return INPUT;
+                    // if local file can't be converted to url it's an internal error
+                    throw new RuntimeException( e );
                 }
             }
             else
@@ -75,6 +77,7 @@
         }
         catch ( ContinuumException e )
         {
+            //TODO add errors to show to the user
             return INPUT;
         }
 

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?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- 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
Sun Aug 13 14:27:24 2006
@@ -42,6 +42,7 @@
     private String m2Pom = null;
 
     public String execute()
+        throws ContinuumException
     {
         if ( !StringUtils.isEmpty( m2PomUrl ) )
         {
@@ -57,7 +58,8 @@
                 }
                 catch ( MalformedURLException e )
                 {
-                    return INPUT;
+                    // if local file can't be converted to url it's an internal error
+                    throw new RuntimeException( e );
                 }
             }
             else
@@ -74,6 +76,7 @@
         }
         catch ( ContinuumException e )
         {
+            //TODO add errors to show to the user
             return INPUT;
         }
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
Sun Aug 13 14:27:24 2006
@@ -46,6 +46,7 @@
     private String projectType;
 
     public String execute()
+        throws ContinuumException
     {
         Project project = new Project();
 
@@ -61,14 +62,7 @@
 
         project.setScmTag( projectScmTag );
 
-        try
-        {
-            continuum.addProject( project, projectType );
-        }
-        catch ( ContinuumException e )
-        {
-            return INPUT;
-        }
+        continuum.addProject( project, projectType );
 
         return SUCCESS;
     }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddScheduleAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddScheduleAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddScheduleAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddScheduleAction.java
Sun Aug 13 14:27:24 2006
@@ -43,23 +43,17 @@
     private String name;
 
     public String execute()
-        throws Exception
+        throws ContinuumException
     {
-        try
-        {
-            Schedule schedule = new Schedule();
-            schedule.setActive( active );
-            schedule.setCronExpression( cronExpression );
-            schedule.setDelay( delay );
-            schedule.setDescription( description );
-            schedule.setName( name );
+        Schedule schedule = new Schedule();
+        schedule.setActive( active );
+        schedule.setCronExpression( cronExpression );
+        schedule.setDelay( delay );
+        schedule.setDescription( description );
+        schedule.setName( name );
+
+        continuum.addSchedule( schedule );
 
-            continuum.addSchedule( schedule );
-        }
-        catch ( ContinuumException e )
-        {
-            e.printStackTrace();
-        }
         return SUCCESS;
     }
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionEditAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionEditAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionEditAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionEditAction.java
Sun Aug 13 14:27:24 2006
@@ -64,71 +64,49 @@
     //    private Profile profile;
 
     public String execute()
+        throws ContinuumException
     {
-        try
-        {
-            boolean isNew = false;
+        boolean isNew = false;
 
-            bd = getBuildDefinition();
+        bd = getBuildDefinition();
 
-            if ( bd == null || buildDefinitionId == 0 )
-            {
-                bd = new BuildDefinition();
+        if ( bd == null || buildDefinitionId == 0 )
+        {
+            bd = new BuildDefinition();
 
-                isNew = true;
-            }
+            isNew = true;
+        }
 
-            bd.setGoals( goals );
+        bd.setGoals( goals );
 
-            bd.setBuildFile( buildFile );
+        bd.setBuildFile( buildFile );
 
-            bd.setArguments( arguments );
+        bd.setArguments( arguments );
 
-            bd.setDefaultForProject( defaultForProject );
+        bd.setDefaultForProject( defaultForProject );
 
-            Schedule schedule = continuum.getSchedule( scheduleId );
+        Schedule schedule = continuum.getSchedule( scheduleId );
 
-            bd.setSchedule( schedule );
+        bd.setSchedule( schedule );
 
-            if ( !isNew )
-            {
-                continuum.updateBuildDefinition( bd, projectId );
-            }
-            else
-            {
-                continuum.addBuildDefinition( projectId, bd );
-            }
+        if ( !isNew )
+        {
+            continuum.updateBuildDefinition( bd, projectId );
         }
-        catch ( ContinuumException e )
+        else
         {
-            addActionMessage( "Can't update build definition (id=" + buildDefinitionId +
") for project " + projectId
-                + " : " + e.getMessage() );
-
-            e.printStackTrace();
-
-            return ERROR;
+            continuum.addBuildDefinition( projectId, bd );
         }
 
         return SUCCESS;
     }
 
     public String doDefault()
+        throws ContinuumException
     {
-        try
-        {
-            project = continuum.getProject( projectId );
+        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;
-        }
+        bd = getBuildDefinition();
 
         defaultForProject = bd.isDefaultForProject();
 
@@ -142,20 +120,9 @@
 
         scheduleName = bd.getSchedule().getName();
 
-        try
-        {
-            initSchedulesMap();
-        }
-        catch ( ContinuumException e )
-        {
-            addActionMessage( "Can't get schedules list : " + e.getMessage() );
-
-            e.printStackTrace();
+        initSchedulesMap();
 
-            return ERROR;
-        }
-
-        //        profile = bd.getProfile();
+        // profile = bd.getProfile();
 
         return INPUT;
     }
@@ -270,16 +237,11 @@
     }
 
     public Map getSchedulesMap()
+        throws ContinuumException
     {
         if ( schedulesMap == null )
         {
-            try
-            {
-                initSchedulesMap();
-            }
-            catch ( ContinuumException e )
-            {
-            }
+            initSchedulesMap();
         }
         return schedulesMap;
     }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
Sun Aug 13 14:27:24 2006
@@ -33,25 +33,15 @@
     private int projectId;
 
     public String execute()
+        throws ContinuumException
     {
-        try
+        if ( projectId > 0 )
         {
-            if ( projectId > 0 )
-            {
-                continuum.buildProject( projectId );
-            }
-            else
-            {
-                continuum.buildProjects();
-            }
+            continuum.buildProject( projectId );
         }
-        catch ( ContinuumException e )
+        else
         {
-            addActionMessage( "Can't build project (id=" + projectId + ") : " + e.getMessage()
);
-
-            e.printStackTrace();
-
-            return ERROR;
+            continuum.buildProjects();
         }
 
         return SUCCESS;

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
Sun Aug 13 14:27:24 2006
@@ -45,22 +45,11 @@
     private List changeSet;
 
     public String execute()
+        throws ContinuumException
     {
-        try
-        {
-            buildResult = continuum.getBuildResult( buildId );
+        buildResult = continuum.getBuildResult( buildId );
 
-            changeSet = continuum.getChangesSinceLastSuccess( projectId, buildId );
-        }
-        catch ( ContinuumException e )
-        {
-            addActionError( "Can't get build result (id=" + buildId + ") for project (id="
+ projectId + ") : "
-                + e.getMessage() );
-
-            e.printStackTrace();
-
-            return ERROR;
-        }
+        changeSet = continuum.getChangesSinceLastSuccess( projectId, buildId );
 
         return SUCCESS;
     }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
Sun Aug 13 14:27:24 2006
@@ -38,19 +38,9 @@
     private String projectName;
 
     public String execute()
+        throws ContinuumException
     {
-        try
-        {
-            buildResults = continuum.getBuildResultsForProject( projectId );
-        }
-        catch ( ContinuumException e )
-        {
-            addActionError( "Can't get build results list for project (id=" + projectId +
") : " + e.getMessage() );
-
-            e.printStackTrace();
-
-            return ERROR;
-        }
+        buildResults = continuum.getBuildResultsForProject( projectId );
 
         return SUCCESS;
     }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ConfigurationAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ConfigurationAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ConfigurationAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ConfigurationAction.java
Sun Aug 13 14:27:24 2006
@@ -18,6 +18,7 @@
 
 import com.opensymphony.xwork.Preparable;
 import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.configuration.ConfigurationStoringException;
 import org.codehaus.plexus.xwork.action.PlexusActionSupport;
 
@@ -72,7 +73,7 @@
     }
 
     public String execute()
-        throws Exception
+        throws ConfigurationStoringException
     {
         continuum.getConfiguration().setGuestAccountEnabled( guestAccountEnabled );
 
@@ -88,17 +89,8 @@
 
         continuum.getConfiguration().setCompanyUrl( companyUrl );
 
-        try
-        {
-            continuum.getConfiguration().setInitialized( true );
-            continuum.getConfiguration().store();            
-        }
-        catch ( ConfigurationStoringException e )
-        {
-            addActionError( "Can't store configuration :" + e.getMessage() );
-
-            return INPUT;
-        }
+        continuum.getConfiguration().setInitialized( true );
+        continuum.getConfiguration().store();            
 
         return SUCCESS;
     }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteBuildDefinitionAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteBuildDefinitionAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteBuildDefinitionAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteBuildDefinitionAction.java
Sun Aug 13 14:27:24 2006
@@ -34,19 +34,9 @@
     private int buildDefinitionId;
 
     public String execute()
+        throws ContinuumException
     {
-        try
-        {
-            continuum.removeBuildDefinition( projectId, buildDefinitionId );
-        }
-        catch ( ContinuumException e )
-        {
-            addActionMessage( "Can't delete build definition (id=" + buildDefinitionId +
") for project " + projectId + " : " + e.getMessage() );
-
-            e.printStackTrace();
-
-            return ERROR;
-        }
+        continuum.removeBuildDefinition( projectId, buildDefinitionId );
 
         return SUCCESS;
     }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteNotifierAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteNotifierAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteNotifierAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteNotifierAction.java
Sun Aug 13 14:27:24 2006
@@ -39,19 +39,9 @@
     private String notifierType;
 
     public String execute()
+        throws ContinuumException
     {
-        try
-        {
-            continuum.removeNotifier( projectId, notifierId );
-        }
-        catch ( ContinuumException e )
-        {
-            addActionMessage( "Can't delete notifier (id=" + notifierId + ") for project
" + projectId + " : " + e.getMessage() );
-
-            e.printStackTrace();
-
-            return ERROR;
-        }
+        continuum.removeNotifier( projectId, notifierId );
 
         return SUCCESS;
     }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
Sun Aug 13 14:27:24 2006
@@ -34,19 +34,9 @@
     private String projectName;
 
     public String execute()
+        throws ContinuumException
     {
-        try
-        {
-            continuum.removeProject( projectId );
-        }
-        catch ( ContinuumException e )
-        {
-            addActionMessage( "Can't delete project (id=" + projectId + ") : " + e.getMessage()
);
-
-            e.printStackTrace();
-
-            return ERROR;
-        }
+        continuum.removeProject( projectId );
 
         return SUCCESS;
     }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/EditScheduleAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/EditScheduleAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/EditScheduleAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/EditScheduleAction.java
Sun Aug 13 14:27:24 2006
@@ -46,7 +46,7 @@
     private String name;
 
     public String execute()
-        throws Exception
+        throws ContinuumException
     {
         try
         {
@@ -63,29 +63,15 @@
         schedule.setDescription( description );
         schedule.setName( name );
 
-        try
-        {
-            continuum.updateSchedule( schedule );
-        }
-        catch ( ContinuumException e )
-        {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
+        continuum.updateSchedule( schedule );
+
         return SUCCESS;
     }
 
     public String doEdit()
-        throws Exception
+        throws ContinuumException
     {
-        try
-        {
-            schedule = continuum.getSchedule( id );
-        }
-        catch ( ContinuumException e )
-        {
-            e.printStackTrace();
-        }
+        schedule = continuum.getSchedule( id );
 
         active = schedule.isActive();
         cronExpression = schedule.getCronExpression();

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java
Sun Aug 13 14:27:24 2006
@@ -1,5 +1,6 @@
 package org.apache.maven.continuum.web.action;
 
+import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
@@ -40,7 +41,7 @@
     private List groups;
 
     public String execute()
-        throws Exception
+        throws ContinuumException
     {
         groups = new ArrayList();
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java?rev=431245&r1=431244&r2=431245&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
Sun Aug 13 14:27:24 2006
@@ -48,19 +48,9 @@
     private String scmTag;
 
     public String execute()
+        throws ContinuumException
     {
-        try
-        {
-            project = getProject( projectId );
-        }
-        catch ( ContinuumException e )
-        {
-            addActionMessage( "Can't get project informations (id=" + projectId + ") : "
+ e.getMessage() );
-
-            e.printStackTrace();
-
-            return ERROR;
-        }
+        project = getProject( projectId );
 
         project.setName( name );
 
@@ -74,36 +64,15 @@
 
         project.setScmTag( scmTag );
 
-        try
-        {
-            continuum.updateProject( project );
-        }
-        catch ( ContinuumException e )
-        {
-            addActionMessage( "Can't update project (id=" + projectId + ") : " + e.getMessage()
);
-
-            e.printStackTrace();
-
-            return ERROR;
-        }
+        continuum.updateProject( project );
 
         return SUCCESS;
     }
 
     public String doEdit()
+        throws ContinuumException
     {
-        try
-        {
-            project = getProject( projectId );
-        }
-        catch ( ContinuumException e )
-        {
-            addActionMessage( "Can't get project informations (id=" + projectId + ") : "
+ e.getMessage() );
-
-            e.printStackTrace();
-
-            return ERROR;
-        }
+        project = getProject( projectId );
 
         name = project.getName();
 

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?rev=431245&r1=431244&r2=431245&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
Sun Aug 13 14:27:24 2006
@@ -36,19 +36,9 @@
     private int projectId;
 
     public String execute()
+        throws ContinuumException
     {
-        try
-        {
-            project = continuum.getProjectWithAllDetails( projectId );
-        }
-        catch ( ContinuumException e )
-        {
-            addActionMessage( "Can't get project informations (id=" + projectId + ") : "
+ e.getMessage() );
-
-            e.printStackTrace();
-
-            return ERROR;
-        }
+        project = continuum.getProjectWithAllDetails( projectId );
 
         return SUCCESS;
     }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
Sun Aug 13 14:27:24 2006
@@ -34,16 +34,9 @@
     private Collection schedules;
 
     public String execute()
-        throws Exception
+        throws ContinuumException
     {
-        try
-        {
-            schedules = continuum.getSchedules();
-        }
-        catch ( ContinuumException e )
-        {
-            e.printStackTrace();
-        }
+        schedules = continuum.getSchedules();
 
         return SUCCESS;
     }

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?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- 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
Sun Aug 13 14:27:24 2006
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.web.model.ProjectSummary;
@@ -48,99 +49,92 @@
     private List summary;
     
     public String execute()
-        throws Exception
+        throws ContinuumException
     {
-        try
+        Collection projects;
+
+        // original logic on this page shows all projects across project groups, however
if projectGroupId
+        // is set then display only those projects in the given group.
+        if ( projectGroupId == -1 )
+        {
+            getLogger().debug("SummaryAction: serving up all projects");
+            projects = continuum.getProjects();
+        }
+        else
         {
-            Collection projects;
+            getLogger().debug("SummaryAction: serving up project id -> " + projectGroupId
);
 
-            // original logic on this page shows all projects across project groups, however
if projectGroupId
-            // is set then display only those projects in the given group.
-            if ( projectGroupId == -1 )
-            {
-                getLogger().debug("SummaryAction: serving up all projects");
-                projects = continuum.getProjects();
-            }
-            else
-            {
-                getLogger().debug("SummaryAction: serving up project id -> " + projectGroupId
);
+            //TODO: Create a summary jpox request so code will be more simple and performance
will be better
+            projects = continuum.getProjectsInGroup( projectGroupId );
+        }
 
-                //TODO: Create a summary jpox request so code will be more simple and performance
will be better
-                projects = continuum.getProjectsInGroup( projectGroupId );
-            }
+        Map buildResults = continuum.getLatestBuildResults();
 
-            Map buildResults = continuum.getLatestBuildResults();
+        Map buildResultsInSuccess = continuum.getBuildResultsInSuccess();
 
-            Map buildResultsInSuccess = continuum.getBuildResultsInSuccess();
+        summary = new ArrayList();
 
-            summary = new ArrayList();
+        for ( Iterator i = projects.iterator(); i.hasNext(); )
+        {
+            Project project = (Project) i.next();
 
-            for ( Iterator i = projects.iterator(); i.hasNext(); )
-            {
-                Project project = (Project) i.next();
+            ProjectSummary model = new ProjectSummary();
 
-                ProjectSummary model = new ProjectSummary();
+            model.setId( project.getId() );
 
-                model.setId( project.getId() );
+            model.setName( project.getName() );
 
-                model.setName( project.getName() );
+            model.setVersion( project.getVersion() );
 
-                model.setVersion( project.getVersion() );
+            model.setProjectGroupName( project.getProjectGroup().getName() );
 
-                model.setProjectGroupName( project.getProjectGroup().getName() );
+            if ( continuum.isInBuildingQueue( project.getId() ) || continuum.isInCheckoutQueue(
project.getId() ) )
+            {
+                model.setInQueue( true );
+            }
+            else
+            {
+                model.setInQueue( false );
+            }
 
-                if ( continuum.isInBuildingQueue( project.getId() ) || continuum.isInCheckoutQueue(
project.getId() ) )
-                {
-                    model.setInQueue( true );
-                }
-                else
-                {
-                    model.setInQueue( false );
-                }
+            model.setState( project.getState() );
 
-                model.setState( project.getState() );
+            if ( project.getState() == 2 )
+            {
+                nbSuccesses++;
+            }
+            else if ( project.getState() == 3 )
+            {
+                nbFailures++;
+            }
+            else if ( project.getState() == 4 )
+            {
+                nbErrors++;
+            }
 
-                if ( project.getState() == 2 )
-                {
-                    nbSuccesses++;
-                }
-                else if ( project.getState() == 3 )
-                {
-                    nbFailures++;
-                }
-                else if ( project.getState() == 4 )
-                {
-                    nbErrors++;
-                }
+            model.setBuildNumber( project.getBuildNumber() );
 
-                model.setBuildNumber( project.getBuildNumber() );
+            if ( buildResultsInSuccess != null )
+            {
+                BuildResult buildInSuccess = (BuildResult) buildResultsInSuccess.get( new
Integer( project.getId() ) );
 
-                if ( buildResultsInSuccess != null )
+                if ( buildInSuccess != null )
                 {
-                    BuildResult buildInSuccess = (BuildResult) buildResultsInSuccess.get(
new Integer( project.getId() ) );
-
-                    if ( buildInSuccess != null )
-                    {
-                        model.setBuildInSuccessId( buildInSuccess.getId() );
-                    }
+                    model.setBuildInSuccessId( buildInSuccess.getId() );
                 }
+            }
 
-                if ( buildResults != null )
-                {
-                    BuildResult latestBuild = (BuildResult) buildResults.get( new Integer(
project.getId() ) );
+            if ( buildResults != null )
+            {
+                BuildResult latestBuild = (BuildResult) buildResults.get( new Integer( project.getId()
) );
 
-                    if ( latestBuild != null )
-                    {
-                        model.setLatestBuildId( latestBuild.getId() );
-                    }
+                if ( latestBuild != null )
+                {
+                    model.setLatestBuildId( latestBuild.getId() );
                 }
-
-                summary.add( model );
             }
-        }
-        catch( Exception e )
-        {
-            e.printStackTrace();
+
+            summary.add( model );
         }
 
         return SUCCESS;

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java?rev=431245&r1=431244&r2=431245&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java
Sun Aug 13 14:27:24 2006
@@ -58,38 +58,29 @@
     private String output;
 
     public String execute()
+        throws ContinuumException
     {
-        try
-        {
-            files = continuum.getFiles( projectId, userDirectory );
+        files = continuum.getFiles( projectId, userDirectory );
 
-            HashMap params = new HashMap();
+        HashMap params = new HashMap();
 
-            params.put( "projectId", new Integer( projectId ) );
+        params.put( "projectId", new Integer( projectId ) );
 
-            params.put( "projectName", projectName );
+        params.put( "projectName", projectName );
 
-            String baseUrl = UrlHelper.buildUrl( "/workingCopy.action", ServletActionContext.getRequest(),
ServletActionContext.getResponse(), params );
+        String baseUrl = UrlHelper.buildUrl( "/workingCopy.action", ServletActionContext.getRequest(),
ServletActionContext.getResponse(), params );
 
-            output = generator.generate( files, baseUrl, continuum.getWorkingDirectory( projectId
) );
+        output = generator.generate( files, baseUrl, continuum.getWorkingDirectory( projectId
) );
 
-            if ( currentFile != null && currentFile != "" )
-            {
-                currentFileContent = continuum.getFileContent( projectId, userDirectory,
currentFile );
-            }
-            else
-            {
-                currentFileContent = "";
-            }
+        if ( currentFile != null && currentFile != "" )
+        {
+            currentFileContent = continuum.getFileContent( projectId, userDirectory, currentFile
);
         }
-        catch ( ContinuumException e )
+        else
         {
-            addActionError( "Can't get file list for project (id=" + projectId + ") : " +
e.getMessage() );
-
-            e.printStackTrace();
-
-            return ERROR;
+            currentFileContent = "";
         }
+
         return SUCCESS;
     }
 



Mime
View raw message