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

svn commit: r168392 - in /incubator/beehive/trunk: ./ samples/petstoreWeb/ samples/petstoreWeb/WEB-INF/ samples/petstoreWeb/WEB-INF/lib/ samples/petstoreWeb/WEB-INF/src/ samples/petstoreWeb/WEB-INF/tags/ samples/petstoreWeb/account/ samples/petstoreWeb/auth/ samples/petstoreWeb/checkout/ samples/petstoreWeb/images/ samples/petstoreWeb/shop/ samples/petstoreWeb/site/ samples/petstoreWeb/src/ samples/petstoreWeb/src/org/ samples/petstoreWeb/src/sql/ samples/petstoreWeb/web/ samples/petstoreWeb/web/WEB-INF/ samples/petstoreWeb/web/WEB-INF/tags/ samples/petstoreWeb/web/WEB-INF/tags/beehive/ samples/petstoreWeb/web/account/ samples/petstoreWeb/web/account/addresses/ samples/petstoreWeb/web/account/create/ samples/petstoreWeb/web/account/edit/ samples/petstoreWeb/web/auth/ samples/petstoreWeb/web/checkout/ samples/petstoreWeb/web/images/ samples/petstoreWeb/web/shop/ samples/petstoreWeb/web/site/ samples/petstoreWeb/web/webappRoot/ samples/petstoreWeb/webappRoot/

Author: ekoneil
Date: Thu May  5 12:59:00 2005
New Revision: 168392

URL: http://svn.apache.org/viewcvs?rev=168392&view=rev
Log:
Rework the structure of the petstoreWeb sample webapp.

This changes the webapp from a structure like:

petstoreWeb/
  Controller.java
  index.jsp
  ...
  WEB-INF/
    web.xml
    src/
      build.xml
      build.properties
      *.java

to:

petstoreWeb/
  build.xml
  build.properties
  src/
    *.java
  web/
    Controller.java
    index.jsp
    WEB-INF/
      web.xml

The webapp now builds into a directory "build/" under petstoreWeb/ which can be deployed to an application container.  It is now slightly more difficult to do iterative development of the webapp because the deployed context root is no longer the location of the JSPs.  Am curious to know what folks think of this, so feedback welcome.

BB: self
DRT: Beehive pass
Test: builds of petstoreWeb from the SVN tree and from the distribution were successful.  The application also runs correctly.



