Return-Path: Delivered-To: apmail-incubator-openwebbeans-commits-archive@minotaur.apache.org Received: (qmail 12488 invoked from network); 12 Nov 2009 18:42:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Nov 2009 18:42:58 -0000 Received: (qmail 16641 invoked by uid 500); 12 Nov 2009 18:42:58 -0000 Delivered-To: apmail-incubator-openwebbeans-commits-archive@incubator.apache.org Received: (qmail 16615 invoked by uid 500); 12 Nov 2009 18:42:58 -0000 Mailing-List: contact openwebbeans-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: openwebbeans-dev@incubator.apache.org Delivered-To: mailing list openwebbeans-commits@incubator.apache.org Received: (qmail 16605 invoked by uid 99); 12 Nov 2009 18:42:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Nov 2009 18:42:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Nov 2009 18:42:54 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EF1C7238890A; Thu, 12 Nov 2009 18:42:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r835495 - in /incubator/openwebbeans/trunk/samples/jsf2sample/src/main: java/org/apache/webbeans/jsf2/ConversationBean.java java/org/apache/webbeans/jsf2/ConversationData.java webapp/conversation.xhtml Date: Thu, 12 Nov 2009 18:42:32 -0000 To: openwebbeans-commits@incubator.apache.org From: gerdogdu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091112184232.EF1C7238890A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gerdogdu Date: Thu Nov 12 18:42:32 2009 New Revision: 835495 URL: http://svn.apache.org/viewvc?rev=835495&view=rev Log: conversation support example Added: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/ConversationBean.java (with props) incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/ConversationData.java (with props) incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/conversation.xhtml (with props) Added: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/ConversationBean.java URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/ConversationBean.java?rev=835495&view=auto ============================================================================== --- incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/ConversationBean.java (added) +++ incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/ConversationBean.java Thu Nov 12 18:42:32 2009 @@ -0,0 +1,111 @@ +/* + * 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.jsf2; + +import javax.enterprise.context.Conversation; +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; +import javax.inject.Named; + +@Named +@RequestScoped +public class ConversationBean +{ + private @Inject Conversation conversation; + + private @Inject @Named("mynumber") int current; + + private String message; + + public ConversationBean() + { + + } + + public String startConversation() + { + conversation.begin(); + + message = "Conversation is started with id : " + this.conversation.getId(); + + return null; + } + + public String next() + { + return "next"; + } + + public String stopConversation() + { + conversation.end(); + + current = 10; + + message = "Conversation is ended"; + + return null; + } + + /** + * @return the message + */ + public String getMessage() + { + return message; + } + + /** + * @param message the message to set + */ + public void setMessage(String message) + { + this.message = message; + } + + /** + * @return the conversation + */ + public Conversation getConversation() + { + return conversation; + } + + /** + * @param conversation the conversation to set + */ + public void setConversation(Conversation conversation) + { + this.conversation = conversation; + } + + /** + * @return the current + */ + public int getCurrent() + { + return current; + } + + /** + * @param current the current to set + */ + public void setCurrent(int current) + { + this.current = current; + } + + + +} Propchange: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/ConversationBean.java ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/ConversationData.java URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/ConversationData.java?rev=835495&view=auto ============================================================================== --- incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/ConversationData.java (added) +++ incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/ConversationData.java Thu Nov 12 18:42:32 2009 @@ -0,0 +1,41 @@ +/* + * 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.jsf2; + +import java.io.Serializable; + +import javax.enterprise.context.ConversationScoped; +import javax.enterprise.inject.Produces; +import javax.inject.Inject; +import javax.inject.Named; + +@ConversationScoped +public class ConversationData implements Serializable +{ + private static final long serialVersionUID = 1L; + + private int i = 0; + + @Inject + public ConversationData() + { + i = 10; + } + + @Produces @Named("mynumber") + public int getNumber() + { + return i++; + } +} Propchange: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/ConversationData.java ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/conversation.xhtml URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/conversation.xhtml?rev=835495&view=auto ============================================================================== --- incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/conversation.xhtml (added) +++ incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/conversation.xhtml Thu Nov 12 18:42:32 2009 @@ -0,0 +1,68 @@ + + + + + + JSF2 Ajax with OpenWebBeans Demo + + + +
+

JSF2 Conversation Demo

+

+ Number will be increased each time user press Show Number button if conversation is in progress. Initial number set to 10 +

+
+ +
    +
  • Click Start Conversation to start conversation

  • +
  • Click End Conversation to end conversation

  • +
  • Click Show Number to show number in the current conversation

  • +
+ + + + + +
+ + +
+ +
+ +
+ +
+ + + + + + + + +
+ +
+ +
+ \ No newline at end of file Propchange: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/conversation.xhtml ------------------------------------------------------------------------------ svn:eol-style = native