You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ri...@apache.org on 2005/08/25 08:47:02 UTC

svn commit: r240007 - /beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/pageflow/pageflow_building.xml

Author: rich
Date: Wed Aug 24 23:46:58 2005
New Revision: 240007

URL: http://svn.apache.org/viewcvs?rev=240007&view=rev
Log:
Rewrite of the "Building a Page Flow Project" doc.

tests: build.release in docs/forrest (WinXP)


Modified:
    beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/pageflow/pageflow_building.xml

Modified: beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/pageflow/pageflow_building.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/pageflow/pageflow_building.xml?rev=240007&r1=240006&r2=240007&view=diff
==============================================================================
--- beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/pageflow/pageflow_building.xml (original)
+++ beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/pageflow/pageflow_building.xml Wed Aug 24 23:46:58 2005
@@ -1,342 +1,465 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
 <document>
-  <header>
-    <title>Building a Page Flow Web App</title>
-  </header>
-  <body>
-
-  <section id="introduction">
-    <title>Introduction</title>
-
-    <p>
-    Now that the theory of Java Page Flows has been explained, you need to know
-    how to concretely put together a web-app that uses JPFs.  Beehive ships with
-    a set of Ant buildfiles to make the building of an application much easier.
-    </p>
-
-  </section>
-
-  <section id="source_tree_layout">
-    <title>Source Tree Layout</title>
-
-    <p>
-    The layout of your project may be anywhere on your local disk.  We will assume
-    that the environment variable $WEBAPP_DIR points to the top-level of your
-    application.      
-    </p>
-	<p>Here is a typical directory structure, an emandation of the core directory structure found in the 
-		web app template <code>&lt;BeehiveRoot>/samples/netui-blank</code>.  For instructions on using the web app
-		template, see <a href="site:netui-blank">Project: Page Flow</a>.</p>
-
-    <ul>
-      <li><code>$WEBAPP_DIR/</code>
-        <ul>
-          <li><code>Controller.java</code></li>
-          <li><code>index.jsp</code></li>
-          <li><code>login.jsp</code></li>
-          <li><code>signup.jsp</code></li>
-          <li><code>mypage.jsp</code></li>
-          <li><code>resources/</code></li>
-          <li><code>WEB-INF/</code>
-            <ul>
-              <li><code>classes/</code></li>
-              <li><code>lib/</code></li>
-              <li><code>src/</code></li>
-            </ul>
-          </li>
-        </ul>
-      </li>
-    </ul>
-
-    <section id="top_level">
-      <title><code>$WEBAPP_DIR/</code></title>
-
-      <p>
-      The top-level of the web-app, at <code>$WEBAPP_DIR</code> should contain
-      your JSP pages and a <code>Controller.java</code>.  When built, the
-      <code>Controller.java</code> will be compiled to <code>WEB-INF/classes/Controller.class</code>.
-      </p>
-
-
-    </section>
-
-    <section id="web-inf">
-      <title><code>$WEBAPP_DIR/WEB-INF/</code></title>
-
-      <p>
-      The <code>$WEBAPP_DIR/WEB-INF/</code> directory is just as it is with any other servlet-based
-      application.
-      </p>
+    <header>
+        <title>Building a Page Flow Web Project</title>
+    </header>
+    <body>
+
+    <section id="introduction">
+        <title>Introduction</title>
+
+        <p>
+          Now that the basics of Page Flow have been explained, you need to know how to put together a web project that
+          uses page flows.  Beehive ships with a set of Ant build files to help with this task.
+        </p>
 
     </section>
 
-    <section id="web-inf_src">
-      <title><code>$WEBAPP_DIR/WEB-INF/src/</code></title>
+    <section id="source_tree_layout">
+        <title>Project Layout</title>
 
