[jboss-cvs] JBossAS SVN: r111060 - projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 29 03:04:51 EDT 2011


Author: rebecca_newton
Date: 2011-03-29 03:04:48 -0400 (Tue, 29 Mar 2011)
New Revision: 111060

Modified:
   projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Appendix_A.xml
   projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Appendix_B.xml
   projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Book_Info.xml
   projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Getting_Started_Introductory_Example.xml
   projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Migration_Guide.xml
   projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Spring_On_JBoss_Best_Practices.xml
Log:
Adding procedures, syntax highlighting, making it build, stylistic and visual fixes, and spelling and grammar.

Modified: projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Appendix_A.xml
===================================================================
--- projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Appendix_A.xml	2011-03-28 23:23:01 UTC (rev 111059)
+++ projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Appendix_A.xml	2011-03-29 07:04:48 UTC (rev 111060)
@@ -9,12 +9,11 @@
   examples</title>
 
   <section>
-    <title>Content of pom.xml file for the introductory example
-    (getting-started)</title>
+    <title>Content of pom.xml File for the Introductory Example </title>
 
     <para></para>
 
-    <programlisting>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    <programlisting language="XML">&lt;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"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;org.jboss.snowdrop.getting.started&lt;/groupId&gt;
@@ -131,9 +130,9 @@
   </section>
 
   <section>
-    <title>Modified starting pom.xml file for Petclinic migration</title>
+    <title>Modified Starting pom.xml File for Petclinic Migration</title>
 
-    <programlisting>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    <programlisting language="XML">&lt;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"&gt;
     &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
     &lt;groupId&gt;org.springframework.samples&lt;/groupId&gt;

Modified: projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Appendix_B.xml
===================================================================
--- projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Appendix_B.xml	2011-03-28 23:23:01 UTC (rev 111059)
+++ projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Appendix_B.xml	2011-03-29 07:04:48 UTC (rev 111060)
@@ -11,15 +11,15 @@
     <title>Installing m2eclipse</title>
 
     <para>Detailed instructions for installing m2eclipse can be found at
