[jboss-svn-commits] JBL Code SVN: r17557 - in labs/jbosslabs/trunk/stats-server/sources/metrics_web: lib and 6 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Jan 4 11:55:16 EST 2008


Author: wrzep
Date: 2008-01-04 11:55:16 -0500 (Fri, 04 Jan 2008)
New Revision: 17557

Added:
   labs/jbosslabs/trunk/stats-server/sources/metrics_web/lib/commons-el-1.0.jar
   labs/jbosslabs/trunk/stats-server/sources/metrics_web/lib/tomahawk-1.1.6.jar
   labs/jbosslabs/trunk/stats-server/sources/metrics_web/resources/WEB-INF/tomahawk.taglib.xml
   labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/action/org/jboss/labs/metrics/web/action/ProjectMenu.java
   labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/model/org/jboss/labs/metrics/web/service/SvnMetricsService.java
   labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/model/org/jboss/labs/metrics/web/service/SvnMetricsServiceBean.java
   labs/jbosslabs/trunk/stats-server/sources/metrics_web/view/svn/
   labs/jbosslabs/trunk/stats-server/sources/metrics_web/view/svn/activity.xhtml
Modified:
   labs/jbosslabs/trunk/stats-server/sources/metrics_web/build.xml
   labs/jbosslabs/trunk/stats-server/sources/metrics_web/resources/WEB-INF/web.xml
   labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/model/org/jboss/labs/metrics/web/service/ProjectServiceBean.java
   labs/jbosslabs/trunk/stats-server/sources/metrics_web/view/jira/assignee.xhtml
   labs/jbosslabs/trunk/stats-server/sources/metrics_web/view/project.xhtml
Log:
metrics migration (portlets -> seam)


Modified: labs/jbosslabs/trunk/stats-server/sources/metrics_web/build.xml
===================================================================
--- labs/jbosslabs/trunk/stats-server/sources/metrics_web/build.xml	2008-01-04 16:55:03 UTC (rev 17556)
+++ labs/jbosslabs/trunk/stats-server/sources/metrics_web/build.xml	2008-01-04 16:55:16 UTC (rev 17557)
@@ -126,8 +126,10 @@
                                 <include name="oscache*.jar" />
                                 <include name="commons-digester.jar" />
                                 <include name="commons-beanutils.jar" />
+                        		<include name="commons-el-*.jar" />
                                 <include name="jsf-facelets.jar" />
                                 <include name="jboss-seam-*.jar" />
+                        		<include name="tomahawk*.jar" />
                                 <exclude name="jboss-seam-gen.jar" />
                         </fileset>
                 </copy>

