Index: continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java =================================================================== --- continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (revision 422039) +++ continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (working copy) @@ -2258,6 +2258,31 @@ } } + public Collection getAllProjectGroupsWithProjects() + { + // todo check why this interface isn't throwing exceptions on this guy + return store.getAllProjectGroupsWithProjects(); + + } + + public Collection getProjectsInGroup( int projectGroupId ) + throws ContinuumException + { + try + { + return store.getProjectGroupWithProjects( projectGroupId ).getProjects(); + } + catch ( ContinuumObjectNotFoundException e ) + { + throw new ContinuumException( "Unable to find the requested project", e ); + } + catch ( ContinuumStoreException e ) + { + throw new ContinuumException( "Error retrieving the requested project", e ); + } + } + + // ---------------------------------------------------------------------- // Private Utilities // ---------------------------------------------------------------------- Index: continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java =================================================================== --- continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (revision 422039) +++ continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (working copy) @@ -43,6 +43,15 @@ String ROLE = Continuum.class.getName(); // ---------------------------------------------------------------------- + // Project Groups + // ---------------------------------------------------------------------- + + public Collection getAllProjectGroupsWithProjects(); + + public Collection getProjectsInGroup( int projectGroupId ) + throws ContinuumException; + + // ---------------------------------------------------------------------- // Project // ---------------------------------------------------------------------- Index: continuum-webapp/src/main/java/org/apache/maven/continuum/web/model/SummaryProjectModel.java =================================================================== --- continuum-webapp/src/main/java/org/apache/maven/continuum/web/model/SummaryProjectModel.java (revision 427150) +++ continuum-webapp/src/main/java/org/apache/maven/continuum/web/model/SummaryProjectModel.java (working copy) @@ -1,5 +1,7 @@ package org.apache.maven.continuum.web.model; +import java.io.Serializable; + /* * Copyright 2004-2005 The Apache Software Foundation. * @@ -21,6 +23,7 @@ * @version $Id$ */ public class SummaryProjectModel + implements Serializable { private int id = -1; private String name; Index: continuum-webapp/src/main/java/org/apache/maven/continuum/web/model/GroupSummaryModel.java =================================================================== --- continuum-webapp/src/main/java/org/apache/maven/continuum/web/model/GroupSummaryModel.java (revision 0) +++ continuum-webapp/src/main/java/org/apache/maven/continuum/web/model/GroupSummaryModel.java (revision 0) @@ -0,0 +1,145 @@ +package org.apache.maven.continuum.web.model; + +import java.util.List; +import java.io.Serializable; + +/* + * 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. + */ + + +/** + * GroupSummaryModel: + * + * @author: Jesse McConnell + * @version: $ID:$ + */ +public class GroupSummaryModel + implements Serializable +{ + /** + * Field id + */ + private int id; + + /** + * Field groupId + */ + private String groupId; + + + /** + * Field name + */ + private String name; + + /** + * Field description + */ + private String description; + + /** + * Field projects + */ + private List projects; + + private int numSuccesses; + + private int numFailures; + + private int numErrors; + + public int getId() + { + return id; + } + + public void setId( int id ) + { + this.id = id; + } + + public String getGroupId() + { + return groupId; + } + + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } + + public String getName() + { + return name; + } + + public void setName( String name ) + { + this.name = name; + } + + public String getDescription() + { + return description; + } + + public void setDescription( String description ) + { + this.description = description; + } + + + public List getProjects() + { + return projects; + } + + public void setProjects( List projects ) + { + this.projects = projects; + } + + + public int getNumSuccesses() + { + return numSuccesses; + } + + public void setNumSuccesses( int numSuccesses ) + { + this.numSuccesses = numSuccesses; + } + + public int getNumFailures() + { + return numFailures; + } + + public void setNumFailures( int numFailures ) + { + this.numFailures = numFailures; + } + + public int getNumErrors() + { + return numErrors; + } + + public void setNumErrors( int numErrors ) + { + this.numErrors = numErrors; + } +} Property changes on: continuum-webapp/src/main/java/org/apache/maven/continuum/web/model/GroupSummaryModel.java ___________________________________________________________________ Name: svn:eol-style + native Index: continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java =================================================================== --- continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java (revision 0) +++ continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java (revision 0) @@ -0,0 +1,174 @@ +package org.apache.maven.continuum.web.action; + +import org.codehaus.plexus.xwork.action.PlexusActionSupport; +import org.apache.maven.continuum.Continuum; +import org.apache.maven.continuum.web.model.SummaryProjectModel; +import org.apache.maven.continuum.web.model.GroupSummaryModel; +import org.apache.maven.continuum.model.project.Project; +import org.apache.maven.continuum.model.project.BuildResult; +import org.apache.maven.continuum.model.project.ProjectGroup; + +import java.util.List; +import java.util.Collection; +import java.util.Map; +import java.util.ArrayList; +import java.util.Iterator; +/* + * Copyright 2005 The Codehaus. + * + * 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. + */ + +/** + * @author Emmanuel Venisse + * @version $Id: SummaryAction.java 424394 2006-07-21 17:38:37Z carlos $ + * + * @plexus.component + * role="com.opensymphony.xwork.Action" + * role-hint="groupSummary" + */ +public class GroupSummaryAction + extends PlexusActionSupport +{ + /** + * @plexus.requirement + */ + private Continuum continuum; + + + + private List groups; + + public String execute() + throws Exception + { + try + { + groups = new ArrayList(); + + Collection projectGroups = continuum.getAllProjectGroupsWithProjects(); + + for ( Iterator j = projectGroups.iterator(); j.hasNext(); ) + { + ProjectGroup projectGroup = (ProjectGroup) j.next(); + + getLogger().info("GroupSummaryAction: building group " + projectGroup.getName() ); + + GroupSummaryModel groupModel = new GroupSummaryModel(); + groupModel.setId( projectGroup.getId() ); + groupModel.setGroupId( projectGroup.getGroupId() ); + groupModel.setName( projectGroup.getName() ); + groupModel.setDescription( projectGroup.getDescription() ); + + //TODO: Create a summary jpox request so code will be more simple and performance will be better + Collection projects = projectGroup.getProjects(); + + Map buildResults = continuum.getLatestBuildResults(); + + Map buildResultsInSuccess = continuum.getBuildResultsInSuccess(); + + List projectModels = new ArrayList(); + int numSuccesses = 0; + int numFailures = 0; + int numErrors = 0; + + for ( Iterator i = projects.iterator(); i.hasNext(); ) + { + Project project = (Project) i.next(); + + SummaryProjectModel model = new SummaryProjectModel(); + + getLogger().info("GroupSummaryAction: building project model " + project.getName() ); + + model.setId( project.getId() ); + + model.setName( project.getName() ); + + model.setVersion( project.getVersion() ); + + model.setProjectGroupName( project.getProjectGroup().getName() ); + + if ( continuum.isInBuildingQueue( project.getId() ) || + continuum.isInCheckoutQueue( project.getId() ) ) + { + model.setInQueue( true ); + } + else + { + model.setInQueue( false ); + } + + model.setState( project.getState() ); + + if ( project.getState() == 2 ) + { + numSuccesses++; + } + else if ( project.getState() == 3 ) + { + numFailures++; + } + else if ( project.getState() == 4 ) + { + numErrors++; + } + + model.setBuildNumber( project.getBuildNumber() ); + + if ( buildResultsInSuccess != null ) + { + BuildResult buildInSuccess = + (BuildResult) buildResultsInSuccess.get( new Integer( project.getId() ) ); + + if ( buildInSuccess != null ) + { + model.setBuildInSuccessId( buildInSuccess.getId() ); + } + } + + if ( buildResults != null ) + { + BuildResult latestBuild = (BuildResult) buildResults.get( new Integer( project.getId() ) ); + + if ( latestBuild != null ) + { + model.setLatestBuildId( latestBuild.getId() ); + } + } + getLogger().info( "GroupSummaryAction: adding model to group " + model.getName() ); + projectModels.add( model ); + } + + groupModel.setNumSuccesses( numSuccesses ); + groupModel.setNumFailures( numFailures ); + groupModel.setNumErrors( numErrors ); + groupModel.setProjects( projectModels ); + getLogger().info( "GroupSummaryAction: adding group to groups list " + groupModel.getName() ); + groups.add( groupModel ); + } + + } + catch ( Exception e ) + { + e.printStackTrace(); + } + + return SUCCESS; + } + + public List getGroups() + { + return groups; + } + +} Property changes on: continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java ___________________________________________________________________ Name: svn:eol-style + native Index: continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java =================================================================== --- continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java (revision 427150) +++ continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java (working copy) @@ -44,6 +44,8 @@ */ private Continuum continuum; + private int projectGroupId = -1; + private int nbSuccesses; private int nbFailures; @@ -57,9 +59,23 @@ { try { - //TODO: Create a summary jpox request so code will be more simple and performance will be better - Collection projects = continuum.getProjects(); + 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 + { + 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 ); + } + Map buildResults = continuum.getLatestBuildResults(); Map buildResultsInSuccess = continuum.getBuildResultsInSuccess(); @@ -156,4 +172,15 @@ { return summary; } + + + public int getProjectGroupId() + { + return projectGroupId; + } + + public void setProjectGroupId( int projectGroupId ) + { + this.projectGroupId = projectGroupId; + } } Index: continuum-webapp/src/main/resources/localization/Continuum.properties =================================================================== --- continuum-webapp/src/main/resources/localization/Continuum.properties (revision 427150) +++ continuum-webapp/src/main/resources/localization/Continuum.properties (working copy) @@ -1,6 +1,6 @@ -// ---------------------------------------------------------------------- -// COMMONS -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# COMMONS +# ---------------------------------------------------------------------- webwork.date=MMM dd, yyyy hh:mm:ss aaa z message.success = Success @@ -19,16 +19,17 @@ info = Info or = OR -// ---------------------------------------------------------------------- -// Page: Top -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: Top +# ---------------------------------------------------------------------- top.logo.default = [Your company logo here] -// ---------------------------------------------------------------------- -// Page: Menu -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: Menu +# ---------------------------------------------------------------------- menu.continuum.about = About menu.continuum.showProjects = Show Projects +menu.continuum.showProjectGroups = Project Groups menu.addProject = Add Project menu.add.m2Project = Maven 2.0.x Project menu.add.m1Project = Maven 1.x Project @@ -38,17 +39,17 @@ menu.administration.configuration = Configuration menu.administration.schedules = Schedules -// ---------------------------------------------------------------------- -// Page: About -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: About +# ---------------------------------------------------------------------- about.page.title = Continuum - About about.section.title = About Continuum about.version.label = Version about.version.number = ${project.version} -// ---------------------------------------------------------------------- -// Page: Login -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: Login +# ---------------------------------------------------------------------- login.page.title = Continuum - Authentication login.section.title = Authentication login.username = Username @@ -56,9 +57,9 @@ login.rememberMe = Remember me login.submit = Connect -// ---------------------------------------------------------------------- -// Page: Summary -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: Summary +# ---------------------------------------------------------------------- summary.page.title = Continuum - Summary summary.section.title = Continuum Projects summary.projectTable.name = Name @@ -69,9 +70,16 @@ summary.buildHistory = Build History summary.buildNow = Build Now -// ---------------------------------------------------------------------- -// Page: Configuration -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: Group Summary +# ---------------------------------------------------------------------- +groups.page.title = Continuum - Group Summary +groups.section.title = Project Group: +groups.manage.label = Manage Group + +# ---------------------------------------------------------------------- +# Page: Configuration +# ---------------------------------------------------------------------- configuration.page.title = Continuum - Configuration configuration.section.title = General Configuration configuration.guest.label = Guests @@ -84,9 +92,9 @@ configuration.companyUrl.label = Company URL configuration.submit.edit = Edit -// ---------------------------------------------------------------------- -// Page: AddMavenOneProject -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: AddMavenOneProject +# ---------------------------------------------------------------------- add.m1.project.page.title = Continuum - Add Maven 1 Project add.m1.project.section.title = Add Maven 1.x Project add.m1.project.m1PomUrl.label = M1 POM Url @@ -96,9 +104,9 @@ add.m1.project.m1PomFile.message = Enter the local filename of the Maven 1 POM to upload add.m1.project.m1PomFile.error = You must enter a valid URL -// ---------------------------------------------------------------------- -// Page: AddMavenTwoProject -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: AddMavenTwoProject +# ---------------------------------------------------------------------- add.m2.project.page.title = Continuum - Add Maven 2 Project add.m2.project.section.title = Add Maven 2.0+ Project add.m2.project.m2PomUrl.label = POM Url @@ -108,9 +116,9 @@ add.m2.project.m2PomFile.message = Enter the local filename of the Maven 2 POM to upload (works only for a single project without modules). add.m2.project.m2PomFile.error = You must enter a valid URL -// ---------------------------------------------------------------------- -// Page: AddProject (ant or shell) -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: AddProject (ant or shell) +# ---------------------------------------------------------------------- add.shell.project.page.title = Continuum - Add Shell Project add.shell.project.section.title = Add Shell Project add.ant.project.page.title = Add Ant Project @@ -141,16 +149,16 @@ projectVersion.error = You must provide a version projectVersion.message = Enter the version of the project -// ---------------------------------------------------------------------- -// Page: DeleteProject -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: DeleteProject +# ---------------------------------------------------------------------- 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 -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: ProjectView +# ---------------------------------------------------------------------- projectView.page.title = Continuum - Continuum Project projectView.section.title = Continuum Project projectView.project.name = Project Name @@ -176,9 +184,9 @@ projectView.developer.name = Name projectView.developer.email = Email -// ---------------------------------------------------------------------- -// Page: ProjectEdit -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: ProjectEdit +# ---------------------------------------------------------------------- projectEdit.page.title = Continuum - Update Continuum Project projectEdit.section.title = Update Continuum Project projectEdit.project.name.label = Project Name @@ -188,9 +196,9 @@ projectEdit.project.scmPassword.label = Scm Password projectEdit.project.scmTag.label = Scm Branch/Tag -// ---------------------------------------------------------------------- -// Page: BuildDefinitionEdit -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: BuildDefinitionEdit +# ---------------------------------------------------------------------- buildDefinition.page.title = Continuum - Add/Edit Build Definition buildDefinition.section.title = Add/Edit Build Definition buildDefinition.buildFile.ant.label = Ant build filename @@ -202,23 +210,23 @@ buildDefinition.defaultForProject.label = Is it default? buildDefinition.schedule.label = Schedule -// ---------------------------------------------------------------------- -// Page: DeleteBuildDefinition -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: DeleteBuildDefinition +# ---------------------------------------------------------------------- deleteBuildDefinition.page.title = Continuum - Delete Build Definition deleteBuildDefinition.section.title = Delete Build Definition deleteBuildDefinition.confirmation.message = Are you sure you want to delete the build definition "{0}"? -// ---------------------------------------------------------------------- -// Page: DeleteNotifier -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: DeleteNotifier +# ---------------------------------------------------------------------- deleteNotifier.page.title = Continuum - Delete Notifier deleteNotifier.section.title = Delete Notifier deleteNotifier.confirmation.message = Are you sure you want to delete the {0} notifier "{1}"? -// ---------------------------------------------------------------------- -// Page: Notifier -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: Notifier +# ---------------------------------------------------------------------- notifier.page.add.title = Continuum - Add Notifier notifier.section.add.title = Add Notifier notifier.page.title = Continuum - Add/Edit {0} Notifier @@ -247,9 +255,9 @@ notifier.event.sendOnError = Send on Error notifier.event.sendOnWarning = Send on Warning -// ---------------------------------------------------------------------- -// Page: BuildResults -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: BuildResults +# ---------------------------------------------------------------------- buildResults.page.title = Continuum - Build results buildResults.section.title = Build results for {0} buildResults.buildNumber = Build # @@ -258,9 +266,9 @@ buildResults.state = State buildResults.noChanges = No changes -// ---------------------------------------------------------------------- -// Page: BuildResults -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: BuildResults +# ---------------------------------------------------------------------- buildResult.page.title = Continuum - Build result buildResult.section.title = Build result for {0} buildResult.startTime = Start Time @@ -278,15 +286,15 @@ buildResult.changes.files = Files buildResult.changesSinceLastSuccess = Other Changes Since Last Success -// ---------------------------------------------------------------------- -// Page: WorkingCopy -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: WorkingCopy +# ---------------------------------------------------------------------- workingCopy.page.title = Continuum - Working Copy workingCopy.section.title = Working Copy for {0} -// ---------------------------------------------------------------------- -// Page: Schedules -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: Schedules +# ---------------------------------------------------------------------- schedules.page.title = Continuum - Schedules schedules.section.title = Schedules schedules.table.name = Name @@ -294,9 +302,9 @@ schedules.table.delay = Quiet Period schedules.table.cronExpression = Cron Expression -// ---------------------------------------------------------------------- -// Page: Add/EditSchedule -// ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Page: Add/EditSchedule +# ---------------------------------------------------------------------- addSchedule.page.title=Continuum - Add Schedule addSchedule.section.title = Add Schedule Index: continuum-webapp/src/main/resources/xwork.xml =================================================================== --- continuum-webapp/src/main/resources/xwork.xml (revision 427150) +++ continuum-webapp/src/main/resources/xwork.xml (working copy) @@ -48,6 +48,10 @@ summary.jsp + + groupSummary.jsp + + addMavenTwoProject.jsp summary.action Index: continuum-webapp/src/main/resources/webwork.properties =================================================================== --- continuum-webapp/src/main/resources/webwork.properties (revision 427150) +++ continuum-webapp/src/main/resources/webwork.properties (working copy) @@ -1,3 +1,4 @@ +webwork.mapper.class = com.opensymphony.webwork.dispatcher.mapper.DefaultActionMapper webwork.objectFactory = org.codehaus.plexus.xwork.PlexusObjectFactory #webwork.tag.altSyntax = true Index: continuum-webapp/src/main/webapp/navigations/Menu.jsp =================================================================== --- continuum-webapp/src/main/webapp/navigations/Menu.jsp (revision 427150) +++ continuum-webapp/src/main/webapp/navigations/Menu.jsp (working copy) @@ -10,6 +10,9 @@
">
+
+ "> +
Index: continuum-webapp/src/main/webapp/css/tigris.css =================================================================== --- continuum-webapp/src/main/webapp/css/tigris.css (revision 427150) +++ continuum-webapp/src/main/webapp/css/tigris.css (working copy) @@ -100,8 +100,9 @@ .app h3 a:link, .app h3 a:visited, .app h4 a:link, .app h4 a:visited { - color: #fff !important; - /*text-decoration: underline;*/ + color:black !important; + /* TODO was #fff causing white on white issues for me, so set it black */ + /*text-decoration: underline;*/ } .app h4 { Index: continuum-webapp/src/main/webapp/summary.jsp =================================================================== --- continuum-webapp/src/main/webapp/summary.jsp (revision 427150) +++ continuum-webapp/src/main/webapp/summary.jsp (working copy) @@ -9,7 +9,7 @@

- + <%----%> +<%@ taglib uri="/tld/extremecomponents" prefix="ec" %> +<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c' %> + + + + <ww:text name="groups.page.title"/> + + + +
+ + + + + + + + +

 ${group.name}

+ + + + + + + + + ${project.name} + + + + + + + + " alt="Build History" title="Build History" + border="0"> + + + " alt="Build History" title="Build History" + border="0"> + + + + + +
+ + + + " alt="" + title=""/> + + " alt="" + title=""/> + + " alt="" + title=""/> + + + + +
+
+ + +
+ +
+ Property changes on: continuum-webapp/src/main/webapp/groupSummary.jsp ___________________________________________________________________ Name: svn:eol-style + native