continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r358124 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/SummaryAction.java webapp/summary.jsp
Date Tue, 20 Dec 2005 22:10:16 GMT
Author: evenisse
Date: Tue Dec 20 14:10:10 2005
New Revision: 358124

URL: http://svn.apache.org/viewcvs?rev=358124&view=rev
Log:
Add project counter

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
    maven/continuum/trunk/continuum-webapp/src/main/webapp/summary.jsp

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java?rev=358124&r1=358123&r2=358124&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 Dec 20 14:10:10 2005
@@ -37,6 +37,10 @@
     extends ActionSupport
 {
     private Continuum continuum;
+
+    private int nbSuccesses;
+    private int nbFailures;
+    private int nbErrors;
     
     public String execute()
         throws Exception
@@ -45,7 +49,9 @@
         {
             //TODO: Create a summary jpox request so code will be more simple and performance
will be better
             Collection projects = continuum.getProjects();
+
             Map buildResults = continuum.getLatestBuildResults();
+
             Map buildResultsInSuccess = continuum.getBuildResultsInSuccess();
 
             Collection summary = new ArrayList();
@@ -53,11 +59,17 @@
             for ( Iterator i = projects.iterator(); i.hasNext(); )
             {
                 Project project = (Project) i.next();
+
                 SummaryProjectModel model = new SummaryProjectModel();
+
                 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 );
@@ -66,18 +78,38 @@
                 {
                     model.setInQueue( false );
                 }
+
                 model.setState( project.getState() );
+
+                if ( project.getState() == 2 )
+                {
+                    nbSuccesses++;
+                }
+                else if ( project.getState() == 3 )
+                {
+                    nbFailures++;
+                }
+                else if ( project.getState() == 4 )
+                {
+                    nbErrors++;
+                }
+
                 model.setBuildNumber( project.getBuildNumber() );
+
                 BuildResult buildInSuccess = (BuildResult) buildResultsInSuccess.get( new
Integer( project.getId() ) );
+
                 if ( buildInSuccess != null )
                 {
                     model.setBuildInSuccessId( buildInSuccess.getId() );
                 }
+
                 BuildResult latestBuild = (BuildResult) buildResults.get( new Integer( project.getId()
) );
+
                 if ( latestBuild != null )
                 {
                     model.setLatestBuildId( latestBuild.getId() );
                 }
+
                 summary.add( model );
             }
 
@@ -88,5 +120,20 @@
             e.printStackTrace();
         }
         return SUCCESS;
+    }
+
+    public int getNbSuccesses()
+    {
+        return nbSuccesses;
+    }
+
+    public int getNbFailures()
+    {
+        return nbFailures;
+    }
+
+    public int getNbErrors()
+    {
+        return nbErrors;
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/summary.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/summary.jsp?rev=358124&r1=358123&r2=358124&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/summary.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/summary.jsp Tue Dec 20 14:10:10
2005
@@ -27,9 +27,9 @@
           </ec:row>
         </ec:table>
         <div class="functnbar3">
-          <img src="<ww:url value="/images/icon_success_sml.gif"/>" alt="<ww:text
name="message.success"/>" title="<ww:text name="message.success"/>"/> <font
color="red">TODO</font>
-          <img src="<ww:url value="/images/icon_warning_sml.gif"/>" alt="<ww:text
name="message.failed"/>" title="<ww:text name="message.failed"/>"/> <font color="red">TODO</font>
-          <img src="<ww:url value="/images/icon_error_sml.gif"/>" alt="<ww:text
name="message.error"/>" title="<ww:text name="message.error"/>"/> <font color="red">TODO</font>
+          <img src="<ww:url value="/images/icon_success_sml.gif"/>" alt="<ww:text
name="message.success"/>" title="<ww:text name="message.success"/>"/> <ww:property
value="nbSuccesses"/>
+          <img src="<ww:url value="/images/icon_warning_sml.gif"/>" alt="<ww:text
name="message.failed"/>" title="<ww:text name="message.failed"/>"/> <ww:property
value="nbFailures"/>
+          <img src="<ww:url value="/images/icon_error_sml.gif"/>" alt="<ww:text
name="message.error"/>" title="<ww:text name="message.error"/>"/> <ww:property
value="nbErrors"/>
         </div>
       </div>
     </body>



Mime
View raw message