From continuum-commits-return-3382-apmail-maven-continuum-commits-archive=maven.apache.org@maven.apache.org Sun Sep 09 20:49:17 2007 Return-Path: Delivered-To: apmail-maven-continuum-commits-archive@www.apache.org Received: (qmail 47459 invoked from network); 9 Sep 2007 20:49:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Sep 2007 20:49:16 -0000 Received: (qmail 62986 invoked by uid 500); 9 Sep 2007 20:49:10 -0000 Delivered-To: apmail-maven-continuum-commits-archive@maven.apache.org Received: (qmail 62964 invoked by uid 500); 9 Sep 2007 20:49:10 -0000 Mailing-List: contact continuum-commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: continuum-dev@maven.apache.org Delivered-To: mailing list continuum-commits@maven.apache.org Delivered-To: moderator for continuum-commits@maven.apache.org Received: (qmail 57432 invoked by uid 99); 9 Sep 2007 20:44:14 -0000 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r574073 - in /maven/continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/core/action/ continuum-model/src/main/mdo/ continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ continuum-webapp/src/main/java/org... Date: Sun, 09 Sep 2007 20:43:54 -0000 To: continuum-commits@maven.apache.org From: olamy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070909204355.B74A51A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olamy Date: Sun Sep 9 13:43:53 2007 New Revision: 574073 URL: http://svn.apache.org/viewvc?rev=574073&view=rev Log: [CONTINUUM-1427] Ability to choose the build definition for 'Build all projects' and 'Build Project(s)' Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java maven/continuum/trunk/continuum-webapp/src/main/mdo/view-models.mdo maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java?rev=574073&r1=574072&r2=574073&view=diff ============================================================================== --- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java (original) +++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java Sun Sep 9 13:43:53 2007 @@ -180,6 +180,8 @@ storedDefinition.setProfile( buildDefinition.getProfile() ); + storedDefinition.setDescription( buildDefinition.getDescription() ); + store.storeBuildDefinition( storedDefinition ); return storedDefinition; Modified: maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml?rev=574073&r1=574072&r2=574073&view=diff ============================================================================== --- maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml (original) +++ maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml Sun Sep 9 13:43:53 2007 @@ -959,6 +959,18 @@ + description + 1.1.0+ + String + description of the buid defintion + + + schedule 1.0.9+ Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java?rev=574073&r1=574072&r2=574073&view=diff ============================================================================== --- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java (original) +++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java Sun Sep 9 13:43:53 2007 @@ -76,6 +76,8 @@ private String projectGroupName = ""; private int profileId; + + private String description; public void prepare() throws Exception @@ -155,6 +157,7 @@ { profileId = profile.getId(); } + description = buildDefinition.getDescription(); } else { @@ -383,6 +386,7 @@ buildDefinition.setProfile( profile ); } } + buildDefinition.setDescription( description ); return buildDefinition; } @@ -552,5 +556,15 @@ public void setProfileId( int profileId ) { this.profileId = profileId; + } + + public String getDescription() + { + return description; + } + + public void setDescription( String description ) + { + this.description = description; } } Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?rev=574073&r1=574072&r2=574073&view=diff ============================================================================== --- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java (original) +++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java Sun Sep 9 13:43:53 2007 @@ -20,12 +20,15 @@ */ import org.apache.maven.continuum.ContinuumException; +import org.apache.maven.continuum.model.project.BuildDefinition; import org.apache.maven.continuum.model.project.Project; import org.apache.maven.continuum.model.project.ProjectDependency; import org.apache.maven.continuum.model.project.ProjectGroup; import org.apache.maven.continuum.project.ContinuumProjectState; import org.apache.maven.continuum.web.bean.ProjectGroupUserBean; import org.apache.maven.continuum.web.exception.AuthorizationRequiredException; +import org.apache.maven.continuum.web.model.BuildDefinitionSummary; +import org.apache.maven.continuum.xmlrpc.project.ProjectGroupSummary; import org.codehaus.plexus.redback.rbac.RBACManager; import org.codehaus.plexus.redback.rbac.RbacManagerException; import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException; @@ -41,6 +44,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -107,6 +111,10 @@ private Collection groupProjects; private int releaseProjectId; + + private Map buildDefinitions; + + private int buildDefinitionId; public String summary() throws ContinuumException @@ -120,9 +128,25 @@ addActionError( authzE.getMessage() ); return REQUIRES_AUTHORIZATION; } - + projectGroup = getProjectGroup( projectGroupId ); + List projectGroupBuildDefs = getContinuum().getBuildDefinitionsForProjectGroup( projectGroupId ); + + if (projectGroupBuildDefs != null) + { + this.buildDefinitions = new LinkedHashMap(projectGroupBuildDefs.size()); + for(BuildDefinition buildDefinition : projectGroupBuildDefs) + { + String key = StringUtils.isEmpty( buildDefinition.getDescription() ) ? buildDefinition.getGoals() : buildDefinition.getDescription(); + buildDefinitions.put( key, Integer.valueOf( buildDefinition.getId() ) ); + } + } + else + { + this.buildDefinitions = Collections.EMPTY_MAP; + } + return SUCCESS; } @@ -334,8 +358,14 @@ return REQUIRES_AUTHORIZATION; } - getContinuum().buildProjectGroup( projectGroupId ); - + if ( this.getBuildDefinitionId() == -1 ) + { + getContinuum().buildProjectGroup( projectGroupId ); + } + else + { + getContinuum().buildProjectGroupWithBuildDefinition( projectGroupId, buildDefinitionId ); + } return SUCCESS; } @@ -670,6 +700,26 @@ { return getProjectGroup( projectGroupId ).getName(); + } + + public Map getBuildDefinitions() + { + return buildDefinitions; + } + + public void setBuildDefinitions( Map buildDefinitions ) + { + this.buildDefinitions = buildDefinitions; + } + + public int getBuildDefinitionId() + { + return buildDefinitionId; + } + + public void setBuildDefinitionId( int buildDefinitionId ) + { + this.buildDefinitionId = buildDefinitionId; } } 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=574073&r1=574072&r2=574073&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 Sun Sep 9 13:43:53 2007 @@ -55,6 +55,8 @@ private int projectGroupId; private String methodToCall; + + private int buildDefinitionId; public String execute() throws Exception @@ -125,7 +127,7 @@ if ( selectedProjects != null && !selectedProjects.isEmpty() ) { - ArrayList projectsList = new ArrayList(); + ArrayList projectsList = new ArrayList(); for ( Iterator i = selectedProjects.iterator(); i.hasNext(); ) { int projectId = Integer.parseInt( (String) i.next() ); @@ -133,6 +135,7 @@ projectsList.add( p ); } + List sortedProjects; try { @@ -145,47 +148,65 @@ //TODO : Change this part because it's a duplicate of DefaultContinuum.buildProjectGroup* BuildDefinition groupDefaultBD = null; - try - { - groupDefaultBD = store.getDefaultBuildDefinitionForProjectGroup( projectGroupId ); - } - catch ( ContinuumObjectNotFoundException e ) + if (getBuildDefinitionId() == -1 || getBuildDefinitionId() == 0) { - throw new ContinuumException( "Project Group (id=" + projectGroupId + - " doens't have a default build definition, this should be impossible, it should always have a default definition set." ); - } - catch ( ContinuumStoreException e ) - { - throw new ContinuumException( "Project Group (id=" + projectGroupId + - " doens't have a default build definition, this should be impossible, it should always have a default definition set." ); - } - - for ( Iterator i = sortedProjects.iterator(); i.hasNext(); ) - { - int buildDefId = groupDefaultBD.getId(); - Project project = (Project) i.next(); - BuildDefinition projectDefaultBD = null; try { - projectDefaultBD = store.getDefaultBuildDefinitionForProject( project.getId() ); + groupDefaultBD = store.getDefaultBuildDefinitionForProjectGroup( projectGroupId ); } catch ( ContinuumObjectNotFoundException e ) { - getLogger().debug( e.getMessage() ); + throw new ContinuumException( "Project Group (id=" + projectGroupId + + " doens't have a default build definition, this should be impossible, it should always have a default definition set." ); } catch ( ContinuumStoreException e ) { - getLogger().debug( e.getMessage() ); + throw new ContinuumException( "Project Group (id=" + projectGroupId + + " doens't have a default build definition, this should be impossible, it should always have a default definition set." ); } + } + for ( Iterator i = sortedProjects.iterator(); i.hasNext(); ) + { + Project project = (Project) i.next(); + if ( this.getBuildDefinitionId() == -1 || getBuildDefinitionId() == 0) + { + int buildDefId = groupDefaultBD.getId(); - if ( projectDefaultBD != null ) + BuildDefinition projectDefaultBD = null; + if ( this.getBuildDefinitionId() == -1 ) + { + try + { + projectDefaultBD = store.getDefaultBuildDefinitionForProject( project.getId() ); + } + catch ( ContinuumObjectNotFoundException e ) + { + getLogger().debug( e.getMessage() ); + } + catch ( ContinuumStoreException e ) + { + 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." ); + } + } + + getContinuum().buildProject( project.getId(), buildDefId, ContinuumProjectState.TRIGGER_FORCED ); + } + else { - buildDefId = projectDefaultBD.getId(); - getLogger().debug( "Project " + project.getId() + - " has own default build definition, will use it instead of group's." ); + getContinuum().buildProject( project.getId(), this.getBuildDefinitionId(), + ContinuumProjectState.TRIGGER_FORCED ); } - getContinuum().buildProject( project.getId(), buildDefId, ContinuumProjectState.TRIGGER_FORCED ); } + } return SUCCESS; @@ -225,5 +246,15 @@ public void setMethodToCall( String methodToCall ) { this.methodToCall = methodToCall; + } + + public int getBuildDefinitionId() + { + return buildDefinitionId; + } + + public void setBuildDefinitionId( int buildDefinitionId ) + { + this.buildDefinitionId = buildDefinitionId; } } Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java?rev=574073&r1=574072&r2=574073&view=diff ============================================================================== --- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java (original) +++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java Sun Sep 9 13:43:53 2007 @@ -182,7 +182,7 @@ return summaryList; } - private BuildDefinitionSummary generateBuildDefinitionSummary( BuildDefinition bd ) + protected BuildDefinitionSummary generateBuildDefinitionSummary( BuildDefinition bd ) { BuildDefinitionSummary bds = new BuildDefinitionSummary(); @@ -199,6 +199,7 @@ bds.setProfileName( bd.getProfile().getName() ); bds.setProfileId( bd.getProfile().getId() ); } + bds.setDescription( bd.getDescription() ); return bds; } Modified: maven/continuum/trunk/continuum-webapp/src/main/mdo/view-models.mdo URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/mdo/view-models.mdo?rev=574073&r1=574072&r2=574073&view=diff ============================================================================== --- maven/continuum/trunk/continuum-webapp/src/main/mdo/view-models.mdo (original) +++ maven/continuum/trunk/continuum-webapp/src/main/mdo/view-models.mdo Sun Sep 9 13:43:53 2007 @@ -341,7 +341,13 @@ true id of the profile for build definition int - + + + description + 1.0.0 + String + description of the buid defintion + Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=574073&r1=574072&r2=574073&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 Sun Sep 9 13:43:53 2007 @@ -156,6 +156,8 @@ projectGroup.buildsStatut.errors = Errors projectGroup.buildsStatut.failures = Failed projectGroup.buildsStatut.success = Success +projectGroup.buildDefinition.label = Choose a BuildDefinition +projectGroup.addProject.label = Add New Project # ---------------------------------------------------------------------- # Page: Add Project Group @@ -321,6 +323,7 @@ projectView.buildDefinition.from = From projectView.buildDefinition.default = Default projectView.buildDefinition.buildFresh = Build Fresh +projectView.buildDefinition.description = Description projectView.notifiers = Notifiers projectView.notifier.type = Type projectView.notifier.recipient = Recipient @@ -369,6 +372,7 @@ buildDefinition.buildFresh.label = Build Fresh (Run always a clean checkout instead of an SCM update) buildDefinition.defaultForProject.label = Is it default? buildDefinition.schedule.label = Schedule +buildDefinition.description.label = Description buildDefinition.noname.save.error.message = There was an error saving the schedule, no schedule name was supplied. buildDefinition.duplicatename.save.error.message = There was an error saving the schedule, a schedule with the same name already exists. Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp?rev=574073&r1=574072&r2=574073&view=diff ============================================================================== --- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp (original) +++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp Sun Sep 9 13:43:53 2007 @@ -75,6 +75,7 @@ +
Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp?rev=574073&r1=574072&r2=574073&view=diff ============================================================================== --- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp (original) +++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp Sun Sep 9 13:43:53 2007 @@ -58,6 +58,7 @@ + @@ -155,6 +156,7 @@ + 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=574073&r1=574072&r2=574073&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 Sun Sep 9 13:43:53 2007 @@ -44,6 +44,7 @@
+ " onclick="document.forms.projectsForm.methodToCall.value='remove';document.forms.projectsForm.submit();" /> - " onclick="document.forms.projectsForm.methodToCall.value='build';document.forms.projectsForm.submit();" /> + + " onclick="$('projectsForm').methodToCall.value='build';$('projectsForm').submit();" /> " onclick="document.forms.projectsForm.action='cancelBuilds.action';document.forms.projectsForm.submit();" /> Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp?rev=574073&r1=574072&r2=574073&view=diff ============================================================================== --- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp (original) +++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp Sun Sep 9 13:43:53 2007 @@ -94,33 +94,38 @@ @@ -138,7 +143,7 @@
- - + + + "/> + "/> - + +
+
- +
- "/> - "/> + "/> + "/>
-
+
- "/> - "/> + "/> + "/>
- "/> - "/> + "/> + "/>