You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2011/07/04 10:21:09 UTC

svn commit: r1142584 - in /myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main: java/org/apache/myfaces/tobago/example/demo/info/ webapp/ webapp/WEB-INF/

Author: lofwyr
Date: Mon Jul  4 08:21:08 2011
New Revision: 1142584

URL: http://svn.apache.org/viewvc?rev=1142584&view=rev
Log:
porting the user activity from the Tobago 1.0.x demo to trunk.

Added:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/
      - copied from r1102564, myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/activity/
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/server-info.xhtml   (contents, props changed)
      - copied, changed from r1140983, myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/server-info.jsp
Removed:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/server-info.jsp
Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/Activity.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityList.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityPhaseListener.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityServletContextListener.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivitySessionListener.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/Activity.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/Activity.java?rev=1142584&r1=1102564&r2=1142584&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/Activity.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/Activity.java Mon Jul  4 08:21:08 2011
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.example.demo.activity;
+package org.apache.myfaces.tobago.example.demo.info;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityList.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityList.java?rev=1142584&r1=1102564&r2=1142584&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityList.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityList.java Mon Jul  4 08:21:08 2011
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.example.demo.activity;
+package org.apache.myfaces.tobago.example.demo.info;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityPhaseListener.java?rev=1142584&r1=1102564&r2=1142584&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityPhaseListener.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityPhaseListener.java Mon Jul  4 08:21:08 2011
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.example.demo.activity;
+package org.apache.myfaces.tobago.example.demo.info;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -19,8 +19,8 @@ package org.apache.myfaces.tobago.exampl
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.ajax.api.AjaxUtils;
-import org.apache.myfaces.tobago.util.VariableResolverUtil;
+import org.apache.myfaces.tobago.ajax.AjaxUtils;
+import org.apache.myfaces.tobago.util.VariableResolverUtils;
 
 import javax.faces.context.FacesContext;
 import javax.faces.event.PhaseEvent;
@@ -32,13 +32,17 @@ public class ActivityPhaseListener imple
 
   private static final Log LOG = LogFactory.getLog(ActivityPhaseListener.class);
 
