continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jzurb...@apache.org
Subject svn commit: r950514 - in /continuum/trunk/continuum-webapp/src/main: java/org/apache/continuum/web/action/ViewBuildsReportAction.java resources/localization/Continuum.properties webapp/WEB-INF/jsp/viewProjectBuildsReport.jsp
Date Wed, 02 Jun 2010 12:01:20 GMT
Author: jzurbano
Date: Wed Jun  2 12:01:20 2010
New Revision: 950514

URL: http://svn.apache.org/viewvc?rev=950514&view=rev
Log:
[CONTINUUM-2521] builds report page
* modified the field error message of rowCount since the field accepts the value of "10"
* modified page so that "No Results Found" is not displayed initially
* added reset of fields to default values


Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ViewBuildsReportAction.java
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    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=950514&r1=950513&r2=950514&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
Wed Jun  2 12:01:20 2010
@@ -22,6 +22,7 @@ package org.apache.continuum.web.action;
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.Collections;
 import java.util.Date;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -142,11 +143,12 @@ public class ViewBuildsReportAction
         if ( rowCount < 10 )
         {
             // TODO: move to validation framework
-            addFieldError( "rowCount", "Row count must be larger than 10." );
+            addFieldError( "rowCount", "Row count should be at least 10." );
             return INPUT;
         }
 
         List<BuildResult> buildResults = getContinuum().getBuildResultsInRange( fromDate,
toDate, buildStatus, triggeredBy );
+        projectBuilds = Collections.emptyList();
 
         if ( buildResults != null && !buildResults.isEmpty() )
         {

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=950514&r1=950513&r2=950514&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Wed Jun  2 12:01:20 2010
@@ -1267,6 +1267,7 @@ releasePrepare.input.error = Unable to g
 # ----------------------------------------------------------------------
 projectBuilds.report.title=Continuum - Project Builds Report
 projectBuilds.report.section.title=Project Builds Report
+projectBuilds.report.button.reset=Reset
 projectBuilds.report.startDate=Start Date
 projectBuilds.report.endDate=End Date
 projectBuilds.report.triggeredBy=Triggered By
@@ -1278,4 +1279,5 @@ projectBuilds.report.next=Next
 projectBuilds.report.projectGroup = Project Group
 projectBuilds.report.project=Project
 projectBuilds.report.buildDate=Build Date
-projectBuilds.report.noResult=No Results Found
\ No newline at end of file
+projectBuilds.report.noResult=No Results Found
+

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=950514&r1=950513&r2=950514&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
Wed Jun  2 12:01:20 2010
@@ -32,8 +32,17 @@
     <script type="text/javascript">
       $(document).ready(function()
       {
-		    $('#startDate').datepicker()
-		    $('#endDate').datepicker()
+        $('#startDate').datepicker()
+        $('#endDate').datepicker()
+
+        $('#resetFilter').click(function()
+        {
+          $('#startDate').val('')
+          $('#endDate').val('')
+          $('#triggeredBy').val('')
+          $('#rowCount').val('30')
+          $("#buildStatus option[value='0']").attr('selected', 'selected')
+        });
       });
     </script>
   </head>
@@ -57,130 +66,133 @@
         <table>
             <s:textfield label="%{getText('projectBuilds.report.startDate')}" name="startDate"
id="startDate" size="20"/>
             <s:textfield label="%{getText('projectBuilds.report.endDate')}" name="endDate"
id="endDate" size="20"/>
-            <s:select label="%{getText('projectBuilds.report.buildStatus')}" name="buildStatus"
list="buildStatuses"/>
-            <s:textfield label="%{getText('projectBuilds.report.triggeredBy')}" name="triggeredBy"
size="40"/>
-            <s:textfield label="%{getText('projectBuilds.report.rowCount')}" name="rowCount"
size="10"/>
+            <s:select label="%{getText('projectBuilds.report.buildStatus')}" name="buildStatus"
id="buildStatus" list="buildStatuses"/>
+            <s:textfield label="%{getText('projectBuilds.report.triggeredBy')}" name="triggeredBy"
id="triggeredBy" size="40"/>
+            <s:textfield label="%{getText('projectBuilds.report.rowCount')}" name="rowCount"
id="rowCount" size="10"/>
         </table>
         <div class="functnbar3">
           <s:submit value="%{getText('projectBuilds.report.view')}" />
+          <input type="button" id="resetFilter" value="<s:text name='projectBuilds.report.button.reset'
/>" />
         </div>
       </div>
     </s:form>
     
     </p>
 
-   	<div id="h3">
-   	  <h3>Results</h3>
-   	  <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"/>
-            </c:when>
-            <c:otherwise>
-              <a href="${prevPageUrl}">
+    <c:if test="${projectBuilds != null}">
+     	<div id="h3">
+     	  <h3>Results</h3>
+     	  <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: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:otherwise>
+                <a href="${prevPageUrl}">
+                  <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: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>
-
-          <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>
+              </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:when>
+          <c:otherwise>
+            <s:text name="projectBuilds.report.noResult"/></p>
+          </c:otherwise>
+        </c:choose>
+      </div>
+    </c:if>
   </body>
   </s:i18n>
 </html>



Mime
View raw message