openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r905125 - in /openwebbeans/trunk/samples: ./ conversation-sample/ conversation-sample/src/ conversation-sample/src/main/ conversation-sample/src/main/java/ conversation-sample/src/main/java/org/ conversation-sample/src/main/java/org/apache/...
Date Sun, 31 Jan 2010 21:31:54 GMT
Author: gerdogdu
Date: Sun Jan 31 21:31:54 2010
New Revision: 905125

URL: http://svn.apache.org/viewvc?rev=905125&view=rev
Log:
Add new sample related with conversation usage

Added:
    openwebbeans/trunk/samples/conversation-sample/
    openwebbeans/trunk/samples/conversation-sample/pom.xml   (with props)
    openwebbeans/trunk/samples/conversation-sample/src/
    openwebbeans/trunk/samples/conversation-sample/src/main/
    openwebbeans/trunk/samples/conversation-sample/src/main/java/
    openwebbeans/trunk/samples/conversation-sample/src/main/java/org/
    openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/
    openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/
    openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/
    openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/
    openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/Item.java
  (with props)
    openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/Products.java
  (with props)
    openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/ShoppingBean.java
  (with props)
    openwebbeans/trunk/samples/conversation-sample/src/main/resources/
    openwebbeans/trunk/samples/conversation-sample/src/main/resources/META-INF/
    openwebbeans/trunk/samples/conversation-sample/src/main/resources/META-INF/beans.xml 
 (with props)
    openwebbeans/trunk/samples/conversation-sample/src/main/resources/META-INF/openwebbeans/
    openwebbeans/trunk/samples/conversation-sample/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
  (with props)
    openwebbeans/trunk/samples/conversation-sample/src/main/webapp/
    openwebbeans/trunk/samples/conversation-sample/src/main/webapp/META-INF/
    openwebbeans/trunk/samples/conversation-sample/src/main/webapp/META-INF/MANIFEST.MF
    openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/
    openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/beans.xml   (with
props)
    openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/faces-config.xml
  (with props)
    openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/lib/
    openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/web.xml   (with
props)
    openwebbeans/trunk/samples/conversation-sample/src/main/webapp/buy.xhtml   (with props)
    openwebbeans/trunk/samples/conversation-sample/src/main/webapp/index.jsp   (with props)
    openwebbeans/trunk/samples/conversation-sample/src/main/webapp/listing.xhtml   (with props)
Modified:
    openwebbeans/trunk/samples/pom.xml

Added: openwebbeans/trunk/samples/conversation-sample/pom.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/samples/conversation-sample/pom.xml?rev=905125&view=auto
==============================================================================
--- openwebbeans/trunk/samples/conversation-sample/pom.xml (added)
+++ openwebbeans/trunk/samples/conversation-sample/pom.xml Sun Jan 31 21:31:54 2010
@@ -0,0 +1,88 @@
+	<!--
+
+		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.
+		The ASF licenses this file to You under the Apache License, Version
+		2.0 (the "License"); you may not use this file except in compliance
+		with the License. You may obtain a copy of the License at
+
+		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+		applicable law or agreed to in writing, software distributed under the
+		License is distributed on an "AS IS" BASIS, 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.
+	-->
+<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>
+	<description>Sample JSF2 Application</description>
+	<parent>
+		<artifactId>samples</artifactId>
+		<groupId>org.apache.openwebbeans</groupId>
+		<version>1.0.0-SNAPSHOT</version>
+	</parent>	
+	
+	<groupId>org.apache.openwebbeans.samples</groupId>
+	<artifactId>conversation-sample</artifactId>
+	<packaging>war</packaging>
+	<name>Apache OpenWebBeans :: JSF Conversation Sample</name>
+
+	<dependencies>
+
+		<dependency>
+			<groupId>org.apache.openwebbeans</groupId>
+			<artifactId>openwebbeans-impl</artifactId>
+		</dependency>
+		
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-interceptor_1.1_spec</artifactId>
+		</dependency>
+				
+		<dependency>
+			<groupId>org.apache.openwebbeans</groupId>
+			<artifactId>openwebbeans-jsf</artifactId>
+		</dependency>
+		
+		<!-- MyFaces API -->
+		<dependency>
+			<groupId>org.apache.myfaces.core</groupId>
+			<artifactId>myfaces-api</artifactId>
+			<version>1.2.8</version>
+		</dependency>
+		
+		<!-- MyFaces IMPL -->
+		<dependency>
+			<groupId>org.apache.myfaces.core</groupId>
+			<artifactId>myfaces-impl</artifactId>
+			<version>1.2.8</version>
+		</dependency>
+		
+		<!-- JSF Facelet -->
+		<dependency>
+			<groupId>com.sun.facelets</groupId>
+			<artifactId>jsf-facelets</artifactId>
+			<version>1.1.14</version>
+		</dependency>
+		
+
+
+	</dependencies>
+	
+	<build>
+		<finalName>conversation-sample</finalName>
+		<plugins>
+			<plugin>
+				<groupId>org.mortbay.jetty</groupId>
+				<artifactId>maven-jetty-plugin</artifactId>
+				<configuration>
+					<contextPath>${build.finalName}</contextPath>
+					<scanIntervalSeconds>3</scanIntervalSeconds>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	
+</project>