-      <p>
-      The <code>$WEBAPP_DIR/WEB-INF/src/</code> directory contains any other application 
-      source files that need to be compiled into Java classes.  They will be compiled 
-      to <code>$WEBAPP_DIR/WEB-INF/classes/</code>.  Additionally, any extra <code>.properties</code> 
-      or <code>.xml</code> files that need to be deployed with your application will be copied
-      from the <code>src/</code> directory to the <code>classes/</code> directory during the build.
-      </p>
+        <p>
+          Your project may live anywhere on your local disk. For now, we will assume that you have a simple project layout
+          in the style of the blank sample Page Flow project (<a href="site:netui-blank">Project: Page Flow</a>). In this
+          case, you can modify and use the build.xml and build.properties files from that project. For a discussion of
+          alternate project layouts, see <a href="#alternateProjectLayouts">Alternate Project Layouts</a>, below.
+        </p>
+        <p>
+          Let's assume that your project looks like this:
+        </p>
+        <source>
+project/
+    myPageFlow/
+        Controller.java
+        page1.jsp
+        page2.jsp
+    WEB-INF/
+        classes/
+        lib/
+        src/
+            build.properties
+            build.xml
+        web.xml</source>
+          
+        <section id="projectRoot">
+            <title><code>project/</code></title>
+            <p>
+                The <code>project</code> directory is the root of the web project.  All web content (JSPs, etc.) lives under
+                this directory.  Page Flow controller source files also live under this directory, alongside the JSPs they
+                own.
+            </p>
+        </section>
+        <section id="myPageFlow">
+            <title><code>project/myPageFlow/</code></title>
+            <p>
+                The <code>project/myPageFlow</code> directory is a <em>page flow</em>: a controller class and a set of pages
+                that go with it.  The <code>Controller.java</code> file is compiled to
+                <code>project/WEB-INF/classes/myPageFlow/Controller.class</code>, and it generates a Struts config
+                file at <code>project/WEB-INF/.pageflow-struts-generated/jpf-struts-config-myPageFlow.xml</code>.
+            </p>
+        </section>
+
+        <section id="webinfSrc">
+            <title><code>project/WEB-INF/src</code></title>
+            <p>
+                The <code>project/WEB-INF/src</code> directory contains both Java source code and resources such
+                as <code>.xml</code> and <code>.properties</code> files. During the build, Java source code is compiled
+                to classes in <code>project/WEB-INF/classes</code>, and resources are copied into directories under
+                <code>project/WEB-INF/classes</code>.
+            </p>
+
+        </section>
+
+        <section id="webinfLib">
+            <title><code>project/WEB-INF/lib/</code></title>
+
+            <p>
+                As with any other web application, the <code>project/WEB-INF/lib</code> directory contains the JAR files
+                used by your application, including those required by Beehive itself.  The jars required by Beehive are
+                listed below.
+            </p>
 	  
