[webbeans-commits] Webbeans SVN: r1771 - in examples/trunk: conversations and 20 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Thu Mar 5 07:44:41 EST 2009


Author: nickarls
Date: 2009-03-05 07:44:41 -0500 (Thu, 05 Mar 2009)
New Revision: 1771

Added:
   examples/trunk/conversations/
   examples/trunk/conversations/WebContent/
   examples/trunk/conversations/WebContent/WEB-INF/
   examples/trunk/conversations/WebContent/WEB-INF/beans.xml
   examples/trunk/conversations/WebContent/WEB-INF/faces-config.xml
   examples/trunk/conversations/WebContent/WEB-INF/web.xml
   examples/trunk/conversations/WebContent/home.xhtml
   examples/trunk/conversations/WebContent/index.html
   examples/trunk/conversations/WebContent/style/
   examples/trunk/conversations/WebContent/template.xhtml
   examples/trunk/conversations/build.xml
   examples/trunk/conversations/pom.xml
   examples/trunk/conversations/src/
   examples/trunk/conversations/src/main/
   examples/trunk/conversations/src/main/java/
   examples/trunk/conversations/src/main/java/org/
   examples/trunk/conversations/src/main/java/org/jboss/
   examples/trunk/conversations/src/main/java/org/jboss/webbeans/
   examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/
   examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/
   examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java
   examples/trunk/conversations/src/main/resources/
   examples/trunk/conversations/src/main/resources/META-INF/
   examples/trunk/conversations/target/
   examples/trunk/conversations/target/classes/
   examples/trunk/conversations/target/classes/org/
   examples/trunk/conversations/target/classes/org/jboss/
   examples/trunk/conversations/target/classes/org/jboss/webbeans/
   examples/trunk/conversations/target/classes/org/jboss/webbeans/examples/
   examples/trunk/conversations/target/classes/org/jboss/webbeans/examples/conversations/
   examples/trunk/conversations/target/classes/org/jboss/webbeans/examples/conversations/Conversations.class
Removed:
   examples/trunk/numberguess/WebContent/conversations.xhtml
   examples/trunk/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Conversations.java
Log:
split conversation example out from numberguess

Added: examples/trunk/conversations/WebContent/WEB-INF/beans.xml
===================================================================

Added: examples/trunk/conversations/WebContent/WEB-INF/faces-config.xml
===================================================================
--- examples/trunk/conversations/WebContent/WEB-INF/faces-config.xml	                        (rev 0)
+++ examples/trunk/conversations/WebContent/WEB-INF/faces-config.xml	2009-03-05 12:44:41 UTC (rev 1771)
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<faces-config version="1.2"
+              xmlns="http://java.sun.com/xml/ns/javaee"
+              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+    
+    <application>
+        <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+    </application>
+
+</faces-config>

Added: examples/trunk/conversations/WebContent/WEB-INF/web.xml
===================================================================
--- examples/trunk/conversations/WebContent/WEB-INF/web.xml	                        (rev 0)
+++ examples/trunk/conversations/WebContent/WEB-INF/web.xml	2009-03-05 12:44:41 UTC (rev 1771)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5"
+    xmlns="http://java.sun.com/xml/ns/javaee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+   
+   <display-name>Web Beans Conversations example</display-name>
+
+   <!-- JSF -->
+
+   <servlet>
+      <servlet-name>Faces Servlet</servlet-name>
+      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+      <load-on-startup>1</load-on-startup>
+   </servlet>
+
+   <servlet-mapping>
+      <servlet-name>Faces Servlet</servlet-name>
+      <url-pattern>*.jsf</url-pattern>
+   </servlet-mapping>
+   
+   <context-param>
+      <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+      <param-value>.xhtml</param-value>
+   </context-param>
+
+   <session-config>
+      <session-timeout>10</session-timeout>
+   </session-config>
+
+</web-app>

Added: examples/trunk/conversations/WebContent/home.xhtml
===================================================================
--- examples/trunk/conversations/WebContent/home.xhtml	                        (rev 0)
+++ examples/trunk/conversations/WebContent/home.xhtml	2009-03-05 12:44:41 UTC (rev 1771)
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html 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">
+
+  <ui:composition template="template.xhtml">
+    <ui:define name="content">
+    	<h:form>
+    		<h:panelGrid columns="1">
+				<h:outputText value="Long-running: #{conversations.conversationList}"/>
+	    		<h:outputText value="Current: #{conversation}"/>
+	    		<h:panelGroup>
+    				<h:commandButton action="#{conversation.begin}" value="begin"/>
+    				<h:commandButton action="#{conversations.noop}" value="noop"/>
+    				<h:commandButton action="#{conversation.end}" value="end"/>
+    				<h:commandButton action="#{conversations.abandon}" value="abandon"/>
+    			</h:panelGroup>
+    			<h:inputText value="#{conversations.cid}"/>
+    			<h:commandButton action="#{conversations.switchConversation}" value="switch"/>
+    		</h:panelGrid>
+		</h:form>
+    </ui:define>
+  </ui:composition>
+</html>