Propchange: openwebbeans/trunk/samples/conversation-sample/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/Item.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/Item.java?rev=905125&view=auto
==============================================================================
--- openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/Item.java
(added)
+++ openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/Item.java
Sun Jan 31 21:31:54 2010
@@ -0,0 +1,76 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.webbeans.samples.conversation;
+
+import java.io.Serializable;
+
+public class Item implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    private String name;
+    
+    private long price;
+    
+    public Item()
+    {
+        
+    }
+    
+    public Item(String name, long price)
+    {
+        this.name = name;
+        this.price = price;
+    }
+
+    /**
+     * @return the name
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * @param name the name to set
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /**
+     * @return the price
+     */
+    public long getPrice()
+    {
+        return price;
+    }
+
+    /**
+     * @param price the price to set
+     */
+    public void setPrice(long price)
+    {
+        this.price = price;
+    }
+    
+    
+    
+}

Propchange: openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/Item.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/Products.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/Products.java?rev=905125&view=auto
==============================================================================
--- openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/Products.java
(added)
+++ openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/Products.java
Sun Jan 31 21:31:54 2010
@@ -0,0 +1,68 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.webbeans.samples.conversation;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Named;
+
+@Named
+@ApplicationScoped
+public class Products implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+    
+    private List<Item> products = new ArrayList<Item>();
+    
+    public Products()
+    {
+        
+    }
+    
+    @PostConstruct
+    public void afterInit()
+    {
+        for(int i=1;i<6;i++)
+        {
+            Item item = new Item("Item-" + i,i*1500L);
+            products.add(item);
+        }
+    }
+    
+    @PreDestroy
+    public void preDestroy()
+    {
+        products.clear(); 
+    }
+
+    /**
+     * @return the products
+     */
+    public List<Item> getProducts()
+    {
+        return products;
+    }
+    
+    
+}

Propchange: openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/Products.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/ShoppingBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/ShoppingBean.java?rev=905125&view=auto
==============================================================================
--- openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/ShoppingBean.java
(added)
+++ openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/ShoppingBean.java
Sun Jan 31 21:31:54 2010
@@ -0,0 +1,118 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.webbeans.samples.conversation;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.context.Conversation;
+import javax.enterprise.context.ConversationScoped;
+import javax.enterprise.inject.New;
+import javax.enterprise.inject.Produces;
+import javax.faces.component.UIData;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+@Named
+@ConversationScoped
+public class ShoppingBean implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    private @Inject Products products;
+    
+    private @Inject Conversation conversation;
+
+    private List<Item> items = new ArrayList<Item>();
+        
+    private UIData uiTable;
+    
+    
+    public ShoppingBean()
+    {
+        
+    }
+    
+    @Inject
+    public ShoppingBean(@New Item defaultItem)
+    {
+        defaultItem.setName("Default Item");
+        defaultItem.setPrice(1000L);
+        
+        items.add(defaultItem);
+    }
+    
+    
+    public String startShopping()
+    {
+        this.conversation.begin();
+        
+        return null;
+    }
+    
+    public String checkout()
+    {
+        this.conversation.end();
+        
+        return null;
+    }
+    
+    public Conversation getConversation()
+    {
+        return this.conversation;
+    }
+    
+    @Produces @Named("selectedItems")
+    public List<Item> listSelectedItems()
+    {
+        return this.items;
+    }
+    
+    public String buy()
+    {
+        Item item = (Item) uiTable.getRowData();
+        this.items.add(item);
+        
+        return null;
+    }
+    
+    @Produces @Named("allProducts")
+    public List<Item> listAllProducts()
+    {
+        return this.products.getProducts();
+    }
+
+    /**
+     * @return the uiTable
+     */
+    public UIData getUiTable()
+    {
+        return uiTable;
+    }
+
+    /**
+     * @param uiTable the uiTable to set
+     */
+    public void setUiTable(UIData uiTable)
+    {
+        this.uiTable = uiTable;
+    }
+     
+}