-	  <p><code>$WEBAPP_DIR/WEB-INF/src/</code> should also contain the build related files for the web app.
-		See the web app template <code>&lt;BeehiveRoot>/samples/netui-blank/WEB-INF/src</code> for an 
-		example build file and supporting <code>build.properties</code> file.</p>
-    
-    </section>
+            <note>
+                These JAR files are installed automatically during the <a href="#building">build</a>. The list below is
+                for reference only; you do not need to install the JARs by hand. If you want, you can always install
+                them into a web project using the following command:
+                <code>ant -f </code><em>beehive-home</em><code>/ant/beehive-runtime.xml
+                -Dwebapp.dir=</code><em>full-path-to-project-directory</em><code>
+                deploy.beehive.webapp.runtime</code>
+            </note>
+
+            <table>
+              <tr>
+                <th>Project</th>
+                <th>Jar</th>
+                <th>Version</th>
+              </tr>
+              <tr>
+                <td>Beehive Controls</td>
+                <td>beehive-controls.jar</td>
+                <td><em>distribution</em></td>
+              </tr>
+              <tr>
+                <td>Beehive NetUI</td>
+                <td>beehive-netui-core.jar</td>
+                <td><em>distribution</em></td>
+              </tr>
+              <tr>
+                <td>Beehive NetUI</td>
+                <td>beehive-netui-tags.jar</td>
+                <td><em>distribution</em></td>
+              </tr>
+              <tr>
+                <td>Jakarta Commons Bean Utils</td>
+                <td>commons-beanutils.jar</td>
+                <td>1.6</td>
+              </tr>
+              <tr>
+                <td>Jakarta Commons Codec</td>
+                <td>commons-codec-1.3.jar</td>
+                <td>1.3</td>
+              </tr>
+              <tr>
+                <td>Jakarta Commons Collections</td>
+                <td>commons-collections.jar</td>
+                <td>2.1.1</td>
+              </tr>
+              <tr>
+                <td>Jakarta Commons Digester</td>
+                <td>commons-digester.jar</td>
+                <td>1.6</td>
+              </tr>
+              <tr>
+                <td>Jakarta Commons Discovery</td>
+                <td>commons-discovery-0.2.jar</td>
+                <td>0.2</td>
+              </tr>
+              <tr>
+                <td>Jakarta Commons EL</td>
+                <td>commons-el.jar</td>
+                <td>1.0</td>
+              </tr>
+              <tr>
+                <td>Jakarta Commons File Upload</td>
+                <td>commons-fileupload.jar</td>
+                <td>1.0</td>
+              </tr>
+              <tr>
+                <td>Jakarta Commons Logging</td>
+                <td>commons-logging.jar</td>
+                <td>1.0.4</td>
+              </tr>
+              <tr>
+                <td>Jakarta Commons ORO (Text Processing)</td>
+                <td>jakarta-oro.jar</td>
+                <td>2.0.7</td>
+              </tr>
+              <tr>
+                <td>Jakarta Commons Validator</td>
+                <td>commons-validator.jar</td>
+                <td>1.1.4</td>
+              </tr>
+              <tr>
+                <td>JSR 173 (Streaming API for XML)</td>
+                <td>jsr173_1.0_api.jar</td>
+                <td>1.0</td>
+              </tr>
+              <tr>
+                <td>JSTL</td>
+                <td>jstl.jar</td>
+                <td>1.1.0-D13</td>
+              </tr>
+              <tr>
+                <td>JSTL</td>
+                <td>standard.jar</td>
+                <td>1.1.0-D13</td>
+              </tr>
+              <tr>
+                <td>Log4J</td>
+                <td>log4j-1.2.8.jar</td>
+                <td>1.2.8</td>
+              </tr>
+              <tr>
+                <td>Struts</td>
+                <td>struts.jar</td>
+                <td>1.2.7</td>
+              </tr>
+              <tr>
+                <td>XMLBeans</td>
+                <td>apache-xbean.jar</td>
+                <td>2.0.0</td>
+              </tr>
+            </table>
 