Added: examples/trunk/conversations/WebContent/index.html
===================================================================
--- examples/trunk/conversations/WebContent/index.html	                        (rev 0)
+++ examples/trunk/conversations/WebContent/index.html	2009-03-05 12:44:41 UTC (rev 1771)
@@ -0,0 +1,5 @@
+<html>
+<head>
+  <meta http-equiv="Refresh" content="0; URL=home.jsf">
+</head>
+</html>
\ No newline at end of file

Added: examples/trunk/conversations/WebContent/template.xhtml
===================================================================
--- examples/trunk/conversations/WebContent/template.xhtml	                        (rev 0)
+++ examples/trunk/conversations/WebContent/template.xhtml	2009-03-05 12:44:41 UTC (rev 1771)
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html 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">
+
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <title>Conversations</title>
+  <link href="style/main.css" rel="stylesheet" type="text/css"/>
+  <ui:insert name="head"/>
+</head>
+
+<body>
+  
+  <div id="container">
+    <div id="header">
+  
+    </div>
+
+    <div id="sidebar">
+    
+    </div>
+  
+    <div id="content">
+      <ui:insert name="content"/>
+    </div>
+    
+    <br style="clear:both"/>
+  </div>
+   
+</body>
+</html>
+

Added: examples/trunk/conversations/build.xml
===================================================================
--- examples/trunk/conversations/build.xml	                        (rev 0)
+++ examples/trunk/conversations/build.xml	2009-03-05 12:44:41 UTC (rev 1771)
@@ -0,0 +1,7 @@
+<project basedir="." name="Conversations Example Build" default="restart">
+	
+	<property name="example.name" value="webbeans-conversations" />
+
+	<import file="../build.xml" />
+	
+</project>
\ No newline at end of file

Added: examples/trunk/conversations/pom.xml
===================================================================
--- examples/trunk/conversations/pom.xml	                        (rev 0)
+++ examples/trunk/conversations/pom.xml	2009-03-05 12:44:41 UTC (rev 1771)
@@ -0,0 +1,90 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+   <modelVersion>4.0.0</modelVersion>
+   
+   <parent>
+      <groupId>org.jboss.webbeans.examples</groupId>
+      <artifactId>parent</artifactId>
+      <version>1.0.0-SNAPSHOT</version>
+   </parent>
+   
+   <groupId>org.jboss.webbeans.examples</groupId>
+   <artifactId>webbeans-conversations</artifactId>
+   <packaging>war</packaging>
+   <name>Web Beans Examples: Conversations</name>
+   
+   <pluginRepositories>
+        <pluginRepository>
+            <id>codehaus snapshot repository</id>
+            <url>http://snapshots.repository.codehaus.org/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+        </pluginRepository>
+    </pluginRepositories>
+   
+   <dependencies>
+      <dependency>
+         <groupId>org.testng</groupId>
+         <artifactId>testng</artifactId>
+         <scope>test</scope>
+         <classifier>jdk15</classifier>
+      </dependency>
+      
+      <dependency>
+         <groupId>org.jboss.webbeans</groupId>
+         <artifactId>webbeans-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>org.jboss.webbeans</groupId>
+         <artifactId>webbeans-ri</artifactId>
+         <scope>provided</scope>
+      </dependency>
+      
+      <dependency>
+         <groupId>javax.faces</groupId>
+         <artifactId>jsf-api</artifactId>
+         <scope>provided</scope>
+      </dependency>
+      
+      <dependency>
+        <groupId>com.sun.facelets</groupId>
+        <artifactId>jsf-facelets</artifactId>
+      </dependency>
+      
+      <!-- <dependency>
+         <groupId>org.jboss.el</groupId>
+         <artifactId>jboss-el</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>javax.el</groupId>
+               <artifactId>el-api</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>-->
+      
+      <dependency>
+         <groupId>javax.el</groupId>
+         <artifactId>el-ri</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>javax.el</groupId>
+               <artifactId>el-api</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+      	<groupId>javax.annotation</groupId>
+      	<artifactId>jsr250-api</artifactId>
+      </dependency>
+      
+   </dependencies>
+   
+   <build>
+      <finalName>webbeans-conversations</finalName>
+   </build>
+   
+</project>
+