Propchange: openwebbeans/trunk/samples/conversation-sample/src/main/java/org/apache/webbeans/samples/conversation/ShoppingBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/samples/conversation-sample/src/main/resources/META-INF/beans.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/samples/conversation-sample/src/main/resources/META-INF/beans.xml?rev=905125&view=auto
==============================================================================
--- openwebbeans/trunk/samples/conversation-sample/src/main/resources/META-INF/beans.xml (added)
+++ openwebbeans/trunk/samples/conversation-sample/src/main/resources/META-INF/beans.xml Sun
Jan 31 21:31:54 2010
@@ -0,0 +1,20 @@
+<?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.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, 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.
+-->
+<beans/>
\ No newline at end of file

Propchange: openwebbeans/trunk/samples/conversation-sample/src/main/resources/META-INF/beans.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/samples/conversation-sample/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/samples/conversation-sample/src/main/resources/META-INF/openwebbeans/openwebbeans.properties?rev=905125&view=auto
==============================================================================
--- openwebbeans/trunk/samples/conversation-sample/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
(added)
+++ openwebbeans/trunk/samples/conversation-sample/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
Sun Jan 31 21:31:54 2010
@@ -0,0 +1,27 @@
+#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.  The ASF licenses this file
+#to you under the Apache License, Version 2.0 (the
+#"License"); you may not use this file except in compliance
+#with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+#Unless required by applicable law or agreed to in writing,
+#software distributed under the License is distributed on an
+#"AS IS" BASIS, 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.
+#---------------------------------------------------------------
+# The default configuration for OpenWebBeans
+#
+# The default configuration is intended for a JDK and a simple ServletContainer
+# like jetty, resin or tomcat.
+# 
+#---------------------------------------------------------------
+
+#general configuration section
+
+org.apache.webbeans.application.useJSF2Extensions=false
\ No newline at end of file

Propchange: openwebbeans/trunk/samples/conversation-sample/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/samples/conversation-sample/src/main/webapp/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/samples/conversation-sample/src/main/webapp/META-INF/MANIFEST.MF?rev=905125&view=auto
==============================================================================
--- openwebbeans/trunk/samples/conversation-sample/src/main/webapp/META-INF/MANIFEST.MF (added)
+++ openwebbeans/trunk/samples/conversation-sample/src/main/webapp/META-INF/MANIFEST.MF Sun
Jan 31 21:31:54 2010
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

Added: openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/beans.xml?rev=905125&view=auto
==============================================================================
--- openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/beans.xml (added)
+++ openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/beans.xml Sun Jan
31 21:31:54 2010
@@ -0,0 +1,20 @@
+<?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.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, 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.
+-->
+<beans/>
\ No newline at end of file

Propchange: openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/beans.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/faces-config.xml?rev=905125&view=auto
==============================================================================
--- openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/faces-config.xml
(added)
+++ openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/faces-config.xml
Sun Jan 31 21:31:54 2010
@@ -0,0 +1,40 @@
+<?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.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, 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.
+-->
+
+<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ 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">
+
+   <navigation-rule>
+    	<from-view-id>/buy.xhtml</from-view-id>
+    	<navigation-case>
+    		<from-outcome>toListingPage</from-outcome>
+    		<redirect/>
+    		<to-view-id>/listing.xhtml</to-view-id>
+    	</navigation-case>
+    </navigation-rule>
+    
+    	 <application>
+  <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
+    
+		
+</faces-config>