-    <uri>http://m2eclipse.sonatype.org/installing-m2eclipse.html</uri>.For
-    this version of the document, For the example (and in general for building
+    <ulink url="http://m2eclipse.sonatype.org/installing-m2eclipse.html">Installing-m2eclipse</ulink>.For
+    this version of the document, for the example (and in general for building
     WTP applications), you need to install at least the following Core and
     Extras m2eclipse components, as follows:</para>
 
     <itemizedlist>
       <listitem>
         <para>From the Core update site
-        (<uri>http://m2eclipse.sonatype.org/sites/m2e</uri>):</para>
+        (<ulink url="http://m2eclipse.sonatype.org/sites/m2e">Core Update</ulink>):</para>
 
         <itemizedlist>
           <listitem>
@@ -29,9 +29,9 @@
       </listitem>
 
       <listitem>
-        <para>From the Extras update
-        site(<uri>http://m2eclipse.sonatype.org/sites/m2e-extras</uri>)</para>
-
+        <para>From the Extras update site 
+        (<ulink url="http://m2eclipse.sonatype.org/sites/m2e-extras/">Extras Update</ulink>):
+         </para>
         <itemizedlist>
           <listitem>
             <para>Install "Maven Integration for WTP"</para>
@@ -49,9 +49,25 @@
     <title>Setting up Maven for m2eclipse</title>
 
     <para>The m2eclipse plugin is bundled with a SNAPSHOT version of Maven.
-    You can configure it to use a specific Maven version. In order to do so,
-    go to Preferences, select Maven-&gt;Instalations and click "Add...", after
-    which you will be prompted to select the directory which contains the
+    You can configure it to use a specific Maven version. In order to do so:
+    </para>
+    <procedure>
+      <step>
+         <para>
+         Go to <guimenu>Preferences</guimenu>
+         </para>
+      </step>
+      <step>
+         <para>
+         Select <guibutton>Maven-Installations</guibutton>
+         </para>
+      </step>
+      <step>
+         <para>Click <guilabel>Add</guilabel></para>
+      </step>
+    </procedure>
+    <para>
+When you have done this, you will be prompted to select the directory which contains the
     Maven distribution that you intend to use. After doing so, a new Maven
     version is added to the list. Make sure that the checkbox besides it is
     selected (which means that this particular version of Maven will be used
@@ -59,11 +75,12 @@
   </section>
 
   <section>
-    <title>Adding a JBoss EAP instance</title>
+    <title>Adding a JBoss Enterprise Application Instance</title>
 
     <para>A regular installation of JBoss Developer Studio will set up one or
-    more JBoss EAP instances. However, it is possible to add more instances
-    after the installation if that is necessary. Please consult the JBoss
-    Developer Studio documentation on how to do that.</para>
+    more JBoss Enterprise Application Platform instances. However, it is possible to add more instances
+    after the installation if that is necessary. See the 
+    <citetitle>JBoss Developer Studio Getting Started Guide</citetitle>
+     for more information.</para>
   </section>
 </appendix>

Modified: projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Book_Info.xml
===================================================================
--- projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Book_Info.xml	2011-03-28 23:23:01 UTC (rev 111059)
+++ projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Book_Info.xml	2011-03-29 07:04:48 UTC (rev 111060)
@@ -7,14 +7,14 @@
 <bookinfo id="book-JBoss_Sample_Project-JBoss_Sample_Project">
   <title>Spring Developer Guide</title>
    <subtitle>for use with JBoss Web Framework Kit</subtitle>  
-    <productname>Web Framework Kit</productname>
+    <productname>JBoss Web Framework Kit</productname>
     <productnumber>1.2</productnumber>
     <edition>1.2.0</edition>
      <pubsnumber>0</pubsnumber>
 
    <abstract>
       <para>
-      An Introduction to developing Spring-based applications for the JBoss platform.
+      An introduction to developing Spring-based applications for the JBoss platform.
       </para>
    </abstract>
 

Modified: projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Getting_Started_Introductory_Example.xml
===================================================================
--- projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Getting_Started_Introductory_Example.xml	2011-03-28 23:23:01 UTC (rev 111059)
+++ projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Getting_Started_Introductory_Example.xml	2011-03-29 07:04:48 UTC (rev 111060)
@@ -39,19 +39,19 @@
     <section>
       <title>Assumptions and placeholder names</title>
 
-      <para>During this tutorial, we are going to assume that the location of
+      <para>This tutorial assumes that the location of
       JBoss Enterprise Application is $EAP_HOME, which represents the
       top-level directory of the extracted distribution (usually
       <emphasis>jboss-eap-5.1</emphasis>).</para>
 
-      <para>We use the placeholder &lt;profile&gt; to indicate the JBoss AS
-      profile with which the application is launched (usually
+      <para>The placeholder &lt;profile&gt; is used to indicate the JBoss Enterprise
+      Application Platform profile with which the application is launched (usually
       <emphasis>default</emphasis>).</para>
     </section>
   </section>
 
   <section>
-    <title>Hello World with a database</title>
+    <title>Hello World With A Database</title>
 
     <para>This is a simple example of a web-based application, including
     access to a database. In a departure from the typical "Hello World"
@@ -66,7 +66,7 @@
       </listitem>
 
       <listitem>
-        <para>A simple set of domain classes, MVC controllers and web
+        <para>A simple set of domain classes, MVC controllers, and web
         pages;</para>
       </listitem>
 
@@ -78,39 +78,76 @@
   </section>
 
   <section>
-    <title>Creating a Maven-based sample project</title>
+    <title>Creating a Maven-based Sample Project</title>
 
-    <para>For this example, we will need to create the Maven project
-    infrastructure, add the dependencies, the code and the Spring
-    configuration files. So we will proceed in this order.</para>
+    <para>For this example, the Maven project
+    infrastructure will need to be created, the dependencies added, 
+    and the code and the Spring
+    configuration files. </para>
 
     <section>
-      <title>Creating the Maven project structure</title>
+      <title>Creating the Maven Project Structure</title>
 
-      <para>Creating a Maven-based web application from JBDS is fairly easy,
-      if the m2eclipse plugin (both core and WTP integration) is
+      <para>Creating a Maven-based web application from JBoss Developer Studio
+       is fairly easy, if the m2eclipse plugin (both core and WTP integration) is
       installed.</para>
 
-      <para>Go to New-&gt;Maven Project (may need to select the 'Other' option
-      first). Leave the 'Create a simple project' option unchecked, as we want
-      to use an archetype for setting up the project structure. After clicking
-      'Next', you will be prompted to select an archetype. For this example,
-      we are using org.apache.maven.archetypes:maven-archetype-webapp. After
-      doing so click 'Next' and enter a groupId, artifactId and version (which
-      is also the project name in Eclipse). We are using
-      'org.jboss.spring.getting.started' for the groupId and 'getting-started'
-      for the artifactId, as well as a version number of 1.0 for this example.
-      However, feel free to enter any other values which are more sensible for
-      your environment. We will set the package name to
+      <procedure>
+         <title>Installing the m2eclipse Plugin</title>
+         <step>
+            <para>
+            Click <guimenu>New</guimenu> and then <guibutton>Maven Project</guibutton>
+            </para>
+            <formalpara>
+               <title>Note</title>
+                  <para>
+                  You may need to click <guibutton>Other</guibutton> before <guibutton>Maven Project</guibutton>
+                  </para>
+               </formalpara>
+         </step>
+         <step>
+            <para>
+            Do not check <guibutton>Create a Simple Project</guibutton>. An archetype is required
+            for setting up the project structure.
+            </para>
+         </step>
+         <step>
+            <para>
+            Select org.apache.maven.archetypes:maven-archetype-webapp when prompted to choose an archetype.
+            </para>
+         </step>
+         <step>
+            <para>Click <guibutton>Next</guibutton></para>
+         </step>
+         <step>
+            <para>
+            Enter a groupId, ArtifactId, and a version. 
+            </para>
+            <para>
+            For this example, use 'org.jboss.spring.getting.started' for the groupId, 'getting-started'
+      for the artifactId, and a version number of 1.0.
+            </para>
+         </step>
+      </procedure>
+
+
+      <para>We will set the package name to
       'org.jboss.spring.getting.started' although no package will be created
       at this point, so the option is not in use.</para>
 
-      <para>The following dependencies need to be included in your
-      application:<table>
+      <para>The following dependencies need to be included in the
+      application:
+      </para>
+      
+         <table>
           <title>Dependencies needed by the example</title>
 
-          <tgroup cols="4">
-            <tbody>
+           <tgroup cols="4">
+           <colspec colnum="1" colwidth="100pt"/>
+           <colspec colnum="2" colwidth="200pt"/>
+           <colspec colnum="3" colwidth="80pt" />
+           <colspec colnum="4" colwidth="80pt" />
+            <thead>
               <row>
                 <entry>Dependency</entry>
 
@@ -120,7 +157,8 @@
 
                 <entry>Scope</entry>
               </row>
-
+            </thead>
+            <tbody>
               <row>
                 <entry>Hibernate Core</entry>
 
@@ -173,92 +211,127 @@
 
               <row>
                 <entry>Spring modules</entry>
-
-                <entrytbl cols="1">
-                  <tbody>
-                    <row>
-                      <entry>org.springframework:spring-aop</entry>
-                    </row>
-
-                    <row>
-                      <entry>org.springframework:spring-asm</entry>
-                    </row>
-
-                    <row>
-                      <entry>org.springframework:spring-expression</entry>
-                    </row>
-
-                    <row>
-                      <entry>org.springframework:spring-beans</entry>
-                    </row>
-
-                    <row>
-                      <entry>org.springframework:spring-context</entry>
-                    </row>
-
-                    <row>
-                      <entry>org.springframework:spring-context-support</entry>
-                    </row>
-
-                    <row>
-                      <entry>org.springframework:spring-tx</entry>
-                    </row>
-
-                    <row>
-                      <entry>org.springframework:spring-core</entry>
-                    </row>
-
-                    <row>
-                      <entry>org.springframework:spring-jdbc</entry>
-                    </row>
-
-                    <row>
-                      <entry>org.springframework:spring-orm</entry>
-                    </row>
-                  </tbody>
-                </entrytbl>
-
+               <entry>
+                  <itemizedlist>
+                     <listitem>
+                        <para>
+                        org.springframework:spring-aop
+                        </para>
+                     </listitem>
+                     <listitem>
+                        <para>
+                        org.springframework:spring-asm
+                        </para>
+                     </listitem> 
+                     <listitem>
+                        <para>
+                        org.springframework:spring-expression
+                        </para>
+                     </listitem>
+                     <listitem>
+                        <para>
+                        org.springframework:spring-beans
+                        </para>
+                     </listitem>
+                     <listitem>
+                        <para>
+                        org.springframework:spring-context
+                        </para>
+                     </listitem>
+                     <listitem>
+                        <para>
+                        org.springframework:spring-context-support
+                        </para>
+                     </listitem>
+                     <listitem>
+                        <para>
+                        org.springframework:spring-tx
+                        </para>
+                     </listitem>
+                     <listitem>
+                        <para>
+                        org.springframework:spring-core
+                        </para>
+                     </listitem>
+                     <listitem>
+                        <para>
+                        org.springframework:spring-jdbc
+                        </para>
+                     </listitem>
+                     <listitem>
+                        <para>
+                        org.springframework:spring-orm
+                        </para>
+                     </listitem>  
+                  </itemizedlist>
+               </entry>  
                 <entry>3.0.5.RELEASE</entry>
 
                 <entry>compile</entry>
               </row>
             </tbody>
-          </tgroup>
-        </table></para>
+       </tgroup>
+        </table>
 
-      <para>You can add these dependencies using the Dependencies tab of the
-      POM editor, or copy them directly to the pom.xml file. An example of the
-      POM file, including the list of dependencies can be found in Appendix
-      A.</para>
+      <para>These dependencies can be added using the Dependencies tab of the
+      POM editor, or copied directly to the <filename>pom.xml</filename> file. 
+      An example of the POM file, including the list of dependencies can
+      be found in Appendix A.</para>
 
       <para>When creating the project, the Java source folder may not be added
-      automatically, case in which you have to add it yourself. Go to
-      'New'-&gt;Source Folder and enter a value of 'src/main/java', and then
-      click 'Finish'.</para>
-
+      automatically. In this case, it will have to be added manually. 
+      To do this, follow this procedure:
+      </para>
+      <procedure>
+         <step>
+            <para>Go to <guimenu>New</guimenu> and then <guibutton>Source Folder</guibutton>
+            </para>
+         </step>
+         <step>
+            <para>Enter a value of src/main/java</para>
+         </step>
+         <step>
+            <para>Click <guibutton>Finish</guibutton></para>
+         </step>
+      </procedure>
       <para>The final step is to add the Spring Project nature to your
       project. While this is not strictly necessary for your application, it
       will enable integration with the Spring IDE, which includes visualizing
       your application context definitions and syntactical and semantical
-      checks. Open the contextual menu for the project (click right on the
-      project) and select Spring Tools-&gt;Add Spring Project nature.</para>
+      checks. To do this, follow this procedure:</para>
+      <procedure>
+         <step>
+            <para>
+            Open the contextual menu for the project by right clicking on the project.
+            </para>
+         </step>
+         <step>
+            <para>
+            Select <guibutton>Spring Tools</guibutton>
+            </para>
+         </step>
+         <step>
+            <para>Click <guibutton>Add Spring Project</guibutton></para>
+         </step>
+      </procedure>
     </section>
 
     <section>
       <title>Creating the source code</title>
 
-      <para>After doing so, we need to add the source code for the
-      application. The figure illustrates the application components, split in
-      tiers.</para>
+      <para>The source code for the application must be added after 
+      doing this. <!--The figure illustrates the application components, split in
+      tiers. Removing until figure available --></para>
 
-      <para>First, we are going to create our domain entity, which contains
+      <para>A domain entity will now be created, which contains
       information about a User. It is a persistent class, so it also contains
       JPA mappings.</para>
 
       <example>
-        <title>Domain entity definition</title>
+        <title>Domain Entity Definition</title>
 
-        <para><programlisting language="java">package org.jboss.spring.getting.started.domain;
+        <programlisting language="Java">
+package org.jboss.spring.getting.started.domain;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -302,39 +375,41 @@
    this.lastName = lastName;
  }
  
-}</programlisting></para>
+}</programlisting>
       </example>
 
-      <para>Data access will be provided through a JPA-based DAO, which will
-      be installed as a Spring bean. The interface for this component
+      <para>Data access is provided through a JPA-based DAO, which is
+      installed as a Spring bean. The interface for this component
       is:</para>
 
       <example>
         <title>Interface for the User DAO</title>
 
-        <para><programlisting language="java">package org.jboss.spring.getting.started.domain;
+        <programlisting language="Java">
+package org.jboss.spring.getting.started.domain;
 
 public interface UserDao {
   User getForUsername(String username);
-}</programlisting></para>
+}       </programlisting>
       </example>
 
-      <para>We encourage using plain JPA for the implementation. The class is
+      <para>Plain JPA is recommended for the implementation. The class is
       annotated with @Service, which means that it can be used by Spring to
-      scan for components rather than explicitely defining them in a
-      configuration file. The entity manager that the implementation will use
+      scan for components rather than explicitly defining them in a
+      configuration file. The entity manager that the implementation uses
       to run JPA queries will be injected in the corresponding field, and
-      @Autowired annotation instructs Spring where to do the injection. The
-      @Transactional annnotation is used for demarcating transactions
-      declaratively, which with this particular setup means that
+      @Autowired annotation instructs Spring where to do the injection.
+      The @Transactional annnotation is used for demarcating transactions
+      declaratively. This particular setup means that
       getForUsername() will execute in its own transaction, if a transaction
-      isn't started yet (this may change with other configuration options, as
-      Spring supports different transaction propagation modes).</para>
+      is not started yet. This may change with other configuration options, as
+      Spring supports different transaction propagation modes.</para>
 
       <example>
