continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r585251 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ mdo/ resources/localization/ webapp/WEB-INF/jsp/ webapp/WEB-INF/jsp/components/
Date Tue, 16 Oct 2007 20:18:01 GMT
Author: olamy
Date: Tue Oct 16 13:18:00 2007
New Revision: 585251

URL: http://svn.apache.org/viewvc?rev=585251&view=rev
Log:
[CONTINUUM-1332] project group summary: show per project the last build time
[CONTINUUM-703]  Display of last build date on Project Summary page
[CONTINUUM-606] Add Build Time to Project Summary Page

display lastBuildDatime in projectGroupSummary and in projectView


Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.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/SummaryAction.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/components/projectSummaryComponent.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectView.jsp

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java?rev=585251&r1=585250&r2=585251&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
Tue Oct 16 13:18:00 2007
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import java.text.SimpleDateFormat;
 import java.util.ResourceBundle;
 
 import com.opensymphony.xwork.ActionContext;
@@ -65,6 +66,8 @@
      * @plexus.requirement
      */
     private Continuum continuum;
+    
+    protected SimpleDateFormat dateFormatter = new SimpleDateFormat("MMM dd, yyyy hh:mm:ss
aaa z");
 
     public void prepare()
         throws Exception

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=585251&r1=585250&r2=585251&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
Tue Oct 16 13:18:00 2007
@@ -19,7 +19,11 @@
  * under the License.
  */
 
+import java.util.Date;
+import java.util.Iterator;
+
 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;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
@@ -36,6 +40,8 @@
     private Project project;
 
     private int projectId;
+    
+    private String lastBuildDateTime;
 
     /**
      * Target {@link ProjectGroup} to view.
@@ -57,9 +63,24 @@
         }
 
         project = getContinuum().getProjectWithAllDetails( projectId );
+        if ( project.getLatestBuildId() > 0 )
+        {
+            try
+            {
+            BuildResult lastBuildResult = getContinuum().getBuildResult( project.getLatestBuildId()
);
+            if ( lastBuildResult != null )
+            {
+                this.setLastBuildDateTime( dateFormatter.format( new Date( lastBuildResult.getEndTime()
) ) );
+            }
+            } catch (ContinuumException e)
+            {
+                getLogger().info( "buildResult with id " + project.getLatestBuildId() + "
has been deleted" );
+            }
+        }
+
         return SUCCESS;
     }
-
+    
     public void setProjectId( int projectId )
     {
         this.projectId = projectId;
@@ -85,5 +106,15 @@
         throws ContinuumException
     {
         return getContinuum().getProjectGroupByProjectId( projectId );
+    }
+
+    public String getLastBuildDateTime()
+    {
+        return lastBuildDateTime;
+    }
+
+    public void setLastBuildDateTime( String lastBuildDateTime )
+    {
+        this.lastBuildDateTime = lastBuildDateTime;
     }
 }

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=585251&r1=585250&r2=585251&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
Tue Oct 16 13:18:00 2007
@@ -19,22 +19,24 @@
  * 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.project.ContinuumProjectState;
-import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
-import org.apache.maven.continuum.web.model.GroupSummary;
-import org.apache.maven.continuum.web.model.ProjectSummary;
-
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+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.project.ContinuumProjectState;
+import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
+import org.apache.maven.continuum.web.model.GroupSummary;
+import org.apache.maven.continuum.web.model.ProjectSummary;
+
 /**
  * Used to render the list of projects in the project group page.
  *
@@ -70,7 +72,7 @@
 
         //TODO: Create a summary jpox request so code will be more simple and performance
will be better
         projectsInGroup = getContinuum().getProjectsInGroup( projectGroupId );
-
+        
         Map buildResults = getContinuum().getLatestBuildResults( projectGroupId );
 
         Map buildResultsInSuccess = getContinuum().getBuildResultsInSuccess( projectGroupId
);
@@ -136,6 +138,7 @@
                 {
                     model.setLatestBuildId( latestBuild.getId() );
                     populateGroupSummary( latestBuild );
+                    model.setLastBuildDateTime( dateFormatter.format( new Date( latestBuild.getEndTime()
) ) );
                 }
             }
 

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=585251&r1=585250&r2=585251&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 Tue Oct 16 13:18:00
2007
@@ -143,6 +143,13 @@
           <type>boolean</type>
           <defaultValue>false</defaultValue>
         </field>
+        <field>
+          <name>lastBuildDateTime</name>
+          <version>1.0.0</version>
+          <required>true</required>
+          <description>last build dateTime of the project</description>
+          <type>String</type>          
+        </field>
       </fields>
     </class>
     <class>

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=585251&r1=585250&r2=585251&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
Tue Oct 16 13:18:00 2007
@@ -120,6 +120,7 @@
 summary.projectTable.version = Version
 summary.projectTable.build = Build
 summary.projectTable.group = Group
+summary.projectTable.lastBuildDateTime = Last Build Date
 summary.buildAll = Build All
 summary.buildHistory = Build history
 summary.buildNow = Build Now
@@ -323,6 +324,7 @@
 projectView.project.scmUrl = SCM Url
 projectView.project.scmTag = SCM Branch/Tag
 projectView.project.group = Group
+projectView.project.lastBuildDateTime = Last Build Date
 projectView.buildDefinitions = Build Definitions
 projectView.buildDefinition.goals = Goals
 projectView.buildDefinition.arguments = Arguments

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=585251&r1=585250&r2=585251&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
Tue Oct 16 13:18:00 2007
@@ -97,7 +97,7 @@
           </c:otherwise>
         </c:choose>
       </ec:column>
-      <ec:column property="projectGroupName" title="summary.projectTable.group" width="30%"/>

+      <ec:column property="lastBuildDateTime" title="summary.projectTable.lastBuildDateTime"
width="30%"/> 
       <ec:column property="buildNowAction" title="&nbsp;" width="1%">
         <c:choose>
           <c:when test="${project.inBuildingQueue}">

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectView.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectView.jsp?rev=585251&r1=585250&r2=585251&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectView.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectView.jsp Tue
Oct 16 13:18:00 2007
@@ -47,6 +47,7 @@
                 <ww:param name="projectGroupId" value="%{project.projectGroup.id}"/>
             </ww:url>            
             <c1:data label="%{getText('projectView.project.group')}" name="project.projectGroup.name"
valueLink="%{'${projectGroupSummaryUrl}'}"/>
+            <c1:data label="%{getText('projectView.project.lastBuildDateTime')}" name="lastBuildDateTime"
/>
           </table>
 
           <redback:ifAuthorized permission="continuum-modify-group" resource="${project.projectGroup.name}">



Mime
View raw message