Added: labs/jbosslabs/trunk/stats-server/sources/metrics_web/lib/commons-el-1.0.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosslabs/trunk/stats-server/sources/metrics_web/lib/commons-el-1.0.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosslabs/trunk/stats-server/sources/metrics_web/lib/tomahawk-1.1.6.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosslabs/trunk/stats-server/sources/metrics_web/lib/tomahawk-1.1.6.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosslabs/trunk/stats-server/sources/metrics_web/resources/WEB-INF/tomahawk.taglib.xml
===================================================================
--- labs/jbosslabs/trunk/stats-server/sources/metrics_web/resources/WEB-INF/tomahawk.taglib.xml	                        (rev 0)
+++ labs/jbosslabs/trunk/stats-server/sources/metrics_web/resources/WEB-INF/tomahawk.taglib.xml	2008-01-04 16:55:16 UTC (rev 17557)
@@ -0,0 +1,430 @@
+<?xml version="1.0"?>
+<!DOCTYPE facelet-taglib PUBLIC
+  "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
+  "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
+
+<facelet-taglib>
+
+    <namespace>http://myfaces.apache.org/tomahawk</namespace>
+
+    <tag>
+        <tag-name>aliasBean</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.AliasBean</component-type>
+            <renderer-type>org.apache.myfaces.AliasBean</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>buffer</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.Buffer</component-type>
+            <renderer-type>org.apache.myfaces.Buffer</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>columns</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlColumns</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>column</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlColumn</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>commandButton</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlCommandButton</component-type>   
+        </component>
+    </tag>
+    <tag>
+        <tag-name>commandLink</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlCommandLink</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>commandNavigation</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlCommandNavigation</component-type>
+            <renderer-type>org.apache.myfaces.Navigation</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>commandNavigation2</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlCommandNavigationItem</component-type>
+            <renderer-type>org.apache.myfaces.NavigationMenu</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>commandSortHeader</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlCommandSortHeader</component-type>
+            <renderer-type>org.apache.myfaces.SortHeader</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>dataList</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlDataList</component-type>
+            <renderer-type>org.apache.myfaces.List</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>dataScroller</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlDataScroller</component-type>
+            <renderer-type>org.apache.myfaces.DataScroller</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>dataTable</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlDataTable</component-type>
+            <renderer-type>org.apache.myfaces.Table</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>div</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.Div</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>document</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.Document</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>documentBody</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.DocumentBody</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>documentHead</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.DocumentHead</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>graphicImage</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlGraphicImage</component-type>
+            <renderer-type>javax.faces.Image</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>htmlTag</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlTag</component-type>
+            <renderer-type>org.apache.myfaces.HtmlTagRenderer</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputFileUpload</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputFileUpload</component-type>
+            <renderer-type>org.apache.myfaces.FileUpload</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputCalendar</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputCalendar</component-type>
+            <renderer-type>org.apache.myfaces.Calendar</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputDate</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputDate</component-type>
+            <renderer-type>org.apache.myfaces.Date</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputHidden</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputHidden</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputHtml</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.InputHtml</component-type>
+            <renderer-type>org.apache.myfaces.InputHtml</renderer-type>
+        </component>
+    </tag>    
+    <tag>
+        <tag-name>inputSecret</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputSecret</component-type>
+            <renderer-type>org.apache.myfaces.Secret</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputText</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputText</component-type>
+            <renderer-type>org.apache.myfaces.Text</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputTextarea</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputTextarea</component-type>
+            <renderer-type>org.apache.myfaces.Textarea</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputTextHelp</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputTextHelp</component-type>
+            <renderer-type>org.apache.myfaces.TextHelp</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>jscookMenu</tag-name>
+                <!--
+                <![CDATA[
+Requires "<input type="hidden" name="jscook_action" />" to be manually added to the form
+                ]]>
+                -->
+        <component>
+            <component-type>org.apache.myfaces.JSCookMenu</component-type>
+            <renderer-type>org.apache.myfaces.JSCookMenu</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>message</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlMessage</component-type>
+            <renderer-type>org.apache.myfaces.Message</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>messages</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlMessages</component-type>
+            <renderer-type>org.apache.myfaces.Messages</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>navigationMenuItem</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.NavigationMenuItem</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>navigationMenuItems</tag-name>
+        <component>
+            <component-type>javax.faces.SelectItems</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>newspaperTable</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlNewspaperTable</component-type>
+            <renderer-type>org.apache.myfaces.HtmlNewspaperTable</renderer-type>
+        </component>                
+    </tag>
+    <tag>
+        <tag-name>outputText</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlOutputText</component-type>
+            <renderer-type>org.apache.myfaces.Text</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>panelGrid</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPanelGrid</component-type>
+            <renderer-type>org.apache.myfaces.Grid</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>panelGroup</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPanelGroup</component-type>
+            <renderer-type>org.apache.myfaces.Group</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>panelNavigation</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPanelNavigation</component-type>
+            <renderer-type>org.apache.myfaces.Navigation</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>panelNavigation2</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPanelNavigationMenu</component-type>
+            <renderer-type>org.apache.myfaces.NavigationMenu</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>panelTab</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPanelTab</component-type>
+            <renderer-type>javax.faces.Group</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>panelTabbedPane</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPanelTabbedPane</component-type>
+            <renderer-type>org.apache.myfaces.TabbedPane</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>popup</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPopup</component-type>
+            <renderer-type>org.apache.myfaces.Popup</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>radio</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlRadio</component-type>
+            <renderer-type>org.apache.myfaces.Radio</renderer-type>
+        </component>
+    </tag> 
+    <tag>
+        <tag-name>saveState</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.SaveState</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>schedule</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.Schedule</component-type>
+         <!--    <renderer-type> org.apache.myfaces.Schedule</renderer-type> 
+            <handler-class>handlers.HtmlScheduleTagHandler</handler-class>  -->
+        </component>
+    </tag>
+    
+
+    <tag>
+        <tag-name>selectBooleanCheckbox</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSelectBooleanCheckbox</component-type>
+            <renderer-type>org.apache.myfaces.Checkbox</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectManyCheckbox</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSelectManyCheckbox</component-type>
+            <renderer-type>org.apache.myfaces.Checkbox</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectManyListbox</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSelectManyListbox</component-type>
+            <renderer-type>org.apache.myfaces.Listbox</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectManyMenu</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSelectManyMenu</component-type>
+            <renderer-type>org.apache.myfaces.Menu</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectOneCountry</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.SelectOneCountry</component-type>
+            <renderer-type>org.apache.myfaces.SelectOneCountryRenderer</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectOneLanguage</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.SelectOneLanguage</component-type>
+            <renderer-type>org.apache.myfaces.SelectOneLanguageRenderer</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectOneListbox</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSelectOneListbox</component-type>
+            <renderer-type>org.apache.myfaces.Listbox</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectOneMenu</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSelectOneMenu</component-type>
+            <renderer-type>org.apache.myfaces.Menu</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectOneRadio</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSelectOneRadio</component-type>
+            <renderer-type>org.apache.myfaces.Radio</renderer-type>
+        </component>
+    </tag> 
+    <tag>
+        <tag-name>stylesheet</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.Stylesheet</component-type>
+        </component>
+    </tag>
+    <!-- Note that "tree" will not work as-is.  Tree either needs a facelets 
+         TagHandler, or a refactoring of
+         org.apache.myfaces.custom.tree.taglib.TreeTag
+         and org.apache.myfaces.custom.tree.HtmlTree
+         to remove non-standard internal "model" attribute usage. -->
+    <tag>
+        <tag-name>tree</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlTree</component-type>
+            <renderer-type>org.apache.myfaces.HtmlTree</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>tree2</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlTree2</component-type>
+            <renderer-type>org.apache.myfaces.HtmlTree2</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>treeColumn</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlTreeColumn</component-type>
+        </component>
+    </tag>
+    <!--
+        <tag-name>updateActionListener</tag-name> requires a Facelets TagHandler.   Use the functionality-equivalent JSF 1.2 f:setPropertyActionListener instead.  f:setPropertyActionListener has been backported as of facelets 1.1.11.  Note that the jsf-comp updateActionListener does not handle setting values on ui:include parameters while setPropertyActionListener will correctly propagate these values.
+    -->
+    <tag>
+        <tag-name>validateEmail</tag-name>
+        <validator>
+            <validator-id>org.apache.myfaces.validator.Email</validator-id>
+        </validator>
+    </tag>
+    <tag>
+        <tag-name>validateEqual</tag-name>
+        <validator>
+            <validator-id>org.apache.myfaces.validator.Equal</validator-id>
+        </validator>
+    </tag>
+    <tag>
+        <tag-name>validateRegExpr</tag-name>
+        <validator>
+            <validator-id>org.apache.myfaces.validator.RegExpr</validator-id>
+        </validator>
+    </tag>
+
+</facelet-taglib>