Added:
    incubator/beehive/trunk/samples/petstoreWeb/build-dist.properties
      - copied, changed from r168071, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.properties
    incubator/beehive/trunk/samples/petstoreWeb/build-dist.xml
      - copied, changed from r168071, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml
    incubator/beehive/trunk/samples/petstoreWeb/build.xml
      - copied, changed from r168071, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build.xml
    incubator/beehive/trunk/samples/petstoreWeb/src/
      - copied from r168071, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/
    incubator/beehive/trunk/samples/petstoreWeb/src/PetstoreInventoryManager.jws
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/PetstoreInventoryManager.jws
    incubator/beehive/trunk/samples/petstoreWeb/src/log4j.xml
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/log4j.xml
    incubator/beehive/trunk/samples/petstoreWeb/src/org/
      - copied from r168391, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/
    incubator/beehive/trunk/samples/petstoreWeb/src/sql/
      - copied from r168391, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/sql/
    incubator/beehive/trunk/samples/petstoreWeb/web/
    incubator/beehive/trunk/samples/petstoreWeb/web/Controller.java
      - copied unchanged from r168344, incubator/beehive/trunk/samples/petstoreWeb/Controller.java
    incubator/beehive/trunk/samples/petstoreWeb/web/WEB-INF/
    incubator/beehive/trunk/samples/petstoreWeb/web/WEB-INF/server-config.wsdd
      - copied unchanged from r168359, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/server-config.wsdd
    incubator/beehive/trunk/samples/petstoreWeb/web/WEB-INF/tags/
      - copied from r168071, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/
    incubator/beehive/trunk/samples/petstoreWeb/web/WEB-INF/tags/beehive/
      - copied from r168391, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/
    incubator/beehive/trunk/samples/petstoreWeb/web/WEB-INF/web.xml
      - copied unchanged from r168071, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/web.xml
    incubator/beehive/trunk/samples/petstoreWeb/web/account/
      - copied from r168071, incubator/beehive/trunk/samples/petstoreWeb/account/
    incubator/beehive/trunk/samples/petstoreWeb/web/account/addresses/
      - copied from r168391, incubator/beehive/trunk/samples/petstoreWeb/account/addresses/
    incubator/beehive/trunk/samples/petstoreWeb/web/account/create/
      - copied from r168391, incubator/beehive/trunk/samples/petstoreWeb/account/create/
    incubator/beehive/trunk/samples/petstoreWeb/web/account/edit/
      - copied from r168391, incubator/beehive/trunk/samples/petstoreWeb/account/edit/
    incubator/beehive/trunk/samples/petstoreWeb/web/auth/
      - copied from r168071, incubator/beehive/trunk/samples/petstoreWeb/auth/
    incubator/beehive/trunk/samples/petstoreWeb/web/auth/Controller.java
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/auth/Controller.java
    incubator/beehive/trunk/samples/petstoreWeb/web/auth/login.jsp
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/auth/login.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/auth/loginError.jsp
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/auth/loginError.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/checkout/
      - copied from r168071, incubator/beehive/trunk/samples/petstoreWeb/checkout/
    incubator/beehive/trunk/samples/petstoreWeb/web/checkout/Controller.java
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/checkout/Controller.java
    incubator/beehive/trunk/samples/petstoreWeb/web/checkout/confirm.jsp
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/checkout/confirm.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/checkout/newOrder.jsp
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/checkout/newOrder.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/checkout/shipping.jsp
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/checkout/shipping.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/checkout/viewCart.jsp
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/checkout/viewCart.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/checkout/viewOrder.jsp
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/checkout/viewOrder.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/help.jsp
      - copied unchanged from r168071, incubator/beehive/trunk/samples/petstoreWeb/help.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/images/
      - copied from r168071, incubator/beehive/trunk/samples/petstoreWeb/images/
    incubator/beehive/trunk/samples/petstoreWeb/web/images/beehive_logo.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/beehive_logo.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/birds_icon.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/birds_icon.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/bkg-topbar.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/bkg-topbar.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/button_submit.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/button_submit.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/cart.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/cart.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/cats_icon.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/cats_icon.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/dogs_icon.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/dogs_icon.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/error-header.jpg
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/error-header.jpg
    incubator/beehive/trunk/samples/petstoreWeb/web/images/fish_icon.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/fish_icon.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/help.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/help.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/reptiles_icon.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/reptiles_icon.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/separator.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/separator.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/sm_birds.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/sm_birds.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/sm_cats.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/sm_cats.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/sm_dogs.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/sm_dogs.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/sm_fish.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/sm_fish.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/images/sm_reptiles.gif
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/images/sm_reptiles.gif
    incubator/beehive/trunk/samples/petstoreWeb/web/index.jsp
      - copied unchanged from r168071, incubator/beehive/trunk/samples/petstoreWeb/index.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/shop/
      - copied from r168071, incubator/beehive/trunk/samples/petstoreWeb/shop/
    incubator/beehive/trunk/samples/petstoreWeb/web/shop/Controller.java
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/shop/Controller.java
    incubator/beehive/trunk/samples/petstoreWeb/web/shop/cart.jsp
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/shop/cart.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/shop/category.jsp
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/shop/category.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/shop/index.jsp
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/shop/index.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/shop/item.jsp
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/shop/item.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/shop/product.jsp
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/shop/product.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/site/
      - copied from r168071, incubator/beehive/trunk/samples/petstoreWeb/site/
    incubator/beehive/trunk/samples/petstoreWeb/web/site/default.css
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/site/default.css
    incubator/beehive/trunk/samples/petstoreWeb/web/site/emptyLeftNav.jsp
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/site/emptyLeftNav.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/site/template.jsp
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/site/template.jsp
    incubator/beehive/trunk/samples/petstoreWeb/web/webappRoot/
      - copied from r168071, incubator/beehive/trunk/samples/petstoreWeb/webappRoot/
    incubator/beehive/trunk/samples/petstoreWeb/web/webappRoot/SharedFlow.java
      - copied unchanged from r168391, incubator/beehive/trunk/samples/petstoreWeb/webappRoot/SharedFlow.java
