[webbeans-commits] Webbeans SVN: r681 - in doc/tags: webbeans-reference-guide-1.0.0.ALPHA1 and 1 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Mon Dec 22 06:52:14 EST 2008


Author: pete.muir at jboss.org
Date: 2008-12-22 06:52:13 -0500 (Mon, 22 Dec 2008)
New Revision: 681

Added:
   doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/
   doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/en/modules/ri.xml
   doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/pom.xml
Removed:
   doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/en/modules/ri.xml
   doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/pom.xml
Log:
[maven-release-plugin]  copy for tag webbeans-reference-guide-1.0.0.ALPHA1

Copied: doc/tags/webbeans-reference-guide-1.0.0.ALPHA1 (from rev 650, doc/trunk/reference)

Deleted: doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/en/modules/ri.xml
===================================================================
--- doc/trunk/reference/en/modules/ri.xml	2008-12-21 05:46:06 UTC (rev 650)
+++ doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/en/modules/ri.xml	2008-12-22 11:52:13 UTC (rev 681)
@@ -1,744 +0,0 @@
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"  [ ]>
-
-<chapter id="ri">
-   <title>The Web Beans Reference Implementation</title>
-
-   <para>
-     The Web Beans Reference Implementation is being developed at
-     <ulink url="http://seamframework.org/WebBeans">the Seam project</ulink>.
-     You can download the latest developer release of Web Beans from the
-     <ulink url="http://seamframework.org/Download">the downloads page</ulink>.
-   </para> 
-
-    <para>
-      The Web Beans RI comes with a two deployable example applications, 
-      <literal>webbeans-numberguess</literal> (a war example, containing only
-      simple beans) and <literal>webbeans-translator</literal> (an ear example,
-      containing enterprise beans). To run the examples you'll need the following:
-   </para>
-   
-   <itemizedlist>
-     <listitem>
-       <para>the latest release of the Web Beans RI,</para>
-     </listitem>
-     <listitem>
-       <para>JBoss AS 5.0.0.GA, and</para>
-     </listitem>
-     <listitem>
-       <para>Ant 1.7.0.</para>
-     </listitem>
-   </itemizedlist>
-   
-   <para>
-      Currently, the Web Beans RI only runs on JBoss Application Server 5. 
-      You'll need to download JBoss AS 5.0.0.GA from 
-      <ulink url="http://www.jboss.org/jbossas/downloads/">jboss.org</ulink>,
-      and unzip it. For example:
-   </para>
-   
-   <programlisting><![CDATA[$ cd /Applications
-$ unzip ~/jboss-5.0.0.GA.zip]]></programlisting>
-
-   <para>
-      Next, download the Web Beans RI from 
-      <ulink url="http://seamframework.org/Download">seamframework.org</ulink>,
-      and unzip it. For example
-   </para>
-   
-   <programlisting><![CDATA[$ cd ~/
-$ unzip ~/webbeans-1.0.0.ALPHA1.zip]]></programlisting>
-
-   
-   <para>
-      Next, we need to tell Web Beans where JBoss is located. Edit
-      <literal>jboss-as/build.properties</literal> and set the
-      <literal>jboss.home</literal> property. For example:
-   </para>
-   
-   <programlisting>jboss.home=/Applications/jboss-5.0.0.GA</programlisting>
-
-   <para>
-      As Web Beans is a new piece of software, you need to update JBoss AS to 
-      run the Web Beans RI. Future versions of JBoss AS will include these
-      updates, and this step won't be necessary.
-   </para>
-   
-   <note>
-      <para>
-         Currently, two updates are needed. Firstly, a new deployer,
-         <literal>webbeans.deployer</literal> is added. This adds supports for
-         Web Bean archives to JBoss AS, and allows the Web Beans RI to query the
-         EJB3 container and discover which EJBs are installed in your 
-         application. Secondly, an update to JBoss EJB3 is needed.
-      </para>
-   </note>
-   
-   <para>
-      To install the update, you'll need Ant 1.7.0 installed, and the 
-      <literal>ANT_HOME</literal> environment variable set. For example:
-   </para>
-   
-      <programlisting>$ unzip apache-ant-1.7.0.zip
-$ export ANT_HOME=~/apache-ant-1.7.0</programlisting>
-
-   <para>
-      Then, you can install the update. The update script will use Maven to
-      download the Web Beans and EJB3 automatically.
-   </para>
-   
-   <programlisting>$ cd webbeans-1.0.0.ALPHA1/jboss-as
-$ ant update</programlisting>
-
-   <para>
-      Now, you're ready to deploy your first example!
-   </para>
-   
-   <tip>
-      <para>
-         The build scripts for the examples offer a number of targets, these 
-         are:
-      </para>
-      <itemizedlist>
-         <listitem>
-            <para>
-               <literal>ant restart</literal> - deploy the example in exploded 
-               format
-            </para>
-         </listitem>
-         <listitem>
-            <para>
-               <literal>ant explode</literal> - update an exploded example, without
-               restarting the deployment
-            </para>
-         </listitem>
-         <listitem>
-            <para>
-               <literal>ant deploy</literal> - deploy the example in compressed jar format
-            </para>
-         </listitem>
-         <listitem>
-            <para>
-               <literal>ant undeploy</literal> - remove the example from the server
-            </para>
-         </listitem>
-         <listitem>
-            <para>
-               <literal>ant clean</literal> - clean the example
-           </para>
-         </listitem>
-      </itemizedlist>
-   </tip>
-
-   <para>
-      To deploy the numberguess example:
-   </para>
-
-   <programlisting>$ cd examples/numberguess
-ant deploy</programlisting>
-
-   <para>
-      Wait for the application to deploy, and enjoy hours of fun at
-      <ulink url="http://localhost:8080/webbeans-numberguess" />!
-   </para>
-   
-   <para>
-      The Web Beans RI includes a second simple example that will translate your text
-      into Latin. The numberguess example is a war example, and uses only simple
-      beans; the translator example is an ear example, and includes enterprise
-      beans, packaged in an EJB module. To try it out:
-   </para>
-
-   <programlisting>$ cd examples/translator
-ant deploy</programlisting>
-
-   <para>
-      Wait for the application to deploy, and visit
-      <ulink url="http://localhost:8080/webbeans-translator" />!
-   </para>
-   
-   <section>
-      <title>The numberguess example</title>
-      
-      <para>
-         In the numberguess application you get given 10 attempts to guess a
-         number between 1 and 100. After each attempt, you will be told whether
-         you are too high, or too low.
-      </para>
-      
-      <para>
-         The numberguess example is comprised of a number of Web Beans, 
-         configuration files, and Facelet JSF pages, packaged as a war. Let's 
-         start with the configuration files.
-      </para>
-      
-      <para>
-          All the configuration files for this example are located in 
-          <literal>WEB-INF/</literal>, which is stored in
-          <literal>WebContent</literal> in the source tree. First, we have 
-          <literal>faces-config.xml</literal>, in which we tell JSF to use
-          Facelets:
-      </para>
-      
-      <programlisting role="XML"><![CDATA[<?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>]]></programlisting>
-
-      <para>
-         There is an empty <literal>web-beans.xml</literal> file, which marks
-         this application as a Web Beans application.
-      </para>
-      
-      <para>
-         Finally there is <literal>web.xml</literal>:
-      </para>
-      
-      <programlistingco>
-         <areaspec>
-            <area id="faces.servlet" coords="12" />
-            <area id="faces.servlet.mapping" coords="18" />
-            <area id="faces.default.suffix" coords="23" />
-            <area id="session.timeout" coords="28" />
-            <area id="webbeans.listener" coords="32" />
-         </areaspec>
-         <programlisting role="XML"><![CDATA[<?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 Numbergues 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>
-   
-    <listener>
-       <listener-class>org.jboss.webbeans.servlet.WebBeansListener</listener-class>
-    </listener>
-
-</web-app>]]></programlisting>
-         <calloutlist>
-            <callout arearefs="faces.servlet">
-               <para>
-                  Enable and load the JSF servlet
-               </para>
-            </callout>
-            <callout arearefs="faces.servlet.mapping">
-               <para>
-                  Configure requests to <literal>.jsf</literal> pages to be
-                  handled by JSF
-               </para>
-            </callout>
-            <callout arearefs="faces.default.suffix">
-               <para>
-                  Tell JSF that we will be giving our source files (facelets) an
-                  extension of <literal>.jsf</literal>
-               </para>
-            </callout>
-            <callout arearefs="session.timeout">
-               <para>
-                  Configure a session timeout of 10 minutes
-               </para>
-            </callout>
-            <callout arearefs="webbeans.listener">
-               <para>
-                  Configure the Web Beans listener, so that Web Beans services
-                  can be used in the servlet request
-               </para>
-            </callout>
-         </calloutlist>
-      </programlistingco>
-      
-      <note>
-         <para>
-            The only configuration required by the Web Beans RI in 
-            <literal>web.xml</literal> is to add the Web Beans listener.
-         </para>
-         <para>
-            Whilst this demo is a JSF demo, you can use the Web Beans RI with 
-            any Servlet based web framework; just configure the Web Beans 
-            listener.
-         </para>
-      </note>
-      
-      <para>
-         Let's take a look at the Facelet view:
-      </para>
-      
-      <programlistingco>
-         <areaspec>
-            <area id="template" coords="8" />
-            <area id="messages" coords="12" />
-            <area id="instructions" coords="19" />
-            <area id="guess" coords="25" />
-            <area id="validator" coords="29" />
-            <area id="submit" coords="32" />
-         </areaspec>
-         <programlisting role="XML"><![CDATA[<!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"
-    xmlns:s="http://jboss.com/products/seam/taglib">
-
-  <ui:composition template="template.xhtml">
-    <ui:define name="content">
-       <h1>Guess a number...</h1>
-       <h:form id="NumberGuessMain">
-          <div style="color: red">
-             <h:messages id="messages" globalOnly="false"/>
-             <h:outputText id="Higher" value="Higher!" rendered="#{game.number gt game.guess}"/>
-             <h:outputText id="Lower" value="Lower!" rendered="#{game.number lt game.guess}"/>
-          </div>
-   
-          <div>
-             I'm thinking of a number between #{game.smallest} and #{game.biggest}.
-             You have #{game.remainingGuesses} guesses.
-          </div>
-     
-          <div>
-             Your guess: 
-             <h:inputText id="inputGuess" 
-                          value="#{game.guess}" 
-                          required="true" 
-                          size="3">
-                <f:validateLongRange maximum="#{game.biggest}" 
-                                     minimum="#{game.smallest}"/>
-             </h:inputText>
-            <h:commandButton id="GuessButton" 
-                             value="Guess" 
-                             action="#{game.check}"/>
-          </div>
-   
-       </h:form>
-    </ui:define>
-  </ui:composition>
-</html>]]></programlisting>
-         <calloutlist>
-            <callout arearefs="template">
-               <para>
-                  Facelets is a templating language for JSF, here we are 
-                  wrapping our page in a template which defines the header.
-               </para>
-            </callout>
-            <callout arearefs="messages">
-               <para>
-                  There are a number of messages which can be sent to the user,
-                  "Higher!", "Lower!" and "Correct!"
-               </para>
-            </callout>
-            <callout arearefs="instructions">
-               <para>
-                  As the user guesses, the range of numbers they can guess gets
-                  smaller - this sentance changes to make sure they know what 
-                  range to guess in.
-               </para>
-            </callout>
-            <callout arearefs="guess">
-               <para>
-                  This input field is bound to a Web Bean, using the value
-                  expression.
-               </para>
-            </callout>
-            <callout arearefs="validator">
-               <para>
-                  A range validator is used to make sure the user doesn't
-                  accidentally input a number outside of the range in which they
-                  can guess - if the validator wasn't here, the user might use
-                  up a guess on an out of range number.
-               </para>
-            </callout>
-            <callout arearefs="submit">
-               <para>
-                  And, of course, there must be a way for the user to send their
-                  guess to the server. Here we bind to an action method on the
-                  Web Bean.
-               </para>
-            </callout>
-         </calloutlist>
-      </programlistingco>
-      
-      <para>
-         The example exists of 4 classes, the first two of which are binding
-         types. First, there is the <literal>@Random</literal> binding type, 
-         used for injecting a random number:
-      </para>
-      
-      <programlisting role="JAVA"><![CDATA[@Target( { TYPE, METHOD, PARAMETER, FIELD })
- at Retention(RUNTIME)
- at Documented
- at BindingType
-public @interface Random {}]]></programlisting>
-
-      <para>
-         There is also the <literal>@MaxNumber</literal> binding type, used for
-         injecting the maximum number that can be injected:
-      </para>
-      
-      <programlisting role="JAVA"><![CDATA[@Target( { TYPE, METHOD, PARAMETER, FIELD })
- at Retention(RUNTIME)
- at Documented
- at BindingType
-public @interface MaxNumber {}
-]]></programlisting>
-
-      <para>
-         The <literal>Generator</literal> class is responsible for creating the
-         random number, via a producer method. It also exposes the maximum
-         possible number via a producer method:
-      </para>
-
-      <programlisting role="JAVA"><![CDATA[@ApplicationScoped
-public class Generator {
-   
-   private java.util.Random random = new java.util.Random( System.currentTimeMillis() );
-   
-   private int maxNumber = 100;
-   
-   java.util.Random getRandom()
-   {
-      return random;
-   }
-   
-   @Produces @Random int next() { 
-      return getRandom().nextInt(maxNumber); 
-   }
-   
-   @Produces @MaxNumber int getMaxNumber()
-   {
-      return maxNumber;
-   }
-
-}]]></programlisting>
-
-      <para>
-         You'll notice that the <literal>Generator</literal> is application
-         scoped; therefore we don't get a different random each time.
-      </para>
-      
-      <para>
-         The final Web Bean in the application is the session scoped
-         <literal>Game</literal>. By making <literal>Game</literal> session 
-         scoped, you can only play the game once per browser session. You could
-         easily add a reset button - a good exercise for the reader :-)
-      </para>
-      
-      <para>
-         You'll also note that we've used the <literal>@Named</literal> 
-         annotation, so that we can use the bean through EL in the JSF page.
-         Finally, we've used constructor injection to initialize the game with
-         a random number. And of course, we need to tell the player when they've
-         won, so we give feedback with a <literal>FacesMessage</literal>.
-      </para>
-      
-      <programlisting role="JAVA"><![CDATA[@Named
- at SessionScoped
-public class Game {
-   private int number;
-   
-   private int guess;
-   private int smallest;
-   private int biggest;
-   private int remainingGuesses;
-   
-   public Game() {}
-   
-   @Initializer
-   Game(@Random int number, @MaxNumber int maxNumber) {
-      this.number = number;
-      this.smallest = 1;
-      this.biggest = maxNumber;
-      this.remainingGuesses = 10;
-   }
-
-   // Getters and setters for fields
-   
-   public String check() {
-      if (guess>number) {
-         biggest = guess - 1;
-      }
-      if (guess<number) {
-         smallest = guess + 1;
-      }
-      if (guess == number) {
-         FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Correct!"));
-      }
-      remainingGuesses--;
-      return null;
-   }
-   
-}]]></programlisting>
-   </section>
-   
-   <section>
-      <title>The translator example</title>
-      
-      <para>
-         The translator example will take any sentences you enter, and translate
-         them to Latin.
-      </para>
-      
-      <para>
-         The translator example is built as an ear, and contains EJBs and 
-         enterprise beans. As a result, it's structure is more complex than
-         the numberguess example.
-      </para>
-      
-      <note>
-         <para>
-            EJB 3.1 and Jave EE 6 allow you to package EJBs in a war, which will
-            make this structure much simpler!
-         </para>
-      </note>
-      
-      <para>
-         First, let's take a look at the ear aggregator, which is located in 
-         <literal>webbeans-translator-ear</literal> module. Maven automatically
-         generates the <literal>application.xml</literal> and 
-         <literal>jboss-app.xml</literal> for us:
-      </para>
-      
-      <programlisting role="XML"><![CDATA[<plugin>
-   <groupId>org.apache.maven.plugins</groupId>
-   <artifactId>maven-ear-plugin</artifactId>
-   <configuration>
-      <modules>
-         <webModule>
-            <groupId>org.jboss.webbeans.examples.translator</groupId>
-            <artifactId>webbeans-translator-war</artifactId>
-            <contextRoot>/webbeans-translator</contextRoot>
-         </webModule>
-      </modules>
-      <jboss>
-         <loader-repository>webbeans.jboss.org:loader=webbeans-translator</loader-repository>
-      </jboss>
-   </configuration>
-</plugin>]]></programlisting>
-
-      <para>
-         We're doing a couple of things here - firstly we set the context path,
-         which gives us a nice url 
-         (<ulink url="http://localhost:8080/webbeans-translator">http://localhost:8080/webbeans-translator</ulink>)
-         and we also enable class loader isolation for JBoss AS.
-      </para>
-      
-      <tip>
-         <para>
-            If you aren't using Maven to generate these files, you would need
-            <literal>META-INF/jboss-app.xml</literal>:
-         </para>
-
-         <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE jboss-app
-    PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"
-    "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd">
-<jboss-app>
-  <loader-repository>webbeans.jboss.org:loader=webbeans-translator</loader-repository>
-</jboss-app>]]></programlisting>
-
-         <para>
-            and <literal>META-INF/application.xml</literal>:
-         </para>
-         
-         <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<application 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/application_5.xsd"
-             version="5">
-  <display-name>webbeans-translator-ear</display-name>
-  <description>Ear Example for the reference implementation of JSR 299: Web Beans</description>
-  
-  <module>
-    <web>
-      <web-uri>webbeans-translator.war</web-uri>
-      <context-root>/webbeans-translator</context-root>
-    </web>
-  </module>
-  <module>
-    <ejb>webbeans-translator.jar</ejb>
-  </module>
-</application>]]></programlisting>
-      </tip>
-      
-      <para>
-         Next, lets look at the war. Just as in the numberguess example, we have
-         a <literal>faces-config.xml</literal> (to enabled Facelets) and a 
-         <literal>web.xml</literal> (to enable JSF and attach Web Beans services
-         to the servlet container) in <literal>WebContent/WEB-INF</literal>.
-      </para>
-      
-      <para>
-         More intersting is the facelet used to translate text. Just as in
-         the numberguess example we have a template, which surrounds the form
-         (ommitted here for brevity):
-      </para>
-      
-      <programlisting role="XML"><![CDATA[<h:form id="NumberGuessMain">
-            
-   <table>
-      <tr align="center" style="font-weight: bold" >
-         <td>
-            Your text
-         </td>
-         <td>
-            Translation
-         </td>
-      </tr>
-      <tr>
-         <td>
-            <h:inputTextarea id="text" value="#{translator.text}" required="true" rows="5" cols="80" />
-         </td>
-         <td>
-            <h:outputText value="#{translator.translatedText}" />
-         </td>
-      </tr>
-   </table>
-   <div>
-      <h:commandButton id="button" value="Translate" action="#{translator.translate}"/>
-   </div>
-   
-</h:form>]]></programlisting>
-
-      <para>
-         The user can enter some text in the lefthand textarea, and hit the 
-         translate button to see the result to the right.
-      </para>
-      
-      <para>
-         Finally, let's look at the ejb module, 
-         <literal>webbeans-translator-ejb</literal>.
-         There are two configuration files in 
-         <literal>src/main/resources/META-INF</literal>, an empty
-         <literal>web-beans.xml</literal>, used to mark the archive as 
-         containing Web Beans, and <literal>ejb-jar.xml</literal>. Web Beans
-         provides injection and initializtion services for all EJBs, and uses 
-         <literal>ejb-jar.xml</literal> to enable this, you'll need this in any
-         EJB project which uses Web Beans:
-      </para>
-      
-      <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<ejb-jar 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/ejb-jar_3_0.xsd"
-         version="3.0">
-         
-   <interceptors>
-     <interceptor>
-       <interceptor-class>org.jboss.webbeans.ejb.SessionBeanInterceptor</interceptor-class>
-     </interceptor>
-   </interceptors>
-   
-   <assembly-descriptor>
-      <interceptor-binding>
-         <ejb-name>*</ejb-name>
-         <interceptor-class>org.jboss.webbeans.ejb.SessionBeanInterceptor</interceptor-class>
-      </interceptor-binding>
-   </assembly-descriptor>
-   
-</ejb-jar>]]></programlisting>
-
-      <para>
-         We've saved the most interesting bit to last, the code! The project has
-         two simple beans, <literal>SentanceParser</literal> and
-         <literal>TextTranslator</literal> and two enterprise beans,
-         <literal>TanslatorControllerBean</literal> and 
-         <literal>SentenceTranslator</literal>. You should be getting quite
-         familiar with what a Web Bean looks like by now, so we'll just 
-         highlight the most interesting bits here.
-      </para>
-      
-      <para>
-         Both <literal>SentanceParser</literal> and 
-         <literal>TextTranslator</literal> are dependent beans, and 
-         <literal>TextTranslator</literal> uses constructor initialization:
-      </para>
-      
-      <programlisting role="JAVA"><![CDATA[public class TextTranslator { 
-   private SentenceParser sentenceParser; 
-   private Translator sentenceTranslator; 
-   
-   @Initializer
-   TextTranslator(SentenceParser sentenceParser, Translator sentenceTranslator) 
-   { 
-      this.sentenceParser = sentenceParser; 
-      this.sentenceTranslator = sentenceTranslator;]]></programlisting>
-      
-      <para>
-         <literal>TextTranslator</literal> is a stateless bean (with a local 
-         business interface), where the magic happens - of course, we couldn't 
-         develop a full translator, but we gave it a good go!
-      </para>
-      
-      <para>
-         Finally, there is UI orientated controller, that collects the text from
-         the user, and dispatches it to the translator. This is a request 
-         scoped, named, stateful session bean, which injects the translator.
-      </para>
-      
-      <programlisting role="JAVA"><![CDATA[@Stateful
- at RequestScoped
- at Named("translator")
-public class TranslatorControllerBean implements TranslatorController
-{
-   
-   @Current TextTranslator translator;]]></programlisting>
-   
-      <para>
-         The bean also has getters and setters for all the fields on the page.
-      </para>
-      
-      <para>
-         As this is a stateful session bean, we have to have a remove method:
-      </para>
-      
-      <programlisting role="JAVA"><![CDATA[   @Remove
-   public void remove()
-   {
-      
-   }]]></programlisting>
-   
-      <para>
-         The Web Beans manager will call the remove method for you when the bean
-         is destroyed; in this case at the end of the request.
-      </para>
-   </section>
-   
-   <para>
-      That concludes our short tour of the Web Beans RI examples. For more on 
-      the RI, or to help out, please visit 
-      <ulink url="http://www.seamframework.org/WebBeans/Development">http://www.seamframework.org/WebBeans/Development</ulink>.
-   </para>
-   
-   <para>
-      We need help in all areas - bug fixing, writing new features, writing
-      examples and translating this reference guide.
-   </para>
-
-</chapter>
\ No newline at end of file

Copied: doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/en/modules/ri.xml (from rev 679, doc/trunk/reference/en/modules/ri.xml)
===================================================================
--- doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/en/modules/ri.xml	                        (rev 0)
+++ doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/en/modules/ri.xml	2008-12-22 11:52:13 UTC (rev 681)
@@ -0,0 +1,744 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"  [ ]>
+
+<chapter id="ri">
+   <title>The Web Beans Reference Implementation</title>
+
+   <para>
+     The Web Beans Reference Implementation is being developed at
+     <ulink url="http://seamframework.org/WebBeans">the Seam project</ulink>.
+     You can download the latest developer release of Web Beans from the
+     <ulink url="http://seamframework.org/Download">the downloads page</ulink>.
+   </para> 
+
+    <para>
+      The Web Beans RI comes with a two deployable example applications:
+      <literal>webbeans-numberguess</literal>, a war example, containing only
+      simple beans, and <literal>webbeans-translator</literal> an ear example,
+      containing enterprise beans. To run the examples you'll need the following:
+   </para>
+   
+   <itemizedlist>
+     <listitem>
+       <para>the latest release of the Web Beans RI,</para>
+     </listitem>
+     <listitem>
+       <para>JBoss AS 5.0.0.GA, and</para>
+     </listitem>
+     <listitem>
+       <para>Ant 1.7.0.</para>
+     </listitem>
+   </itemizedlist>
+   
+   <para>
+      Currently, the Web Beans RI only runs on JBoss Application Server 5. 
+      You'll need to download JBoss AS 5.0.0.GA from 
+      <ulink url="http://www.jboss.org/jbossas/downloads/">jboss.org</ulink>,
+      and unzip it. For example:
+   </para>
+   
+   <programlisting><![CDATA[$ cd /Applications
+$ unzip ~/jboss-5.0.0.GA.zip]]></programlisting>
+
+   <para>
+      Next, download the Web Beans RI from 
+      <ulink url="http://seamframework.org/Download">seamframework.org</ulink>,
+      and unzip it. For example
+   </para>
+   
+   <programlisting><![CDATA[$ cd ~/
+$ unzip ~/webbeans-1.0.0.ALPHA1.zip]]></programlisting>
+
+   
+   <para>
+      Next, we need to tell Web Beans where JBoss is located. Edit
+      <literal>jboss-as/build.properties</literal> and set the
+      <literal>jboss.home</literal> property. For example:
+   </para>
+   
+   <programlisting>jboss.home=/Applications/jboss-5.0.0.GA</programlisting>
+
+   <para>
+      As Web Beans is a new piece of software, you need to update JBoss AS to 
+      run the Web Beans RI. Future versions of JBoss AS will include these
+      updates, and this step won't be necessary.
+   </para>
+   
+   <note>
+      <para>
+         Currently, two updates are needed. Firstly, a new deployer,
+         <literal>webbeans.deployer</literal> is added. This adds supports for
+         Web Bean archives to JBoss AS, and allows the Web Beans RI to query the
+         EJB3 container and discover which EJBs are installed in your 
+         application. Secondly, an update to JBoss EJB3 is needed.
+      </para>
+   </note>
+   
+   <para>
+      To install the update, you'll need Ant 1.7.0 installed, and the 
+      <literal>ANT_HOME</literal> environment variable set. For example:
+   </para>
+   
+      <programlisting>$ unzip apache-ant-1.7.0.zip
+$ export ANT_HOME=~/apache-ant-1.7.0</programlisting>
+
+   <para>
+      Then, you can install the update. The update script will use Maven to
+      download the Web Beans and EJB3 automatically.
+   </para>
+   
+   <programlisting>$ cd webbeans-1.0.0.ALPHA1/jboss-as
+$ ant update</programlisting>
+
+   <para>
+      Now, you're ready to deploy your first example!
+   </para>
+   
+   <tip>
+      <para>
+         The build scripts for the examples offer a number of targets, these 
+         are:
+      </para>
+      <itemizedlist>
+         <listitem>
+            <para>
+               <literal>ant restart</literal> - deploy the example in exploded 
+               format
+            </para>
+         </listitem>
+         <listitem>
+            <para>
+               <literal>ant explode</literal> - update an exploded example, without
+               restarting the deployment
+            </para>
+         </listitem>
+         <listitem>
+            <para>
+               <literal>ant deploy</literal> - deploy the example in compressed jar format
+            </para>
+         </listitem>
+         <listitem>
+            <para>
+               <literal>ant undeploy</literal> - remove the example from the server
+            </para>
+         </listitem>
+         <listitem>
+            <para>
+               <literal>ant clean</literal> - clean the example
+           </para>
+         </listitem>
+      </itemizedlist>
+   </tip>
+
+   <para>
+      To deploy the numberguess example:
+   </para>
+
+   <programlisting>$ cd examples/numberguess
+ant deploy</programlisting>
+
+   <para>
+      Wait for the application to deploy, and enjoy hours of fun at
+      <ulink url="http://localhost:8080/webbeans-numberguess" />!
+   </para>
+   
+   <para>
+      The Web Beans RI includes a second simple example that will translate your text
+      into Latin. The numberguess example is a war example, and uses only simple
+      beans; the translator example is an ear example, and includes enterprise
+      beans, packaged in an EJB module. To try it out:
+   </para>
+
+   <programlisting>$ cd examples/translator
+ant deploy</programlisting>
+
+   <para>
+      Wait for the application to deploy, and visit
+      <ulink url="http://localhost:8080/webbeans-translator" />!
+   </para>
+   
+   <section>
+      <title>The numberguess example</title>
+      
+      <para>
+         In the numberguess application you get given 10 attempts to guess a
+         number between 1 and 100. After each attempt, you will be told whether
+         you are too high, or too low.
+      </para>
+      
+      <para>
+         The numberguess example is comprised of a number of Web Beans, 
+         configuration files, and Facelet JSF pages, packaged as a war. Let's 
+         start with the configuration files.
+      </para>
+      
+      <para>
+          All the configuration files for this example are located in 
+          <literal>WEB-INF/</literal>, which is stored in
+          <literal>WebContent</literal> in the source tree. First, we have 
+          <literal>faces-config.xml</literal>, in which we tell JSF to use
+          Facelets:
+      </para>
+      
+      <programlisting role="XML"><![CDATA[<?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>]]></programlisting>
+
+      <para>
+         There is an empty <literal>web-beans.xml</literal> file, which marks
+         this application as a Web Beans application.
+      </para>
+      
+      <para>
+         Finally there is <literal>web.xml</literal>:
+      </para>
+      
+      <programlistingco>
+         <areaspec>
+            <area id="faces.servlet" coords="12" />
+            <area id="faces.servlet.mapping" coords="18" />
+            <area id="faces.default.suffix" coords="23" />
+            <area id="session.timeout" coords="28" />
+            <area id="webbeans.listener" coords="32" />
+         </areaspec>
+         <programlisting><![CDATA[<?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 Numbergues 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>
+   
+    <listener>
+       <listener-class>org.jboss.webbeans.servlet.WebBeansListener</listener-class>
+    </listener>
+
+</web-app>]]></programlisting>
+         <calloutlist>
+            <callout arearefs="faces.servlet">
+               <para>
+                  Enable and load the JSF servlet
+               </para>
+            </callout>
+            <callout arearefs="faces.servlet.mapping">
+               <para>
+                  Configure requests to <literal>.jsf</literal> pages to be
+                  handled by JSF
+               </para>
+            </callout>
+            <callout arearefs="faces.default.suffix">
+               <para>
+                  Tell JSF that we will be giving our source files (facelets) an
+                  extension of <literal>.jsf</literal>
+               </para>
+            </callout>
+            <callout arearefs="session.timeout">
+               <para>
+                  Configure a session timeout of 10 minutes
+               </para>
+            </callout>
+            <callout arearefs="webbeans.listener">
+               <para>
+                  Configure the Web Beans listener, so that Web Beans services
+                  can be used in the servlet request
+               </para>
+            </callout>
+         </calloutlist>
+      </programlistingco>
+      
+      <note>
+         <para>
+            The only configuration required by the Web Beans RI in 
+            <literal>web.xml</literal> is to add the Web Beans listener.
+         </para>
+         <para>
+            Whilst this demo is a JSF demo, you can use the Web Beans RI with 
+            any Servlet based web framework; just configure the Web Beans 
+            listener.
+         </para>
+      </note>
+      
+      <para>
+         Let's take a look at the Facelet view:
+      </para>
+      
+      <programlistingco>
+         <areaspec>
+            <area id="template" coords="8" />
+            <area id="messages" coords="12" />
+            <area id="instructions" coords="19" />
+            <area id="guess" coords="25" />
+            <area id="validator" coords="29" />
+            <area id="submit" coords="32" />
+         </areaspec>
+         <programlisting><![CDATA[<!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"
+    xmlns:s="http://jboss.com/products/seam/taglib">
+
+  <ui:composition template="template.xhtml">
+    <ui:define name="content">
+       <h1>Guess a number...</h1>
+       <h:form id="NumberGuessMain">
+          <div style="color: red">
+             <h:messages id="messages" globalOnly="false"/>
+             <h:outputText id="Higher" value="Higher!" rendered="#{game.number gt game.guess}"/>
+             <h:outputText id="Lower" value="Lower!" rendered="#{game.number lt game.guess}"/>
+          </div>
+   
+          <div>
+             I'm thinking of a number between #{game.smallest} and #{game.biggest}.
+             You have #{game.remainingGuesses} guesses.
+          </div>
+     
+          <div>
+             Your guess: 
+             <h:inputText id="inputGuess" 
+                          value="#{game.guess}" 
+                          required="true" 
+                          size="3">
+                <f:validateLongRange maximum="#{game.biggest}" 
+                                     minimum="#{game.smallest}"/>
+             </h:inputText>
+            <h:commandButton id="GuessButton" 
+                             value="Guess" 
+                             action="#{game.check}"/>
+          </div>
+   
+       </h:form>
+    </ui:define>
+  </ui:composition>
+</html>]]></programlisting>
+         <calloutlist>
+            <callout arearefs="template">
+               <para>
+                  Facelets is a templating language for JSF, here we are 
+                  wrapping our page in a template which defines the header.
+               </para>
+            </callout>
+            <callout arearefs="messages">
+               <para>
+                  There are a number of messages which can be sent to the user,
+                  "Higher!", "Lower!" and "Correct!"
+               </para>
+            </callout>
+            <callout arearefs="instructions">
+               <para>
+                  As the user guesses, the range of numbers they can guess gets
+                  smaller - this sentance changes to make sure they know what 
+                  range to guess in.
+               </para>
+            </callout>
+            <callout arearefs="guess">
+               <para>
+                  This input field is bound to a Web Bean, using the value
+                  expression.
+               </para>
+            </callout>
+            <callout arearefs="validator">
+               <para>
+                  A range validator is used to make sure the user doesn't
+                  accidentally input a number outside of the range in which they
+                  can guess - if the validator wasn't here, the user might use
+                  up a guess on an out of range number.
+               </para>
+            </callout>
+            <callout arearefs="submit">
+               <para>
+                  And, of course, there must be a way for the user to send their
+                  guess to the server. Here we bind to an action method on the
+                  Web Bean.
+               </para>
+            </callout>
+         </calloutlist>
+      </programlistingco>
+      
+      <para>
+         The example exists of 4 classes, the first two of which are binding
+         types. First, there is the <literal>@Random</literal> binding type, 
+         used for injecting a random number:
+      </para>
+      
+      <programlisting role="JAVA"><![CDATA[@Target( { TYPE, METHOD, PARAMETER, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at BindingType
+public @interface Random {}]]></programlisting>
+
+      <para>
+         There is also the <literal>@MaxNumber</literal> binding type, used for
+         injecting the maximum number that can be injected:
+      </para>
+      
+      <programlisting role="JAVA"><![CDATA[@Target( { TYPE, METHOD, PARAMETER, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at BindingType
+public @interface MaxNumber {}
+]]></programlisting>
+
+      <para>
+         The <literal>Generator</literal> class is responsible for creating the
+         random number, via a producer method. It also exposes the maximum
+         possible number via a producer method:
+      </para>
+
+      <programlisting role="JAVA"><![CDATA[@ApplicationScoped
+public class Generator {
+   
+   private java.util.Random random = new java.util.Random( System.currentTimeMillis() );
+   
+   private int maxNumber = 100;
+   
+   java.util.Random getRandom()
+   {
+      return random;
+   }
+   
+   @Produces @Random int next() { 
+      return getRandom().nextInt(maxNumber); 
+   }
+   
+   @Produces @MaxNumber int getMaxNumber()
+   {
+      return maxNumber;
+   }
+
+}]]></programlisting>
+
+      <para>
+         You'll notice that the <literal>Generator</literal> is application
+         scoped; therefore we don't get a different random each time.
+      </para>
+      
+      <para>
+         The final Web Bean in the application is the session scoped
+         <literal>Game</literal>. By making <literal>Game</literal> session 
+         scoped, you can only play the game once per browser session. You could
+         easily add a reset button - a good exercise for the reader :-)
+      </para>
+      
+      <para>
+         You'll also note that we've used the <literal>@Named</literal> 
+         annotation, so that we can use the bean through EL in the JSF page.
+         Finally, we've used constructor injection to initialize the game with
+         a random number. And of course, we need to tell the player when they've
+         won, so we give feedback with a <literal>FacesMessage</literal>.
+      </para>
+      
+      <programlisting role="JAVA"><![CDATA[@Named
+ at SessionScoped
+public class Game {
+   private int number;
+   
+   private int guess;
+   private int smallest;
+   private int biggest;
+   private int remainingGuesses;
+   
+   public Game() {}
+   
+   @Initializer
+   Game(@Random int number, @MaxNumber int maxNumber) {
+      this.number = number;
+      this.smallest = 1;
+      this.biggest = maxNumber;
+      this.remainingGuesses = 10;
+   }
+
+   // Getters and setters for fields
+   
+   public String check() {
+      if (guess>number) {
+         biggest = guess - 1;
+      }
+      if (guess<number) {
+         smallest = guess + 1;
+      }
+      if (guess == number) {
+         FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Correct!"));
+      }
+      remainingGuesses--;
+      return null;
+   }
+   
+}]]></programlisting>
+   </section>
+   
+   <section>
+      <title>The translator example</title>
+      
+      <para>
+         The translator example will take any sentences you enter, and translate
+         them to Latin.
+      </para>
+      
+      <para>
+         The translator example is built as an ear, and contains EJBs and 
+         enterprise beans. As a result, it's structure is more complex than
+         the numberguess example.
+      </para>
+      
+      <note>
+         <para>
+            EJB 3.1 and Jave EE 6 allow you to package EJBs in a war, which will
+            make this structure much simpler!
+         </para>
+      </note>
+      
+      <para>
+         First, let's take a look at the ear aggregator, which is located in 
+         <literal>webbeans-translator-ear</literal> module. Maven automatically
+         generates the <literal>application.xml</literal> and 
+         <literal>jboss-app.xml</literal> for us:
+      </para>
+      
+      <programlisting role="XML"><![CDATA[<plugin>
+   <groupId>org.apache.maven.plugins</groupId>
+   <artifactId>maven-ear-plugin</artifactId>
+   <configuration>
+      <modules>
+         <webModule>
+            <groupId>org.jboss.webbeans.examples.translator</groupId>
+            <artifactId>webbeans-translator-war</artifactId>
+            <contextRoot>/webbeans-translator</contextRoot>
+         </webModule>
+      </modules>
+      <jboss>
+         <loader-repository>webbeans.jboss.org:loader=webbeans-translator</loader-repository>
+      </jboss>
+   </configuration>
+</plugin>]]></programlisting>
+
+      <para>
+         We're doing a couple of things here - firstly we set the context path,
+         which gives us a nice url 
+         (<ulink url="http://localhost:8080/webbeans-translator">http://localhost:8080/webbeans-translator</ulink>)
+         and we also enable class loader isolation for JBoss AS.
+      </para>
+      
+      <tip>
+         <para>
+            If you aren't using Maven to generate these files, you would need
+            <literal>META-INF/jboss-app.xml</literal>:
+         </para>
+
+         <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss-app
+    PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd">
+<jboss-app>
+  <loader-repository>webbeans.jboss.org:loader=webbeans-translator</loader-repository>
+</jboss-app>]]></programlisting>
+
+         <para>
+            and <literal>META-INF/application.xml</literal>:
+         </para>
+         
+         <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<application 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/application_5.xsd"
+             version="5">
+  <display-name>webbeans-translator-ear</display-name>
+  <description>Ear Example for the reference implementation of JSR 299: Web Beans</description>
+  
+  <module>
+    <web>
+      <web-uri>webbeans-translator.war</web-uri>
+      <context-root>/webbeans-translator</context-root>
+    </web>
+  </module>
+  <module>
+    <ejb>webbeans-translator.jar</ejb>
+  </module>
+</application>]]></programlisting>
+      </tip>
+      
+      <para>
+         Next, lets look at the war. Just as in the numberguess example, we have
+         a <literal>faces-config.xml</literal> (to enabled Facelets) and a 
+         <literal>web.xml</literal> (to enable JSF and attach Web Beans services
+         to the servlet container) in <literal>WebContent/WEB-INF</literal>.
+      </para>
+      
+      <para>
+         More intersting is the facelet used to translate text. Just as in
+         the numberguess example we have a template, which surrounds the form
+         (ommitted here for brevity):
+      </para>
+      
+      <programlisting role="XML"><![CDATA[<h:form id="NumberGuessMain">
+            
+   <table>
+      <tr align="center" style="font-weight: bold" >
+         <td>
+            Your text
+         </td>
+         <td>
+            Translation
+         </td>
+      </tr>
+      <tr>
+         <td>
+            <h:inputTextarea id="text" value="#{translator.text}" required="true" rows="5" cols="80" />
+         </td>
+         <td>
+            <h:outputText value="#{translator.translatedText}" />
+         </td>
+      </tr>
+   </table>
+   <div>
+      <h:commandButton id="button" value="Translate" action="#{translator.translate}"/>
+   </div>
+   
+</h:form>]]></programlisting>
+
+      <para>
+         The user can enter some text in the lefthand textarea, and hit the 
+         translate button to see the result to the right.
+      </para>
+      
+      <para>
+         Finally, let's look at the ejb module, 
+         <literal>webbeans-translator-ejb</literal>.
+         There are two configuration files in 
+         <literal>src/main/resources/META-INF</literal>, an empty
+         <literal>web-beans.xml</literal>, used to mark the archive as 
+         containing Web Beans, and <literal>ejb-jar.xml</literal>. Web Beans
+         provides injection and initializtion services for all EJBs, and uses 
+         <literal>ejb-jar.xml</literal> to enable this, you'll need this in any
+         EJB project which uses Web Beans:
+      </para>
+      
+      <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar 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/ejb-jar_3_0.xsd"
+         version="3.0">
+         
+   <interceptors>
+     <interceptor>
+       <interceptor-class>org.jboss.webbeans.ejb.SessionBeanInterceptor</interceptor-class>
+     </interceptor>
+   </interceptors>
+   
+   <assembly-descriptor>
+      <interceptor-binding>
+         <ejb-name>*</ejb-name>
+         <interceptor-class>org.jboss.webbeans.ejb.SessionBeanInterceptor</interceptor-class>
+      </interceptor-binding>
+   </assembly-descriptor>
+   
+</ejb-jar>]]></programlisting>
+
+      <para>
+         We've saved the most interesting bit to last, the code! The project has
+         two simple beans, <literal>SentanceParser</literal> and
+         <literal>TextTranslator</literal> and two enterprise beans,
+         <literal>TanslatorControllerBean</literal> and 
+         <literal>SentenceTranslator</literal>. You should be getting quite
+         familiar with what a Web Bean looks like by now, so we'll just 
+         highlight the most interesting bits here.
+      </para>
+      
+      <para>
+         Both <literal>SentanceParser</literal> and 
+         <literal>TextTranslator</literal> are dependent beans, and 
+         <literal>TextTranslator</literal> uses constructor initialization:
+      </para>
+      
+      <programlisting role="JAVA"><![CDATA[public class TextTranslator { 
+   private SentenceParser sentenceParser; 
+   private Translator sentenceTranslator; 
+   
+   @Initializer
+   TextTranslator(SentenceParser sentenceParser, Translator sentenceTranslator) 
+   { 
+      this.sentenceParser = sentenceParser; 
+      this.sentenceTranslator = sentenceTranslator;]]></programlisting>
+      
+      <para>
+         <literal>TextTranslator</literal> is a stateless bean (with a local 
+         business interface), where the magic happens - of course, we couldn't 
+         develop a full translator, but we gave it a good go!
+      </para>
+      
+      <para>
+         Finally, there is UI orientated controller, that collects the text from
+         the user, and dispatches it to the translator. This is a request 
+         scoped, named, stateful session bean, which injects the translator.
+      </para>
+      
+      <programlisting role="JAVA"><![CDATA[@Stateful
+ at RequestScoped
+ at Named("translator")
+public class TranslatorControllerBean implements TranslatorController
+{
+   
+   @Current TextTranslator translator;]]></programlisting>
+   
+      <para>
+         The bean also has getters and setters for all the fields on the page.
+      </para>
+      
+      <para>
+         As this is a stateful session bean, we have to have a remove method:
+      </para>
+      
+      <programlisting role="JAVA"><![CDATA[   @Remove
+   public void remove()
+   {
+      
+   }]]></programlisting>
+   
+      <para>
+         The Web Beans manager will call the remove method for you when the bean
+         is destroyed; in this case at the end of the request.
+      </para>
+   </section>
+   
+   <para>
+      That concludes our short tour of the Web Beans RI examples. For more on 
+      the RI, or to help out, please visit 
+      <ulink url="http://www.seamframework.org/WebBeans/Development">http://www.seamframework.org/WebBeans/Development</ulink>.
+   </para>
+   
+   <para>
+      We need help in all areas - bug fixing, writing new features, writing
+      examples and translating this reference guide.
+   </para>
+
+</chapter>
\ No newline at end of file

Deleted: doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/pom.xml
===================================================================
--- doc/trunk/reference/pom.xml	2008-12-21 05:46:06 UTC (rev 650)
+++ doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/pom.xml	2008-12-22 11:52:13 UTC (rev 681)
@@ -1,169 +0,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/xsd/maven-4.0.0.xsd">
-
-   <modelVersion>4.0.0</modelVersion>
-
-   <groupId>org.jboss.webbeans.reference-guide</groupId>
-   <artifactId>webbeans-reference-guide</artifactId>
-   <version>1.0.0-SNAPSHOT</version>
-   <packaging>jdocbook</packaging>
-   <name>Web Beans Reference Guide</name>
-
-   <pluginRepositories>
-      <pluginRepository>
-         <id>repository.jboss.org</id>
-         <name>JBoss Repository</name>
-         <url>http://repository.jboss.org/maven2</url>
-      </pluginRepository>
-   </pluginRepositories>
-   <repositories>
-      <repository>
-         <id>repository.jboss.org</id>
-         <name>JBoss Repository</name>
-         <url>http://repository.jboss.org/maven2</url>
-      </repository>
-   </repositories>
-
-   <build>
-      <defaultGoal>process-classes</defaultGoal>
-      <plugins>
-         <plugin>
-            <groupId>org.jboss.maven.plugins</groupId>
-            <artifactId>maven-jdocbook-plugin</artifactId>
-            
-            <extensions>true</extensions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.jboss.webbeans</groupId>
-                  <artifactId>webbeans-docbook-xslt</artifactId>
-                  <version>1.1.1.BETA2</version>
-                  <exclusions>
-                     <exclusion>
-                        <groupId>org.eclipse.wst.css</groupId>
-                        <artifactId>core</artifactId>
-                     </exclusion>
-                     <exclusion>
-                        <groupId>org.eclipse.wst.sse</groupId>
-                        <artifactId>core</artifactId>
-                     </exclusion>
-                  </exclusions>
-               </dependency>
-               <dependency>
-                  <groupId>org.jboss.seam</groupId>
-                  <artifactId>seam-jdocbook-style</artifactId>
-                  <version>1.1.0.GA</version>
-                  <type>jdocbook-style</type>
-               </dependency>
-               <dependency>
-                  <groupId>org.jboss</groupId>
-                  <artifactId>jbossorg-jdocbook-style</artifactId>
-                  <version>1.1.0</version>
-                  <type>jdocbook-style</type>
-               </dependency>
-            </dependencies>
-            <configuration>
-               <sourceDirectory>${pom.basedir}</sourceDirectory>
-               <sourceDocumentName>master.xml</sourceDocumentName>
-               <masterTranslation>en</masterTranslation>
-               <translations>
-                 <translation>it-IT</translation>
-               </translations>
-               <imageResource>
-                  <directory>${pom.basedir}/en</directory>
-                  <includes>
-                     <include>images/*.png</include>
-                  </includes>
-               </imageResource>
-               <formats>
-                  <format>
-                     <formatName>pdf</formatName>
-                     <stylesheetResource>
-                        classpath:/xslt/org/jboss/webbeans/pdf.xsl
-                     </stylesheetResource>
-                     <finalName>webbeans_reference.pdf</finalName>
-                  </format>
-                  <format>
-                     <formatName>html</formatName>
-                     <stylesheetResource>
-                        classpath:/xslt/org/jboss/webbeans/xhtml.xsl
-                     </stylesheetResource>
-                     <finalName>index.html</finalName>
-                  </format>
-                  <format>
-                     <formatName>html_single</formatName>
-                     <stylesheetResource>
-                        classpath:/xslt/org/jboss/webbeans/xhtml-single.xsl
-                     </stylesheetResource>
-                     <finalName>index.html</finalName>
-                  </format>
-               </formats>
-               <options>
-                  <xincludeSupported>true</xincludeSupported>
-                  <xmlTransformerType>saxon</xmlTransformerType>
-                  <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
-                  <!--     could also locate the docbook dependency and inspect its version... -->
-                  <docbookVersion>1.72.0</docbookVersion>
-                  <localeSeparator>-</localeSeparator>
-               </options>
-            </configuration>
-         </plugin>
-         <plugin>
-            <artifactId>maven-antrun-plugin</artifactId>
-            <executions>
-               <execution>
-                  <phase>process-classes</phase>
-                  <configuration>
-                     <tasks>
-                        <copy file="${basedir}/target/docbook/publish/en/pdf/webbeans_reference.pdf" todir="${basedir}" />
-                     </tasks>
-                  </configuration>
-                  <goals>
-                     <goal>run</goal>
-                  </goals>
-               </execution>
-            </executions>
-         </plugin>
-      </plugins>
-      <pluginManagement>
-         <plugins>
-            <plugin>
-               <groupId>org.apache.maven.plugins</groupId>
-               <artifactId>maven-dependency-plugin</artifactId>
-               <version>2.0</version>
-            </plugin>
-            <plugin>
-               <groupId>org.jboss.maven.plugins</groupId>
-               <artifactId>maven-jdocbook-plugin</artifactId>
-               <version>2.1.1</version>
-            </plugin>
-         </plugins>
-      </pluginManagement>
-   </build>
-   
-   <profiles>
-      <profile>
-         <activation>
-            <property>
-               <name>build.translations</name>  
-            </property>
-         </activation>
-         <build>
-            <plugins>
-               <plugin>
-               <groupId>org.jboss.maven.plugins</groupId>
-               <artifactId>maven-jdocbook-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <phase>process-resources</phase>
-                        <goals>
-                           <goal>translate</goal>
-                        </goals>
-                     </execution>
-                  </executions>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
-</project>

Copied: doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/pom.xml (from rev 680, doc/trunk/reference/pom.xml)
===================================================================
--- doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/pom.xml	                        (rev 0)
+++ doc/tags/webbeans-reference-guide-1.0.0.ALPHA1/pom.xml	2008-12-22 11:52:13 UTC (rev 681)
@@ -0,0 +1,205 @@
+<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/xsd/maven-4.0.0.xsd">
+
+   <modelVersion>4.0.0</modelVersion>
+
+   <groupId>org.jboss.webbeans.reference-guide</groupId>
+   <artifactId>webbeans-reference-guide</artifactId>
+   <version>1.0.0.ALPHA1</version>
+   <packaging>jdocbook</packaging>
+   <name>Web Beans Reference Guide</name>
+
+   <pluginRepositories>
+      <pluginRepository>
+         <id>repository.jboss.org</id>
+         <name>JBoss Repository</name>
+         <url>http://repository.jboss.org/maven2</url>
+      </pluginRepository>
+   </pluginRepositories>
+   <repositories>
+      <repository>
+         <id>repository.jboss.org</id>
+         <name>JBoss Repository</name>
+         <url>http://repository.jboss.org/maven2</url>
+      </repository>
+   </repositories>
+
+   <build>
+      <defaultGoal>process-classes</defaultGoal>
+      <plugins>
+         <plugin>
+            <groupId>org.jboss.maven.plugins</groupId>
+            <artifactId>maven-jdocbook-plugin</artifactId>
+            
+            <extensions>true</extensions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.jboss.webbeans</groupId>
+                  <artifactId>webbeans-docbook-xslt</artifactId>
+                  <version>1.1.1.BETA2</version>
+                  <exclusions>
+                     <exclusion>
+                        <groupId>org.eclipse.wst.css</groupId>
+                        <artifactId>core</artifactId>
+                     </exclusion>
+                     <exclusion>
+                        <groupId>org.eclipse.wst.sse</groupId>
+                        <artifactId>core</artifactId>
+                     </exclusion>
+                  </exclusions>
+               </dependency>
+               <dependency>
+                  <groupId>org.jboss.seam</groupId>
+                  <artifactId>seam-jdocbook-style</artifactId>
+                  <version>1.1.0.GA</version>
+                  <type>jdocbook-style</type>
+               </dependency>
+               <dependency>
+                  <groupId>org.jboss</groupId>
+                  <artifactId>jbossorg-jdocbook-style</artifactId>
+                  <version>1.1.0</version>
+                  <type>jdocbook-style</type>
+               </dependency>
+            </dependencies>
+            <configuration>
+               <sourceDirectory>${pom.basedir}</sourceDirectory>
+               <sourceDocumentName>master.xml</sourceDocumentName>
+               <masterTranslation>en</masterTranslation>
+               <translations>
+                 <translation>it-IT</translation>
+               </translations>
+               <imageResource>
+                  <directory>${pom.basedir}/en</directory>
+                  <includes>
+                     <include>images/*.png</include>
+                  </includes>
+               </imageResource>
+               <formats>
+                  <format>
+                     <formatName>pdf</formatName>
+                     <stylesheetResource>
+                        classpath:/xslt/org/jboss/webbeans/pdf.xsl
+                     </stylesheetResource>
+                     <finalName>webbeans_reference.pdf</finalName>
+                  </format>
+                  <format>
+                     <formatName>html</formatName>
+                     <stylesheetResource>
+                        classpath:/xslt/org/jboss/webbeans/xhtml.xsl
+                     </stylesheetResource>
+                     <finalName>index.html</finalName>
+                  </format>
+                  <format>
+                     <formatName>html_single</formatName>
+                     <stylesheetResource>
+                        classpath:/xslt/org/jboss/webbeans/xhtml-single.xsl
+                     </stylesheetResource>
+                     <finalName>index.html</finalName>
+                  </format>
+               </formats>
+               <options>
+                  <xincludeSupported>true</xincludeSupported>
+                  <xmlTransformerType>saxon</xmlTransformerType>
+                  <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+                  <!--     could also locate the docbook dependency and inspect its version... -->
+                  <docbookVersion>1.72.0</docbookVersion>
+                  <localeSeparator>-</localeSeparator>
+               </options>
+            </configuration>
+         </plugin>
+         <plugin>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+               <execution>
+                  <phase>process-classes</phase>
+                  <configuration>
+                     <tasks>
+                        <copy file="${basedir}/target/docbook/publish/en/pdf/webbeans_reference.pdf" todir="${basedir}" />
+                     </tasks>
+                  </configuration>
+                  <goals>
+                     <goal>run</goal>
+                  </goals>
+               </execution>
+            </executions>
+         </plugin>
+      </plugins>
+      <pluginManagement>
+         <plugins>
+            <plugin>
+               <groupId>org.apache.maven.plugins</groupId>
+               <artifactId>maven-dependency-plugin</artifactId>
+               <version>2.0</version>
+            </plugin>
+            <plugin>
+               <groupId>org.jboss.maven.plugins</groupId>
+               <artifactId>maven-jdocbook-plugin</artifactId>
+               <version>2.1.1</version>
+            </plugin>
+         </plugins>
+      </pluginManagement>
+   </build>
+   
+   <profiles>
+      <profile>
+         <activation>
+            <property>
+               <name>build.translations</name>  
+            </property>
+         </activation>
+         <build>
+            <plugins>
+               <plugin>
+               <groupId>org.jboss.maven.plugins</groupId>
+               <artifactId>maven-jdocbook-plugin</artifactId>
+                  <executions>
+                     <execution>
+                        <phase>process-resources</phase>
+                        <goals>
+                           <goal>translate</goal>
+                        </goals>
+                     </execution>
+                  </executions>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
+   </profiles>
+   
+      <ciManagement>
+      <system>Hudson</system>
+      <url />
+
+   </ciManagement>
+
+   <issueManagement>
+      <system>JIRA</system>
+      <url>http://jira.jboss.org/browse/WBRI</url>
+   </issueManagement>
+
+   <inceptionYear>2008</inceptionYear>
+
+   <scm>
+
+      <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/doc/tags/webbeans-reference-guide-1.0.0.ALPHA1</connection>
+      <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/doc/tags/webbeans-reference-guide-1.0.0.ALPHA1</developerConnection>
+      <url>http://fisheye.jboss.org/browse/WebBeans/doc/tags/webbeans-reference-guide-1.0.0.ALPHA1</url>
+   </scm>
+
+   <distributionManagement>
+      <repository>
+         <!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
+
+         <!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
+         <!-- todo : replace this with direct svn access once the svnkit providers are available -->
+         <id>repository.jboss.org</id>
+         <url>file://${maven.repository.root}</url>
+      </repository>
+      <snapshotRepository>
+         <id>snapshots.jboss.org</id>
+
+         <name>JBoss Snapshot Repository</name>
+         <url>dav:https://snapshots.jboss.org/maven2</url>
+      </snapshotRepository>
+   </distributionManagement>
+   
+</project>
\ No newline at end of file




More information about the weld-commits mailing list