continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r698342 - in /continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ resources/ resources/localization/ webapp/WEB-INF/jsp/
Date Tue, 23 Sep 2008 20:35:13 GMT
Author: evenisse
Date: Tue Sep 23 13:35:13 2008
New Revision: 698342

URL: http://svn.apache.org/viewvc?rev=698342&view=rev
Log:
[CONTINUUM-1488] Add Build, Release and Delete icons/links to groupSummary page
Submitted by: Tomislav Stojcevich

Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
    continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?rev=698342&r1=698341&r2=698342&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
Tue Sep 23 13:35:13 2008
@@ -112,14 +112,16 @@
 
     private int buildDefinitionId;
 
+    private boolean fromSummaryPage = false;
+
     private String preferredExecutor = "maven2";
-    
+
     private String url;
 
     private int repositoryId;
-    
+
     private List<LocalRepository> repositories;
-    
+
     public String summary()
         throws ContinuumException
     {
@@ -159,35 +161,35 @@
         }
 
         if ( projectGroup != null )
-        {        	
+        {
             if ( projectGroup.getProjects() != null && projectGroup.getProjects().size()
> 0 )
             {
                 int nbMaven2Projects = 0;
                 int nbMaven1Projects = 0;
                 int nbAntProjects = 0;
                 int nbShellProjects = 0;
-                
+
                 // get the projects according to build order (first project in the group
is the root project)            
                 try
-                {                	
-                	Project rootProject =
-                            ( getContinuum().getProjectsInBuildOrder( getContinuum().getProjectsInGroupWithDependencies(
-                                projectGroupId ) ) ).get( 0 );
-                	if( "maven2".equals( rootProject.getExecutorId() ) || "maven-1".equals(
rootProject.getExecutorId() ) )
-                	{
-                		url = rootProject.getUrl();
-                	}
+                {
+                    Project rootProject = ( getContinuum().getProjectsInBuildOrder(
+                        getContinuum().getProjectsInGroupWithDependencies( projectGroupId
) ) ).get( 0 );
+                    if ( "maven2".equals( rootProject.getExecutorId() ) ||
+                        "maven-1".equals( rootProject.getExecutorId() ) )
+                    {
+                        url = rootProject.getUrl();
+                    }
                 }
-                catch ( CycleDetectedException e ) 
+                catch ( CycleDetectedException e )
                 {
                     // ignore. url won't be displayed if null
                 }
-                
+
                 for ( Object o : projectGroup.getProjects() )
                 {
                     Project p = (Project) o;
                     if ( "maven2".equals( p.getExecutorId() ) )
-                    {   
+                    {
                         nbMaven2Projects += 1;
                     }
                     else if ( "maven-1".equals( p.getExecutorId() ) )
@@ -309,7 +311,7 @@
         name = projectGroup.getName();
 
         description = projectGroup.getDescription();
-        
+
         projectList = projectGroup.getProjects();
 
         if ( projectList != null )
@@ -334,7 +336,7 @@
             projectGroups.put( new Integer( pg.getId() ), pg.getName() );
         }
 
-        if ( projectGroup.getLocalRepository() != null)
+        if ( projectGroup.getLocalRepository() != null )
         {
             repositoryId = projectGroup.getLocalRepository().getId();
         }
@@ -342,9 +344,9 @@
         {
             repositoryId = -1;
         }
-        
+
         repositories = getContinuum().getRepositoryService().getAllLocalRepositories();
-        
+
         return SUCCESS;
     }
 
@@ -413,7 +415,7 @@
         }
 
         projectGroup.setDescription( description );
-        
+
         if ( repositoryId > 0 )
         {
             LocalRepository repository = getContinuum().getRepositoryService().getLocalRepository(
repositoryId );
@@ -423,7 +425,7 @@
         {
             projectGroup.setLocalRepository( null );
         }
-        
+
         getContinuum().updateProjectGroup( projectGroup );
 
         Iterator keys = projects.keySet().iterator();
@@ -490,7 +492,15 @@
         {
             getContinuum().buildProjectGroupWithBuildDefinition( projectGroupId, buildDefinitionId
);
         }
-        return SUCCESS;
+
+        if ( this.isFromSummaryPage() )
+        {
+            return "to_summary_page";
+        }
+        else
+        {
+            return SUCCESS;
+        }
     }
 
     public String release()
@@ -514,7 +524,7 @@
         boolean allBuildsOk = true;
 
         boolean allMavenTwo = true;
-        
+
         projectList = getContinuum().getProjectsInGroupWithDependencies( projectGroupId );
 
         if ( projectList != null )
@@ -544,7 +554,7 @@
                         return INPUT;
                     }
                 }