Modified: labs/jbosslabs/trunk/stats-server/sources/metrics_web/resources/WEB-INF/web.xml
===================================================================
--- labs/jbosslabs/trunk/stats-server/sources/metrics_web/resources/WEB-INF/web.xml	2008-01-04 16:55:03 UTC (rev 17556)
+++ labs/jbosslabs/trunk/stats-server/sources/metrics_web/resources/WEB-INF/web.xml	2008-01-04 16:55:16 UTC (rev 17557)
@@ -71,6 +71,11 @@
        <auth-constraint/>
    </security-constraint>
    
+   	<!-- Tomahawk -->	
+	
+	<context-param>
+        <param-name>facelets.LIBRARIES</param-name>
+        <param-value>/WEB-INF/tomahawk.taglib.xml</param-value>
+    </context-param>
    
-   
 </web-app>

Added: labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/action/org/jboss/labs/metrics/web/action/ProjectMenu.java
===================================================================
--- labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/action/org/jboss/labs/metrics/web/action/ProjectMenu.java	                        (rev 0)
+++ labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/action/org/jboss/labs/metrics/web/action/ProjectMenu.java	2008-01-04 16:55:16 UTC (rev 17557)
@@ -0,0 +1,18 @@
+package org.jboss.labs.metrics.web.action;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+
+import org.jboss.seam.ScopeType;
+
+ at Name("projectMenu")
+ at Scope(ScopeType.PAGE)
+public class ProjectMenu {
+
+	@Out private String projectMenuSelection;
+	
+	public void select(String selection) {
+		projectMenuSelection = selection;
+	}
+}