-        <title>UserDao implementation</title>
+        <title>UserDao Implementation</title>
 
-        <para><programlisting language="java">package org.jboss.spring.getting.started.domain;
+        <programlisting language="Java">
+package org.jboss.spring.getting.started.domain;
 
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
@@ -358,17 +433,18 @@
     }
 
 }
-</programlisting></para>
+</programlisting>
       </example>
 
-      <para>In the web tier, we will need a controller and a web page for
-      displaying the results. So we will create the UserController class
-      first.</para>
+      <para>In the web tier, a controller and a web page for
+      displaying the results is required. The UserController class will
+      therefore be created first.</para>
 
       <example>
-        <title>The MVC Controller class</title>
+        <title>The MVC Controller Class</title>
 
-        <para><programlisting language="java">package org.jboss.spring.getting.started.mvc;
+        <programlisting language="Java">
+package org.jboss.spring.getting.started.mvc;
 
 import org.jboss.spring.getting.started.domain.User;
 import org.jboss.spring.getting.started.domain.UserDao;
@@ -398,7 +474,7 @@
         User user = userDao.getForUsername(username);
         return "Hello, " + user.getFirstName() + " " + user.getLastName() + "!";
     }
-}</programlisting></para>
+}</programlisting>
       </example>
 
       <para>The @Controller annotation is similar to @Service, but targeted
@@ -409,7 +485,7 @@
       to this class, however, are the MVC annotations: @RequestMapping,
       @RequestParam and @ModelAttribute.</para>
 
-      <para>We add the @RequestMapping annotation at the class level to map
+      <para>The @RequestMapping annotation is added at the class level to map
       requests that end in 'say-hello' to this controller. The actual URL
       which will be mapped to it also depends on the rest of the Spring
       configuration. Spring MVC uses the Front Controller pattern, which means
@@ -418,26 +494,27 @@
 
       <para>The class serves as backing to a web form, and different methods
       need to execute when the form page is initially requested (GET) and data
-      is posted back (POST). Hence, the two distinct @RequestMapping
+      is posted back (POST). This is why there are two distinct @RequestMapping
       annotations with which the getInitialMessage() and getForUsername()
       methods are annotated. The @ModelAttribute annotation instructs Spring
       MVC to add the returned value as a request attribute so that it can be
-      used when rendering the view. The @RequestParam instructs the Spring to
+      used when rendering the view. The @RequestParam instructs Spring to
       bind the 'username' value submitted by the form to the method
       parameter.</para>
 
-      <para>To finalize the code, we will create a view that renders the form.
+      <para>To finalize the code, a view that renders the form will be created.
       When the page is initially rendered, it will display the warning message
       returned by getInitialMessage(). After each submission, the page will
       display a welcome message with the full name of the user. So, create a
-      new JSP page as /src/main/webapp/WEB-INF/views/say-hello.jsp.</para>
+      new JSP page as <filename>/src/main/webapp/WEB-INF/views/say-hello.jsp</filename>.</para>
 
       <example>
-        <title>The Web page that renders the results</title>
+        <title>The Web Page That Renders The Results</title>
 
-        <para><programlisting language="jsp">&lt;%@ page language="java" contentType="text/html; charset=UTF-8"
-    pageEncoding="UTF-8"%&gt;
-&lt;%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%&gt;
+        <programlisting language="XML">
+&lt;page contentType="text/html; charset=UTF-8"
+    pageEncoding="UTF-8"&gt;
+&lt;taglib uri="http://java.sun.com/jstl/core" prefix="c"&gt;
 &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
 &lt;html&gt;
 &lt;head&gt;
@@ -452,7 +529,7 @@
 &lt;/form&gt;
 
 &lt;/body&gt;
-&lt;/html&gt;</programlisting></para>
+&lt;/html&gt;</programlisting>
       </example>
     </section>
 
@@ -466,9 +543,10 @@
       named init-db.sql underneath src/main/resources.</para>
 
       <example>