Removed:
    incubator/beehive/trunk/samples/petstoreWeb/Controller.java
    incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/lib/
    incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/server-config.wsdd
    incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/
    incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/
    incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/web.xml
    incubator/beehive/trunk/samples/petstoreWeb/account/
    incubator/beehive/trunk/samples/petstoreWeb/auth/
    incubator/beehive/trunk/samples/petstoreWeb/checkout/
    incubator/beehive/trunk/samples/petstoreWeb/help.jsp
    incubator/beehive/trunk/samples/petstoreWeb/images/
    incubator/beehive/trunk/samples/petstoreWeb/index.jsp
    incubator/beehive/trunk/samples/petstoreWeb/shop/
    incubator/beehive/trunk/samples/petstoreWeb/site/
    incubator/beehive/trunk/samples/petstoreWeb/src/build-dist.properties
    incubator/beehive/trunk/samples/petstoreWeb/src/build-dist.xml
    incubator/beehive/trunk/samples/petstoreWeb/src/build.xml
    incubator/beehive/trunk/samples/petstoreWeb/webappRoot/
Modified:
    incubator/beehive/trunk/distribution.xml

Modified: incubator/beehive/trunk/distribution.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/distribution.xml?rev=168392&r1=168391&r2=168392&view=diff
==============================================================================
--- incubator/beehive/trunk/distribution.xml (original)
+++ incubator/beehive/trunk/distribution.xml Thu May  5 12:59:00 2005
@@ -442,20 +442,19 @@
 
         <copy todir="${dist.dir}/samples/petstoreWeb" failOnError="true">
             <fileset dir="samples/petstoreWeb">
-                <exclude name="WEB-INF/src/build.xml"/>
-                <exclude name="WEB-INF/src/build-dist.xml"/>
-                <exclude name="WEB-INF/src/build-dist.properties"/>
-                <exclude name="WEB-INF/lib/*.jar"/>
+                <exclude name="build"/>
+                <exclude name="build-dist.xml"/>
+                <exclude name="build-dist.properties"/>
+                <exclude name="build.xml"/>
+                <exclude name="build.properties"/>
             </fileset>
         </copy>
 
         <!-- rename build-dist.xml to build.xml -->
-        <copy tofile="${dist.dir}/samples/petstoreWeb/WEB-INF/src/build.xml" 
-              file="${beehive.home}/samples/petstoreWeb/WEB-INF/src/build-dist.xml" failOnError="true"/>
+        <copy tofile="${dist.dir}/samples/petstoreWeb/build.xml" file="${beehive.home}/samples/petstoreWeb/build-dist.xml" failOnError="true"/>
 
         <!-- rename build-dist.properties to build.properties -->
-        <copy tofile="${dist.dir}/samples/petstoreWeb/WEB-INF/src/build.properties" 
-              file="${beehive.home}/samples/petstoreWeb/WEB-INF/src/build-dist.properties" failOnError="true"/>
+        <copy tofile="${dist.dir}/samples/petstoreWeb/build.properties" file="${beehive.home}/samples/petstoreWeb/build-dist.properties" failOnError="true"/>
 
 
         <!-- Build the netui-samples distro -->

Copied: incubator/beehive/trunk/samples/petstoreWeb/build-dist.properties (from r168071, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.properties)
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/build-dist.properties?p2=incubator/beehive/trunk/samples/petstoreWeb/build-dist.properties&p1=incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.properties&r1=168071&r2=168392&rev=168392&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.properties (original)
+++ incubator/beehive/trunk/samples/petstoreWeb/build-dist.properties Thu May  5 12:59:00 2005
@@ -1,7 +1,7 @@
 #
 #
 #
-beehive.home=../../../..
+beehive.home=../../
 
 servlet-api.jar=${os.CATALINA_HOME}/common/lib/servlet-api.jar
 jsp-api.jar=${os.CATALINA_HOME}/common/lib/jsp-api.jar