Modified: labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/model/org/jboss/labs/metrics/web/service/ProjectServiceBean.java
===================================================================
--- labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/model/org/jboss/labs/metrics/web/service/ProjectServiceBean.java	2008-01-04 16:55:03 UTC (rev 17556)
+++ labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/model/org/jboss/labs/metrics/web/service/ProjectServiceBean.java	2008-01-04 16:55:16 UTC (rev 17557)
@@ -27,9 +27,11 @@
 import javax.ejb.Stateless;
 
 import org.jboss.labs.metrics.web.ws.jaxb.Project;
+import org.jboss.seam.ScopeType;
 import org.jboss.seam.annotations.Factory;
 import org.jboss.seam.annotations.In;
 import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
 import org.jboss.seam.annotations.web.RequestParameter;
 
 /**
@@ -37,6 +39,7 @@
  */
 
 @Name("projectService")
+ at Scope(ScopeType.PAGE)
 @Stateless
 public class ProjectServiceBean implements ProjectService {
 
@@ -46,15 +49,11 @@
 	@Factory("project")
 	public Project getProject() {
 		
-		System.out.println("get");
-		
 		for (Project project : projects) {
 			if (projectId.equals(project.getId())) {
 				return project;
 			}
 		}
-	    
-		System.out.println("null");
 		
 		return null;
 	}

Added: labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/model/org/jboss/labs/metrics/web/service/SvnMetricsService.java
===================================================================
--- labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/model/org/jboss/labs/metrics/web/service/SvnMetricsService.java	                        (rev 0)
+++ labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/model/org/jboss/labs/metrics/web/service/SvnMetricsService.java	2008-01-04 16:55:16 UTC (rev 17557)
@@ -0,0 +1,33 @@
+ /*
+  * JBoss, a division of Red Hat
+  * Copyright 2007, Red Hat Middleware LLC and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.labs.metrics.web.service;
+
+import javax.ejb.Local;
+
+import hu.midori.kosmos.model.SvnRepository;
+
+ at Local
+public interface SvnMetricsService {
+
+	public abstract SvnRepository getSvnRepository();
+}
\ No newline at end of file

Added: labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/model/org/jboss/labs/metrics/web/service/SvnMetricsServiceBean.java
===================================================================
--- labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/model/org/jboss/labs/metrics/web/service/SvnMetricsServiceBean.java	                        (rev 0)
+++ labs/jbosslabs/trunk/stats-server/sources/metrics_web/src/model/org/jboss/labs/metrics/web/service/SvnMetricsServiceBean.java	2008-01-04 16:55:16 UTC (rev 17557)
@@ -0,0 +1,107 @@
+ /*
+  * JBoss, a division of Red Hat
+  * Copyright 2007, Red Hat Middleware LLC and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.labs.metrics.web.service;
+
+import java.net.MalformedURLException;
+import java.util.List;
+
+import hu.midori.kosmos.model.SvnRepository;
+import hu.midori.kosmos.protocol.SvnService;
+
+import javax.ejb.Stateless;
+
+import org.jboss.labs.metrics.web.ws.jaxb.Project;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.log.Log;
+
+import com.caucho.hessian.client.HessianProxyFactory;
+
+/**
+ * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
+ * @author <a href="mailto:aron.gombas at midori.hu">Aron Gombas</a>
+ */
+
+ at Name("svnService")
+ at Stateless
+public class SvnMetricsServiceBean implements SvnMetricsService {
+
+	private static final String SVN_SERVICE = "kosmos-server/kosmos-services/svn-service";
+	
+	@In private Project project;
+	@Logger private Log log;
+	
+	@Factory("repository")
+	public SvnRepository getSvnRepository() {
+		
+		String projectId = project.getId();
+		
+		String serviceUrl = "http://localhost:8180/";
+		SvnService service = getService(serviceUrl + SVN_SERVICE);
+		
+		List<SvnRepository> repositories = null;
+		
+		String monitoredUrl = project.getSvn();
+		
+		if ((monitoredUrl == null) || (monitoredUrl.equals(""))) {
+			return null;
+		}
+		
+		// get project list if the service was successfully set-up
+		if ((service != null) && (monitoredUrl != null)) {
+		
+			try {
+				repositories = service.getRepositories(monitoredUrl);
+				//timestamp = service.getTimestamp();
+			} catch (Exception e) {
+				log.warn("Unable to get repository from service " + 
+										"(projectId: " + projectId + ")", e);
+				return null;
+			}
+		}
+		
+		if ((repositories != null) && (repositories.size() > 0)) {
+			return repositories.get(0);
+		} else {
+			log.warn("Failed to download svn repository: " + monitoredUrl +
+										" (projectId:" + projectId + ")");
+		}
+		
+		return null;
+	}
+	
+	private SvnService getService(String serviceUrl) {
+		
+		SvnService service = null;
+		HessianProxyFactory factory = new HessianProxyFactory();
+		try {
+			service = (SvnService)factory.create(SvnService.class, serviceUrl);
+		} catch (MalformedURLException ex) {
+			log.warn("Unable to connect to the service", ex);
+		}
+		return service;
+	}
+	
+}

Modified: labs/jbosslabs/trunk/stats-server/sources/metrics_web/view/jira/assignee.xhtml
===================================================================
--- labs/jbosslabs/trunk/stats-server/sources/metrics_web/view/jira/assignee.xhtml	2008-01-04 16:55:03 UTC (rev 17556)
+++ labs/jbosslabs/trunk/stats-server/sources/metrics_web/view/jira/assignee.xhtml	2008-01-04 16:55:16 UTC (rev 17557)
@@ -5,28 +5,37 @@
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:s="http://jboss.com/products/seam/taglib"
     xmlns:rich="http://richfaces.org/rich"
-    xmlns:c="http://java.sun.com/jsf/core">
+    xmlns:c="http://java.sun.com/jsf/core"
+    xmlns:t="http://myfaces.apache.org/tomahawk">
     <h3>Open Issues By Assignee</h3><hr class="greyHR"/><br/>
 	<img src="#{jira.openIssuesPerAssigneeChartLocator.hiresUrl}" border="0" />
 	<br/><br/>
-	<rich:dataTable value="#{jira.openIssuesPerAssignee}" var="i" rowKeyVar="row">
-		<rich:column>
-			<f:facet name="header">
-				Rank
-			</f:facet>
-			#{row}
-		</rich:column>
-		<rich:column>
-			<f:facet name="header">
-				Assignee
-			</f:facet>
-			#{i.key}
-		</rich:column>
-		<rich:column>
-			<f:facet name="header">
-				Issues
-			</f:facet>
-			#{i.value}
-		</rich:column>
-	</rich:dataTable>
+	<h:form id="assigneeForm">
+		<t:dataTable value="#{jira.openIssuesPerAssignee}" var="i" rows="10" rowIndexVar="row"
+					 border="0" cellpadding="4" cellspacing="0"
+					 styleClass="basetablestyle"
+					 headerClass="header" rowClasses="oddRow, evenRow"
+					 columnClasses="rowlinefirst, rowline, rowline"
+					 footerClass="topline">
+			<h:column id="rank">
+				<f:facet name="header">
+					Rank
+				</f:facet>
+				#{row+1}
+				<f:facet name="footer"><h:outputText value=" " /></f:facet>
+			</h:column>
+			<h:column id="assignee">
+				<f:facet name="header">
+					Assignee
+				</f:facet>
+				#{i.key}
+			</h:column>
+			<h:column id="issues">
+				<f:facet name="header">
+					Issues
+				</f:facet>
+				#{i.value}
+			</h:column>
+		</t:dataTable>
+	</h:form>
 </div>

Modified: labs/jbosslabs/trunk/stats-server/sources/metrics_web/view/project.xhtml
===================================================================
--- labs/jbosslabs/trunk/stats-server/sources/metrics_web/view/project.xhtml	2008-01-04 16:55:03 UTC (rev 17556)
+++ labs/jbosslabs/trunk/stats-server/sources/metrics_web/view/project.xhtml	2008-01-04 16:55:16 UTC (rev 17557)
@@ -6,33 +6,53 @@
                 xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:rich="http://richfaces.org/rich"
+                xmlns:t="http://myfaces.apache.org/tomahawk"
                 template="layout/template.xhtml">
 
 <ui:define name="body">
 
     <h:messages globalOnly="true" styleClass="message"/>
     
+    <h:form id="mainForm">
     <rich:panel>
 	    <f:facet name="header">#{project.name}</f:facet>
-
-				<rich:panelMenu style="width:200px" mode="ajax"
-					iconExpandedGroup="disc" iconCollapsedGroup="disc"
-					iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
-					iconCollapsedTopGroup="chevronDown" iconCollapsedTopPosition="right">
-					<rich:panelMenuItem label="Item 1.1">
-						<f:param name="current" value="Item 1.1" />
-					</rich:panelMenuItem>
-					<rich:panelMenuItem label="Item 1.2">
-						<f:param name="current" value="Item 1.2" />
-					</rich:panelMenuItem>
-	
-				</rich:panelMenu>
-				
-			    <ui:include src="jira/status.xhtml" />
-				<ui:include src="jira/assignee.xhtml" />
-				<ui:include src="jira/priority.xhtml" />
-				
+			<table cellspacing="10" cellpadding="10">
+			   <tr>
+				  <td valign="top">
+					<rich:panelMenu style="width:200px" mode="ajax"
+						iconExpandedGroup="disc" iconCollapsedGroup="disc"
+						iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
+						iconCollapsedTopGroup="chevronDown" iconCollapsedTopPosition="right">
+						<rich:panelMenuGroup expanded="true" label="JIRA metrics">
+							<rich:panelMenuItem label="Issues by Assignee" action="#{projectMenu.select('assignee')}" reRender="chartDivs" />
+							<rich:panelMenuItem label="Issues by Status" action="#{projectMenu.select('status')}" reRender="chartDivs"/>
+							<rich:panelMenuItem label="Issues by Priority" action="#{projectMenu.select('priority')}" reRender="chartDivs"/>
+						</rich:panelMenuGroup>
+						<rich:panelMenuGroup expanded="true" label="SVN metrics">
+							<rich:panelMenuItem label="Repository Activity" action="#{projectMenu.select('activity')}" reRender="chartDivs" />
+						</rich:panelMenuGroup>
+					</rich:panelMenu>
+				  </td>
+				  <td valign="top">
+					<t:div id="chartDivs">
+						<t:div rendered="#{projectMenuSelection eq 'status'}">
+					    	<ui:include src="jira/status.xhtml" />
+					    </t:div>
+					    <t:div rendered="#{projectMenuSelection eq 'assignee'}">
+							<ui:include src="jira/assignee.xhtml" />
+						</t:div>
+						<t:div rendered="#{projectMenuSelection eq 'priority'}">
+							<ui:include src="jira/priority.xhtml" />
+						</t:div>
+						<t:div rendered="#{projectMenuSelection eq 'activity'}">
+							<ui:include src="svn/activity.xhtml" />
+						</t:div>
+					</t:div>
+				  </td>
+			   </tr>
+			</table>
 		</rich:panel>
+		</h:form>
     
 </ui:define> 
 </ui:composition>

Added: labs/jbosslabs/trunk/stats-server/sources/metrics_web/view/svn/activity.xhtml
===================================================================
--- labs/jbosslabs/trunk/stats-server/sources/metrics_web/view/svn/activity.xhtml	                        (rev 0)
+++ labs/jbosslabs/trunk/stats-server/sources/metrics_web/view/svn/activity.xhtml	2008-01-04 16:55:16 UTC (rev 17557)
@@ -0,0 +1,73 @@
+<div
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:ui="http://java.sun.com/jsf/facelets"
+    xmlns:h="http://java.sun.com/jsf/html"
+    xmlns:f="http://java.sun.com/jsf/core"
+    xmlns:s="http://jboss.com/products/seam/taglib"
+    xmlns:rich="http://richfaces.org/rich"
+    xmlns:c="http://java.sun.com/jsf/core"
+    xmlns:t="http://myfaces.apache.org/tomahawk">
+    <h3>Commit History</h3><hr class="greyHR"/><br/>
+    
+    <table border="0" cellpadding="4" cellspacing="0" class="basetablestyle">
+	<tr class="header">
+    	<th class="tableheaderfirst"></th>
+    	<th class="tableheader">Today</th>
+    	<th class="tableheader">Last 7 Days </th>
+    	<th class="tableheader">Last 31 Days </th>
+    	<th class="tableheader">Total</th>
+    </tr>
+    <tr class="oddRow portlet-section-body">
+    	<td class="rowlinefirst"><strong>Commits</strong></td>
+        <td class="rowline">#{repository.commitsToday}</td>
+        <td class="rowline">#{repository.commitsLast7Days}</td>
+        <td class="rowline">#{repository.commitsLast31Days}</td>
+        <td class="rowline">#{repository.commitsTotal}</td>
+    </tr>
+    <tr class="evenRow portlet-section-alternate">
+    	<td class="bottomline rowlinefirst"><strong>Committers</strong></td>
+        <td class="bottomline rowline">#{repository.committersToday}</td>
+		<td class="bottomline rowline">#{repository.committersLast7Days}</td>
+        <td class="bottomline rowline">#{repository.committersLast31Days}</td>
+        <td class="bottomline rowline">#{repository.committersTotal}</td>
+     </tr>
+	</table><br/>
+	
+	<img src="#{repository.commitsPerWeekChartLocator.hiresUrl}" border="0"/>
+	<br/><br/>
+    
+	<h:form id="commitHistoryForm">
+		<t:dataTable value="#{repository.commits}" var="commit" rows="10" rowIndexVar="row"
+					 border="0" cellpadding="4" cellspacing="0"
+					 styleClass="basetablestyle"
+					 headerClass="header" rowClasses="oddRow, evenRow"
+					 columnClasses="rowlinefirst, rowline, rowline"
+					 footerClass="topline">
+			<h:column id="rev">
+				<f:facet name="header">
+					Commit #
+				</f:facet>
+				#{commit.revision}
+				<f:facet name="footer"><h:outputText value=" " /></f:facet>
+			</h:column>
+			<h:column id="message">
+				<f:facet name="header">
+					Commit Message
+				</f:facet>
+				#{commit.message}<br/>(A#{commit.addedFiles} D#{commit.deletedFiles} U#{commit.modifiedFiles} R#{commit.replacedFiles})
+			</h:column>
+			<h:column id="commiter">
+				<f:facet name="header">
+					Commiter
+				</f:facet>
+				#{commit.author}
+			</h:column>
+			<h:column id="age">
+				<f:facet name="header">
+					Time
+				</f:facet>
+				#{commit.ageInDays}
+			</h:column>
+		</t:dataTable>
+	</h:form>
+</div>




More information about the jboss-svn-commits mailing list