continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jzurb...@apache.org
Subject svn commit: r949697 - in /continuum/trunk/continuum-webapp/src/main: java/org/apache/continuum/web/action/ViewBuildsReportAction.java webapp/WEB-INF/jsp/viewProjectBuildsReport.jsp
Date Mon, 31 May 2010 09:44:53 GMT
Author: jzurbano
Date: Mon May 31 09:44:53 2010
New Revision: 949697

URL: http://svn.apache.org/viewvc?rev=949697&view=rev
Log:
[CONTINUUM-2521] builds report page
* set 'endDate' time to 23h 59min 59s so it would be possible to search builds of current
date
* changed conditions to when-otherwise instead of ifs in displaying 'projectBuilds'
* adjusted formats


Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ViewBuildsReportAction.java
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/viewProjectBuildsReport.jsp

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ViewBuildsReportAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ViewBuildsReportAction.java?rev=949697&r1=949696&r2=949697&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ViewBuildsReportAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ViewBuildsReportAction.java
Mon May 31 09:44:53 2010
@@ -21,6 +21,7 @@ package org.apache.continuum.web.action;
 
 import java.text.ParseException;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -115,7 +116,15 @@ public class ViewBuildsReportAction
     
             if ( !StringUtils.isEmpty( endDate ) )
             {
-                toDate = DateUtils.parseDate( endDate, datePatterns ).getTime();
+                Date toDateInDateFormat = DateUtils.parseDate( endDate, datePatterns );
+                
+                Calendar toDateCal = Calendar.getInstance();
+                toDateCal.setTime( toDateInDateFormat );
+                toDateCal.set( Calendar.HOUR_OF_DAY, 23 );
+                toDateCal.set( Calendar.MINUTE, 59 );
+                toDateCal.set( Calendar.SECOND, 59 );
+                
+                toDate = toDateCal.getTimeInMillis();
             }
         }
         catch ( ParseException e )

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/viewProjectBuildsReport.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/viewProjectBuildsReport.jsp?rev=949697&r1=949696&r2=949697&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/viewProjectBuildsReport.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/viewProjectBuildsReport.jsp
Mon May 31 09:44:53 2010
@@ -33,8 +33,8 @@
     <script type="text/javascript">
       $(document).ready(function()
       {
-		  $('#startDate').datepicker()
-		  $('#endDate').datepicker()
+		    $('#startDate').datepicker()
+		    $('#endDate').datepicker()
       });
     </script>
   </head>
@@ -72,114 +72,116 @@
 
    	<div id="h3">
    	  <h3>Results</h3>
-      <c:if test="${not empty projectBuilds}">
-        <c:set var="prevPageUrl">
-          <s:url action="generateProjectBuildsReport">    
-            <s:param name="triggeredBy" value="%{#attr.triggeredBy}"/>
-            <s:param name="buildStatus" value="%{#attr.buildStatus}"/>
-            <s:param name="rowCount" value="%{#attr.rowCount}"/>
-            <s:param name="startDate" value="%{#attr.startDate}"/>                
     
-            <s:param name="endDate" value="%{#attr.endDate}"/>
-            <s:param name="page" value="%{#attr.page - 1}"/>
-          </s:url>
-        </c:set>
-        <c:set var="nextPageUrl">
-          <s:url action="generateProjectBuildsReport">    
-            <s:param name="triggeredBy" value="%{#attr.triggeredBy}"/>
-            <s:param name="buildStatus" value="%{#attr.buildStatus}"/>
-            <s:param name="rowCount" value="%{#attr.rowCount}"/>
-            <s:param name="startDate" value="%{#attr.startDate}"/>                
     
-            <s:param name="endDate" value="%{#attr.endDate}"/>          
-            <s:param name="page" value="%{#attr.page + 1}"/>
-          </s:url>
-        </c:set>
-        <c:choose>
-          <c:when test="${page == 1}">                               
-            <s:text name="projectBuilds.report.prev"/>
-          </c:when>
-          <c:otherwise>
-            <a href="${prevPageUrl}">
+   	  <c:choose>
+     	  <c:when test="${not empty projectBuilds}">
+          <c:set var="prevPageUrl">
+            <s:url action="generateProjectBuildsReport">    
+              <s:param name="triggeredBy" value="%{#attr.triggeredBy}"/>
+              <s:param name="buildStatus" value="%{#attr.buildStatus}"/>
+              <s:param name="rowCount" value="%{#attr.rowCount}"/>
+              <s:param name="startDate" value="%{#attr.startDate}"/>              
       