-        <title>The database initialization script</title>
+        <title>The Database Initialization Script</title>
 
-        <para><programlisting language="sql">DROP TABLE USERS IF EXISTS CASCADE;
+        <programlisting>
+DROP TABLE USERS IF EXISTS CASCADE;
 CREATE TABLE USERS (
   ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY, 
   USERNAME VARCHAR(255),
@@ -477,15 +555,16 @@
   
 INSERT INTO USERS (ID, USERNAME, FIRSTNAME, LASTNAME) VALUES (1, 'jdoe', 'John', 'Doe');
 INSERT INTO USERS (ID, USERNAME, FIRSTNAME, LASTNAME) VALUES (2, 'emuster', 'Erika', 'Mustermann');
-</programlisting>As well, we need to create a persistence unit definition
-        file. Create the persistence.xml file underneath
+</programlisting>
+      <para>A persistence unit definition
+        file is also required. Create the <filename>persistence.xml</filename> file underneath
         src/main/resources/META-INF.</para>
       </example>
 
       <example>
-        <title>The persistence unit definition file</title>
+        <title>The Persistence Unit Definition File</title>
 
-        <para><programlisting language="xml">&lt;persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"&gt;
+        <programlisting language="XML">&lt;persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"&gt;
    &lt;persistence-unit name="helloPU" transaction-type="JTA"&gt;
        &lt;jta-data-source&gt;java:/DefaultDS&lt;/jta-data-source&gt;
        &lt;properties&gt;
@@ -493,38 +572,47 @@
             &lt;property name="hibernate.show_sql" value="true"/&gt;
        &lt;/properties&gt;
    &lt;/persistence-unit&gt;
-&lt;/persistence&gt;</programlisting></para>
+&lt;/persistence&gt;
+      </programlisting>
       </example>
     </section>
 
     <section>
-      <title>Adding the Spring configuration files</title>
+      <title>Adding the Spring Configuration Files</title>
 
       <para>A Spring MVC application is using the Front Controller pattern
-      (encountered to other frameworks such as Struts, for example). Requests
-      are directed to a servlet which dispatches them to controller
+      (encountered by other frameworks such as Struts, for example). Requests
+      are directed to a servlet that dispatches them to controller
       components, after which it forwards to a view that renders the response.
       The Spring configuration consists of two sets of beans which will be
       bootstrapped in separate application contexts:</para>
-
-      <itemizedlist>
-        <listitem>
-          <para>business logic beans - which configure and wire together
-          services, wrap them in transactional and AOP proxies;</para>
-        </listitem>
-
-        <listitem>
-          <para>front-end components - controllers and URL mappings</para>
-        </listitem>
-      </itemizedlist>
-
-      <para>For configuring the web application, update the web.xml as
+      <variablelist>
+         <varlistentry>
+            <term>business logic beans</term>
+            <listitem>
+               <para>
+               which configure and wire together
+          services, wrap them in transactional and AOP proxies;
+               </para>
+            </listitem>
+         </varlistentry>
+         <varlistentry>
+            <term>front-end components</term>
+            <listitem>
+               <para>
+               controllers and URL mappings
+               </para>
+            </listitem>
+         </varlistentry>
+      </variablelist>
+      <para>To configure the web application, update the <filename>web.xml</filename> as
       follows:</para>
 
       <example>
-        <title>The web.xml definition</title>
+        <title>The web.xml Definition</title>
 
-        <para><programlisting language="xml">&lt;!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+        <programlisting language="XML">
+&lt;!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
                          "http://java.sun.com/dtd/web-app_2_3.dtd"&gt;
 &lt;web-app&gt;
  &lt;display-name&gt;Getting Started with Spring&lt;/display-name&gt;
@@ -550,21 +638,61 @@
  &lt;/servlet-mapping&gt;
 
 &lt;/web-app&gt;
-</programlisting></para>
+</programlisting>
       </example>
 
       <para>The ContextLoaderListener will boostrap an application context
       containing the business components, while the DispatcherServlet will
       create an application context using the former as its parent (and thus
-      having access to its bean definitions).</para>
+      having access to its bean definitions). To do this, follow these steps:</para>
 
-      <para>From src/main/webapp/WEB-INF, create a Spring bean definition
-      file, by selecting New-&gt;Spring Bean Configuration File and enter a
-      file name of 'spring-business-context.xml'. Make sure that you follow
-      the 'Next' option and select the following namespaces: bean, context,
-      jbdc, jee and tx. The content of the file is as follows;</para>
+      <procedure>
+         <step>
+            <para>
+            Select <guimenu>New</guimenu> and then <guimenu>Spring Bean Configuration File</guimenu>
+            </para>
+         </step>
+         <step>
+            <para>
+            Enter the filename as <filename>spring-business-context.xml</filename>
+            </para>
+         </step>
+         <step>
+            <para>Follow the <guibutton>Next</guibutton> option</para>
+         </step>
+         <step>
+            <para>
+            Select these namespaces:
+            </para>
+            <itemizedlist>
+               <listitem>
+                  <para>
+                  bean
+                  </para>
+               </listitem>
+               <listitem>
+                  <para>context</para>
+               </listitem>
+               <listitem>
+                  <para>
+                  jbdc
+                  </para>
+               </listitem>
+               <listitem>
+                  <para>
+                  jee
+                  </para>
+               </listitem>
+               <listitem>
+                  <para>tx</para>
+               </listitem>
+            </itemizedlist>
+         </step>
+      </procedure>
+      <para>The content of the file is as follows;</para>
 
-      <programlisting lang="xml">&lt;beans xmlns="http://www.springframework.org/schema/beans"
+      <programlisting language="XML">
+&lt;beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
    xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
@@ -593,14 +721,14 @@
 
 &lt;/beans&gt;</programlisting>
 
-      <para>First, we instructed Spring to scan the package
+      <para>First, Spring was instructed to scan the package
       'org.jboss.spring.getting.started.domain' for component beans, looking
       for specific annotations such as @Service, and inject them automatically
-      based on the @Autowired annotation. In our case, this will create the
-      bean definition for UserDao. Then, we create beans for the data source
-      and the entity manager. Because we are using a managed data source and a
+      based on the @Autowired annotation. In this case, this will create the
+      bean definition for UserDao. Then, beans are created for the data source
+      and the entity manager, because a managed data source is being used, as well as a
       container-managed entity manager. The management strategy is set to JTA,
-      and we instruct Spring to apply transactions declaratively, based on the
+      and Spring is instructed to apply transactions declaratively, based on the
       @Transactional annotations found on bean classes. Since this is a demo
       example, we need to initialize the database and we instruct Spring to
       run the init-db.sql script at startup.</para>
@@ -614,7 +742,7 @@
       <example>
         <title>Dispatcher servlet configuration file</title>
 
-        <para><programlisting language="xml">&lt;beans xmlns="http://www.springframework.org/schema/beans"
+        <para><programlisting language="XML">&lt;beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

Modified: projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Migration_Guide.xml
===================================================================
--- projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Migration_Guide.xml	2011-03-28 23:23:01 UTC (rev 111059)
+++ projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Migration_Guide.xml	2011-03-29 07:04:48 UTC (rev 111060)
@@ -7,24 +7,24 @@
 <chapter id="Migration_Guide">
   <title>Migrating applications to JBoss EAP and EWP</title>
 