Propchange: openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/faces-config.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/web.xml?rev=905125&view=auto
==============================================================================
--- openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/web.xml (added)
+++ openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/web.xml Sun Jan
31 21:31:54 2010
@@ -0,0 +1,43 @@
+<?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.
+	The ASF licenses this file to You under the Apache License, Version
+	2.0 (the "License"); you may not use this file except in compliance
+	with the License. You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+	applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, 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.
+-->
+<web-app 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"
+	version="2.5">
+
+	<context-param>
+		<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+		<param-value>.xhtml</param-value>
+	</context-param>
+
+	<listener>
+		<listener-class>
+			org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
+	</listener>
+
+	<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>
+
+</web-app>
\ No newline at end of file

Propchange: openwebbeans/trunk/samples/conversation-sample/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/samples/conversation-sample/src/main/webapp/buy.xhtml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/samples/conversation-sample/src/main/webapp/buy.xhtml?rev=905125&view=auto
==============================================================================
--- openwebbeans/trunk/samples/conversation-sample/src/main/webapp/buy.xhtml (added)
+++ openwebbeans/trunk/samples/conversation-sample/src/main/webapp/buy.xhtml Sun Jan 31 21:31:54
2010
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
+<!--
+	
+	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.
+	The ASF licenses this file to You under the Apache License, Version
+	2.0 (the "License"); you may not use this file except in compliance
+	with the License. You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+	applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, 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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" 
+xmlns:h="http://java.sun.com/jsf/html"
+xmlns:f="http://java.sun.com/jsf/core">
+<head>
+  <title>OpenWebBeans :: Examples</title>
+</head>
+<body>
+	
+	<div>
+		<h3>Shopping Card Example</h3>
+		<ul>
+			<li>When user clicks <b style="color:red;">"Starts Shopping"</b> button,
new conversation is started. When user clicks <b style="color:red;">"Checkout"</b>
button, conversation ends.</li>
+			<li>When user clicks <b style="color:red;">"Add Item"</b> link in the
table, it adds new item to the buyer's shopping card.</li>
+ 			<li>When user clicks <b style="color:red;">"Show Items"</b> button,
it shows contents of buyer shopping card.</li>
+			<li>When user clicks <b style="color:red;">"To Listing Page"</b> button,
it shows content of buyer shopping card in a new page.</li>
+		</ul>
+	</div>
+	
+	<h:form id="form">
+		
+		<div>		
+			<h:outputText value="Current Conversation Id  : " style="color:red;"/>
+			<h:outputText value="#{shoppingBean.conversation.id}" id="conversation" style="font-weight:bold;"
/>
+		</div>
+			
+		<div style="margin-top: 10px;">
+			<h:commandButton id="button1" value="Starts Shopping" action="#{shoppingBean.startShopping}">
+			</h:commandButton>
+			
+			<h:commandButton id="button3" value="To Listing Page" action="toListingPage">		
    
+			</h:commandButton>			
+			
+			<h:commandButton id="button4" value="Checkout" action="#{shoppingBean.checkout}">
		    