+              <s:param name="endDate" value="%{#attr.endDate}"/>
+              <s:param name="page" value="%{#attr.page - 1}"/>
+            </s:url>
+          </c:set>
+          <c:set var="nextPageUrl">
+            <s:url action="generateProjectBuildsReport">    
+              <s:param name="triggeredBy" value="%{#attr.triggeredBy}"/>
+              <s:param name="buildStatus" value="%{#attr.buildStatus}"/>
+              <s:param name="rowCount" value="%{#attr.rowCount}"/>
+              <s:param name="startDate" value="%{#attr.startDate}"/>              
       
+              <s:param name="endDate" value="%{#attr.endDate}"/>          
+              <s:param name="page" value="%{#attr.page + 1}"/>
+            </s:url>
+          </c:set>
+          <c:choose>
+            <c:when test="${page == 1}">                               
               <s:text name="projectBuilds.report.prev"/>
-            </a>
-          </c:otherwise>
-        </c:choose>
-
-        <c:choose>
-          <c:when test="${numPages > 11}">
-            <c:choose>
-              <c:when test="${(page - 5) < 0}">
-                <c:set var="beginVal">0</c:set>
-                <c:set var="endVal">10</c:set> 
-              </c:when>			        
-              <c:when test="${(page + 5) > (numPages - 1)}">
-                <c:set var="beginVal">${(numPages - 1) - 10}</c:set>
-                <c:set var="endVal">${numPages - 1}</c:set>
-              </c:when>
-              <c:otherwise>
-                <c:set var="beginVal">${page - 5}</c:set>
-                <c:set var="endVal">${page + 5}</c:set>
-              </c:otherwise>
-            </c:choose>  
-          </c:when>
-          <c:otherwise>
-            <c:set var="beginVal">0</c:set>
-            <c:set var="endVal">${numPages - 1}</c:set>
-          </c:otherwise>
-        </c:choose>
+            </c:when>
+            <c:otherwise>
+              <a href="${prevPageUrl}">
+                <s:text name="projectBuilds.report.prev"/>
+              </a>
+            </c:otherwise>
+          </c:choose>
 
-        <c:forEach var="i" begin="${beginVal}" end="${endVal}">      
-          <c:choose>                   			    
-            <c:when test="${i != (page - 1)}">
-              <c:set var="specificPageUrl">
-                <s:url action="generateProjectBuildsReport">    
-                  <s:param name="triggeredBy" value="%{#attr.triggeredBy}"/>
-            	  <s:param name="buildStatus" value="%{#attr.buildStatus}"/>
-                  <s:param name="rowCount" value="%{#attr.rowCount}"/>
-                  <s:param name="startDate" value="%{#attr.startDate}"/>          
           
-                  <s:param name="endDate" value="%{#attr.endDate}"/>          
-                  <s:param name="page" value="%{#attr.i + 1}"/>
-                </s:url>
-              </c:set>
-              <a href="${specificPageUrl}">${i + 1}</a>
+          <c:choose>
+            <c:when test="${numPages > 11}">
+              <c:choose>
+                <c:when test="${(page - 5) < 0}">
+                  <c:set var="beginVal">0</c:set>
+                  <c:set var="endVal">10</c:set> 
+                </c:when>			        
+                <c:when test="${(page + 5) > (numPages - 1)}">
+                  <c:set var="beginVal">${(numPages - 1) - 10}</c:set>
+                  <c:set var="endVal">${numPages - 1}</c:set>
+                </c:when>
+                <c:otherwise>
+                  <c:set var="beginVal">${page - 5}</c:set>
+                  <c:set var="endVal">${page + 5}</c:set>
+                </c:otherwise>
+              </c:choose>  
             </c:when>