-    <section id="web-inf_lib">
-      <title><code>$WEBAPP_DIR/WEB-INF/lib/</code></title>
-
-      <p>
-      As with any other web application, the <code>$WEBAPP_DIR/WEB-INF/lib/</code> directory
-      should contain the jars for each dependency of your application, including those
-      required by Beehive itself.  The jars required by Beehive are listed below.
-      </p>
-	  
-	  <p><strong>Note:</strong> this Ant command will deploy the necessary JARs listed
-		below (plus a few other optional control JARs) to the WEB-INF/lib directory.</p>
-		
-	  <source>ant -f $BEEHIVE_HOME\ant\beehive-runtime.xml -Dwebapp.dir=$WEBAPP_DIR deploy.beehive.webapp.runtime</source>
-
-      <table>
-        <tr>
-          <th>Project</th>
-          <th>Jar</th>
-          <th>Version</th>
-        </tr>
-        <tr>
-          <td>Beehive Controls</td>
-          <td>beehive-controls.jar</td>
-          <td><em>distribution</em></td>
-        </tr>
-        <tr>
-          <td>Beehive NetUI</td>
-          <td>beehive-netui-core.jar</td>
-          <td><em>distribution</em></td>
-        </tr>
-        <tr>
-          <td>Beehive NetUI</td>
-          <td>beehive-netui-tags.jar</td>
-          <td><em>distribution</em></td>
-        </tr>
-        <tr>
-          <td>Jakarta Commons Bean Utils</td>
-          <td>commons-beanutils.jar</td>
-          <td>1.6</td>
-        </tr>
-        <tr>
-          <td>Jakarta Commons Codec</td>
-          <td>commons-codec-1.3.jar</td>
-          <td>1.3</td>
-        </tr>
-        <tr>
-          <td>Jakarta Commons Collections</td>
-          <td>commons-collections.jar</td>
-          <td>2.1.1</td>
-        </tr>
-        <tr>
-          <td>Jakarta Commons Digester</td>
-          <td>commons-digester.jar</td>
-          <td>1.6</td>
-        </tr>
-        <tr>
-          <td>Jakarta Commons Discovery</td>
-          <td>commons-discovery-0.2.jar</td>
-          <td>0.2</td>
-        </tr>
-        <tr>
-          <td>Jakarta Commons EL</td>
-          <td>commons-el.jar</td>
-          <td>1.0</td>
-        </tr>
-        <tr>
-          <td>Jakarta Commons File Upload</td>
-          <td>commons-fileupload.jar</td>
-          <td>1.0</td>
-        </tr>
-        <tr>
-          <td>Jakarta Commons Logging</td>
-          <td>commons-logging.jar</td>
-          <td>1.0.4</td>
-        </tr>
-        <tr>
-          <td>Jakarta Commons ORO (Text Processing)</td>
-          <td>jakarta-oro.jar</td>
-          <td>2.0.7</td>
-        </tr>
-        <tr>
-          <td>Jakarta Commons Validator</td>
-          <td>commons-validator.jar</td>
-          <td>1.1.4</td>
-        </tr>
-        <tr>
-          <td>JSR 173 (Streaming API for XML)</td>
-          <td>jsr173_1.0_api.jar</td>
-          <td>1.0</td>
-        </tr>
-        <tr>
-          <td>JSTL</td>
-          <td>jstl.jar</td>
-          <td>1.1.0-D13</td>
-        </tr>
-        <tr>
-          <td>JSTL</td>
-          <td>standard.jar</td>
-          <td>1.1.0-D13</td>
-        </tr>
-        <tr>
-          <td>Log4J</td>
-          <td>log4j-1.2.8.jar</td>
-          <td>1.2.8</td>
-        </tr>
-        <tr>
-          <td>Struts</td>
-          <td>struts.jar</td>
-          <td>1.2.7</td>
-        </tr>
-        <tr>
-          <td>XMLBeans</td>
-          <td>apache-xbean.jar</td>
-          <td>2.0.0</td>
-        </tr>
-      </table>
+        </section>
 
     </section>
 
-  </section>
-
-  <section id="running_ant">
-    <title>Running Ant</title>
+    <section id="building">
+        <title>Building</title>
 
-    <p>The following section assumes that you are using the Ant build.xml 
-		file found at <code>&lt;BeehiveRoot>/samples/netui-blank/WEB-INF/src/</code>.  We assume either (1)
-		that the build.xml file has been copied to <code>$WEBAPP_DIR/WEB-INF/src/</code>
-		or (2) that your web app has been developed by amending the template web app 
-		&lt;BeehiveRoot/samples/netui-blank. (For instructions on starting a web with the template web app, see
-		<a href="site:netui-blank">Project: Page Flow</a>.)</p>
+        <p>
+            This section assumes that you are using <code>project/WEB-INF/src/build.xml</code>, which should like the
+            file found at <em>beehive-home</em><code>/samples/netui-blank/WEB-INF/src/build.xml</code>. (For
+            instructions on starting with the template web project, see
+            <a href="site:netui-blank">Project: Page Flow</a>.)
+        </p>
 	