Copied: incubator/beehive/trunk/samples/petstoreWeb/build-dist.xml (from r168071, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml)
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/build-dist.xml?p2=incubator/beehive/trunk/samples/petstoreWeb/build-dist.xml&p1=incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml&r1=168071&r2=168392&rev=168392&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml (original)
+++ incubator/beehive/trunk/samples/petstoreWeb/build-dist.xml Thu May  5 12:59:00 2005
@@ -1,106 +1,122 @@
-<?xml version="1.0"?>
-<!--
-   Copyright 2004 The Apache Software Foundation.
+<?xml version="1.0" ?>
 
+<!--
+   Copyright 2005 The Apache Software Foundation 
+ 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
-   
-       http://www.apache.org/licenses/LICENSE-2.0
-   
+  
+      http://www.apache.org/licenses/LICENSE-2.0
+  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-  
+ 
    $Header:$
  -->
 
-<!--
-  An Ant build file for compiling the petstoreWeb Beehive sample web application.
--->
-<project name="Beehive/Samples/PetstoreWeb" default="usage" basedir="../..">
+<project name="Beehive petstoreWeb sample" default="build" basedir=".">
 
     <property environment="os"/>
-    <property file="${basedir}/WEB-INF/src/build.properties"/>
-
+    <property file="build.properties"/>
     <import file="${beehive.home}/beehive-imports.xml"/>
     <import file="${beehive.home}/ant/beehive-tools.xml"/>
 
-    <property name="webapp.dir" location="${basedir}"/>
-
     <property name="tmp.sourcegen.dir" value=".tmpbeansrc"/>
     <property name="tmp.jpfgen.dir" value=".pageflow-struts-generated"/>
 
-    <!-- Define the classpath used to build the webapp -->
-    <path id="webapp.build.classpath">
-        <pathelement location="${servlet-api.jar}"/>
+    <property name="build.dir" location="build"/>
+    <property name="web.dir" location="web"/>
+    <property name="src.dir" location="src"/>
+  
+    <!-- ========================================= -->
+    <!-- build - build the webapp                  -->
+    <!-- ========================================= -->
+
+    <path id="webapp.classpath">
         <pathelement location="${jsp-api.jar}"/>
-        <pathelement location="${webapp.dir}/WEB-INF/classes"/>
-        <fileset dir="${webapp.dir}/WEB-INF/lib">
+        <pathelement location="${servlet-api.jar}"/>
+        <fileset dir="${build.dir}/WEB-INF/lib">
             <include name="*.jar"/>
         </fileset>
+        <pathelement location="${build.dir}/WEB-INF/classes"/>
     </path>    
 
     <target name="deploy-beehive" description="Copy the Beehive webapp rutime into the petstoreWeb webapp">
-        <deploy-netui webappDir="${webapp.dir}"/>
-        <deploy-wsm webappDir="${webapp.dir}"/>
+        <mkdir dir="${build.dir}"/>
+
+        <copy todir="${build.dir}/WEB-INF/lib" file="${beehive.home}/lib/controls/jdbc-control.jar"/>
+
+        <deploy-netui webappDir="${build.dir}"/>
+        <deploy-wsm webappDir="${build.dir}"/>
     </target>
 
-    <target name="build" depends="deploy-beehive" description="Build the petstoreWeb webapp">
-        <available property="webapp.dir.available" file="${webapp.dir}" type="dir"/>
-        <fail unless="webapp.dir.available" message="Can't find the webapp directory ${webapp.dir}"/>
-
-        <!-- 
-            this directory needs to get whacked before every build so 
-            that control interface repackagings don't cause stale
-            files to be compiled 
-          -->
-        <delete dir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}" includeEmptyDirs="true"/>
+    <target name="build" description="Build the webapp">
+        <copy todir="${build.dir}/">
+            <fileset dir="${web.dir}">
+                <exclude name="**/*.java"/>
+            </fileset>
+        </copy>
 
-        <mkdir dir="${webapp.dir}/WEB-INF/classes"/>
+        <copy todir="${build.dir}/WEB-INF/lib">
+            <fileset dir="${basedir}/lib">
+                <include name="*.jar"/>
+            </fileset>
+        </copy>
+
+        <copy todir="${build.dir}/WEB-INF/classes">
+            <fileset dir="${src.dir}/">
+                <include name="sql/**"/>
+                <include name="**/*.properties"/>
+            </fileset>
+        </copy>
 
         <!-- compile XSDs -->