-            <c:otherwise>		
-              <b>${i + 1}</b>   
-            </c:otherwise>				  			    
-          </c:choose>      
-        </c:forEach>
+            <c:otherwise>
+              <c:set var="beginVal">0</c:set>
+              <c:set var="endVal">${numPages - 1}</c:set>
+            </c:otherwise>
+          </c:choose>
 
-        <c:choose>
-          <c:when test="${page == numPages}">
-            <s:text name="projectBuilds.report.next"/>
-          </c:when>
-  	      <c:otherwise>
-            <a href="${nextPageUrl}">
+          <c:forEach var="i" begin="${beginVal}" end="${endVal}">      
+            <c:choose>                   			    
+              <c:when test="${i != (page - 1)}">
+                <c:set var="specificPageUrl">
+                  <s:url action="generateProjectBuildsReport">    
+                    <s:param name="triggeredBy" value="%{#attr.triggeredBy}"/>
+              	  <s:param name="buildStatus" value="%{#attr.buildStatus}"/>
+                    <s:param name="rowCount" value="%{#attr.rowCount}"/>
+                    <s:param name="startDate" value="%{#attr.startDate}"/>        
             
+                    <s:param name="endDate" value="%{#attr.endDate}"/>          
+                    <s:param name="page" value="%{#attr.i + 1}"/>
+                  </s:url>
+                </c:set>
+                <a href="${specificPageUrl}">${i + 1}</a>
+              </c:when>
+              <c:otherwise>		
+                <b>${i + 1}</b>   
+              </c:otherwise>				  			    
+            </c:choose>      
+          </c:forEach>
+
+          <c:choose>
+            <c:when test="${page == numPages}">
               <s:text name="projectBuilds.report.next"/>
-            </a>
-          </c:otherwise>   
-        </c:choose>
+            </c:when>
+    	      <c:otherwise>
+              <a href="${nextPageUrl}">
+                <s:text name="projectBuilds.report.next"/>
+              </a>
+            </c:otherwise>   
+          </c:choose>
 
-        <s:set name="projectBuilds" value="projectBuilds" scope="request"/>
-        <ec:table items="projectBuilds"
-                    var="projectBuild"
-                    showExports="false"
-                    showPagination="false"
-                    showStatusBar="false"
-                    sortable="false"
-                    filterable="false">
-          <ec:row highlightRow="true">
-            <ec:column property="projectGroupName" title="projectBuilds.report.projectGroup"/>
-            <ec:column property="projectName" title="projectBuilds.report.project"/>
-            <ec:column property="buildDate" title="projectBuilds.report.buildDate" cell="date"/>
-            <ec:column property="buildTriggeredBy" title="projectBuilds.report.triggeredBy"/>
-            <ec:column property="buildState" title="projectBuilds.report.buildStatus"
cell="org.apache.maven.continuum.web.view.buildresults.StateCell"/>
-          </ec:row>
-        </ec:table>
-      </c:if>
-      <c:if test="${empty projectBuilds}">
-        <s:text name="projectBuilds.report.noResult"/>
-      </c:if>
+          <s:set name="projectBuilds" value="projectBuilds" scope="request"/>
+          <ec:table items="projectBuilds"
+                      var="projectBuild"
+                      showExports="false"
+                      showPagination="false"
+                      showStatusBar="false"
+                      sortable="false"
+                      filterable="false">
+            <ec:row highlightRow="true">
+              <ec:column property="projectGroupName" title="projectBuilds.report.projectGroup"/>
+              <ec:column property="projectName" title="projectBuilds.report.project"/>
+              <ec:column property="buildDate" title="projectBuilds.report.buildDate" cell="date"/>
+              <ec:column property="buildTriggeredBy" title="projectBuilds.report.triggeredBy"/>
+              <ec:column property="buildState" title="projectBuilds.report.buildStatus"
cell="org.apache.maven.continuum.web.view.buildresults.StateCell"/>
+            </ec:row>
+          </ec:table>
+        </c:when>
+        <c:otherwise>
+          <s:text name="projectBuilds.report.noResult"/></p>
+        </c:otherwise>
+      </c:choose>
     </div>
   </body>
   </s:i18n>
-</html>
\ No newline at end of file
+</html>



Mime
View raw message