Added: examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java
===================================================================
--- examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java	                        (rev 0)
+++ examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java	2009-03-05 12:44:41 UTC (rev 1771)
@@ -0,0 +1,72 @@
+package org.jboss.webbeans.examples.conversations;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.Named;
+import javax.context.Conversation;
+import javax.context.SessionScoped;
+import javax.faces.model.SelectItem;
+import javax.inject.Current;
+import javax.inject.Produces;
+
+import java.io.Serializable;
+
+import org.jboss.webbeans.conversation.ConversationIdGenerator;
+import org.jboss.webbeans.conversation.ConversationManager;
+import org.jboss.webbeans.conversation.bindings.ConversationInactivityTimeout;
+
+ at SessionScoped
+ at Named("conversations")
+public class Conversations implements Serializable {
+
+   @Current private Conversation conversation;
+   @Current private ConversationIdGenerator id;
+   @Current private ConversationManager conversationManager;
+   private String cid;
+     
+   public Conversations() 
+   {
+   }
+   
+   public void abandon() 
+   {
+      conversation.begin(id.nextId());
+   }
+   
+   public void noop()
+   {
+   
+   }
+   
+   public Iterable<Conversation> getConversationList() 
+   {
+      return conversationManager.getLongRunningConversations(); 
+   }
+   
+   public List<SelectItem> getLongRunningConversations() 
+   {
+      List<SelectItem> longRunningConversations = new ArrayList<SelectItem>();
+      for (Conversation conversation : conversationManager.getLongRunningConversations()) 
+      {
+         longRunningConversations.add(new SelectItem(conversation.getId(), conversation.getId()));
+      }
+      return longRunningConversations;
+   }
+
+   public void switchConversation() 
+   {
+      conversation.begin(cid);
+   }
+   
+   public String getCid()
+   {
+      return cid;
+   }
+
+   public void setCid(String cid)
+   {
+      this.cid = cid;
+   }
+   
+}
\ No newline at end of file

Added: examples/trunk/conversations/target/classes/org/jboss/webbeans/examples/conversations/Conversations.class
===================================================================
(Binary files differ)


Property changes on: examples/trunk/conversations/target/classes/org/jboss/webbeans/examples/conversations/Conversations.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: examples/trunk/numberguess/WebContent/conversations.xhtml
===================================================================
--- examples/trunk/numberguess/WebContent/conversations.xhtml	2009-03-05 08:00:16 UTC (rev 1770)
+++ examples/trunk/numberguess/WebContent/conversations.xhtml	2009-03-05 12:44:41 UTC (rev 1771)
@@ -1,25 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html 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">
-
-  <ui:composition template="template.xhtml">
-    <ui:define name="content">
-    	<h:form>
-    		<h:panelGrid columns="1">
-				<h:outputText value="Long-running: #{conversations.conversationList}"/>
-	    		<h:outputText value="Current: #{conversation}"/>
-	    		<h:panelGroup>
-    				<h:commandButton action="#{conversation.begin}" value="begin"/>
-    				<h:commandButton action="#{conversations.noop}" value="noop"/>
-    				<h:commandButton action="#{conversation.end}" value="end"/>
-    				<h:commandButton action="#{conversations.abandon}" value="abandon"/>
-    			</h:panelGroup>
-    			<h:inputText value="#{conversations.cid}"/>
-    			<h:commandButton action="#{conversations.switchConversation}" value="switch"/>
-    		</h:panelGrid>
-		</h:form>
-    </ui:define>
-  </ui:composition>
-</html>

Deleted: examples/trunk/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Conversations.java
===================================================================
--- examples/trunk/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Conversations.java	2009-03-05 08:00:16 UTC (rev 1770)
+++ examples/trunk/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Conversations.java	2009-03-05 12:44:41 UTC (rev 1771)
@@ -1,72 +0,0 @@
-package org.jboss.webbeans.examples.numberguess;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.Named;
-import javax.context.Conversation;
-import javax.context.SessionScoped;
-import javax.faces.model.SelectItem;
-import javax.inject.Current;
-import javax.inject.Produces;
-
-import java.io.Serializable;
-
-import org.jboss.webbeans.conversation.ConversationIdGenerator;
-import org.jboss.webbeans.conversation.ConversationManager;
-import org.jboss.webbeans.conversation.bindings.ConversationInactivityTimeout;
-
- at SessionScoped
- at Named("conversations")
-public class Conversations implements Serializable {
-
-   @Current private Conversation conversation;
-   @Current private ConversationIdGenerator id;
-   @Current private ConversationManager conversationManager;
-   private String cid;
-     
-   public Conversations() 
-   {
-   }
-   
-   public void abandon() 
-   {
-      conversation.begin(id.nextId());
-   }
-   
-   public void noop()
-   {
-   
-   }
-   
-   public Iterable<Conversation> getConversationList() 
-   {
-      return conversationManager.getLongRunningConversations(); 
-   }
-   
-   public List<SelectItem> getLongRunningConversations() 
-   {
-      List<SelectItem> longRunningConversations = new ArrayList<SelectItem>();
-      for (Conversation conversation : conversationManager.getLongRunningConversations()) 
-      {
-         longRunningConversations.add(new SelectItem(conversation.getId(), conversation.getId()));
-      }
-      return longRunningConversations;
-   }
-
-   public void switchConversation() 
-   {
-      conversation.begin(cid);
-   }
-   
-   public String getCid()
-   {
-      return cid;
-   }
-
-   public void setCid(String cid)
-   {
-      this.cid = cid;
-   }
-   
-}
\ No newline at end of file




More information about the weld-commits mailing list