-  <para>Spring applications that have been designed to run in a servlet
+ <!-- <para>Spring applications that have been designed to run in a servlet
   container such as Tomcat and Jetty will find an ideal running environment in
   JBoss Enterprise Web Server. At the same time, more sophisticated
   environments such as JBoss Enterprise Application Platform and JBoss
   Enterprise Web Platform offer a wider variety of middleware services such as
-  transaction management, messaging or web service integration.</para>
+  transaction management, messaging or web service integration.</para> -->
 
   <para>This chapter explores how Spring applications that have
   been originally developed for servlet containers can be migrated to take
-  advantage of the JBoss middleware service support and infrastructure. In
-  order to do so, we will use a few sample applications provided by the Spring
-  framework.</para>
+  advantage of the JBoss middleware service support and infrastructure. 
+  Sample applications provided by the Spring frameworks will be used to do so.
+  </para> 
 
   <section>
     <title>General Migration Mechanics</title>
 
     <para>Migrating applications from a servlet container to one of the
-    enterprise platforms is a simple process, which addresses two
+    enterprise platforms is a process that addresses two
     distinct concerns:</para>
 
     <itemizedlist>
@@ -47,9 +47,9 @@
     <para>Except for rare situations, migrating applications does not
     involve changes to the Java code, or the Spring bean configuration
     definitions that define the business logic of the application (bean
-    wiring, aspect definitions, and controllers). The definitions that in
-    almost every case are the ones that relate to the infrastructure are:
-    datasources, session factories, entity managers and entity manager
+    wiring, aspect definitions, and controllers). The definitions that
+    relate to the infrastructure are:
+    datasources, session factories, entity managers, and entity managers.
     </para>
     <itemizedlist>
       <listitem>
@@ -72,7 +72,7 @@
       dependencies that are required by applications. This is unlike servlet
       containers, where applications need to package a significant number of
       libraries in order to provide access to certain Java EE 5 technologies.
-      One of the first things that needs to be considered in the migration
+      One of the things to be considered in the migration
       process is changing the deployable build by removing the libraries which
       are already provided by the application server. It is not just an
       improvement which reduces the size of the final build, but also a
@@ -99,23 +99,22 @@
         </listitem>
       </itemizedlist>
 
-      <para>Please consult the list of components included in JBoss Enterprise
-      Application Platform for a complete list. Of course, the 
-      components mentioned above may be required
-      as compile-time dependencies, so please make sure that they are included
+      <para> The components above may be required
+      as compile-time dependencies, so they need to be included
       in the project, but not packaged in the final build. In Maven builds,
-      this can be achieved by setting the scope to 'provided' and in JBDS by
-      unchecking the 'Exported' flag for the dependency. Other build systems
-      have their own respective mechanisms of achieving the same goal.</para>
+      this can be achieved by setting the scope to 'provided' and in 
+      JBoss Developer Studio by unchecking the 
+      <guilabel>Exported</guilabel> flag for the dependency. Other build
+       systems have their own respective mechanisms of achieving the same goal.</para>
 
-      <para>On the other hand, components and frameworks that are not part of
+      <para>However, components and frameworks that are not part of
       the Java EE 5 implementation but are certified for use with JBoss Enterprise
       Application Platform 5 need to be included in your application. 
       These components are:</para>
 
       <itemizedlist>
         <listitem>