+			</h:commandButton>			
+							
+		</div>
+		
+		<div style="margin-top: 10px;">
+			<h3>Products Details</h3>
+			<h:dataTable cellpadding="1" cellspacing="5" value="#{allProducts}" var="item" binding="#{shoppingBean.uiTable}">
+				
+				<h:column>
+					<f:facet name="header">
+						<h:outputText value="Product Name" />
+					</f:facet>
+					<h:outputText value="#{item.name}" />
+				</h:column>
+				
+				<h:column>
+					<f:facet name="header">
+						<h:outputText value="Product Price" />
+					</f:facet>
+					<h:outputText value="#{item.price}" />
+				</h:column>
+				
+				<h:column>
+					<f:facet name="header">
+						<h:outputText value="" />
+					</f:facet>
+					<h:commandLink action="#{shoppingBean.buy}" value="Add Item to Card" />
+				</h:column>
+				
+			</h:dataTable>
+		</div>
+		
+		<div style="margin-top: 10px;">
+			<h3>Current Shopping Card Content</h3>
+			<h:dataTable cellpadding="1" cellspacing="5" value="#{selectedItems}" var="item">
+				
+				<h:column>
+					<f:facet name="header">
+						<h:outputText value="Product Name" />
+					</f:facet>
+					<h:outputText value="#{item.name}" />
+				</h:column>
+				
+				<h:column>
+					<f:facet name="header">
+						<h:outputText value="Product Price" />
+					</f:facet>
+					<h:outputText value="#{item.price}" />
+				</h:column>
+				
+			</h:dataTable>
+		</div>
+		
+				
+	</h:form>
+
+</body>
+</html>
\ No newline at end of file

Propchange: openwebbeans/trunk/samples/conversation-sample/src/main/webapp/buy.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/samples/conversation-sample/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/samples/conversation-sample/src/main/webapp/index.jsp?rev=905125&view=auto
==============================================================================
--- openwebbeans/trunk/samples/conversation-sample/src/main/webapp/index.jsp (added)
+++ openwebbeans/trunk/samples/conversation-sample/src/main/webapp/index.jsp Sun Jan 31 21:31:54
2010
@@ -0,0 +1,21 @@
+<!--
+	
+	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.
+	The ASF licenses this file to You under the Apache License, Version
+	2.0 (the "License"); you may not use this file except in compliance
+	with the License. You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+	applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, 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.
+-->
+<html>
+<head>
+<meta HTTP-EQUIV="REFRESH" content="0; url=buy.jsf">
+</head>
+</html>

Propchange: openwebbeans/trunk/samples/conversation-sample/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/samples/conversation-sample/src/main/webapp/listing.xhtml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/samples/conversation-sample/src/main/webapp/listing.xhtml?rev=905125&view=auto
==============================================================================
--- openwebbeans/trunk/samples/conversation-sample/src/main/webapp/listing.xhtml (added)
+++ openwebbeans/trunk/samples/conversation-sample/src/main/webapp/listing.xhtml Sun Jan 31
21:31:54 2010
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
+<!--
+	
+	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.
+	The ASF licenses this file to You under the Apache License, Version
+	2.0 (the "License"); you may not use this file except in compliance
+	with the License. You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+	applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, 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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" 
+xmlns:h="http://java.sun.com/jsf/html"
+xmlns:f="http://java.sun.com/jsf/core">
+<head>
+  <title>OpenWebBeans :: Examples</title>
+</head>
+<body>		
+	
+	<div style="margin-top: 10px;">
+		<h3>Current Shopping Card Content</h3>
+		<h:dataTable cellpadding="1" cellspacing="5" value="#{selectedItems}" var="item">
+			
+			<h:column>
+				<f:facet name="header">
+					<h:outputText value="Product Name" />
+				</f:facet>
+				<h:outputText value="#{item.name}" />
+			</h:column>
+			
+			<h:column>
+				<f:facet name="header">
+					<h:outputText value="Product Price" />
+				</f:facet>
+				<h:outputText value="#{item.price}" />
+			</h:column>
+			
+		</h:dataTable>
+	</div>
+						
+</body>
+</html>
\ No newline at end of file

Propchange: openwebbeans/trunk/samples/conversation-sample/src/main/webapp/listing.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: openwebbeans/trunk/samples/pom.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/samples/pom.xml?rev=905125&r1=905124&r2=905125&view=diff
==============================================================================
--- openwebbeans/trunk/samples/pom.xml (original)
+++ openwebbeans/trunk/samples/pom.xml Sun Jan 31 21:31:54 2010
@@ -29,6 +29,7 @@
 	<description>Contains samples project for openwebbeans.</description>
 	<modules>
            <module>guess</module>
+           <module>conversation-sample</module>
            <module>jsf2sample</module>
            <module>ejb-sample</module>
            <module>jms-sample</module>



Mime
View raw message