-	<p>You also set the following properties in a supporting <code>build.properties</code>
-		file located at <code>$WEBAPP_DIR/WEB-INF/src/build.properties</code>.</p>
-		
-    <ul>
-		<li><code>beehive.home</code> -- points to the top-level directory of your Beehive installation</li>
-		<li><code>servlet-api.jar</code> -- for Tomcat, this value is $CATALINA_HOME/common/lib/servlet-api.jar</li>
-		<li>jsp-api.jar -- for Tomcat, this value is $CATALINA_HOME/common/lib/jsp-api.jar</li>
-		<li>context.path -- determines (1) part of the URL where your web app resides, e.g., http://some.domain/<strong>contextPath</strong>/someDirectory,
-			and (2) the name of the compiled WAR file.</li>
-    </ul>
-	
-	<p>An example <code>build.properties</code> file appears below.</p>
-	
-	<p><strong>build.properties</strong></p>
-	<source>
+        <p>
+            The build.xml file depends on properties that you have set up in the file
+            <code>project/WEB-INF/src/build.xml</code>. You need to provide values for the following properties:
+        </p>
+            
+        <ul>
+            <li><code>beehive.home</code>: points to the top-level directory of your Beehive installation</li>
+            <li><code>servlet-api.jar</code>: for Tomcat, this value is $CATALINA_HOME/common/lib/servlet-api.jar</li>
+            <li><code>jsp-api.jar</code>: for Tomcat, this value is $CATALINA_HOME/common/lib/jsp-api.jar</li>
+            <li>
+                <code>context.path</code>: determines (1) the context path for your deployed webapp (e.g., 
+                http://some.domain/<em>context.path</em>/someDirectory), and (2) the name of the compiled WAR file.
+            </li>
+        </ul>
+        
+        <p>An example <code>build.properties</code> file appears below.</p>
+        
+        <source>
 beehive.home=/apache/apache-beehive-1.0
 servlet-api.jar=${os.CATALINA_HOME}/common/lib/servlet-api.jar
 jsp-api.jar=${os.CATALINA_HOME}/common/lib/jsp-api.jar
-context.path=contextPath</source>
-		
-			<p>
-    Before you can build the web-app using Ant, you must ensure that the
-    following variables are set: <code>ANT_HOME</code>, <code>JAVA_HOME</code>, 
-	and <code>CATALINA_HOME</code>.
-    </p>
-
-    <table>
-      <tr>
-        <th>Variable</th>
-        <th>Value</th>
-      </tr>
-      <tr>
-        <td>ANT-HOME</td>
-        <td>Top level of your Ant distribution</td>
-      </tr>
-      <tr>
-        <td>JAVA_HOME</td>
-        <td>You must have JDK5 installed.</td>
-      </tr>
-      <tr>
-        <td>CATALINA_HOME</td>
-        <td>Top level of the installed Tomcat server.</td>
-      </tr>
-    </table>
-
-    <p>
-    Once these variables are set correctly, building the deployable web-app 
-    requires a single ant invocation using the build file at <code>$WEBAPP_DIR/WEB-INF/src/build.xml</code>.
-    This build-file is invoked using ant's <code>-f &lt;buildfile-path&gt;</code> option.
-    The directory of the web app is gleened from the supporting <code>build.properties file</code>.  
-	Finally, the <code>clean</code>, <code>build</code>, and <code>war</code> targets are invoked in turn.
-    </p>
-
-<source>
-ant -f $WEBAPP_DIR/WEB-INF/src/build.xml clean build war
-</source>
+context.path=myWebApp</source>
+        <p>
+            Before you can build the web project using Ant, you must ensure that the
+            following variables are set: <code>ANT_HOME</code>, <code>JAVA_HOME</code>, 
+            and <code>CATALINA_HOME</code>.
+        </p>
+
+        <table>
+            <tr>
+              <th>Variable</th>
+              <th>Value</th>
+            </tr>
+            <tr>
+              <td>ANT_HOME</td>
+              <td>Top level of your Ant distribution</td>
+            </tr>
+            <tr>
+              <td>JAVA_HOME</td>
+              <td>You must have JDK5 installed.</td>
+            </tr>
+            <tr>
+              <td>CATALINA_HOME</td>
+              <td>Top level of the installed Tomcat server (optional; required only if you use Tomcat).</td>
+            </tr>
+        </table>
+
+        <p>
+            Once these variables are set correctly, you can build the project and generate a deployable <code>war</code>
+            file using the following command (assuming you are in the <code>project</code> directory):
+        </p>
+        <source>ant -f WEB-INF/src/build.xml clean build war</source>
+        <p>
+            This cleans the project, builds it, and packages it into a deployable unit (<code>myWebApp.war</code>, in
+            this case, since <code>context.path=myWebApp</code> in <code>build.properties</code>).
+        </p>
 
+    </section>
 
-<p>The <code>clean</code> target deletes any old build artifacts from the <code>WEB-INF/classes</code> directory, and
-	other directories.</p>
-	
-<p>The <code>build</code> target compiles new build artifacts from the source files.</p>
+    <section id="deploying">
+        <title>Deploying the Web Project</title>
+
+        <p>
+            To deploy your project, you have two options:
+        </p>
+        <ul>
+            <li>deploy the <code>war</code> file (<code>myWebApp.war</code>), or,</li>
+            <li>deploy the actual web project directory.</li>
+        </ul>
+        <note>
+            Deploying the web project directory is useful when you in an iterative development; once the directory is
+            deployed as a webapp, you can see changes by running <code>ant -f WEB-INf/src/build.xml build</code>, then
+            redeploying the webapp.
+        </note>
+        
+        <p>
+            Instructions for deploying a project vary from server to server.  One way to deploy using Tomcat is to
+            hit the following URL in your browser:
+        </p>
+        <source>http://localhost:8080/manager/deploy?path=<em>context-path</em>&amp;war=<em>URL-to-project-directory-or-war</em>&amp;update=true</source>
+        <p>
+            An example <em>context-path</em> might be <code>/myWebApp</code>, and an example URL (on Windows) might be
+            <code>file:///C:/temp/project</code>.
+        </p>
+        
+        <note>
+            The Tomcat instructions assume that you have created the <code>manager</code> role in the configuration file 
+            <code>$CATALINA_HOME/conf/tomcat-users.xml</code>.
+        </note>
+    </section>
 
-<p>Finally, the <code>war</code> target zips up the results into a WAR file, named <code>contextPath.war</code>.</p>
+    <section id="next">
+        <title>Next...</title>
 
-  </section>
+        <p>
+            Now that you've built and deployed a project, you can see how easy it is to modify the flow between pages.
+        </p>
 
-  <section id="deploying">
-    <title>Deploying the Web-app</title>
+        <ul>
+            <li><a href="site:pageflow_altering">Altering a Page Flow</a></li>
+        </ul>
+    </section>
+        
+    <section id="alternateProjectLayouts">
+        <title>Alternate Project Layouts</title>
+        <p>
+            The Beehive build tools support many project layouts (see
+                <a href="site:ant-macros">Beehive Ant Macros</a>).  The project layout described above is a very
+            simple one; web source, content, and generated files are all mixed in the same directory.  An alternate
+            project model might separate these out in a structure like this:
+        </p>
+        <source>
+project/
+    build/
+        webapp/
+    src/
+        java/ <em>(contains pure Java source code)</em>
+        web/  <em>(contains JSPs and controller source files)</em>
+    build.properties
+    build.xml</source>
+        <p>
+            Here, the full webapp is built to project/build/webapp, while source and content directories are
+            untouched.  The build.xml file would look like this:
+        </p>
+        <source>
+&lt;project name="AlternateProjectModel" default="usage" basedir="."&gt;
+
+    &lt;property environment="os"/&gt;
+    &lt;property file="${basedir}/build.properties"/&gt;
+
+    &lt;import file="${beehive.home}/beehive-imports.xml"/&gt;
+    &lt;import file="${beehive.home}/ant/beehive-tools.xml"/&gt;
+
+    &lt;property name="build.dir" location="${basedir}/build"/&gt;
+    &lt;property name="build.webapp.dir" location="${build.dir}/webapp"/&gt;
+    &lt;property name="src.dir" location="${basedir}/src"/&gt;
+    &lt;property name="src.java.dir" location="${src.dir}/java"/&gt;
+    &lt;property name="src.content.dir" location="${src.dir}/web"/&gt;
+    &lt;property name="webinf.dir" location="${build.webapp.dir}/WEB-INF"/&gt;
+    &lt;property name="build.classes.dir" location="${webinf.dir}/classes"/&gt;
+    &lt;property name="tmp.sourcegen.dir" value="${build.dir}/tmpbeansrc"/&gt;
+
+    &lt;!-- Define the classpath used to build the webapp --&gt;
+    &lt;path id="webapp.build.classpath"&gt;
+        &lt;pathelement location="${servlet-api.jar}"/&gt;
+        &lt;pathelement location="${jsp-api.jar}"/&gt;
+        &lt;pathelement location="${build.classes.dir}"/&gt;
+        &lt;fileset dir="${webinf.dir}/lib"&gt;
+            &lt;include name="*.jar"/&gt;
+        &lt;/fileset&gt;
+    &lt;/path&gt;    
+
+    &lt;!-- Define the sourcepath used to build the webapp --&gt;
+    &lt;path id="webapp.build.sourcepath"&gt;
+        &lt;pathelement location="${src.java.dir}"/&gt;
+    &lt;/path&gt;    
+
+    &lt;target name="deploy-beehive" description="Copy the Beehive Page Flow rutime into the target webapp"&gt;
+        &lt;mkdir dir="${build.webapp.dir}"/&gt;
+        &lt;deploy-netui webappDir="${build.webapp.dir}"/&gt;
+    &lt;/target&gt;
+
+    &lt;target name="build" depends="deploy-beehive" description="Build the webapp"&gt;
+        &lt;available property="src.dir.available" file="${src.dir}" type="dir"/&gt;
+        &lt;fail unless="src.dir.available" message="Can't find the source directory ${src.dir}"/&gt;
+
+        &lt;!-- 
+            this directory needs to get whacked before every build so 
+            that control interface repackagings don't cause stale
+            files to be compiled 
+          --&gt;
+        &lt;delete dir="${tmp.sourcegen.dir}" includeEmptyDirs="true"/&gt;
+
+        &lt;mkdir dir="${build.classes.dir}"/&gt;
+
+        &lt;!-- compile XSDs --&gt;
+        &lt;build-schemas srcdir="${src.dir}/schemas" destdir="${build.classes.dir}"/&gt;
+
+        &lt;!-- compile controls --&gt;
+        &lt;build-controls srcdir="${src.java.dir}" 
+                        destdir="${build.classes.dir}" 
+                        tempdir="${tmp.sourcegen.dir}"
+                        classpathref="webapp.build.classpath"/&gt;
+
+        &lt;!--
+            compile page flows (note: controller source files live inside the web content
+            directory, but they are not included in the built webapp.)
+        --&gt;
+        &lt;build-pageflows srcdir="${src.content.dir}"
+                         webcontentdir="${src.content.dir}" 
+                         weboutputdir="${build.webapp.dir}" 
+                         classoutputdir="${build.classes.dir}" 
+                         tempdir="${tmp.sourcegen.dir}"
+                         classpathref="webapp.build.classpath"
+                         sourcepathref="webapp.build.sourcepath"/&gt;
+
+        &lt;!-- Copy the content to the build directory. --&gt;
+        &lt;copy todir="${build.webapp.dir}"&gt;
+            &lt;fileset dir="${src.content.dir}"&gt;
+                &lt;include name="**"/&gt;
+                &lt;exclude name="**/*.java"/&gt;
+            &lt;/fileset&gt;
+        &lt;/copy&gt;
+    &lt;/target&gt;
+
+    &lt;target name="clean" description="Clean the webapp"&gt;
+        &lt;delete dir="${build.dir}" includeEmptyDirs="true"/&gt;
+    &lt;/target&gt;
+
+    &lt;target name="war" description="Build a compressed WAR file that can be deployed to an application container"&gt;
+        &lt;property name="archive.dir" value="${build.webapp.dir}/.."/&gt;
+
+        &lt;!-- this does *not* exclude source from the archive --&gt;
+        &lt;war destfile="${archive.dir}/${context.path}.war" webxml="${webinf.dir}/web.xml"&gt;
+            &lt;fileset dir="${webinf.dir}"&gt;
+                &lt;exclude name="web.xml"/&gt;
+            &lt;/fileset&gt;
+        &lt;/war&gt;
+    &lt;/target&gt;
+
+    &lt;target name="usage" description="Print usage information for this build file"&gt;
+            <em>(same as in netui-blank)</em>
+    &lt;/target&gt;
+
+&lt;/project&gt;
+        </source>
+        <p>
+            Note that the Page Flow controller source files live among web content, e.g.,
+        </p>
+        <source>
+project/
+    build/
+        webapp/
+    src/
+        java/
+        web/
+          myPageFlow/
+              Controller.java
+              page1.jsp
+              page2.jsp
+    build.properties
+    build.xml</source>
+        <p>
+            Keeping the controller .java files next to their associated JSPs is a convenience; they are <em>not</em>
+            included in the built webapp. You could just as easily put these files under a directory like
+            project/src/pageflow.
+        </p>
+    </section>
 
-    <p>
-    The easiest way to deploy the web-app is to create a symlink/shortcut from
-    $WEBAPP_DIR to $CATALINA_HOME/webapps.  
-    </p>
-
-<source>ln -s $WEBAPP_DIR $CATALINA_HOME/webapps</source>
-
-<p>Another way would be to simply copy
-    $WEBAPP_DIR to $CATALINE_HOME/webapps.</p>
-
-<source>cp -R $WEBAPP_DIR $CATALINE_HOME/webapps</source>
-
-<p>Another way is to visit the following link in a browser.  This method
-	assumes that you have created the manager role in the configuration file 
-	<code>CATALINA_HOME/conf/tomcat-users.xml</code>.  For details, see 
-	<a href="site:setup">Installation and Setup</a>.   <strong>&lt;Context-Path></strong> is the desired
-	URL path to the application.  <strong>&lt;Full-Path-to-Development-Dir></strong>
-	is the location of the application on your machine.</p>
-
-<source>http://localhost:8080/manager/deploy?path=<strong>&lt;Context-Path></strong>&amp;war=<strong>&lt;Full-Path-to-Development-Dir></strong>&amp;update=true</source>
-
-  </section>
-
-  <section id="next">
-    <title>Next...</title>
-
-    <p>
-    Now that you've built and deployed an application, you can see how easy it is to modify
-    the flow between pages, adding and removing pages.
-    </p>
-
-    <ul>
-      <li><a href="site:pageflow_altering">Altering a Page Flow</a></li>
-    </ul>
-  </section>
-      
-      <section>
-          <title>[TODO]</title>
-          <source>
-              
-          </source>
-      </section>
-
-  </body>
-  <footer>
-    <legal>
-      Java, J2EE, and JCP are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.<br/>
-      &copy; 2004, Apache Software Foundation 
-    </legal>
-  </footer>
+    </body>
+    <footer>
+        <legal>
+        Java, J2EE, and JCP are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.<br/>
+        &copy; 2004, Apache Software Foundation 
+        </legal>
+    </footer>
 </document>