continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r585455 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ProjectsListAction.java webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
Date Wed, 17 Oct 2007 12:15:42 GMT
Author: evenisse
Date: Wed Oct 17 05:15:36 2007
New Revision: 585455

URL: http://svn.apache.org/viewvc?rev=585455&view=rev
Log:
[CONTINUUM-1524] Fix selected projects build with/without a specified build definition

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java?rev=585455&r1=585454&r2=585455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
Wed Oct 17 05:15:36 2007
@@ -23,9 +23,6 @@
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
-import org.apache.maven.continuum.store.ContinuumStore;
-import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.dag.CycleDetectedException;
@@ -50,7 +47,7 @@
     private int projectGroupId;
 
     private String methodToCall;
-    
+
     private int buildDefinitionId;
 
     public String execute()
@@ -130,7 +127,6 @@
                 projectsList.add( p );
             }
 
-            
             List sortedProjects;
             try
             {
@@ -143,23 +139,27 @@
 
             //TODO : Change this part because it's a duplicate of DefaultContinuum.buildProjectGroup*
             List<BuildDefinition> groupDefaultBDs = null;
-            if ( getBuildDefinitionId() == -1 || getBuildDefinitionId() == 0 )
+
+            if ( getBuildDefinitionId() <= 0 )
             {
                 groupDefaultBDs = getContinuum().getDefaultBuildDefinitionsForProjectGroup(
projectGroupId );
             }
             for ( Iterator i = sortedProjects.iterator(); i.hasNext(); )
             {
                 Project project = (Project) i.next();
-                if ( this.getBuildDefinitionId() == -1 || getBuildDefinitionId() == 0)
+                if ( this.getBuildDefinitionId() <= 0 )
                 {
                     int buildDefId = -1;
 
-                    for ( BuildDefinition bd : groupDefaultBDs )
+                    if ( groupDefaultBDs != null )
                     {
-                        if ( project.getExecutorId().equals( bd.getType() ) )
+                        for ( BuildDefinition bd : groupDefaultBDs )
                         {
-                            buildDefId = bd.getId();
-                            break;
+                            if ( project.getExecutorId().equals( bd.getType() ) )
+                            {
+                                buildDefId = bd.getId();
+                                break;
+                            }
                         }
                     }
 
@@ -175,15 +175,12 @@
                             // here skip ObjectNotException
                             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." );
+                            getLogger().debug( "Project " + project.getId() +
+                                " has own default build definition, will use it instead of
group's." );
                         }
                     }
 
@@ -195,7 +192,7 @@
                                                  ContinuumProjectState.TRIGGER_FORCED );
                 }
             }
-            
+
         }
 
         return SUCCESS;
@@ -246,4 +243,4 @@
     {
         this.buildDefinitionId = buildDefinitionId;
     }
-}
\ No newline at end of file
+}

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp?rev=585455&r1=585454&r2=585455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
Wed Oct 17 05:15:36 2007
@@ -44,7 +44,8 @@
 
   <form id="projectsForm" action="ProjectsList.action" method="post">
     <input type="hidden" name="methodToCall" value="" />
-    <input type="hidden" id="buildDefinitionId" name="buildDefinitionId" />
+    <input type="hidden" name="projectGroupId" value="${projectGroupId}" />
+    <input type="hidden" name="buildDefinitionId" value="-1" />
   <ec:table items="projects"
             var="project"
             showExports="false"
@@ -241,12 +242,11 @@
           <tr>
             <td>
               <redback:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
-                <input type="hidden" name="projectGroupId" value="${project.projectGroupId}"
/>
                 <input type="button" name="delete-projects" value="<ww:text name="projectGroup.deleteProjects"/>"
onclick="document.forms.projectsForm.methodToCall.value='remove';document.forms.projectsForm.submit();"
/>
-                <ww:select theme="simple" name="buildDefinitionId" id="buildDefinitions"
list="buildDefinitions" 
+                <ww:select theme="simple" name="buildDef" list="buildDefinitions" 
                            listKey="value" listValue="key" headerKey="-1" headerValue="%{getText('projectGroup.buildDefinition.label')}"
-                           onchange="$('projectsForm').buildDefinitionId.value=$('buildDefinitions').value"
/>                
-                <input type="button" name="build-projects" value="<ww:text name="projectGroup.buildProjects"/>"
onclick="$('projectsForm').methodToCall.value='build';$('projectsForm').submit();" />
+                           onchange="$('projectsForm').buildDefinitionId.value=$('buildDef').value"
/>
+                <input type="button" name="build-projects" value="<ww:text name="projectGroup.buildProjects"/>"
onclick="$('projectsForm').methodToCall.value='build';document.forms.projectsForm.submit();"
/>
                 <input type="button" name="cancel-builds" value="<ww:text name="projectGroup.cancelBuilds"/>"
onclick="document.forms.projectsForm.action='cancelBuilds.action';document.forms.projectsForm.submit();"
/>
               </redback:ifAuthorized>
             </td>



Mime
View raw message