You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by ge...@apache.org on 2009/11/15 02:49:08 UTC

svn commit: r836308 - in /incubator/openwebbeans/trunk/samples/guess/src/main: java/org/apache/webbeans/sample/conversation/ java/org/apache/webbeans/sample/guess/ webapp/ webapp/WEB-INF/

Author: gerdogdu
Date: Sun Nov 15 01:49:07 2009
New Revision: 836308

URL: http://svn.apache.org/viewvc?rev=836308&view=rev
Log:
Update while running TCK.

Added:
    incubator/openwebbeans/trunk/samples/guess/src/main/webapp/redirect.xhtml   (with props)
Modified:
    incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/conversation/ShoppingCardBean.java
    incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/guess/JSFNumberGuess.java
    incubator/openwebbeans/trunk/samples/guess/src/main/webapp/WEB-INF/faces-config.xml
    incubator/openwebbeans/trunk/samples/guess/src/main/webapp/conversation.xhtml

Modified: incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/conversation/ShoppingCardBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/conversation/ShoppingCardBean.java?rev=836308&r1=836307&r2=836308&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/conversation/ShoppingCardBean.java (original)
+++ incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/conversation/ShoppingCardBean.java Sun Nov 15 01:49:07 2009
@@ -68,6 +68,19 @@
         return null;
     }
     
+    public String getBooks()
+    {
+        StringBuffer buffer = new StringBuffer("Your shopping card contents : [");
+        
+        for(String b : model.getList())
+        {
+            buffer.append("," + b);
+        }
+        
+        return buffer.toString();
+        
+    }
+    
     public String endConversation()
     {
         messageUtil.addMessage(FacesMessage.SEVERITY_INFO, "Conversation with id : " + conversation.getId() + " is ended", null);

Modified: incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/guess/JSFNumberGuess.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/guess/JSFNumberGuess.java?rev=836308&r1=836307&r2=836308&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/guess/JSFNumberGuess.java (original)
+++ incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/guess/JSFNumberGuess.java Sun Nov 15 01:49:07 2009
@@ -68,11 +68,13 @@
         };
 
         Set<Bean<?>> beans = manager.getBeans(Integer.class, anns);
-        this.no = (Integer)manager.getReference(beans.iterator().next(), null, null);
+        Bean<?> bean = beans.iterator().next();
+        this.no = (Integer)manager.getReference(bean, null, manager.createCreationalContext(bean));
         //this.no = manager.getInstanceByType(Integer.class, anns);
         setSmallRange(1);
         beans = manager.getBeans(Integer.class, anns2);
-        setMaxRange((Integer)manager.getReference(beans.iterator().next(), null, null));
+        bean = beans.iterator().next();
+        setMaxRange((Integer)manager.getReference(bean, null, manager.createCreationalContext(bean)));
         //setMaxRange(manager.getInstanceByType(Integer.class, anns2));
         setRemainder(10);
         setGuess(1);

Modified: incubator/openwebbeans/trunk/samples/guess/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/guess/src/main/webapp/WEB-INF/faces-config.xml?rev=836308&r1=836307&r2=836308&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/samples/guess/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ incubator/openwebbeans/trunk/samples/guess/src/main/webapp/WEB-INF/faces-config.xml Sun Nov 15 01:49:07 2009
@@ -44,6 +44,15 @@
     		<to-view-id>/home.xhtml</to-view-id>
     	</navigation-case>
     </navigation-rule>
+
+   <navigation-rule>
+    	<from-view-id>/conversation.xhtml</from-view-id>
+    	<navigation-case>
+    		<from-outcome>toRedirect</from-outcome>
+    		<redirect/>
+    		<to-view-id>/redirect.jsf?book=alis</to-view-id>
+    	</navigation-case>
+    </navigation-rule>
 	
 	
 </faces-config>

Modified: incubator/openwebbeans/trunk/samples/guess/src/main/webapp/conversation.xhtml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/guess/src/main/webapp/conversation.xhtml?rev=836308&r1=836307&r2=836308&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/samples/guess/src/main/webapp/conversation.xhtml (original)
+++ incubator/openwebbeans/trunk/samples/guess/src/main/webapp/conversation.xhtml Sun Nov 15 01:49:07 2009
@@ -44,6 +44,7 @@
 					<h:panelGroup>					
 						<h:commandButton action="#{shoppingCardBean.startConversation}" immediate="true" value="Start Conversation"></h:commandButton>
 						<h:commandButton action="#{shoppingCardBean.endConversation}" immediate="true" value="End Conversation"></h:commandButton>
+						<h:commandButton action="toRedirect" immediate="true" value="Redirect"></h:commandButton>
 					</h:panelGroup>
 					
 					<h:commandButton action="#{shoppingCardBean.addNewBook}" value="Add New Book"></h:commandButton>

Added: incubator/openwebbeans/trunk/samples/guess/src/main/webapp/redirect.xhtml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/guess/src/main/webapp/redirect.xhtml?rev=836308&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/guess/src/main/webapp/redirect.xhtml (added)
+++ incubator/openwebbeans/trunk/samples/guess/src/main/webapp/redirect.xhtml Sun Nov 15 01:49:07 2009
@@ -0,0 +1,51 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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:f="http://java.sun.com/jsf/core"
+    xmlns:h="http://java.sun.com/jsf/html"
+    xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<head>
+  <title>OpenWebBeans :: Examples :: Conversation</title>
+</head>
+
+<body>
+  
+  <div id="container">
+    <div id="content">
+		<h:messages globalOnly="false" showSummary="true" infoStyle="font-weight:bold;"></h:messages>
+		
+		<h:form id="form">
+			
+			<div style="border:1px solid black;margin: 25px 75px;">
+			
+				<h:panelGrid columns="2">
+					
+					<h:outputLabel>
+						<h:outputText value="Redirected Books : "></h:outputText>
+					</h:outputLabel>
+					<h:outputText value="#{shoppingCardBean.books}" />					
+					
+				</h:panelGrid>
+			</div>
+		</h:form>
+	    </div>
+    
+  </div>
+</body>
+</html>
\ No newline at end of file

Propchange: incubator/openwebbeans/trunk/samples/guess/src/main/webapp/redirect.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native