-          <para>Spring Framework (consult the Spring Installation Guide for
+          <para>Spring Framework (consult the <citetitle>Spring Installation Guide</citetitle> for
           more details)</para>
         </listitem>
 
@@ -136,16 +135,17 @@
     <simplesect>
       <title>Migrating Datasource Definitions</title>
 
-      <para>Almost all servlet containers support the use of JNDI-bound
+      <para>Most servlet containers support the use of JNDI-bound
       resources, and binding Datasources in JNDI allows for managing
       connectivity parameters such as URLs, credentials, and pool sizes
+      connectivity parameters such as URLs, credentials, and pool sizes
       independently from the application code. However, Spring applications often
       rely on independent connection pool bean
       definitions, such as the ones used by commons-dbcp or c3po (see example
       <xref linkend="dbcp-ref" />).</para>
 
-      <example>
-        <title id="dbcp-def">Example commons-dbcp DataSource definition in a
+      <example id="dbcp-ref">
+        <title>Example commons-dbcp DataSource definition in a
         servlet container</title>
 
         <programlisting language="XML">&lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
@@ -166,8 +166,8 @@
         linkend="jboss-managed-ds" />.</para>
       </example>
 
-      <example>
-        <title id="jboss-managed-ds">Using a JBoss managed datasource in
+      <example id="jboss-managed-ds">
+        <title>Using a JBoss managed datasource in
         Spring</title>
 
         <programlisting language="XML">&lt;jee:jndi-lookup id="dataSource" jndi-name="java:/ExampleDsJndiName" expected-type="javax.sql.DataSource"/&gt;</programlisting>
@@ -194,7 +194,7 @@
       in a servlet container with local Hibernate-based transactions
       enabled.</para>
 
-      <example>
+      <example id="hibernate_sf">
         <title>SessionFactory and transaction manager definitions in a servlet
         environment</title>
 
@@ -237,13 +237,13 @@
 
 &lt;tx:jta-transaction-manager id="transactionManager"/&gt;
 </programlisting>
-         <note>
+      </example>
+      <note>
         <para>The definitions of the 'sessionFactory' bean is
-        virtually unchanged - the only difference is the addition of the
+        virtually unchanged; the only difference is the addition of the
         properties required for setting up the JTA-based context management
         and the transaction manager change.</para>
         </note>
-      </example>
     </simplesect>
 
     <simplesect>
@@ -288,9 +288,9 @@
       in a Java EE 5 application, server enrollment in JTA transactions is a
       requirement, Spring applications running outside Java EE have to set up
       a resource-local transaction manager as described in example <xref
-      linkend="???" />.</para>
+      linkend="entman" />.</para>
 
-      <example>
+      <example id="entman">
         <title>JPA EntityManagerFactory and transaction setup in a
         servlet-container based application</title>
 
@@ -346,9 +346,9 @@
 
         <para>A more effective approach is converting the <filename>persistence.xml</filename>
         definition to a JTA-based model and using JNDI lookup for retrieving
-        the entity manager. For this, you must convert the persistence unit
+        the entity manager. For this, convert the persistence unit
         definition as in the following example (please note that it is not
-        necessary to provide values for both 'jboss.entity.manager.jndi.name'
+        necessary to provide values for <emphasis>both</emphasis> 'jboss.entity.manager.jndi.name'
         and 'jboss.entity.manager.factory.jndi.name', but one must be specified)</para>
       </example>
 
@@ -366,7 +366,8 @@
 &lt;/persistence-unit&gt;</programlisting>
 
         <para>The EntityManagerFactory or a JTA-synchronized
-        EntityManager can be retrieved from JNDI as follows:<example>
+        EntityManager can be retrieved from JNDI as follows:
+        <example>
             <title>EntityManager retrieved by JNDI lookup and JTA transaction
             manager (works with @Autowired)</title>
 
@@ -387,7 +388,8 @@
             the choice of a JPA provider. While servlet-container-based
             applications have to include a JPA implementation and specify the
             nature of the provider explicitly, JBoss Enterprise Application
-            Platform uses Hibernate as a JPA provider. <example>
+            Platform uses Hibernate as a JPA provider. 
+            <example>
                 <title>EntityManagerFactory retrieved by JNDI lookup and JTA
                 transaction manager (works with @PersistenceContext)</title>
 
@@ -398,17 +400,18 @@
 
                 <para>If the original application relied on Spring to inject
                 the EntityManager using the @PersistenceContext annotation
-                into services and DAOs, then going the EntityManager route
+                into services and DAOs, using the EntityManager
                 will require changing the annotation to @Autowired (as the
                 bean is an EntityManager). In such cases, it may be
-                preferrable to look up for the EntityManagerFactory instead,
+                better to look up for the EntityManagerFactory instead,
                 and leave Spring to create the EntityManager.</para>
 
                 <para>A particular concern when migrating JPA-based
                 application is the choice of a JPA provider. While
                 servlet-container-based applications have to include a JPA
                 implementation and specify the nature of the provider
-                explicitely, JBoss EAP uses Hibernate as the unique JPA
+                explicitely, JBoss Enterprise Application Platform uses
+                Hibernate as the unique JPA
                 provider. In such cases, using an application-server deployed
                 persistence unit simplifies the process.</para>
               </example></para>
@@ -446,7 +449,7 @@
     <simplesect>
       <title>Adjusting Dependencies</title>
 
-      <para>One of the first things that we need to focus on is adjusting
+      <para>One of the first things that need focus is adjusting
       dependency scopes. They will need to change as follows:</para>
 
       <itemizedlist>
@@ -461,7 +464,7 @@
           <para>javax.persistence:persistence-api,
           org.hibernate:hibernate-core, org.hibernate:hibernate-entitymanager,
           org.hibernate:hibernate-annotations become provided-scope
-          dependencies. JBoss enterprise platforms include a JPA
+          dependencies. JBoss Enterprise platforms include a JPA
           implementation, so there is no need for the application to include
           these libraries in the WAR, but they are needed for compiling
           the application. They are also needed for compiling and running
@@ -489,31 +492,65 @@
 
       <para>A slightly unexpected set of changes is caused by the naming of
       the application context definition files. In particular, the file
-      applicationContext-hibernate.xml found in
-      /src/main/webapp/WEB-INF/spring may cause problems when deployed in
-      JBoss EAP, since the Hibernate deployer will try to process it, which
-      can result in a deployment failure. So we will rename the four
+      <filename>applicationContext-hibernate.xml</filename> found in
+      <filename>/src/main/webapp/WEB-INF/spring</filename> may cause problems when deployed in
+      JBoss Enterprise Applicaton Platform, since the Hibernate deployer will try to process it. This
+      can result in a deployment failure. To avoid this, rename the four
       applicationContext-*.xml files from /src/main/webapp/WEB-INF/spring to:
-      applicationContextDataSource.xml, applicationContextHibernate.xml,
-      applicationContextJdbc.xml and applicationContextJpa.xml, respectively.
-      Since they are referred from web.xml, that file has to change as
+      </para>
+         <itemizedlist>
+            <listitem>
+               <para>applicationContextDataSource.xml</para>
+            </listitem>
+            <listitem>
+               <para>
+               applicationContextHibernate.xml
+               </para>
+            </listitem>
+            <listitem>
+               <para>
+               applicationContextJdbc.xml
+               </para>
+            </listitem>
+            <listitem>
+               <para>
+               applicationContextJpa.xm
+               </para>
+            </listitem>
+         </itemizedlist>
+         <para>
+      Since they are referred from <filename>web.xml</filename>, that file has to change as
       well.</para>
     </simplesect>
 
     <simplesect>
-      <title>Switching to a JTA and managed persistence context model</title>
+      <title>Switching to a JTA and Managed Persistence Context Model</title>
 
-      <para>First, we need to make the persistence unit definition deployable
-      by JBoss. In order to do so, we will copy jpa-persistence.xml to
-      /src/test/resources/META-INF (check the test section to see why) and
-      rename it to persistence.xml. After that we will change its contents to
-      make it Java EE 5-compatible as described in the previous sections. The
-      end result is:</para>
-
+      <para>The persistence unit definition must be made deployable
+      by JBoss. In order to do so, 
+      </para>
+         <procedure>
+            <step>
+               <para>Copy <filename>jpa-persistence.xml</filename> to
+      <filename>/src/test/resources/META-INF</filename> </para>
+            </step>
+            <step>
+               <para>
+               Rename it to <filename>persistence.xml</filename>
+               </para>
+            </step>
+            <step>
+               <para>
+               Change its contents to
+      make it Java EE 5-compatible as described in the previous sections.
+               </para>
+            </step>
+            <step>
+               <title>Result</title>
       <example>
         <title>Migrated persistence.xml definition</title>
 
-        <para><programlisting lang="xml">&lt;persistence xmlns="http://java.sun.com/xml/ns/persistence"
+        <programlisting language="XML">&lt;persistence xmlns="http://java.sun.com/xml/ns/persistence"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
   version="1.0"&gt;
@@ -531,31 +568,32 @@
      &lt;property name="jboss.entity.manager.factory.jndi.name" value="java:/petclinic/emf"/&gt;            
   &lt;/properties&gt;
  &lt;/persistence-unit&gt;
-&lt;/persistence&gt;</programlisting></para>
+&lt;/persistence&gt;</programlisting>
       </example>
+            </step>
+         </procedure>
+      <para>For this migration, the default datasource
+      provided by JBoss will be used. You are able to replace it with a
+       datasource JNDI name that is specific to your environment. The
+      deployer will be instructed to bind the EntityManagerFactory in 
+      JNDI under a specific name.</para>
 
-      <para>For this migration, we will just use the default datasource
-      provided by JBoss - but feel free to replace with a datasource JNDI name
-      that is specific to your environment. As well, we will instruct the
-      deployer to bind the EntityManagerFactory in JNDI under a specific
-      name.</para>
-
-      <para>Now that we intend to use a Java EE datasource, we need to reflect
-      that in the configuration file. Go to applicationContextDataSource.xml,
+      <para>Since a Java EE datasource, this needs to be reflected
+      in the configuration file. Go to <filename>applicationContextDataSource.xml</filename>,
       comment the DBCP-based datasource definition, and uncomment the one
       using the &lt;jee:jndi-lookup/&gt; element. Now the datasource will be
       provided by a JNDI lookup.</para>
 
-      <para>For simple JDBC access, we need to switch the transaction model to
-      JTA. Therefore, we need to change the applicationContextJdbc.xml file by
-      replacing the DataSourceTransactionManager bean definition with the one
-      using the JtaTransactionManager (or the
-      &lt;tx:jta-transaction-manager/&gt; element),</para>
+      <para>For simple JDBC access, the transaction model needs to
+      be switched to JTA. The <filename>applicationContextJdbc.xml</filename> file 
+      must be changed by replacing the DataSourceTransactionManager bean
+       definition with the one using the JtaTransactionManager (or the
+      &lt;tx:jta-transaction-manager/&gt; element).</para>
 
-      <para>For Hibernate access, we also need to adjust the definition of the
-      Hibernate SessionFactory, in order to make it JTA-aware. We will modify
-      applicationContextHibernate.xml next by adding the JTA configuration
-      properties to the SessionFactory definition, removing the
+      <para>For Hibernate access, the definition of the
+      Hibernate SessionFactory must be adjusted in order to make it JTA-aware. 
+      The <filename>applicationContextHibernate.xml</filename> is modified 
+      next by adding the JTA configuration properties to the SessionFactory definition, removing the
       HibernateTransactionManager and switching transaction management to JTA
       by uncommenting the JtaTransactionManager bean definition.<example>
           <title>Migrated SessionFactory and transaction manager
@@ -563,7 +601,7 @@
 
           <para></para>
 
-          <programlisting lang="xml">	&lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
+          <programlisting language="XML">	&lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
 			p:dataSource-ref="dataSource" p:mappingResources="petclinic.hbm.xml"&gt;
 		&lt;property name="hibernateProperties"&gt;
 			&lt;props&gt;
@@ -571,8 +609,10 @@
 				&lt;prop key="hibernate.show_sql"&gt;${hibernate.show_sql}&lt;/prop&gt;
 				&lt;prop key="hibernate.generate_statistics"&gt;${hibernate.generate_statistics}&lt;/prop&gt;
                 &lt;prop key="hibernate.current_session_context_class"&gt;jta&lt;/prop&gt;
-                &lt;prop key="transaction.manager_lookup_class"&gt;org.hibernate.transaction.JBossTransactionManagerLookup&lt;/prop&gt;
-                &lt;prop key="hibernate.transaction.factory_class"&gt;org.hibernate.transaction.JTATransactionFactory&lt;/prop&gt;
+                &lt;prop key="transaction.manager_lookup_class"
+                &gt;org.hibernate.transaction.JBossTransactionManagerLookup&lt;/prop&gt;
+                &lt;prop key="hibernate.transaction.factory_class"&gt;
+                org.hibernate.transaction.JTATransactionFactory&lt;/prop&gt;
 			&lt;/props&gt;
 		&lt;/property&gt;
 		&lt;property name="eventListeners"&gt;
@@ -590,15 +630,15 @@
 </programlisting>
         </example></para>
 
-      <para>Finally, we will to change the JPA configuration. In order to do
-      so, we will remove the EntityManagerFactory bean definition from
+      <para>The JPA configuration also has to be changed. In order to do
+      so, remove the EntityManagerFactory bean definition from
       applicationContextJpa and replace it with an EntityManagerFactory
       lookup, as well as changing transaction management to JTA.</para>
 
       <example>
         <title>Migrated JPA EntityManagerFactory definition and</title>
 
-        <para><programlisting>    &lt;jee:jndi-lookup id="entityManagerFactory" jndi-name="java:/petclinic/emf" expected-type="javax.persistence.EntityManagerFactory"/&gt;
+        <para><programlisting language="XML">    &lt;jee:jndi-lookup id="entityManagerFactory" jndi-name="java:/petclinic/emf" expected-type="javax.persistence.EntityManagerFactory"/&gt;
 
     &lt;tx:jta-transaction-manager/&gt;
 </programlisting></para>
@@ -606,25 +646,24 @@
     </simplesect>
 
     <simplesect>
-      <title>Adjusting unit tests</title>
+      <title>Adjusting Unit Tests</title>
 
       <para>The most important change to the unit tests is caused by switching
       our JPA from Spring-managed to container-managed. As such, unit tests,
       which run outside a container, will still need to have access to a
-      EntityManagerFactory. So, we will use the original jpa-persistence.xml
-      file, which we copied underneath /src/test/resources/META-INF while we
-      were doing the migration.</para>
+      EntityManagerFactory. Use the original <filename>jpa-persistence.xml</filename>
+      file, which was copied underneath /src/test/resources/META-INF while doing the migration.</para>
 
-      <para>We also need to make sure that OpenJpaEntityManagerClinicTests and
-      EntityManagerClinicTests do not run during the build (since we aren't
-      using neither OpenJpa nor Toplink). This can be simply done by
+      <para>You also need to make sure that OpenJpaEntityManagerClinicTests and
+      EntityManagerClinicTests do not run during the build (since 
+      OpenJpa nor Toplink are being used). Do this by
       annotating them with @Ignore.</para>
 
       <para>This concludes the migration of Spring's Petclinic application to
       JBoss. You can build the project using maven and copy the resulting war
       (target/petclinic.war) to $JBOSS_HOME/server/&lt;profile&gt;/deploy, or
-      you can import the Maven project in JBDS (if you have the m2eclipse
-      plugin installed).</para>
+      you can import the Maven project in JBoss Developer Studio (if 
+      you have the m2eclipse plugin installed).</para>
     </simplesect>
   </section>
 
@@ -638,14 +677,14 @@
 
     <itemizedlist>
       <listitem>
-        <para>Before the migration: adapting the POM to use the JBoss
+        <para>Before the migration; adapting the POM to use the JBoss
         repositories or Maven central (one particular concern is that the
-        example is using a version of Hibernate - the migrated POM may
-        ;</para>
+        example is using a version of Hibernate<!-- - the migrated POM may
+        ; --></para>
       </listitem>
 
       <listitem>
-        <para>Setting the proper scopes for dependencies;</para>
+        <para>Setting the Proper Scopes for Dependencies;</para>
       </listitem>
 
       <listitem>
@@ -654,16 +693,16 @@
       </listitem>
     </itemizedlist>
 
-    <para>Because of the similarities, we will leave the details out. However,
+ <!--   <para>Because of the similarities, we will leave the details out. However,
     the reason why we have chosen Spring Travel as the second migration case
     is because of it is in a particular respect different from
-    Petclinic.</para>
+    Petclinic.</para> -->
 
     <simplesect>
-      <title>The special case of flow-scoped persistence</title>
+      <title>The special Case of Flow-scoped Persistence</title>
 
       <para>While in general using a JNDI-provided EntityMangerFactory or
-      EntityManager is a better suited solution, there are cases when using a
+      EntityManager is a better solution, there are cases when using a
       JTA-based LocalContainerEntityManagerFactory may be necessary. As shown
       in the previous chapter, this is necessary when the application relies
       on the support for the read-only transactions in Spring. In the
@@ -671,16 +710,16 @@
       application uses a flow-scoped persistence context. In such cases, the
       persistence context is flushed only when the flow ends so any other
       transactional operations must complete without saving the persistence
-      context (which is what, in short, the read-only flag is supposed to do).
+      context (which is what the read-only flag is intended to do).
       <footnote>
           <para>For details on flow-scoped persistence contexts and their
           usage, please consult the Spring Web Flow documentation</para>
         </footnote></para>
 
       <para>Since the project will not use a JNDI-based persistence unit
-      anymore, we can suppress its deployment by renaming the persistence.xml
-      file to jpa-persistence.xml and disabling class scanning by setting the
-      metadata-complete flag in web.xml (see previous chapter for
+      anymore, its deployment can be suppressed by renaming the <filename>persistence.xml</filename>
+      file to <filename>jpa-persistence.xml</filename> and disabling class scanning by setting the
+      metadata-complete flag in <filename>web.xml</filename> (see previous chapter for
       details).</para>
 
       <para>The EntityManagerFactory bean definition found in data.xml needs
@@ -690,7 +729,7 @@
         <title>Changing Spring Travel's EntityManagerFactory bean definition
         to support JTA</title>
 
-        <programlisting>&lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
+        <programlisting language="XML">&lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
     &lt;property name="jpaVendorAdapter"&gt;
         &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/&gt;
     &lt;/property&gt;

Modified: projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Spring_On_JBoss_Best_Practices.xml
===================================================================
--- projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Spring_On_JBoss_Best_Practices.xml	2011-03-28 23:23:01 UTC (rev 111059)
+++ projects/docs/enterprise/WFK/Spring_Developer_Guide/en-US/Spring_On_JBoss_Best_Practices.xml	2011-03-29 07:04:48 UTC (rev 111060)
@@ -82,7 +82,7 @@
       <example>
         <title>Defining a Managed Datasource Spring Bean</title>
 
-        <programlisting lang="xml">&lt;jee:jndi-lookup id="dataSource" jndi-name="java:/ExampleDsJndiName" expected-type="javax.sql.DataSource"/&gt;</programlisting>
+        <programlisting language="XML">&lt;jee:jndi-lookup id="dataSource" jndi-name="java:/ExampleDsJndiName" expected-type="javax.sql.DataSource"/&gt;</programlisting>
       </example>
 
       <para>A datasource bean can be injected in any regular Spring bean
@@ -103,11 +103,10 @@
 
       <example>
         <title>SessionFactory bean definition</title>
-
-        <para><programlisting language="XML">&lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
+         <programlisting language="XML">&lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
         &lt;property name="dataSource" ref="dataSource"/&gt;
        ...
-&lt;/bean&gt;</programlisting></para>
+&lt;/bean&gt;</programlisting>
       </example>
 
       <para>JTA transaction management and Hibernate-JTA session
@@ -116,7 +115,7 @@
       <example>
         <title>JTA session management setup properties</title>
 
-        <programlisting language="XML">hibernate.current_session_context_class=jta
+        <programlisting>hibernate.current_session_context_class=jta
 hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
 hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory</programlisting>
       </example>
@@ -129,7 +128,7 @@
         <title>Hibernate-based DAO: a SessionFactory is injected directly in
         the bean</title> -->
 
-        <programlisting language="java">public class HibernateAccountDao {
+        <programlisting language="Java">public class HibernateAccountDao {
   @Autowired SessionFactory sessionFactory;
 
   public List&lt;Account&gt; getAllAccounts() {
@@ -190,15 +189,14 @@
         <example>
           <title>Hibernate-based DAO: a SessionFactory is injected directly in
           the bean</title>
-
-          <para><programlisting language="XML">public class HibernateAccountDao {
+<programlisting language="Java">public class HibernateAccountDao {
   @Autowired EntityManager entityManager;
 
   public List&lt;Account&gt; getAllAccounts() {
      return entityManager.createQuery("SELECT a FROM Account").getResultList();
   }
   ...
-}</programlisting></para>
+}</programlisting>
         </example>
 
         <para>As an alternative, an EntityManagerFactory can also be used
@@ -210,7 +208,7 @@
         <example>
           <title>Spring Bean Representing an Entity Manager Factory</title>
 
-          <programlisting language="xml">&lt;jee:jndi-lookup id="entityManagerFactory" jndi-name="java:/example/emf"/&gt;</programlisting>
+          <programlisting language="XML">&lt;jee:jndi-lookup id="entityManagerFactory" jndi-name="java:/example/emf"/&gt;</programlisting>
         </example>
 
         <para>In general, for implementing transaction-aware components, it is not typical to access EntityManagerFactories directly (for example a service that delegates to multiple DAOs which have to be
@@ -269,7 +267,7 @@
         <example>
           <title>A Spring-defined JTA-based entity manager factory</title>
 
-          <para><programlisting language="XML">&lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
+          <programlisting language="XML">&lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
     &lt;property name="jpaVendorAdapter"&gt;
         &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/&gt;
     &lt;/property&gt;
@@ -280,7 +278,7 @@
              &lt;/prop&gt;
          &lt;/props&gt;
     &lt;/property&gt;
-&lt;/bean&gt;</programlisting></para>
+&lt;/bean&gt;</programlisting>
 
           <para>The above definition relies upon a <filename>META-INF/persistence.xml</filename>
           file being provided in the deployment. However, if it is not present,
@@ -291,13 +289,12 @@
           linkend="alt-location" />.</para>
         </example>
 
-        <example>
+        <example id="alt-location">
           <title>Using an alternative location for persistence.xml</title>
-
-          <para><programlisting language="XML">&lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
+<programlisting language="XML">&lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
    &lt;property name="persistenceXmlLocation" value="classpath*:META-INF/persistence-booking.xml"/&gt;
    &lt;!-- other properties (ommitted) --&gt;
-&lt;/bean&gt;</programlisting></para>
+&lt;/bean&gt;</programlisting>
         </example>
 
         <para>When using the LocalContainerManagedEntityFactoryBean in JBoss,
@@ -378,19 +375,20 @@
         </example>
 
         <para>A bean of this class can be injected in the
-        LocalContainerEntityManagerFactoryBean as follows:<example>
+        LocalContainerEntityManagerFactoryBean as follows:
+        </para>
+        <example>
             <title>Adding the PersistenceUnitPostProcessor to the context
             definition</title>
-
-            <para><programlisting language="XML">&lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
+            <programlisting language="XML">&lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
 &lt;!-- other properties --&gt;
   &lt;property name="persistenceUnitPostProcessors"&gt;
     &lt;list&gt;
       &lt;bean class="org.springframework.webflow.samples.booking.MyPersistenceUnitPostProcessor"/&gt;
     &lt;/list&gt;
   &lt;/property&gt;
-&lt;/bean&gt;</programlisting></para>
-          </example></para>
+&lt;/bean&gt;</programlisting>
+          </example>
       </section>
 
       <section>
@@ -514,8 +512,7 @@
     <example>
       <title>Using the JCA message listener containers and namespace support
       in JBoss</title>
-
-      <para><programlisting language="XML"> &lt;jms:jca-listener-container resource-adapter="resourceAdapter" acknowledge="auto"
+<programlisting language="XML"> &lt;jms:jca-listener-container resource-adapter="resourceAdapter" acknowledge="auto"
                                 activation-spec-factory="activationSpecFactory"&gt;
         &lt;jms:listener destination="/someDestination" ref="messageDrivenPojo"
                       method="pojoHandlerMethod"/&gt;
@@ -526,7 +523,7 @@
 
     &lt;jboss:resource-adapter id="resourceAdapter"/&gt;
 
-    &lt;bean id="messageDrivenPojo" class="example.MessageDrivenPojo"/&gt;</programlisting></para>
+    &lt;bean id="messageDrivenPojo" class="example.MessageDrivenPojo"/&gt;</programlisting>
     </example>
 
     <para>When a message arrives, the container will invoke the messageDrivenPojo bean. 
@@ -564,7 +561,7 @@
     <example>
       <title>JTA transaction manager definition in Spring</title>
 
-      <programlisting lang="xml">&lt;tx:jta-transaction-manager id="transactionManager"/&gt;</programlisting>
+      <programlisting language="XML">&lt;tx:jta-transaction-manager id="transactionManager"/&gt;</programlisting>
     </example>
 
     <para>The use of this transaction manager allows Spring to create JTA
@@ -715,7 +712,7 @@
         <example>
           <title>Injecting a Spring bean into an EJB using Snowdrop</title>
 
-          <para><programlisting language="Java">@Stateless
+          <programlisting language="Java">@Stateless
 @Interceptors(SpringLifecycleInterceptor.class)
 public class InjectedEjbImpl implements InjectedEjb
 {
@@ -723,7 +720,7 @@
  private SpringBean springBean;
 
  /* rest of the class definition ommitted */
-}</programlisting></para>
+}</programlisting>
         </example>
       </simplesect>
     </section>



More information about the jboss-cvs-commits mailing list