-                
+
                 if ( !"maven2".equals( p.getExecutorId() ) )
                 {
                     allMavenTwo = false;
@@ -896,38 +906,48 @@
         this.buildDefinitionId = buildDefinitionId;
     }
 
+    public boolean isFromSummaryPage()
+    {
+        return fromSummaryPage;
+    }
+
+    public void setFromSummaryPage( boolean fromSummaryPage )
+    {
+        this.fromSummaryPage = fromSummaryPage;
+    }
+
     public String getPreferredExecutor()
     {
         return preferredExecutor;
     }
 
-	public String getUrl() 
-	{
-		return url;
-	}
-
-	public void setUrl(String url) 
-	{
-		this.url = url;
-	}
-	
-	public int getRepositoryId()
-	{
-	    return repositoryId;
-	}
-	
-	public void setRepositoryId( int repositoryId )
-	{
-	    this.repositoryId = repositoryId;
-	}
-	
-	public List<LocalRepository> getRepositories()
-	{
-	    return repositories;
-	}
-	
-	public void setRepositories( List<LocalRepository> repositories )
-	{
-	    this.repositories = repositories;
-	}
+    public String getUrl()
+    {
+        return url;
+    }
+
+    public void setUrl( String url )
+    {
+        this.url = url;
+    }
+
+    public int getRepositoryId()
+    {
+        return repositoryId;
+    }
+
+    public void setRepositoryId( int repositoryId )
+    {
+        this.repositoryId = repositoryId;
+    }
+
+    public List<LocalRepository> getRepositories()
+    {
+        return repositories;
+    }
+
+    public void setRepositories( List<LocalRepository> repositories )
+    {
+        this.repositories = repositories;
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=698342&r1=698341&r2=698342&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Tue Sep 23 13:35:13 2008
@@ -170,6 +170,7 @@
 projectGroup.release.error.projectNotInSuccess = Cannot release project group: one or more
projects in the group were not built successfully.
 projectGroup.deleteGroup = Delete Group
 projectGroup.buildGroup = Build all projects
+projectGroup.buildGroupNow = Build Group Now
 projectGroup.deleteProjects = Delete Project(s)
 projectGroup.buildProjects = Build Project(s)
 projectGroup.cancelBuilds = Cancel Build(s)
@@ -179,6 +180,7 @@
 projectGroup.buildsStatut.success = Success
 projectGroup.buildDefinition.label = Default Build Definition
 projectGroup.addProject.label = Add New Project
+projectGroup.releaseNow = Release Group
 projectGroup.repository.label = Local Repository
 projectGroup.tab.releaseResults = Release Results
 

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties?rev=698342&r1=698341&r2=698342&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
Tue Sep 23 13:35:13 2008
@@ -166,6 +166,7 @@
 projectGroup.release.error.projectNotInSuccess = Ne peut pas faire la "release" du groupe
de projet : un ou plusieurs projets dans le groupe n''ont pas pu \u00eatre construit avec
succ\u00e8s.
 projectGroup.deleteGroup = Supprimer groupe
 projectGroup.buildGroup = Construire tous les projets
+projectGroup.buildGroupNow = Construire le groupe maintenant
 projectGroup.deleteProjects = Supprimer projet(s)
 projectGroup.buildProjects = Construire projet(s)
 projectGroup.cancelBuilds = Annuler construction(s)
@@ -175,6 +176,7 @@
 projectGroup.buildsStatut.success = Succ\u00e8s
 projectGroup.buildDefinition.label = D\u00e9finitions de la construction par d\u00e9fault
 projectGroup.addProject.label = Ajouter un nouveau projet
+projectGroup.releaseNow = Release du groupe
 
 # ----------------------------------------------------------------------
 # Page: Project Group - Members

Modified: continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml?rev=698342&r1=698341&r2=698342&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Tue Sep 23 13:35:13 2008
@@ -315,6 +315,7 @@
         <param name="actionName">projectGroupSummary</param>
         <param name="projectGroupId">${projectGroupId}</param>
       </result>
+      <result name="to_summary_page" type="chain">groupSummary</result>
     </action>
 
     <action name="removeProjectGroup" class="projectGroup" method="remove">

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp?rev=698342&r1=698341&r2=698342&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp Tue Sep
23 13:35:13 2008
@@ -68,6 +68,47 @@
             ${pageScope.group.repositoryName}
           </redback:elseAuthorized>
         </ec:column>
+        <ec:column property="buildGroupNowAction" title="&nbsp;" width="1%">
+          <redback:ifAuthorized permission="continuum-build-group" resource="${group.name}">
+            <ww:url id="buildProjectGroupUrl" action="buildProjectGroup" namespace="/"
includeParams="none">
+              <ww:param name="projectGroupId" value="${group.id}"/>
+              <ww:param name="buildDefinitionId" value="-1"/>
+              <ww:param name="fromSummaryPage" value="true"/>
+            </ww:url>
+            <ww:a href="%{buildProjectGroupUrl}">
+              <img src="<ww:url value='/images/buildnow.gif'/>" alt="<ww:text
name="projectGroup.buildGroup"/>" title="<ww:text name="projectGroup.buildGroup"/>"
border="0">
+            </ww:a>
+          </redback:ifAuthorized>
+          <redback:elseAuthorized>
+            <img src="<ww:url value='/images/buildnow_disabled.gif'/>" alt="<ww:text
name="projectGroup.buildGroup"/>" title="<ww:text name="projectGroup.buildGroup"/>"
border="0">
+          </redback:elseAuthorized>
+        </ec:column>
+        <ec:column property="releaseProjectGroupAction" title="&nbsp;" width="1%">
+          <redback:ifAuthorized permission="continuum-build-group" resource="${group.name}">
+            <ww:url id="releaseProjectGroupUrl" action="releaseProjectGroup" namespace="/"
includeParams="none">
+              <ww:param name="projectGroupId" value="${group.id}"/>
+            </ww:url>
+            <ww:a href="%{releaseProjectGroupUrl}">
+              <img src="<ww:url value='/images/releaseproject.gif'/>" alt="<ww:text
name="projectGroup.releaseNow"/>" title="<ww:text name="projectGroup.releaseNow"/>"
border="0">
+            </ww:a>
+          </redback:ifAuthorized>
+          <redback:elseAuthorized>
+            <img src="<ww:url value='/images/releaseproject_disabled.gif'/>" alt="<ww:text
name="projectGroup.releaseNow"/>" title="<ww:text name="projectGroup.releaseNow"/>"
border="0">
+          </redback:elseAuthorized>
+        </ec:column>
+        <ec:column property="removeProjectGroupAction" title="&nbsp;" width="1%">
+          <redback:ifAuthorized permission="continuum-remove-group" resource="${group.name}">
+            <ww:url id="removeProjectGroupUrl" action="removeProjectGroup" namespace="/"
includeParams="none">
+              <ww:param name="projectGroupId" value="${group.id}"/>
+            </ww:url>
+            <ww:a href="%{removeProjectGroupUrl}">
+              <img src="<ww:url value='/images/delete.gif'/>" alt="<ww:text name="projectGroup.deleteGroup"/>"
title="<ww:text name="projectGroup.deleteGroup"/>" border="0">
+            </ww:a>
+          </redback:ifAuthorized>
+          <redback:elseAuthorized>
+            <img src="<ww:url value='/images/delete_disabled.gif'/>" alt="<ww:text
name="projectGroup.deleteGroup"/>" title="<ww:text name="projectGroup.deleteGroup"/>"
border="0">
+          </redback:elseAuthorized>
+        </ec:column>
         <ec:column property="numSuccesses" title="&nbsp;" format="0" width="2%" style="text-align:
right" headerClass="calcHeaderSucces" calc="total" calcTitle="groups.table.summary"/>
         <ec:column property="numFailures" title="&nbsp;" format="0" width="2%" style="text-align:
right" headerClass="calcHeaderFailure" calc="total" />
         <ec:column property="numErrors" title="&nbsp;" format="0" width="2%" style="text-align:
right" headerClass="calcHeaderError" calc="total"/>



Mime
View raw message