-        <build-schemas srcdir="${webapp.dir}/WEB-INF/schemas" destdir="${webapp.dir}/WEB-INF/classes"/>
+        <echo>Building XML Schemas</echo>
+        <build-schemas srcdir="${basedir}/schemas"
+                       destDir="${build.dir}/WEB-INF/classes"/>
 
         <!-- compile controls -->
-        <build-controls srcdir="${webapp.dir}/WEB-INF/src" 
-                        destdir="${webapp.dir}/WEB-INF/classes" 
-                        tempdir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"
-                        classpathref="webapp.build.classpath"/>
+        <echo>Building Controls</echo>
+        <build-controls srcdir="${basedir}/src"
+                        destdir="${build.dir}/WEB-INF/classes" 
+                        tempdir="${build.dir}/WEB-INF/${tmp.sourcegen.dir}"
+                        classpathRef="webapp.classpath"/>
 
         <!-- compile JPFs -->
-        <build-pageflows srcdir="${webapp.dir}" 
-                         tempdir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"
-                         classpathref="webapp.build.classpath"/>
-
-        <!-- copy resources -->
-        <echo>Copy all .properties and .xml files</echo>
-        <copy todir="${webapp.dir}/WEB-INF/classes">
-            <fileset dir="${webapp.dir}/WEB-INF/src" includes="**/*.properties"/>
-            <fileset dir="${webapp.dir}/WEB-INF/src" includes="**/*.xml"/>
-        </copy>
-        <echo>Copy .sql file</echo>
-        <copy todir="${webapp.dir}/WEB-INF/classes/sql">
-            <fileset dir="${webapp.dir}/WEB-INF/src/sql" includes="**/*.sql"/>
-        </copy>
+        <echo>Building Page Flows</echo>
+        <build-pageflows srcdir="${web.dir}"
+                         webcontentdir="${web.dir}"
+                         weboutputdir="${build.dir}"
+                         tempdir="${build.dir}/WEB-INF/${tmp.sourcegen.dir}"
+                         classpathref="webapp.classpath"/>
     </target>
+  
+    <!-- ========================================= -->
+    <!-- clean - clean the webapp                  -->
+    <!-- ========================================= -->
 
-    <target name="clean" description="Clean the petstoreWeb">
-        <delete dir="${webapp.dir}/WEB-INF/classes" includeEmptyDirs="true"/>
-        <delete dir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}" includeEmptyDirs="true"/>
-        <delete dir="${webapp.dir}/WEB-INF/${tmp.jpfgen.dir}" includeEmptyDirs="true"/>
+    <target name="scrub" description="Scrub the webapp">
+        <delete dir="${build.dir}"/>
     </target>
 
+    <target name="clean" description="Clean the webapp">
+        <delete dir="${build.dir}/WEB-INF/classes"/>
+        <delete dir="${build.dir}/WEB-INF/jspc-src"/>
+        <delete dir="${build.dir}/WEB-INF/${tmp.sourcegen.dir}"/>
+        <delete dir="${build.dir}/WEB-INF/.pageflow-struts-generated"/>
+    </target>
+  
     <target name="war" description="Build a compressed WAR file that can be deployed to an application container">
-        <property name="archive.dir" value="${webapp.dir}/.."/>
+        <property name="archive.dir" location="${basedir}"/>
 
         <!-- this does *not* exclude source from the archive -->
-        <war destfile="${archive.dir}/${context.path}.war" webxml="${webapp.dir}/WEB-INF/web.xml">
-            <fileset dir="${webapp.dir}">
+        <war destfile="${archive.dir}/${context.path}.war" webxml="${build.dir}/WEB-INF/web.xml">
+            <fileset dir="${build.dir}">
                 <exclude name="WEB-INF/web.xml"/>
-                <exclude name="WEB-INF/src/**"/>
             </fileset>
         </war>
     </target>
@@ -109,12 +125,12 @@
         <echo>
 Welcome to the Beehive petstoreWeb sample webapp!  
 
-To run the webapp, two steps need to occur:
-- copy the Beehive runtime to the webapp
-- include derby.jar in WEB-INF/lib
-- build the webapp
+To build the petstore, run:
+ant deploy-beehive
+ant build
+ant war
 
-Once the webapp is built, it's ready to deploy onto your application container.
+Once the .war archive is built, it's ready to deploy to an application container.
         </echo>
 
         <java fork="no" classname="org.apache.tools.ant.Main">

Copied: incubator/beehive/trunk/samples/petstoreWeb/build.xml (from r168071, incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build.xml)
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/build.xml?p2=incubator/beehive/trunk/samples/petstoreWeb/build.xml&p1=incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build.xml&r1=168071&r2=168392&rev=168392&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build.xml (original)
+++ incubator/beehive/trunk/samples/petstoreWeb/build.xml Thu May  5 12:59:00 2005
@@ -1,7 +1,7 @@
 <?xml version="1.0" ?>
 
 <!--
-   Copyright 2004 The Apache Software Foundation 
+   Copyright 2005 The Apache Software Foundation 
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
@@ -18,50 +18,138 @@
    $Header:$
  -->
 
-<project name="Beehive petstoreWeb sample" default="build" basedir="../..">
+<project name="Beehive petstoreWeb sample" default="build" basedir=".">
 
-  <import file="../../../../beehive-imports.xml" />
+    <import file="../../beehive-imports.xml"/>
+    <import file="${beehive.home}/ant/beehive-tools.xml"/>
 
-  <property name="context.path" value="petstoreWeb"/>
+    <property name="tmp.sourcegen.dir" value=".tmpbeansrc"/>
+    <property name="tmp.jpfgen.dir" value=".pageflow-struts-generated"/>
 
-  <!-- =========================================== -->
-  <!-- deploy targets - move the app to the server -->
-  <!-- =========================================== -->
-  
-  <target name="deploy" description="Deploy the webapp to a running server">
-    <deploy-webapp webappDir="${basedir}" contextPath="${context.path}"/>
-  </target>
-
-  <target name="undeploy" description="Undeploy the webapp from a running server">
-    <undeploy-webapp contextPath="${context.path}"/>
-  </target>
-
-  <target name="redeploy" description="Redeploy the webapp on a running server">
-    <redeploy-webapp contextPath="${context.path}"/>
-  </target>
-  
-  <!-- ========================================= -->
-  <!-- build - build the webapp                  -->
-  <!-- ========================================= -->
-
-  <target name="build" description="Build the webapp">
-    <copy todir="${basedir}/WEB-INF/lib" file="${beehive.home}/controlhaus/jdbc/trunk/build/dist/jdbc-control.jar"/>
-    <deploy-netui webappDir="${basedir}"/>
-    <deploy-wsm webappDir="${basedir}"/>
-    <build-webapp webappDir="${basedir}"/>
-    <copy todir="${basedir}/WEB-INF/classes">
-        <fileset dir="${basedir}/WEB-INF/src">
-            <include name="sql/**"/>
+    <property name="context.path" value="petstoreWeb"/>
+    <property name="build.dir" location="build"/>
+    <property name="web.dir" location="web"/>
+    <property name="src.dir" location="src"/>
+  
+    <!-- ========================================= -->
+    <!-- build - build the webapp                  -->
+    <!-- ========================================= -->
+
+    <path id="webapp.classpath">
+        <path refid="servlet.dependency.path"/>
+        <fileset dir="${build.dir}/WEB-INF/lib">
+            <include name="*.jar"/>
         </fileset>
-    </copy>
-  </target>
-  
-  <!-- ========================================= -->
-  <!-- clean - clean the webapp                  -->
-  <!-- ========================================= -->
-
-  <target name="clean" description="Clean the webapp">
-    <clean-webapp webappDir="${basedir}"/>
-  </target>
-  
+        <pathelement location="${build.dir}/WEB-INF/classes"/>
+    </path>    
+
+    <target name="deploy-beehive" description="Copy the Beehive webapp rutime into the petstoreWeb webapp">
+        <mkdir dir="${build.dir}"/>
+
+        <copy todir="${build.dir}/WEB-INF/lib" file="${beehive.home}/controlhaus/jdbc/trunk/build/dist/jdbc-control.jar"/>
+
+        <deploy-netui webappDir="${build.dir}"/>
+        <deploy-wsm webappDir="${build.dir}"/>
+    </target>
+
+    <target name="build" description="Build the webapp">
+        <copy todir="${build.dir}/">
+            <fileset dir="${web.dir}">
+                <exclude name="**/*.java"/>
+            </fileset>
+        </copy>
+
+        <copy todir="${build.dir}/WEB-INF/lib">
+            <fileset dir="${basedir}/lib">
+                <include name="*.jar"/>
+            </fileset>
+        </copy>
+
+        <copy todir="${build.dir}/WEB-INF/classes">
+            <fileset dir="${src.dir}/">
+                <include name="sql/**"/>
+                <include name="**/*.properties"/>
+            </fileset>
+        </copy>
+
+        <!-- compile XSDs -->
+        <echo>Building XML Schemas</echo>
+        <build-schemas srcdir="${basedir}/schemas"
+                       destDir="${build.dir}/WEB-INF/classes"/>
+
+        <!-- compile controls -->
+        <echo>Building Controls</echo>
+        <build-controls srcdir="${basedir}/src"
+                        destdir="${build.dir}/WEB-INF/classes" 
+                        tempdir="${build.dir}/WEB-INF/${tmp.sourcegen.dir}"
+                        classpathRef="webapp.classpath"/>
+
+        <!-- compile JPFs -->
+        <echo>Building Page Flows</echo>
+        <build-pageflows srcdir="${web.dir}"
+                         webcontentdir="${web.dir}"
+                         weboutputdir="${build.dir}"
+                         tempdir="${build.dir}/WEB-INF/${tmp.sourcegen.dir}"
+                         classpathref="webapp.classpath"/>
+    </target>
+  
+    <!-- ========================================= -->
+    <!-- clean - clean the webapp                  -->
+    <!-- ========================================= -->
+
+    <target name="scrub" description="Scrub the webapp">
+        <delete dir="${build.dir}"/>
+    </target>
+
+    <target name="clean" description="Clean the webapp">
+        <delete dir="${build.dir}/WEB-INF/classes"/>
+        <delete dir="${build.dir}/WEB-INF/jspc-src"/>
+        <delete dir="${build.dir}/WEB-INF/${tmp.sourcegen.dir}"/>
+        <delete dir="${build.dir}/WEB-INF/.pageflow-struts-generated"/>
+    </target>
+  
+    <!-- =========================================== -->
+    <!-- deploy targets - move the app to the server -->
+    <!-- =========================================== -->
+  
+    <target name="deploy" description="Deploy the webapp to a running server">
+        <deploy-webapp webappDir="${build.dir}" contextPath="${context.path}"/>
+    </target>
+
+    <target name="undeploy" description="Undeploy the webapp from a running server">
+        <undeploy-webapp contextPath="${context.path}"/>
+    </target>
+
+    <target name="redeploy" description="Redeploy the webapp on a running server">
+        <redeploy-webapp contextPath="${context.path}"/>
+    </target>
+
+    <target name="war" description="Build a compressed WAR file that can be deployed to an application container">
+        <property name="archive.dir" location="${basedir}"/>
+
+        <!-- this does *not* exclude source from the archive -->
+        <war destfile="${archive.dir}/${context.path}.war" webxml="${build.dir}/WEB-INF/web.xml">
+            <fileset dir="${build.dir}">
+                <exclude name="WEB-INF/web.xml"/>
+            </fileset>
+        </war>
+    </target>
+
+    <target name="usage" description="Print usage information for this build file">
+        <echo>
+Welcome to the Beehive petstoreWeb sample webapp!  
+
+To build the petstore, run:
+ant deploy-beehive
+ant build
+ant war
+
+Once the .war archive is built, it's ready to deploy to an application container.
+        </echo>
+
+        <java fork="no" classname="org.apache.tools.ant.Main">
+            <arg line="-f ${ant.file} -projecthelp"/>
+        </java>
+    </target>
+
 </project>