+  public ActivityPhaseListener() {
+    LOG.error("Hier bin ich!");
+  }
+
   public void afterPhase(PhaseEvent event) {
   }
 
   public void beforePhase(PhaseEvent event) {
     final FacesContext facesContext = event.getFacesContext();
     final ActivityList activityList
-        = (ActivityList) VariableResolverUtil.resolveVariable(facesContext, ActivityList.NAME);
+        = (ActivityList) VariableResolverUtils.resolveVariable(facesContext, ActivityList.NAME);
     String sessionId = ((HttpSession) facesContext.getExternalContext().getSession(true)).getId();
 
     if (AjaxUtils.isAjaxRequest(facesContext)) {

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityServletContextListener.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityServletContextListener.java?rev=1142584&r1=1102564&r2=1142584&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityServletContextListener.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivityServletContextListener.java Mon Jul  4 08:21:08 2011
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.example.demo.activity;
+package org.apache.myfaces.tobago.example.demo.info;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivitySessionListener.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivitySessionListener.java?rev=1142584&r1=1102564&r2=1142584&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivitySessionListener.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/info/ActivitySessionListener.java Mon Jul  4 08:21:08 2011
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.example.demo.activity;
+package org.apache.myfaces.tobago.example.demo.info;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml?rev=1142584&r1=1142583&r2=1142584&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml Mon Jul  4 08:21:08 2011
@@ -77,6 +77,9 @@
       org.apache.myfaces.tobago.example.demo.SynchronizeNavigationPhaseListener
     </phase-listener>
     <phase-listener>
+      org.apache.myfaces.tobago.example.demo.info.ActivityPhaseListener
+    </phase-listener>
+    <phase-listener>
       org.apache.myfaces.tobago.util.DebugPhaseListener
     </phase-listener>
   </lifecycle>
@@ -104,7 +107,7 @@
   <navigation-rule>
     <navigation-case>
       <from-outcome>server-info</from-outcome>
-      <to-view-id>/server-info.jsp</to-view-id>
+      <to-view-id>/server-info.xhtml</to-view-id>
     </navigation-case>
   </navigation-rule>
 

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml?rev=1142584&r1=1142583&r2=1142584&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml Mon Jul  4 08:21:08 2011
@@ -93,6 +93,13 @@
     <url-pattern>/faces/*</url-pattern>
   </filter-mapping>
 
+  <listener>
+    <listener-class>org.apache.myfaces.tobago.example.demo.info.ActivitySessionListener</listener-class>
+  </listener>
+  <listener>
+    <listener-class>org.apache.myfaces.tobago.example.demo.info.ActivityServletContextListener</listener-class>
+  </listener>
+
   <!--  workaround (e.g. for Oracle AS 10.1.2.0.0)-->
   <listener>
     <listener-class>org.apache.myfaces.tobago.webapp.TobagoServletContextListener</listener-class>

Copied: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/server-info.xhtml (from r1140983, myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/server-info.jsp)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/server-info.xhtml?p2=myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/server-info.xhtml&p1=myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/server-info.jsp&r1=1140983&r2=1142584&rev=1142584&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/server-info.jsp (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/server-info.xhtml Mon Jul  4 08:21:08 2011
@@ -1,4 +1,6 @@
-<%--
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -13,36 +15,47 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
---%>
-<%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %>
-<%@ taglib uri="http://myfaces.apache.org/tobago/extension" prefix="tx" %>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<%@ taglib tagdir="/WEB-INF/tags/layout" prefix="layout" %>
-
-<layout:overview>
-  <jsp:body>
-    <tc:box label="Server Info">
-      <f:facet name="layout">
-        <tc:gridLayout rows="fixed;fixed;fixed;fixed;fixed;fixed;*" />
-      </f:facet>
-
-      <tx:in value="#{info.version}" readonly="true"
-          label="Tobago Version" />
-
-      <tx:in value="#{info.jsfTitle}" readonly="true"
-          label="JSF Implementation" />
+-->
 
-      <tx:in value="#{info.jsfVersion}" readonly="true"
-          label="JSF Version" />
+<ui:composition template="/WEB-INF/tags/layout/overview.xhtml"
+                xmlns:tc="http://myfaces.apache.org/tobago/component"
+                xmlns:tx="http://myfaces.apache.org/tobago/extension"
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:f="http://java.sun.com/jsf/core">
+  <ui:param name="title" value="Server Info"/>
+
+  <tc:panel rendered="#{info.enabled}">
+    <f:facet name="layout">
+      <tc:gridLayout rows="auto;auto;auto;auto;auto;auto;*;*"/>
+    </f:facet>
+
+    <tx:in value="#{info.version}" readonly="true"
+           label="Tobago Version"/>
+
+    <tx:in value="#{info.jsfTitle}" readonly="true"
+           label="JSF Implementation"/>
+
+    <tx:in value="#{info.jsfVersion}" readonly="true"
+           label="JSF Version"/>
+
+    <tx:in value="#{info.serverInfo}" readonly="true"
+           label="Server Info"/>
+
+    <tx:in value="#{info.systemProperties['java.runtime.version']} - #{info.systemProperties['java.vm.vendor']}"
+           readonly="true"
+           label="Java"/>
+
+    <tx:in
+        value="#{info.systemProperties['os.name']} - #{info.systemProperties['os.version']} - #{info.systemProperties['os.arch']}"
+        readonly="true"
+        label="Operating System"/>
 
-      <tx:in value="#{info.serverInfo}" readonly="true"
-          label="Server Info" />
-
-      <tx:in value="#{info.systemProperties['java.runtime.version']} - #{info.systemProperties['java.vm.vendor']}" readonly="true"
-          label="Java" />
+    <tc:panel>
+      <f:facet name="layout">
+        <tc:gridLayout columns="auto;*"/>
+      </f:facet>
 
-      <tx:in value="#{info.systemProperties['os.name']} - #{info.systemProperties['os.version']} - #{info.systemProperties['os.arch']}" readonly="true"
-          label="Operating System" />
+      <tc:label value="System Properties"/>
 
       <tc:sheet var="entry" value="#{info.systemPropertiesAsList}" columns="*;2*" rows="1000">
         <tc:column label="Key">
@@ -52,7 +65,31 @@
           <tc:out value="#{entry.value}" escape="true"/>
         </tc:column>
       </tc:sheet>
-      
-    </tc:box>
-  </jsp:body>
-</layout:overview>
+    </tc:panel>
+
+    <tc:panel>
+      <f:facet name="layout">
+        <tc:gridLayout columns="auto;*"/>
+      </f:facet>
+
+      <tc:label value="Sessions"/>
+
+      <tc:sheet value="#{activities.values}" var="activity"
+                showRowRange="left" showPageRange="right" showDirectLinks="center">
+        <tc:column label="Session Id">
+          <tc:out value="#{activity.sessionId}"/>
+        </tc:column>
+        <tc:column label="Creation Date">
+          <tc:out value="#{activity.creationDate}"/>
+        </tc:column>
+        <tc:column label="Jsf Request Count">
+          <tc:out value="#{activity.jsfRequest}"/>
+        </tc:column>
+        <tc:column label="Ajax Request Count">
+          <tc:out value="#{activity.ajaxRequest}"/>
+        </tc:column>
+      </tc:sheet>
+    </tc:panel>
+
+  </tc:panel>
+</ui:composition>

Propchange: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/server-info.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/server-info.xhtml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL