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 2004/10/20 04:23:29 UTC

svn commit: rev 55118 - in incubator/beehive/trunk/samples: . petstoreWeb petstoreWeb/WEB-INF petstoreWeb/WEB-INF/lib petstoreWeb/WEB-INF/src petstoreWeb/WEB-INF/src/org petstoreWeb/WEB-INF/src/org/apache petstoreWeb/WEB-INF/src/org/apache/beehive petstoreWeb/WEB-INF/src/org/apache/beehive/samples petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/internal petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/ws petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/resources petstoreWeb/WEB-INF/tags petstoreWeb/WEB-INF/tags/beehive petstoreWeb/WEB-INF/tags/beehive/petstore petstoreWeb/account petstoreWeb/account/create petstoreWeb/account/edit petstoreWeb/auth petstoreWeb/checkout petstoreWeb/images petstoreWeb/search petstoreWeb/shop petstoreWeb/site

Author: ekoneil
Date: Tue Oct 19 19:23:27 2004
New Revision: 55118

Added:
   incubator/beehive/trunk/samples/
   incubator/beehive/trunk/samples/petstoreWeb/
   incubator/beehive/trunk/samples/petstoreWeb/Controller.jpf   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/SharedFlow.jpfs   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/lib/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/netui-config.xml   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/netui-validator-rules.xml   (contents, props changed)
   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/src/log4j.xml   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/AccountController.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/PetstoreController.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/AccountControl.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/AccountControlImpl.jcs   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/CatalogControl.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/CatalogControlImpl.jcs   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/OrderControl.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/OrderControlImpl.jcs   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/SequenceControl.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/SequenceControlImpl.jcs   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/AccountAlreadyExistsException.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/InvalidIdentifierException.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchAccountException.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchOrderException.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchSequenceException.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchUserException.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/OrderAlreadyExistsException.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/UserAlreadyExistsException.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/internal/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/internal/InMemoryObjectStore.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AbstractPetstoreForm.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AccountForm.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/CheckoutForm.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/OrderForm.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/ReturnToForm.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/SearchForm.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Account.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Address.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Cart.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Category.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Item.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/LineItem.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Order.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Product.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Sequence.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/ws/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/ws/Category.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/ws/Product.java   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/resources/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/resources/account.properties   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/resources/order.properties   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/resources/search.properties   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/resources/view.properties   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/petstore-build.xml   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/accountFields.tag   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/catalogNav.tag   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/categoryNavHeader.tag   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/copyright.tag   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/footer.tag   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/headerMenu.tag   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/orderSummary.tag   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/productFavorites.tag   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/validation_1_1.dtd   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/validator-rules.xml   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/validator-rules_1_1.dtd   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/web.xml   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/account/
   incubator/beehive/trunk/samples/petstoreWeb/account/create/
   incubator/beehive/trunk/samples/petstoreWeb/account/create/Controller.jpf   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/account/create/create.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/account/edit/
   incubator/beehive/trunk/samples/petstoreWeb/account/edit/Controller.jpf   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/account/edit/edit.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/account/edit/listOrders.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/auth/
   incubator/beehive/trunk/samples/petstoreWeb/auth/Controller.jpf   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/auth/login.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/auth/loginError.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/checkout/
   incubator/beehive/trunk/samples/petstoreWeb/checkout/Controller.jpf   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/checkout/confirm.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/checkout/newOrder.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/checkout/shipping.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/checkout/viewCart.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/checkout/viewOrder.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/error.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/help.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/
   incubator/beehive/trunk/samples/petstoreWeb/images/beehive_logo.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/birds_icon.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/bkg-topbar.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/button_add_to_cart.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/button_checkout.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/button_continue.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/button_previous.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/button_register_now.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/button_remove.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/button_submit.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/button_update_cart.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/cart.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/cats_icon.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/dogs_icon.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/error-header.jpg   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/fish_icon.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/help.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/my_account.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/reptiles_icon.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/search.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/separator.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/sign-in.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/sign-out.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/sign-outHL.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/sm_birds.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/sm_cats.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/sm_dogs.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/sm_fish.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/images/sm_reptiles.gif   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/index.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/petstore.jws
   incubator/beehive/trunk/samples/petstoreWeb/search/
   incubator/beehive/trunk/samples/petstoreWeb/search/Controller.jpf   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/search/index.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/shop/
   incubator/beehive/trunk/samples/petstoreWeb/shop/Controller.jpf   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/shop/cart.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/shop/category.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/shop/index.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/shop/item.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/shop/product.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/site/
   incubator/beehive/trunk/samples/petstoreWeb/site/default.css   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/site/emptyLeftNav.jsp   (contents, props changed)
   incubator/beehive/trunk/samples/petstoreWeb/site/template.jsp   (contents, props changed)
Log:
Initial checkin of a simple petstore-style sample application.

The app needs a fair amount of work.  There are features left un-implemented:

  - security
  - completion of the business controls
  - persistence (Database Control, etc)
  - XMLBeans used for the catalog
  - declarative validation
  - form beans wrapping the various business objects that are exposed to JSPs via the JPFs
  - tests of the controls

lots of bugs:

  - back button
  - double post
  - business control issues

and lots of undiscovered problems / cleanup, I've no doubt.  <g>

In addition, the images of the actual pets have been left out because of licensing issues with their original provider.  We are unable to check them into Apache given this, and it would be *terrific* if anyone can help provide some art in this area.  If you think you can contribute, let me know.

I'll try to provide a TODO list of things where people can jump in and help clean-up the application.

So, don't consider this finished -- consider this just a starting point that we need to evolve.  <g>

BB: self
DRT: Beehive pass



Added: incubator/beehive/trunk/samples/petstoreWeb/Controller.jpf
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/Controller.jpf	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+@Jpf.Controller()
+public class Controller
+    extends PageFlowController
+{
+    @Jpf.SharedFlowField
+    private webappRoot.SharedFlow _sharedFlow;
+
+    @Jpf.Action(
+        forwards = { 
+            @Jpf.Forward(name = "shop", path = "/shop/Controller.jpf"),
+            @Jpf.Forward(name = "index", path = "/index.jsp")
+        }
+    )
+    protected Forward begin()
+    {
+        if (_sharedFlow.isUserLoggedIn())
+            return new Forward("shop");
+        else return new Forward("index");
+    }
+}
+
+@Jpf.ViewProperties(value = {
+    "<!-- This data is auto-generated. Hand-editing this section is not recommended. -->",
+    "<view-properties>",
+    "<pageflow-object id='pageflow:/Controller.jpf'/>",
+    "<pageflow-object id='page:error.jsp'>",
+    "  <property name='x' value='100'/>",
+    "  <property name='y' value='400'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='page:help.jsp'>",
+    "  <property value='220' name='x'/>",
+    "  <property value='400' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='page:index.jsp'><property name='x' value='240'/><property name='y' value='300'/></pageflow-object>",
+    "<pageflow-object id='action:begin.do'>",
+    "  <property name='x' value='100'/>",
+    "  <property name='y' value='200'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='external-jpf:/shop/Controller.jpf'><property name='x' value='240'/><property name='y' value='100'/></pageflow-object>",
+    "<pageflow-object id='forward:path#shop#/shop/Controller.jpf#@action:begin.do@'><property name='elbowsX' value='136,170,170,204'/><property name='elbowsY' value='192,192,92,92'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='shop'/></pageflow-object>",
+    "<pageflow-object id='forward:path#index#/index.jsp#@action:begin.do@'><property name='elbowsX' value='136,170,170,204'/><property name='elbowsY' value='203,203,292,292'/><property name='fromPort' value='East_2'/><property name='toPort' value='West_1'/><property name='label' value='index'/></pageflow-object>",
+    "</view-properties>"
+})
+interface VIEW_PROPERTIES
+{
+}
+

Added: incubator/beehive/trunk/samples/petstoreWeb/SharedFlow.jpfs
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/SharedFlow.jpfs	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,283 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package webappRoot;
+
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.*;
+
+import org.apache.beehive.samples.petstore.forms.ReturnToForm;
+import org.apache.beehive.samples.petstore.forms.SearchForm;
+import org.apache.beehive.samples.petstore.model.Account;
+import org.apache.beehive.samples.petstore.model.Cart;
+import org.apache.beehive.samples.petstore.model.Category;
+import org.apache.beehive.samples.petstore.model.Product;
+import org.apache.beehive.samples.petstore.controls.AccountControl;
+import org.apache.beehive.samples.petstore.controls.CatalogControl;
+import org.apache.beehive.samples.petstore.controls.exceptions.NoSuchAccountException;
+import org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
+
+/**
+ * todo: one issue with exposing properties on a SharedFlow / GlobalApp is that they
+ *       are then bindable by all web clients; there needs to be a flag in netui-config.xml
+ *       that prevents this from happening.
+ */
+@Jpf.Controller(
+    catches={
+        @Jpf.Catch(method="handlePageFlowException", type=PageFlowException.class),
+        @Jpf.Catch(method="handleException", type=Exception.class),
+        @Jpf.Catch(method="handleNotLoggedInException", type=NotLoggedInException.class)
+    },
+    simpleActions={
+        @Jpf.SimpleAction(name="signoff", path="/auth/logout.do"),
+        @Jpf.SimpleAction(name="globalShowHelp", path="/help.jsp"),
+        @Jpf.SimpleAction(name="globalViewCart", path="/shop/viewCart.do"),
+        @Jpf.SimpleAction(name="globalViewCategory", path="/shop/viewCategory.do"),
+        @Jpf.SimpleAction(name="globalEditAccount", path="/account/edit/viewUpdateAccount.do"),
+        @Jpf.SimpleAction(name="globalViewProductById", path="/shop/viewProduct.do"),
+        @Jpf.SimpleAction(name="globalViewCreateAccount", path="/account/create/Controller.jpf")
+    }
+)
+public class SharedFlow
+    extends SharedFlowController
+{
+    @org.apache.beehive.controls.api.bean.Control()
+    private CatalogControl _catalogControl;
+
+    @org.apache.beehive.controls.api.bean.Control()
+    private AccountControl _accountControl;
+
+    private Account _account = null;
+    private Cart _cart = null;
+    private Product[] _myList;
+
+    private static String[] _categoryNames = null;
+
+    protected void onCreate()
+    {
+        // todo: move to ServletContext so it's cached for all users
+        Category[] categories = _catalogControl.getCategoryList();
+        _categoryNames = new String[categories.length];
+        for(int i = 0; i < _categoryNames.length; i++)
+        {
+            _categoryNames[i] = categories[i].getCatId();
+        }
+    }
+
+    /**
+     * Utility used to ensure that the user is logged into the site; an exception is
+     * thrown when the the user is not logged in.
+     */
+    public void ensureLogin()
+        throws NotLoggedInException
+    {
+        if (!isUserLoggedIn())
+            throw new NotLoggedInException("User not logged in", this);
+    }
+
+    public void handleLogin(String username)
+    {
+        Account account = _accountControl.getAccount(username);
+
+        // @todo: need to fix the case where the account isn't found for this username
+        if(account == null)
+            return;
+        
+        // and set the account (this toggles the user's logged in status)
+        setAccount(account);
+
+        // set the user's favorites list if they are logged in
+        if (account.isMyListOpt())
+        {
+            Product[] favProducts = _catalogControl.getProductListByCategory(account.getFavCategory());
+            setMyList(favProducts);
+        }
+    }
+    
+    public void handleLogout()
+    {
+        setAccount(null);
+        setCart(null);
+    }
+
+    public void handleCheckout()
+    {
+        setCart(null);   
+    }
+
+    public void updateAccount(Account account)
+        throws InvalidIdentifierException, NoSuchAccountException
+    {
+        // update account info in globalApp
+        _account = account;
+
+        // set the user's favorites list if they are logged in
+        if (account.isMyListOpt())
+            setMyList(_catalogControl.getProductListByCategory(account.getFavCategory()));
+    }
+    
+    public String[] getCategoryNames()
+    {
+        return _categoryNames;
+    }
+
+    /**
+     * Determine if the user is logged into the website.
+     */
+    public boolean isUserLoggedIn()
+    {
+        return _account == null ? false : true;
+    }
+
+    public Product[] getMyList()
+    {
+        return _myList;
+    }
+
+    public Cart getCart()
+    {
+        if(_cart == null)
+            _cart = new Cart();
+
+        return _cart;
+    }
+
+    public Account getAccount()
+    {
+        return _account;
+    }
+
+    private void setAccount(Account account)
+    {
+        _account = account;
+    }
+
+    private void setCart(Cart cart)
+    {
+        _cart = cart;
+    }
+
+    private void setMyList(Product[] myList)
+    {
+        _myList = myList;
+    }
+
+    @Jpf.Action(
+        forwards={@Jpf.Forward(name="help", path="/help.jsp")}
+    )
+    public Forward showHelp()
+    {
+        return new Forward("help");
+    }
+
+    /**
+     * This action is used to drop into the nested login controller
+     * from a user click on a page
+     */
+    @Jpf.Action(
+        forwards={@Jpf.Forward(name="auth", path="/auth/Controller.jpf")}
+    )
+    public Forward signon()
+    {
+        ReturnToForm initForm = new ReturnToForm(false);
+        return new Forward("auth", initForm);
+    }
+
+   /**
+     * This action is used to drop into the nested login controller
+     * en-route to another action
+     */
+    @Jpf.Action(
+        forwards={@Jpf.Forward(name="auth", path="/auth/Controller.jpf")}
+    )
+    public Forward actionSignon()
+    {
+        ReturnToForm initForm = new ReturnToForm(true);
+        return new Forward("auth", initForm);
+    }
+
+    @Jpf.Action(
+        forwards={@Jpf.Forward(name="search", path="/search/Controller.jpf")}
+    )
+    public Forward search(SearchForm form)
+    {
+        return new Forward("search");
+    }
+
+    @Jpf.Action(
+        forwards={
+            @Jpf.Forward(
+                redirect=true,
+                name="shop",
+                path="/shop/Controller.jpf"
+            )
+        }
+    )
+    public Forward globalShop()
+    {
+        return new Forward("shop");
+    }
+
+    /**
+     * after login, depending on what the user was doing, we may want to return
+     * to current page or previous action
+     */
+    @Jpf.Action(
+        forwards={
+            @Jpf.Forward(name="previousAction", navigateTo=Jpf.NavigateTo.previousAction),
+            @Jpf.Forward(name="currentPage", navigateTo=Jpf.NavigateTo.currentPage)
+        }
+    )
+    public Forward loginDone(ReturnToForm initForm)
+    {
+        if (initForm.getReturnToPreviousAction())
+            return new Forward("previousAction");
+        else return new Forward("currentPage");
+    }
+
+    @Jpf.ExceptionHandler(
+        forwards={
+            @Jpf.Forward(name="errorPage", path="/error.jsp")
+        }
+    )
+    protected Forward handleException(Exception ex, String actionName, String message, Object form)
+    {
+        System.err.print("[" + getRequest().getContextPath() + "] ");
+        System.err.println("Unhandled exception caught in SharedFlow.jpfs:");
+        ex.printStackTrace();
+        return new Forward("errorPage");
+    }
+
+    @Jpf.ExceptionHandler(
+        forwards={
+            @Jpf.Forward(name="login", path="actionSignon.do")
+        }
+    )
+    protected Forward handleNotLoggedInException(NotLoggedInException ex, String actionName, String message, Object form)
+    {
+        return new Forward("login");
+    }
+
+    @Jpf.ExceptionHandler()
+    public Forward handlePageFlowException(PageFlowException ex, String message, String action, Object form)
+        throws java.io.IOException
+    {
+        ex.sendError(getRequest(), getResponse());
+        return null;
+    }
+
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/netui-config.xml
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/netui-config.xml	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<netui-config xmlns="http://beehive.apache.org/netui/2004/server/config">
+
+    <legacy-tag-support>false</legacy-tag-support>
+
+    <expression-languages>
+        <default-language>netuiel</default-language>
+        <expression-language>
+            <name>netuiel</name>
+            <factory-class>org.apache.beehive.netui.script.el.ExpressionEvaluatorImpl$NetUIELEngineFactory</factory-class>
+            <binding-contexts>
+                <binding-context>
+                    <name>bundle</name>
+                    <factory-class>org.apache.beehive.netui.databinding.script.el.BundleVariableResolver$BundleContextFactory</factory-class>
+                </binding-context>
+                <binding-context>
+                    <name>container</name>
+                    <factory-class>org.apache.beehive.netui.databinding.script.el.ContainerVariableResolver$ContainerContextFactory</factory-class>
+                </binding-context>
+            </binding-contexts>
+        </expression-language>
+    </expression-languages>
+
+    <iterator-factories>
+    </iterator-factories>
+
+</netui-config>

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/netui-validator-rules.xml
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/netui-validator-rules.xml	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,1055 @@
+<!DOCTYPE form-validation PUBLIC
+          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
+          "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
+<!--
+
+   This file contains the default Struts Validator pluggable validator
+   definitions.  It should be placed somewhere under /WEB-INF and
+   referenced in the struts-config.xml under the plug-in element
+   for the ValidatorPlugIn.
+
+      <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
+        <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
+                                                  /WEB-INF/validation.xml"/>
+      </plug-in>
+
+   These are the default error messages associated with
+   each validator defined in this file.  They should be
+   added to your projects ApplicationResources.properties
+   file or you can associate new ones by modifying the
+   pluggable validators msg attributes in this file.
+
+   # Struts Validator Error Messages
+   errors.required={0} is required.
+   errors.minlength={0} can not be less than {1} characters.
+   errors.maxlength={0} can not be greater than {1} characters.
+   errors.invalid={0} is invalid.
+
+   errors.byte={0} must be a byte.
+   errors.short={0} must be a short.
+   errors.integer={0} must be an integer.
+   errors.long={0} must be a long.
+   errors.float={0} must be a float.
+   errors.double={0} must be a double.
+
+   errors.date={0} is not a date.
+   errors.range={0} is not in the range {1} through {2}.
+   errors.creditcard={0} is an invalid credit card number.
+   errors.email={0} is an invalid e-mail address.
+
+-->
+
+<form-validation>
+
+   <global>
+
+      <validator name="required"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateRequired"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+                  msg="errors.required">
+
+         <javascript><![CDATA[
+            function validateRequired(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oRequired = new required();
+                for (x in oRequired) {
+                	var field = form[oRequired[x][0]];
+                	
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'file' ||
+                        field.type == 'select-one' ||
+                        field.type == 'radio' ||
+                        field.type == 'password') {
+                        
+                        var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+							if (si >= 0) {
+								value = field.options[si].value;
+							}
+						} else {
+							value = field.value;
+						}
+                        
+                        if (trim(value).length == 0) {
+                        
+	                        if (i == 0) {
+	                            focusField = field;
+	                        }
+	                        fields[i++] = oRequired[x][1];
+	                        isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return isValid;
+            }
+            
+            // Trim whitespace from left and right sides of s.
+            function trim(s) {
+                return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
+            }
+            
+            ]]>
+         </javascript>
+
+      </validator>
+
+      <validator name="requiredif"
+                 classname="org.apache.struts.validator.FieldChecks"
+                 method="validateRequiredIf"
+                 methodParams="java.lang.Object,
+                               org.apache.commons.validator.ValidatorAction,
+                               org.apache.commons.validator.Field,
+                               org.apache.struts.action.ActionErrors,
+                               org.apache.commons.validator.Validator,
+                               javax.servlet.http.HttpServletRequest"
+                 msg="errors.required">
+      </validator>
+
+      <validator name="minlength"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateMinLength"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.minlength">
+
+         <javascript><![CDATA[
+            function validateMinLength(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oMinLength = new minlength();
+                for (x in oMinLength) {
+                    var field = form[oMinLength[x][0]];
+                    
+                    if (field.type == 'text' ||
+                        field.type == 'textarea') {
+                        
+                        var iMin = parseInt(oMinLength[x][2]("minlength"));
+                        if ((trim(field.value).length > 0) && (field.value.length < iMin)) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oMinLength[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return isValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="maxlength"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateMaxLength"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.maxlength">
+
+         <javascript><![CDATA[
+            function validateMaxLength(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oMaxLength = new maxlength();
+                for (x in oMaxLength) {
+                    var field = form[oMaxLength[x][0]];
+                    
+                    if (field.type == 'text' ||
+                        field.type == 'textarea') {
+                        
+                        var iMax = parseInt(oMaxLength[x][2]("maxlength"));
+                        if (field.value.length > iMax) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oMaxLength[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return isValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="mask"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateMask"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.invalid">
+
+         <javascript><![CDATA[
+            function validateMask(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oMasked = new mask();
+                for (x in oMasked) {
+                    var field = form[oMasked[x][0]];
+                    
+                    if ((field.type == 'text' || 
+                         field.type == 'textarea') && 
+                         (field.value.length > 0)) {
+                        
+                        if (!matchPattern(field.value, oMasked[x][2]("mask"))) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oMasked[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return isValid;
+            }
+
+            function matchPattern(value, mask) {
+               return mask.exec(value);
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="byte"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateByte"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.byte"
+       jsFunctionName="ByteValidations">
+
+         <javascript><![CDATA[
+            function validateByte(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oByte = new ByteValidations();
+                for (x in oByte) {
+                	var field = form[oByte[x][0]];
+                	
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'select-one' ||
+						field.type == 'radio') {
+
+						var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+							if (si >= 0) {
+								value = field.options[si].value;
+							}
+						} else {
+							value = field.value;
+						}
+                        
+                        if (value.length > 0) {
+                            if (!isAllDigits(value)) {
+                                bValid = false;
+                                if (i == 0) {
+                                    focusField = field;
+                                }
+                                fields[i++] = oByte[x][1];
+
+                            } else {
+
+	                            var iValue = parseInt(value);
+	                            if (isNaN(iValue) || !(iValue >= -128 && iValue <= 127)) {
+	                                if (i == 0) {
+	                                    focusField = field;
+	                                }
+	                                fields[i++] = oByte[x][1];
+	                                bValid = false;
+	                            }
+                            }
+						}
+						
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return bValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="short"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateShort"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.short"
+       jsFunctionName="ShortValidations">
+
+         <javascript><![CDATA[
+            function validateShort(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oShort = new ShortValidations();
+                for (x in oShort) {
+                	var field = form[oShort[x][0]];
+                	
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'select-one' ||
+                        field.type == 'radio') {
+                        
+                        var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+							if (si >= 0) {
+								value = field.options[si].value;
+							}
+						} else {
+							value = field.value;
+						}
+                        
+                        if (value.length > 0) {
+                            if (!isAllDigits(value)) {
+                                bValid = false;
+                                if (i == 0) {
+                                    focusField = field;
+                                }
+                                fields[i++] = oShort[x][1];
+
+                            } else {
+                        
+	                            var iValue = parseInt(value);
+	                            if (isNaN(iValue) || !(iValue >= -32768 && iValue <= 32767)) {
+	                                if (i == 0) {
+	                                    focusField = field;
+	                                }
+	                                fields[i++] = oShort[x][1];
+	                                bValid = false;
+	                            }
+	                       }
+                       }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return bValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="integer"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateInteger"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.integer"
+       jsFunctionName="IntegerValidations">
+
+         <javascript><![CDATA[
+            function validateInteger(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oInteger = new IntegerValidations();
+                for (x in oInteger) {
+                	var field = form[oInteger[x][0]];
+
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'select-one' ||
+                        field.type == 'radio') {
+                        
+                        var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+						    if (si >= 0) {
+							    value = field.options[si].value;
+						    }
+						} else {
+							value = field.value;
+						}
+                        
+                        if (value.length > 0) {
+                        
+                            if (!isAllDigits(value)) {
+                                bValid = false;
+                                if (i == 0) {
+	                                focusField = field;
+	                            }
+						        fields[i++] = oInteger[x][1];
+						        
+                            } else {
+	                            var iValue = parseInt(value);
+	                            if (isNaN(iValue) || !(iValue >= -2147483648 && iValue <= 2147483647)) {
+	                                if (i == 0) {
+	                                    focusField = field;
+	                                }
+	                                fields[i++] = oInteger[x][1];
+	                                bValid = false;
+	                           }
+                           }
+                       }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return bValid;
+            }
+
+            function isAllDigits(argvalue) {
+                argvalue = argvalue.toString();
+                var validChars = "0123456789";
+                var startFrom = 0;
+                if (argvalue.substring(0, 2) == "0x") {
+                   validChars = "0123456789abcdefABCDEF";
+                   startFrom = 2;
+                } else if (argvalue.charAt(0) == "0") {
+                   validChars = "01234567";
+                   startFrom = 1;
+                } else if (argvalue.charAt(0) == "-") {
+                    startFrom = 1;
+                }
+                
+                for (var n = startFrom; n < argvalue.length; n++) {
+                    if (validChars.indexOf(argvalue.substring(n, n+1)) == -1) return false;
+                }
+                return true;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="long"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateLong"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.long"/>
+
+
+      <validator name="float"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateFloat"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.float"
+       jsFunctionName="FloatValidations">
+
+         <javascript><![CDATA[
+            function validateFloat(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oFloat = new FloatValidations();
+                for (x in oFloat) {
+                	var field = form[oFloat[x][0]];
+                	
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'select-one' ||
+                        field.type == 'radio') {
+                        
+                    	var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+							if (si >= 0) {
+							    value = field.options[si].value;
+							}
+						} else {
+							value = field.value;
+						}
+                        
+                        if (value.length > 0) {
+                            // remove '.' before checking digits
+                            var tempArray = value.split('.');
+                            var joinedString= tempArray.join('');
+
+                            if (!isAllDigits(joinedString)) {
+                                bValid = false;
+                                if (i == 0) {
+                                    focusField = field;
+                                }
+                                fields[i++] = oFloat[x][1];
+
+                            } else {
+	                            var iValue = parseFloat(value);
+	                            if (isNaN(iValue)) {
+	                                if (i == 0) {
+	                                    focusField = field;
+	                                }
+	                                fields[i++] = oFloat[x][1];
+	                                bValid = false;
+	                            }
+                            }
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return bValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="double"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateDouble"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.double"/>
+
+
+      <validator name="date"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateDate"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.date"
+       jsFunctionName="DateValidations">
+
+         <javascript><![CDATA[
+            function validateDate(form) {
+               var bValid = true;
+               var focusField = null;
+               var i = 0;
+               var fields = new Array();
+               oDate = new DateValidations();
+               for (x in oDate) {
+                   var value = form[oDate[x][0]].value;
+                   var datePattern = oDate[x][2]("datePatternStrict");
+                   if ((form[oDate[x][0]].type == 'text' ||
+                        form[oDate[x][0]].type == 'textarea') &&
+                       (value.length > 0) &&
+                       (datePattern.length > 0)) {
+                     var MONTH = "MM";
+                     var DAY = "dd";
+                     var YEAR = "yyyy";
+                     var orderMonth = datePattern.indexOf(MONTH);
+                     var orderDay = datePattern.indexOf(DAY);
+                     var orderYear = datePattern.indexOf(YEAR);
+                     if ((orderDay < orderYear && orderDay > orderMonth)) {
+                         var iDelim1 = orderMonth + MONTH.length;
+                         var iDelim2 = orderDay + DAY.length;
+                         var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
+                         var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
+                         if (iDelim1 == orderDay && iDelim2 == orderYear) {
+                            dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
+                         } else if (iDelim1 == orderDay) {
+                            dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
+                         } else if (iDelim2 == orderYear) {
+                            dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
+                         } else {
+                            dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
+                         }
+                         var matched = dateRegexp.exec(value);
+                         if(matched != null) {
+                            if (!isValidDate(matched[2], matched[1], matched[3])) {
+                               if (i == 0) {
+                                   focusField = form[oDate[x][0]];
+                               }
+                               fields[i++] = oDate[x][1];
+                               bValid =  false;
+                            }
+                         } else {
+                            if (i == 0) {
+                                focusField = form[oDate[x][0]];
+                            }
+                            fields[i++] = oDate[x][1];
+                            bValid =  false;
+                         }
+                     } else if ((orderMonth < orderYear && orderMonth > orderDay)) {
+                         var iDelim1 = orderDay + DAY.length;
+                         var iDelim2 = orderMonth + MONTH.length;
+                         var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
+                         var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
+                         if (iDelim1 == orderMonth && iDelim2 == orderYear) {
+                             dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
+                         } else if (iDelim1 == orderMonth) {
+                             dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
+                         } else if (iDelim2 == orderYear) {
+                             dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
+                         } else {
+                             dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
+                         }
+                         var matched = dateRegexp.exec(value);
+                         if(matched != null) {
+                             if (!isValidDate(matched[1], matched[2], matched[3])) {
+                                 if (i == 0) {
+                                     focusField = form[oDate[x][0]];
+                                 }
+                                 fields[i++] = oDate[x][1];
+                                 bValid =  false;
+                              }
+                         } else {
+                             if (i == 0) {
+                                 focusField = form[oDate[x][0]];
+                             }
+                             fields[i++] = oDate[x][1];
+                             bValid =  false;
+                         }
+                     } else if ((orderMonth > orderYear && orderMonth < orderDay)) {
+                         var iDelim1 = orderYear + YEAR.length;
+                         var iDelim2 = orderMonth + MONTH.length;
+                         var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
+                         var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
+                         if (iDelim1 == orderMonth && iDelim2 == orderDay) {
+                             dateRegexp = new RegExp("^(\\d{4})(\\d{2})(\\d{2})$");
+                         } else if (iDelim1 == orderMonth) {
+                             dateRegexp = new RegExp("^(\\d{4})(\\d{2})[" + delim2 + "](\\d{2})$");
+                         } else if (iDelim2 == orderDay) {
+                             dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})(\\d{2})$");
+                         } else {
+                             dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{2})$");
+                         }
+                         var matched = dateRegexp.exec(value);
+                         if(matched != null) {
+                             if (!isValidDate(matched[3], matched[2], matched[1])) {
+                                 if (i == 0) {
+                                     focusField = form[oDate[x][0]];
+                                  }
+                                  fields[i++] = oDate[x][1];
+                                  bValid =  false;
+                              }
+                          } else {
+                              if (i == 0) {
+                                  focusField = form[oDate[x][0]];
+                              }
+                              fields[i++] = oDate[x][1];
+                              bValid =  false;
+                          }
+                     } else {
+                         if (i == 0) {
+                             focusField = form[oDate[x][0]];
+                         }
+                         fields[i++] = oDate[x][1];
+                         bValid =  false;
+                     }
+                  }
+               }
+               if (fields.length > 0) {
+                  focusField.focus();
+                  alert(fields.join('\n'));
+               }
+               return bValid;
+            }
+
+	    function isValidDate(day, month, year) {
+	        if (month < 1 || month > 12) {
+                    return false;
+                }
+                if (day < 1 || day > 31) {
+                    return false;
+                }
+                if ((month == 4 || month == 6 || month == 9 || month == 11) &&
+                    (day == 31)) {
+                    return false;
+                }
+                if (month == 2) {
+                    var leap = (year % 4 == 0 &&
+                               (year % 100 != 0 || year % 400 == 0));
+                    if (day>29 || (day == 29 && !leap)) {
+                        return false;
+                    }
+                }
+                return true;
+            }]]>
+         </javascript>
+
+      </validator>
+
+<!-- range is deprecated use intRange instead -->
+      <validator name="range"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateIntRange"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends="integer"
+                  msg="errors.range">
+
+         <javascript><![CDATA[
+            function validateRange(form) {
+                return validateIntRange(form);
+            }]]>
+         </javascript>
+
+      </validator>
+
+      <validator name="intRange"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateIntRange"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends="integer"
+                  msg="errors.range">
+
+         <javascript><![CDATA[
+            function validateIntRange(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oRange = new intRange();
+                for (x in oRange) {
+                    var field = form[oRange[x][0]];
+                    
+                    if ((field.type == 'text' ||
+                         field.type == 'textarea') &&
+                        (field.value.length > 0)) {
+                        
+                        var iMin = parseInt(oRange[x][2]("min"));
+                        var iMax = parseInt(oRange[x][2]("max"));
+                        var iValue = parseInt(field.value);
+                        if (!(iValue >= iMin && iValue <= iMax)) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oRange[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                    focusField.focus();
+                    alert(fields.join('\n'));
+                }
+                return isValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+      <validator name="floatRange"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateFloatRange"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends="float"
+                  msg="errors.range">
+
+         <javascript><![CDATA[
+            function validateFloatRange(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oRange = new floatRange();
+                for (x in oRange) {
+                    var field = form[oRange[x][0]];
+                    
+                    if ((field.type == 'text' ||
+                         field.type == 'textarea') &&
+                        (field.value.length > 0)) {
+                        
+                        var fMin = parseFloat(oRange[x][2]("min"));
+                        var fMax = parseFloat(oRange[x][2]("max"));
+                        var fValue = parseFloat(field.value);
+                        if (!(fValue >= fMin && fValue <= fMax)) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oRange[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                    focusField.focus();
+                    alert(fields.join('\n'));
+                }
+                return isValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+      <validator name="creditCard"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateCreditCard"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.creditcard">
+
+         <javascript><![CDATA[
+            function validateCreditCard(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oCreditCard = new creditCard();
+                for (x in oCreditCard) {
+                    if ((form[oCreditCard[x][0]].type == 'text' ||
+                         form[oCreditCard[x][0]].type == 'textarea') &&
+                        (form[oCreditCard[x][0]].value.length > 0)) {
+                        if (!luhnCheck(form[oCreditCard[x][0]].value)) {
+                            if (i == 0) {
+                                focusField = form[oCreditCard[x][0]];
+                            }
+                            fields[i++] = oCreditCard[x][1];
+                            bValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                    focusField.focus();
+                    alert(fields.join('\n'));
+                }
+                return bValid;
+            }
+
+            /**
+             * Reference: http://www.ling.nwu.edu/~sburke/pub/luhn_lib.pl
+             */
+            function luhnCheck(cardNumber) {
+                if (isLuhnNum(cardNumber)) {
+                    var no_digit = cardNumber.length;
+                    var oddoeven = no_digit & 1;
+                    var sum = 0;
+                    for (var count = 0; count < no_digit; count++) {
+                        var digit = parseInt(cardNumber.charAt(count));
+                        if (!((count & 1) ^ oddoeven)) {
+                            digit *= 2;
+                            if (digit > 9) digit -= 9;
+                        };
+                        sum += digit;
+                    };
+                    if (sum == 0) return false;
+                    if (sum % 10 == 0) return true;
+                };
+                return false;
+            }
+
+            function isLuhnNum(argvalue) {
+                argvalue = argvalue.toString();
+                if (argvalue.length == 0) {
+                    return false;
+                }
+                for (var n = 0; n < argvalue.length; n++) {
+                    if ((argvalue.substring(n, n+1) < "0") ||
+                        (argvalue.substring(n,n+1) > "9")) {
+                        return false;
+                    }
+                }
+                return true;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="email"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateEmail"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.email">
+
+         <javascript><![CDATA[
+            function validateEmail(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oEmail = new email();
+                for (x in oEmail) {
+                    if ((form[oEmail[x][0]].type == 'text' ||
+                         form[oEmail[x][0]].type == 'textarea') &&
+                        (form[oEmail[x][0]].value.length > 0)) {
+                        if (!checkEmail(form[oEmail[x][0]].value)) {
+                            if (i == 0) {
+                                focusField = form[oEmail[x][0]];
+                            }
+                            fields[i++] = oEmail[x][1];
+                            bValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                    focusField.focus();
+                    alert(fields.join('\n'));
+                }
+                return bValid;
+            }
+
+            /**
+             * Reference: Sandeep V. Tamhankar (stamhankar@hotmail.com),
+             * http://javascript.internet.com
+             */
+            function checkEmail(emailStr) {
+               if (emailStr.length == 0) {
+                   return true;
+               }
+               var emailPat=/^(.+)@(.+)$/;
+               var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
+               var validChars="\[^\\s" + specialChars + "\]";
+               var quotedUser="(\"[^\"]*\")";
+               var ipDomainPat=/^(\d{1,3})[.](\d{1,3})[.](\d{1,3})[.](\d{1,3})$/;
+               var atom=validChars + '+';
+               var word="(" + atom + "|" + quotedUser + ")";
+               var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
+               var domainPat=new RegExp("^" + atom + "(\\." + atom + ")*$");
+               var matchArray=emailStr.match(emailPat);
+               if (matchArray == null) {
+                   return false;
+               }
+               var user=matchArray[1];
+               var domain=matchArray[2];
+               if (user.match(userPat) == null) {
+                   return false;
+               }
+               var IPArray = domain.match(ipDomainPat);
+               if (IPArray != null) {
+                   for (var i = 1; i <= 4; i++) {
+                      if (IPArray[i] > 255) {
+                         return false;
+                      }
+                   }
+                   return true;
+               }
+               var domainArray=domain.match(domainPat);
+               if (domainArray == null) {
+                   return false;
+               }
+               var atomPat=new RegExp(atom,"g");
+               var domArr=domain.match(atomPat);
+               var len=domArr.length;
+               if ((domArr[domArr.length-1].length < 2) ||
+                   (domArr[domArr.length-1].length > 3)) {
+                   return false;
+               }
+               if (len < 2) {
+                   return false;
+               }
+               return true;
+            }]]>
+         </javascript>
+
+      </validator>
+
+      <validator name="netui_validwhen"
+            classname="org.apache.beehive.netui.pageflow.validation.ValidatorRules"
+               method="validateValidWhen"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest,
+                       javax.servlet.ServletContext" >
+      </validator>
+
+   </global>
+
+</form-validation>

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/server-config.wsdd
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/server-config.wsdd	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+ <globalConfiguration>
+  <parameter name="adminPassword" value="admin"/>
+  <parameter name="disablePrettyXML" value="true"/>
+  <parameter name="attachments.implementation" value="org.apache.axis.attachments.AttachmentsImpl"/>
+  <parameter name="sendXsiTypes" value="true"/>
+  <!--<parameter name="sendMultiRefs" value="true"/>-->
+  <parameter name="sendXMLDeclaration" value="true"/>
+  <requestFlow>
+   <handler type="java:org.apache.beehive.wsm.axis.DropInDeploymentHandler">
+    <parameter name="scope" value="session"/>
+   </handler>
+  <handler type="java:org.apache.axis.handlers.JWSHandler">
+    <parameter name="scope" value="session"/>
+   </handler>
+    <!--<handler type="java:org.apache.axis.handlers.JWSHandler">
+    <parameter name="scope" value="request"/>
+    <parameter name="extension" value=".jwr"/>
+   </handler>-->
+  </requestFlow>
+ </globalConfiguration>
+ <handler name="LocalResponder" type="java:org.apache.axis.transport.local.LocalResponder"/>
+ <handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper"/>
+ <handler name="Authenticate" type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>
+ <service name="AdminService" provider="java:MSG">
+  <parameter name="allowedMethods" value="AdminService"/>
+  <parameter name="enableRemoteAdmin" value="false"/>
+  <parameter name="className" value="org.apache.axis.utils.Admin"/>
+  <namespace>http://xml.apache.org/axis/wsdd/</namespace>
+ </service>
+ <service name="Version" provider="java:RPC">
+  <parameter name="allowedMethods" value="getVersion"/>
+  <parameter name="className" value="org.apache.axis.Version"/>
+ </service>
+ <transport name="http">
+  <requestFlow>
+   <handler type="URLMapper"/>
+   <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/>
+  </requestFlow>
+  <parameter name="qs:list" value="org.apache.axis.transport.http.QSListHandler"/>
+  <parameter name="qs:wsdl" value="org.apache.axis.transport.http.QSWSDLHandler"/>
+  <parameter name="qs:method" value="org.apache.axis.transport.http.QSMethodHandler"/>
+ </transport>
+ <transport name="local">
+  <responseFlow>
+   <handler type="LocalResponder"/>
+  </responseFlow>
+ </transport>
+</deployment>
+

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/log4j.xml
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/log4j.xml	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+<!-- 
+  <appender name="NETUISYSLOGFILE" class="org.apache.log4j.RollingFileAppender">
+    <param name="File" value="c:/tmp/netui.log"/>
+-->
+  <appender name="NETUISYSLOGFILE" class="org.apache.log4j.ConsoleAppender">
+    <param name="Append" value="true"/>
+    <param name="MaxFileSize" value="500000KB"/>
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="%d{DATE} %-5p %-15c{1} [%x]: %m%n"/>
+    </layout>
+  </appender>
+
+  <!-- base for all netui server components -->
+  <category name="org.apache.beehive.netui">
+    <priority value="error"/>
+    <appender-ref ref="NETUISYSLOGFILE"/>
+  </category>
+
+  <!-- base for all netui server components -->
+  <category name="org.apache.struts">
+    <priority value="error"/>
+    <appender-ref ref="NETUISYSLOGFILE"/>
+  </category>
+
+  <category name="org.apache.beehive.netui.script">
+    <priority value="error"/>
+    <appender-ref ref="NETUISYSLOGFILE"/>
+  </category>
+
+</log4j:configuration>

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/AccountController.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/AccountController.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,15 @@
+package org.apache.beehive.samples.petstore.controller;
+
+import org.apache.beehive.netui.pageflow.PageFlowController;
+
+public class AccountController
+    extends PageFlowController
+{
+    protected static final String[] LANGUAGES;
+
+    static
+    {
+        LANGUAGES = new String[] {"English", "Japanese"};
+    }
+
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/PetstoreController.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/PetstoreController.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,20 @@
+package org.apache.beehive.samples.petstore.controller;
+
+import org.apache.beehive.netui.pageflow.PageFlowController;
+
+public class PetstoreController
+    extends PageFlowController
+{
+    /*
+     There are a set of JPF bugs that prevent the use of PageFlowController
+     base classes.  Generally, they are related to being unable to use
+     controls / shared flows as annotated fields as the runtime doesn't
+     discover and initialize them correctly.
+
+     Once this happens, methods like getAccount() in the SharedFlow
+     can be implemented once for the Page Flows in the base class.
+
+     In addition, all JPFs would then have protected access to the SharedFlow
+     field
+     */
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/AccountControl.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/AccountControl.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+import org.apache.beehive.samples.petstore.model.Account;
+import org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
+import org.apache.beehive.samples.petstore.controls.exceptions.AccountAlreadyExistsException;
+import org.apache.beehive.samples.petstore.controls.exceptions.NoSuchAccountException;
+
+@ControlInterface
+public interface AccountControl
+{
+    public Account getAccount(String userId);
+
+    public void insertAccount(Account account)
+        throws InvalidIdentifierException, AccountAlreadyExistsException;
+
+    public void updateAccount(Account account)
+        throws InvalidIdentifierException, NoSuchAccountException;
+
+    public boolean checkAccountExists(String userId);
+
+    public Account[] getAccounts();
+}
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/AccountControlImpl.jcs
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/AccountControlImpl.jcs	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.samples.petstore.controls.AccountControl;
+import org.apache.beehive.samples.petstore.controls.exceptions.AccountAlreadyExistsException;
+import org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
+import org.apache.beehive.samples.petstore.controls.exceptions.NoSuchAccountException;
+import org.apache.beehive.samples.petstore.controls.internal.InMemoryObjectStore;
+import org.apache.beehive.samples.petstore.model.Account;
+import org.apache.beehive.samples.petstore.model.Address;
+
+import java.util.HashMap;
+
+@ControlImplementation
+public class AccountControlImpl
+    implements AccountControl, java.io.Serializable
+{
+    private static final String BANNER_NAMESPACE = "banner";
+    private static final String ACCOUNT_NAMESPACE = "account";
+
+    static
+    {
+        InMemoryObjectStore.store(BANNER_NAMESPACE, "FISH", "banner_fish.gif");
+        InMemoryObjectStore.store(BANNER_NAMESPACE, "CATS", "banner_cats.gif");
+        InMemoryObjectStore.store(BANNER_NAMESPACE, "DOGS", "banner_dogs.gif");
+        InMemoryObjectStore.store(BANNER_NAMESPACE, "REPTILES", "banner_reptiles.gif");
+        InMemoryObjectStore.store(BANNER_NAMESPACE, "BIRDS", "banner_birds.gif");
+
+        Account account = new Account();
+        account.setUserId("beehive");
+        account.setPassword("beehive");
+        account.setEmail("yourname@yourdomain.com");
+        Address address = new Address();
+        address.setAddr1("901 San Antonio Road");
+        address.setAddr2("MS UCUP02-206");
+        address.setCity("Palo Alto");
+        address.setCountry("USA");
+        account.setFirstName("Joe");
+        account.setLastName("User");
+        account.setPhone("555-555-5555");
+        address.setState("CA");
+        account.setStatus("OK");
+        address.setZip("94303");
+        account.setAddress(address);
+
+        account.setBannerOpt(true);
+        account.setLangPref("english");
+        account.setMyListOpt(true);
+        account.setFavCategory("DOGS");
+        account.setBannerName((String)InMemoryObjectStore.find(BANNER_NAMESPACE, account.getFavCategory()));
+
+        InMemoryObjectStore.store(ACCOUNT_NAMESPACE, account.getUserId(), account);
+    }
+
+    public Account[] getAccounts()
+    {
+        return (Account[])InMemoryObjectStore.toArray(ACCOUNT_NAMESPACE, Account.class);
+    }
+
+    public boolean checkAccountExists(String key)
+    {
+        return InMemoryObjectStore.find(ACCOUNT_NAMESPACE, key) != null;
+    }
+
+    /**
+    */
+    public Account getAccount(String key)
+    {
+        return (Account)InMemoryObjectStore.find(ACCOUNT_NAMESPACE, key);
+    }
+
+    /**
+    */
+    public void updateAccount(Account account)
+        throws InvalidIdentifierException, NoSuchAccountException
+    {
+        String userId = account.getUserId();
+        if (userId == null || userId.length()==0)
+            throw new InvalidIdentifierException("cannot update Account with null or empty userId");
+
+        if (!checkAccountExists(userId))
+            throw new NoSuchAccountException("no Account found for userId: "+userId);
+
+        doUpdateAccount(account);
+    }
+
+    /**
+     */
+    public void insertAccount(Account account)
+         throws InvalidIdentifierException, AccountAlreadyExistsException
+    {
+        String userId = account.getUserId();
+        if (userId == null || userId.length() == 0)
+        {
+            throw new InvalidIdentifierException("cannot insert Account with null userId");
+        }
+
+        if (checkAccountExists(userId))
+            throw new AccountAlreadyExistsException("attempted to insert Account with duplicate userId: "+userId);
+
+        doInsertAccount(account);
+    }
+
+    private void doUpdateAccount(Account account)
+    {
+        InMemoryObjectStore.store(ACCOUNT_NAMESPACE, account.getUserId(), account);
+    }
+
+    private void doInsertAccount(Account account)
+    {
+        InMemoryObjectStore.store(ACCOUNT_NAMESPACE, account.getUserId(), account);   
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/CatalogControl.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/CatalogControl.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.samples.petstore.model.Item;
+import org.apache.beehive.samples.petstore.model.Product;
+import org.apache.beehive.samples.petstore.model.Category;
+import org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
+
+@ControlInterface
+public interface CatalogControl
+{
+    public Category[] getCategoryList();
+
+    public Category getCategory(String categoryId);
+
+    public Product getProduct(String productId);
+
+    public Product[] getProductListByCategory(String categoryId);
+
+    public Product[] searchProductList(String searchString);
+
+    public Item getItem(String itemId);
+
+    public Item[] getItemListByProduct(String categoryId);
+
+    public void updateItemQuantity(Item item, int quantity)
+        throws InvalidIdentifierException;
+}
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/CatalogControlImpl.jcs
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/CatalogControlImpl.jcs	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,267 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.samples.petstore.controls.internal.InMemoryObjectStore;
+import org.apache.beehive.samples.petstore.model.Item;
+import org.apache.beehive.samples.petstore.model.Category;
+import org.apache.beehive.samples.petstore.model.Product;
+import org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.ArrayList;
+import java.math.BigDecimal;
+
+@ControlImplementation
+public class CatalogControlImpl
+    implements CatalogControl, java.io.Serializable
+{
+    private static final String ITEM_NAMESPACE = "items";
+    private static final String CATEGORY_NAMESPACE= "categories";
+    private static final String PRODUCTS_NAMESPACE = "products";
+
+    // @todo: would be nice to return an XMLBean for the Catalog object here
+    static
+    {
+        Integer one = new Integer(1);
+        Integer ten_thousand = new Integer(10000);
+        int col = 0;
+        Object[] row;
+
+        // itemId, productId, unitPrice, unitCost, supplierId, status, attribute1, quantity
+        Object[][] dataArray = new Object[][]
+        {
+            {"EST-1", "FI-SW-01", new BigDecimal(16.50), new BigDecimal(10.00), one, "P", "Large", ten_thousand},
+            {"EST-2", "FI-SW-01", new BigDecimal(16.50), new BigDecimal(10.00), one, "P", "Small", ten_thousand},
+            {"EST-3", "FI-SW-02", new BigDecimal(18.50), new BigDecimal(12.00), one, "P", "Toothless", ten_thousand},
+            {"EST-4", "FI-FW-01", new BigDecimal(18.50), new BigDecimal(12.00), one, "P", "Spotted", ten_thousand},
+            {"EST-5", "FI-FW-01", new BigDecimal(18.50), new BigDecimal(12.00), one, "P", "Spotless", ten_thousand},
+            {"EST-6", "K9-BD-01", new BigDecimal(18.50), new BigDecimal(12.00), one, "P", "Male Adult", ten_thousand},
+            {"EST-7", "K9-BD-01", new BigDecimal(18.50), new BigDecimal(12.00), one, "P", "Female Puppy", ten_thousand},
+            {"EST-8", "K9-PO-02", new BigDecimal(18.50), new BigDecimal(12.00), one, "P", "Male Puppy", ten_thousand},
+            {"EST-9", "K9-DL-01", new BigDecimal(18.50), new BigDecimal(12.00), one, "P", "Spotless Male Puppy", ten_thousand},
+            {"EST-10", "K9-DL-01", new BigDecimal(18.50), new BigDecimal(12.00), one, "P", "Spotted Adult Female", ten_thousand},
+            {"EST-11", "RP-SN-01", new BigDecimal(18.50), new BigDecimal(12.00), one, "P", "Venomless", ten_thousand},
+            {"EST-12", "RP-SN-01", new BigDecimal(18.50), new BigDecimal(12.00), one, "P", "Rattleless", ten_thousand},
+            {"EST-13", "RP-LI-02", new BigDecimal(18.50), new BigDecimal(12.00), one, "P", "Green Adult", ten_thousand},
+            {"EST-14", "FL-DSH-01", new BigDecimal(58.50), new BigDecimal(12.00), one, "P", "Tailless", ten_thousand},
+            {"EST-15", "FL-DSH-01", new BigDecimal(23.50), new BigDecimal(12.00), one, "P", "With tail", ten_thousand},
+            {"EST-16", "FL-DLH-02", new BigDecimal(93.50), new BigDecimal(12.00), one, "P", "Adult Female", ten_thousand},
+            {"EST-17", "FL-DLH-02", new BigDecimal(93.50), new BigDecimal(12.00), one, "P", "Adult Male", ten_thousand},
+            {"EST-18", "AV-CB-01", new BigDecimal(193.50), new BigDecimal(92.00), one, "P", "Adult Male", ten_thousand},
+            {"EST-19", "AV-SB-02", new BigDecimal(15.50), new BigDecimal(2.00), one, "P", "Adult Male", ten_thousand},
+            {"EST-20", "FI-FW-02", new BigDecimal(5.50), new BigDecimal(2.00), one, "P", "Adult Male", ten_thousand},
+            {"EST-21", "FI-FW-02", new BigDecimal(5.29), new BigDecimal(1.00), one, "P", "Adult Female", ten_thousand},
+            {"EST-22", "K9-RT-02", new BigDecimal(135.50), new BigDecimal(100.00), one, "P", "Adult Male", ten_thousand},
+            {"EST-23", "K9-RT-02", new BigDecimal(145.49), new BigDecimal(100.00), one, "P", "Adult Female", ten_thousand},
+            {"EST-24", "K9-RT-02", new BigDecimal(255.50), new BigDecimal(92.00), one, "P", "Adult Male", ten_thousand},
+            {"EST-25", "K9-RT-02", new BigDecimal(325.29), new BigDecimal(90.00), one, "P", "Adult Female", ten_thousand},
+            {"EST-26", "K9-CW-01", new BigDecimal(125.50), new BigDecimal(92.00), one, "P", "Adult Male", ten_thousand},
+            {"EST-27", "K9-CW-01", new BigDecimal(155.29), new BigDecimal(90.00), one, "P", "Adult Female", ten_thousand},
+            {"EST-28", "K9-RT-01", new BigDecimal(155.29), new BigDecimal(90.00), one, "P", "Adult Female", ten_thousand}
+        };
+
+        // item data
+        for(int i = 0; i < dataArray.length; i++)
+        {
+            col = 0;
+
+            row = dataArray[i];
+            Item item = new Item();
+            item.setItemId((String)row[col++]);
+            item.setProductId((String)row[col++]);
+            item.setListPrice((BigDecimal)row[col++]);
+            item.setUnitCost((BigDecimal)row[col++]);
+            item.setSupplier(((Integer)row[col++]).intValue());
+            item.setStatus((String)row[col++]);
+            item.setAttr1((String)row[col++]);
+            item.setQty(((Integer)row[col++]).intValue());
+
+            InMemoryObjectStore.store(ITEM_NAMESPACE, item.getItemId(), item);
+        }
+
+        // catId, catName, catImage, catDescription
+        String[][] categoryDataArray = new String[][]
+        {
+            {"FISH", "Fish", "fish_icon.gif", "Saltwater, Freshwater"},
+            {"DOGS", "Dogs", "dogs_icon.gif", "Various Breeds"},
+            {"REPTILES", "Reptiles", "reptiles_icon.gif", "Lizards, Turtles, Snakes"},
+            {"CATS", "Cats", "cats_icon.gif", "Various Breeds, Exotic Varieties"},
+            {"BIRDS", "Birds", "birds_icon.gif", "Exotic Varieties"}
+        };
+
+        for(int i = 0; i < categoryDataArray.length; i++)
+        {
+            col = 0;
+
+            row = categoryDataArray[i];
+            Category category = new Category();
+            category.setCatId((String) row[col++]);
+            category.setName((String) row[col++]);
+            category.setImage((String) row[col++]);
+            category.setDescription((String) row[col++]);
+
+            InMemoryObjectStore.store(CATEGORY_NAMESPACE, category.getCatId(), category);
+        }
+
+        // productId, categoryId, productName, productImage, productDescription
+        String[][] productDataArray = new String[][]
+        {
+            {"AV-CB-01", "BIRDS", "Amazon Parrot", "bird2.jpg", "Great companion for up to 75 years"},
+            {"AV-SB-02", "BIRDS", "Finch", "bird1.jpg", "Great stress reliever"},
+            {"FI-FW-01", "FISH", "Koi", "fish3.jpg", "Fresh Water fish from Japan"},
+            {"FI-FW-02", "FISH", "Goldfish", "fish2.jpg", "Fresh Water fish from China"},
+            {"FI-SW-01", "FISH", "Angelfish", "fish1.jpg", "Salt Water fish from Australia"},
+            {"FI-SW-02", "FISH", "Tiger Shark", "fish4.jpg", "Salt Water fish from Australia"},
+            {"FL-DLH-02", "CATS", "Persian", "cat1.jpg", "Friendly house cat, doubles as a princess"},
+            {"FL-DSH-01", "CATS", "Manx", "cat2.jpg", "Great for reducing mouse populations"},
+            {"K9-BD-01", "DOGS", "Bulldog", "dog1.jpg", "Friendly dog from England"},
+            {"K9-CW-01", "DOGS", "Chihuahua", "dog2.jpg", "Great companion dog"},
+            {"K9-DL-01", "DOGS", "Dalmation", "dog3.jpg", "Great dog for a Fire Station"},
+            {"K9-PO-02", "DOGS", "Poodle", "dog6.jpg", "Cute dog from France"},
+            {"K9-RT-01", "DOGS", "Golden Retriever", "dog4.jpg", "Great family dog"},
+            {"K9-RT-02", "DOGS", "Labrador Retriever", "dog5.jpg", "Great hunting dog"},
+            {"RP-LI-02", "REPTILES", "Iguana", "lizard1.jpg", "Friendly green friend"},
+            {"RP-SN-01", "REPTILES", "Rattlesnake", "snake1.jpg", "Doubles as a watch dog"}
+        };
+
+        for(int i = 0; i < productDataArray.length; i++)
+        {
+            col = 0;
+            
+            row = productDataArray[i];
+            Product product = new Product();
+            product.setProductId((String) row[col++]);
+            product.setCategory((String) row[col++]);
+            product.setName((String) row[col++]);
+            product.setImage((String) row[col++]);
+            product.setDescription((String) row[col++]);
+
+            InMemoryObjectStore.store(PRODUCTS_NAMESPACE, product.getProductId(), product);
+        }
+    }
+
+    public Category[] getCategoryList()
+    {
+        // todo: bad form -- should return an immutable array here
+        return (Category[])InMemoryObjectStore.toArray(CATEGORY_NAMESPACE, Category.class);
+    }
+
+    public Category getCategory(String key)
+    {
+        return (Category)InMemoryObjectStore.find(CATEGORY_NAMESPACE, key);
+    }
+
+    /**
+     */
+    public Item getItem(String key)
+    {
+        return (Item)InMemoryObjectStore.find(ITEM_NAMESPACE, key);
+    }
+    
+    /**
+     */
+    public Item[] getItemListByProduct(String key)
+    {
+        Item[] items = getItemList();
+        Item item = null;
+        ArrayList result = new ArrayList();
+        for(int i = 0; i < items.length; i++)
+        {
+            item = items[i];
+            if (item.getProductId().hashCode() == key.hashCode())
+            {
+                result.add(item);
+            }
+        }
+
+        Item[] a = new Item[result.size()];
+        result.toArray(a);
+        return a;
+    }
+
+    // todo: this doesn't handle the case where something goes "out of stock", ie a negative quantity
+    public void updateItemQuantity(Item item, int quantity)
+        throws InvalidIdentifierException
+    {
+        if(item == null)
+            throw new InvalidIdentifierException("cannot update Item inventory with null or empty itemId");
+
+        item.setQty(item.getQty() - quantity);
+    }
+
+    public Product getProduct(String key)
+    {
+        return (Product)InMemoryObjectStore.find(PRODUCTS_NAMESPACE, key);
+    }
+
+    public Product[] getProductListByCategory(String key)
+    {
+        Product[] products = getProductList();
+        ArrayList result = new ArrayList();
+        Product product = null;
+        for(int i = 0; i < products.length; i++)
+        {
+            product = (Product)products[i];
+            if (product.getCategory().hashCode() == key.hashCode())
+            {
+                result.add(product);
+            }
+        }
+        Product[] a = new Product[result.size()];
+        result.toArray(a);
+        return a;
+    }
+
+
+    /**
+     */
+    public Product[] searchProductList(String searchTerm)
+    {
+        Product[] products = getProductList();
+        ArrayList result = new ArrayList();
+        Product product = null;
+        for(int i = 0; i < products.length; i++)
+        {
+            product = products[i];
+            if (product.getName().toLowerCase().indexOf(searchTerm) >= 0 ||
+                product.getCategory().toLowerCase().indexOf(searchTerm) >= 0 ||
+                product.getDescription().toLowerCase().indexOf(searchTerm) >= 0)
+            {
+                result.add(product);
+            }
+        }
+        Product[] a = new Product[result.size()];
+        result.toArray(a);
+        return a;
+    }
+
+    private Item[] getItemList()
+    {
+        // todo: bad form -- should return an immutable array here
+        return (Item[])InMemoryObjectStore.toArray(ITEM_NAMESPACE, Item.class);
+    }
+
+    private Product[] getProductList()
+    {
+        // todo: bad form -- should return an immutable array here
+        return (Product[])InMemoryObjectStore.toArray(PRODUCTS_NAMESPACE, Product.class);
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/OrderControl.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/OrderControl.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls;
+
+import java.util.List;
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.samples.petstore.model.Order;
+import org.apache.beehive.samples.petstore.controls.exceptions.NoSuchOrderException;
+import org.apache.beehive.samples.petstore.controls.exceptions.OrderAlreadyExistsException;
+import org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
+
+@ControlInterface
+public interface OrderControl
+{
+    public Order createOrder();
+
+    public void commitOrder(Order order)
+        throws OrderAlreadyExistsException, NoSuchOrderException, InvalidIdentifierException;
+
+    public Order getOrder(String key)
+        throws NoSuchOrderException;
+
+    public Order[] getOrdersByUserId(String key);
+
+    public List getCreditCards();
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/OrderControlImpl.jcs
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/OrderControlImpl.jcs	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,170 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.ArrayList;
+import java.math.BigDecimal;
+
+import java.util.List;
+import org.apache.beehive.samples.petstore.controls.internal.InMemoryObjectStore;
+import org.apache.beehive.samples.petstore.model.Order;
+import org.apache.beehive.samples.petstore.model.LineItem;
+import org.apache.beehive.samples.petstore.model.Product;
+import org.apache.beehive.samples.petstore.model.Sequence;
+import org.apache.beehive.samples.petstore.model.Item;
+import org.apache.beehive.samples.petstore.controls.exceptions.OrderAlreadyExistsException;
+import org.apache.beehive.samples.petstore.controls.exceptions.NoSuchOrderException;
+import org.apache.beehive.samples.petstore.controls.exceptions.NoSuchSequenceException;
+import org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+
+@ControlImplementation
+public class OrderControlImpl
+    implements OrderControl, java.io.Serializable
+{
+    private static final String ORDER_SEQUENCE_NAME = "order";
+    private static final String LINE_ITEM_SEQUENCE_NAME = "lineitem";
+    
+    private static final String ORDER_NAMESPACE = "orders";
+    private static final String LINE_ITEM_NAMESPACE = "lineitems";
+
+    @org.apache.beehive.controls.api.bean.Control()
+    private CatalogControl _catalogControl;
+
+    @org.apache.beehive.controls.api.bean.Control()
+    private SequenceControl _sequenceControl;
+
+    private static final ArrayList<String> CARD_TYPE_LIST;
+
+    // todo: add sample order data for a customer
+    static
+    {
+        CARD_TYPE_LIST = new ArrayList<String>();
+        CARD_TYPE_LIST.add("Visa");
+        CARD_TYPE_LIST.add("MasterCard");
+        CARD_TYPE_LIST.add("American Express");
+    }
+
+    public Order createOrder()
+    {
+        try
+        {
+            int id = _sequenceControl.getNextSequenceId(ORDER_SEQUENCE_NAME);
+            Order order = new Order(id);
+            return order;
+        }
+        catch(Exception e)
+        {
+            assert e instanceof NoSuchSequenceException || e instanceof InvalidIdentifierException;
+            e.printStackTrace();
+            
+            return null;
+        }
+    }
+
+    /**
+     */
+    public void commitOrder(Order order)
+        throws OrderAlreadyExistsException, NoSuchOrderException, InvalidIdentifierException
+    {
+        Integer integerOrderId = order.getOrderId();
+
+        Order o = lookupOrder(integerOrderId);
+        if (o != null)
+            throw new OrderAlreadyExistsException("attempted to insert Order with duplicate orderId: " + integerOrderId);
+
+        Item item = null;
+        Iterator i = order.getCart().getLineItems().iterator();
+        while (i.hasNext())
+        {
+            LineItem lineItem = (LineItem) i.next();
+            updateItemQuantity(lineItem.getItem(), lineItem.getQuantity());
+        }
+
+        InMemoryObjectStore.store(ORDER_NAMESPACE, integerOrderId, order);
+    }
+
+    /**
+     */
+    public Order getOrder(String key)
+        throws NoSuchOrderException
+    {
+        Integer orderId = convertStringToInteger(key);
+
+        Order order = lookupOrder(orderId);
+        if(order == null)
+            throw new NoSuchOrderException("No order could be found with order id \"" + key + "\"");
+
+        return order;
+    }
+
+    /**
+     */
+    public Order[] getOrdersByUserId(String userId)
+    {
+        ArrayList result = new ArrayList();
+        Order order = null;
+        Order[] orders = getOrders();
+        for(int i = 0; i < orders.length; i++)
+        {
+            order = orders[i];
+            if (order.getAccount().getUserId().equals(userId))
+                result.add(order);
+        }
+
+        Order[] a = new Order[result.size()];
+        result.toArray(a);
+        return a;
+    }
+
+    public List getCreditCards()
+    {
+        return CARD_TYPE_LIST;
+    }
+
+    private void updateItemQuantity(Item item, int quantity)
+        throws InvalidIdentifierException
+    {
+        _catalogControl.updateItemQuantity(item, quantity);
+    }
+
+    private Order lookupOrder(Integer orderId)
+    {
+        return (Order)InMemoryObjectStore.find(ORDER_NAMESPACE, orderId);
+    }
+
+    private Order[] getOrders()
+    {
+        return (Order[])InMemoryObjectStore.toArray(ORDER_NAMESPACE, Order.class);
+    }
+
+    private LineItem[] getLineItems()
+    {
+        return (LineItem[])InMemoryObjectStore.toArray(LINE_ITEM_NAMESPACE, LineItem.class);
+    }
+
+    private static Integer convertStringToInteger(String i)
+    {
+        Integer integer = new Integer(0);
+        integer = Integer.valueOf(i);
+        return integer;
+    }
+}
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/SequenceControl.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/SequenceControl.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+import org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
+import org.apache.beehive.samples.petstore.controls.exceptions.NoSuchSequenceException;
+
+@ControlInterface
+public interface SequenceControl
+{
+    int getNextSequenceId(String name)
+        throws InvalidIdentifierException, NoSuchSequenceException;
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/SequenceControlImpl.jcs
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/SequenceControlImpl.jcs	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+
+import org.apache.beehive.samples.petstore.controls.internal.InMemoryObjectStore;
+import org.apache.beehive.samples.petstore.model.Sequence;
+import org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
+import org.apache.beehive.samples.petstore.controls.exceptions.NoSuchSequenceException;
+
+@ControlImplementation
+public class SequenceControlImpl
+    implements SequenceControl, java.io.Serializable
+{
+    private static final String SEQUENCE_NAMESPACE = "sequence";
+    
+    public int getNextSequenceId(String name)
+        throws InvalidIdentifierException, NoSuchSequenceException
+    {
+        if (name == null || name.length() == 0)
+            throw new InvalidIdentifierException("Can not update Sequence with null or empty sequence name");
+
+        Sequence sequence = null;
+        Object seq = InMemoryObjectStore.find(SEQUENCE_NAMESPACE, name);
+        if(seq == null)
+        {
+            sequence = new Sequence(name);
+            InMemoryObjectStore.store(SEQUENCE_NAMESPACE, name, sequence);
+        }
+        else sequence = (Sequence)seq;
+
+        return sequence.getNextId();
+    }
+}
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/AccountAlreadyExistsException.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/AccountAlreadyExistsException.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls.exceptions;
+
+public class AccountAlreadyExistsException
+    extends Exception
+{
+    public AccountAlreadyExistsException(String message)
+    {
+        super(message);
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/InvalidIdentifierException.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/InvalidIdentifierException.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls.exceptions;
+
+public class InvalidIdentifierException
+    extends Exception
+{
+    public InvalidIdentifierException(String message)
+    {
+        super(message);
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchAccountException.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchAccountException.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls.exceptions;
+
+public class NoSuchAccountException
+    extends Exception
+{
+    public NoSuchAccountException(String message)
+    {
+        super(message);
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchOrderException.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchOrderException.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls.exceptions;
+
+public class NoSuchOrderException
+    extends Exception        
+{
+    public NoSuchOrderException(String message)
+    {
+        super(message);
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchSequenceException.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchSequenceException.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls.exceptions;
+
+public class NoSuchSequenceException
+    extends Exception
+{
+    public NoSuchSequenceException(String message)
+    {
+        super(message);
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchUserException.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchUserException.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls.exceptions;
+
+public class NoSuchUserException
+    extends Exception
+{
+    public NoSuchUserException(String message)
+    {
+        super(message);
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/OrderAlreadyExistsException.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/OrderAlreadyExistsException.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls.exceptions;
+
+public class OrderAlreadyExistsException
+    extends Exception
+{
+    public OrderAlreadyExistsException(String message)
+    {
+        super(message);
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/UserAlreadyExistsException.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/UserAlreadyExistsException.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls.exceptions;
+
+public class UserAlreadyExistsException
+    extends Exception
+{
+    public UserAlreadyExistsException(String message)
+    {
+        super(message);
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/internal/InMemoryObjectStore.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/internal/InMemoryObjectStore.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.controls.internal; 
+
+import java.lang.reflect.Array;
+import java.util.HashMap;
+import java.util.Map;
+
+public class InMemoryObjectStore
+{
+    private static Map<String, Map> OBJECT_STORE = new HashMap<String, Map>();
+    
+    public static final boolean store(String namespace, Object key, Object value)
+    {
+        Map store = (Map)getNamespaceStore(namespace);
+
+        store.put(key, value);
+
+        return true;
+    }
+
+    public static final Object find(String namespace, Object key)
+    {
+        Map nsStore = getNamespaceStore(namespace);
+
+        return nsStore.get(key);
+    }
+
+    public static final Object[] toArray(String namespace, Class type)
+    {
+        Map nsData = getNamespaceStore(namespace);
+        Object[] values = (Object[])Array.newInstance(type, nsData.values().size());
+        return nsData.values().toArray(values);
+    }
+
+    private static final Map getNamespaceStore(String namespace)
+    {
+        Map nsStore = OBJECT_STORE.get(namespace);
+        if(nsStore == null)
+        {
+            nsStore = createNamespaceStore();
+            OBJECT_STORE.put(namespace, nsStore);
+        }
+
+        return nsStore;
+    }
+
+    private static final Map createNamespaceStore()
+    {
+        return new HashMap();
+    }
+} 

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AbstractPetstoreForm.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AbstractPetstoreForm.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.forms;
+
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.action.ActionError;
+import org.apache.beehive.netui.pageflow.FormData;
+
+public abstract class AbstractPetstoreForm
+    extends FormData
+{
+    protected final void addErrorIfStringEmpty(ActionErrors errors, String errorName,
+                                               String resourceKey, String value)
+    {
+        if(value == null || value.trim().length() == 0)
+        {
+            errors.add(errorName, new ActionError(resourceKey));
+        }
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AccountForm.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AccountForm.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,208 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.forms;
+
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.action.ActionMapping;
+import org.apache.beehive.samples.petstore.model.Account;
+import org.apache.beehive.samples.petstore.model.Address;
+
+import javax.servlet.http.HttpServletRequest;
+
+public abstract class AccountForm
+    extends AbstractPetstoreForm
+{
+    private Account _account;
+
+    public AccountForm()
+    {
+        super();
+    }
+    
+    public AccountForm(Account account)
+    {
+        this();
+        _account = account;
+    }
+
+    protected Account getAccount()
+    {
+        return _account;
+    }
+
+    public String getUserId()
+    {
+        return _account.getUserId();
+    }
+    
+    public String getFirstName() {
+        return _account.getFirstName();
+    }
+
+    public void setFirstName(String firstName) {
+        _account.setFirstName(firstName);
+    }
+
+    public String getLastName() {
+        return _account.getLastName();
+    }
+
+    public void setLastName(String lastName) {
+        _account.setLastName(lastName);
+    }
+
+    public String getEmail() {
+        return _account.getEmail();
+    }
+
+    public void setEmail(String email) {
+        _account.setEmail(email);
+    }
+
+    public String getPhone()
+    {
+        return _account.getPhone();
+    }
+
+    public void setPhone(String value)
+    {
+        _account.setPhone(value);
+    }
+
+    public String getAddr1()
+    {
+        return _account.getAddress().getAddr1();
+    }
+
+    public void setAddr1(String value)
+    {
+        _account.getAddress().setAddr1(value);
+    }
+
+    public String getAddr2()
+    {
+        return _account.getAddress().getAddr2();
+    }
+
+    public void setAddr2(String value)
+    {
+        _account.getAddress().setAddr2(value);
+    }
+
+    public String getCity()
+    {
+        return _account.getAddress().getCity();
+    }
+
+    public void setCity(String value)
+    {
+        _account.getAddress().setCity(value);
+    }
+
+    public String getState()
+    {
+        return _account.getAddress().getState();
+    }
+
+    public void setState(String value)
+    {
+        _account.getAddress().setState(value);
+    }
+
+    public String getZip()
+    {
+        return _account.getAddress().getZip();
+    }
+
+    public void setZip(String value)
+    {
+        _account.getAddress().setZip(value);
+    }
+
+    public String getCountry()
+    {
+        return _account.getAddress().getCountry();
+    }
+
+    public void setCountry(String value)
+    {
+        _account.getAddress().setCountry(value);
+    }
+
+    public String getFavCategory()
+    {
+        return _account.getFavCategory();
+    }
+
+    public void setFavCategory(String value)
+    {
+        _account.setFavCategory(value);
+    }
+
+    public String getLangPref()
+    {
+        return _account.getLangPref();
+    }
+
+    public void setLangPref(String value)
+    {
+        _account.setLangPref(value);
+    }
+
+    public boolean isMyListOpt()
+    {
+        return _account.isMyListOpt();
+    }
+
+    public void setMyListOpt(boolean value)
+    {
+        _account.setMyListOpt(value);
+    }
+
+    public boolean isBannerOpt()
+    {
+        return _account.isBannerOpt();
+    }
+
+    public void setBannerOpt(boolean value)
+    {
+        _account.setBannerOpt(value);
+    }
+
+    public ActionErrors baseValidate(ActionErrors errors, ActionMapping mapping, HttpServletRequest request)
+    {
+        addErrorIfStringEmpty(errors, "firstName", "account.error.firstName.required", _account.getFirstName());
+        addErrorIfStringEmpty(errors, "lastName", "account.error.lastName.required", _account.getLastName());
+        addErrorIfStringEmpty(errors, "email", "account.error.email.required", _account.getEmail());
+        addErrorIfStringEmpty(errors, "phone", "account.error.phone.required", _account.getPhone());
+
+        Address address = _account.getAddress();
+        addErrorIfStringEmpty(errors, "address1", "account.error.address1.required", address.getAddr1());
+        addErrorIfStringEmpty(errors, "city", "account.error.city.required", address.getCity());
+        addErrorIfStringEmpty(errors, "state", "account.error.state.required", address.getState());
+        addErrorIfStringEmpty(errors, "zip", "account.error.zip.required", address.getZip());
+        addErrorIfStringEmpty(errors, "country", "account.error.country.required", address.getCountry());
+
+        return errors;
+    }
+
+    public static final Account getAccount(AccountForm form)
+    {
+        return form.getAccount();   
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/CheckoutForm.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/CheckoutForm.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.forms;
+
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.action.ActionMapping;
+import org.apache.beehive.samples.petstore.model.Account;
+import org.apache.beehive.samples.petstore.model.Address;
+import org.apache.beehive.samples.petstore.model.Order;
+
+import javax.servlet.http.HttpServletRequest;
+
+public class CheckoutForm
+    extends OrderForm
+{
+    private boolean _shippingAddressRequired;
+    private boolean _isCheckOut;
+
+    public void setShippingAddressRequired(boolean shippingAddressRequired)
+    {
+        _shippingAddressRequired = shippingAddressRequired;
+    }
+
+    public boolean isShippingAddressRequired()
+    {
+        return _shippingAddressRequired;
+    }
+
+    public boolean isCheckOut()
+    {
+        return _isCheckOut;
+    }
+
+    public void setCheckOut(boolean checkOut)
+    {
+        _isCheckOut = checkOut;
+    }
+
+    // todo: format validation for e-mail, zip, credit card, date
+    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
+    {
+        Order order = getOrder();
+        ActionErrors errors = new ActionErrors();
+        Account account = order.getAccount();
+
+        addErrorIfStringEmpty(errors, "creditCart", "order.error.creditCard.required", order.getCreditCard());
+    	addErrorIfStringEmpty(errors, "expirationDate", "order.error.expirationDate.required", order.getExprDate());
+        addErrorIfStringEmpty(errors, "cardType", "order.error.cardType.required", order.getCardType());
+        
+        Address billing = order.getBillingAddress();
+        addErrorIfStringEmpty(errors, "billToFirstName", "order.error.billToFirstName.required", billing.getFirstName());
+        addErrorIfStringEmpty(errors, "billToLastName", "order.error.billToLastName.required", billing.getLastName());
+        addErrorIfStringEmpty(errors, "billToAddress1", "order.error.billToAddress1.required", billing.getAddr1());
+        addErrorIfStringEmpty(errors, "billToCity", "order.error.billToCity.required", billing.getCity());
+        addErrorIfStringEmpty(errors, "billToState", "order.error.billToState.required", billing.getState());
+        addErrorIfStringEmpty(errors, "billToZip", "order.error.billToZip.required", billing.getZip());
+        addErrorIfStringEmpty(errors, "billToCountry", "order.error.billToCountry.required", billing.getCountry());
+
+    	if(isShippingAddressRequired())
+        {
+            Address shipping = order.getShippingAddress();
+            addErrorIfStringEmpty(errors, "shipToFirstName", "order.error.shipToFirstName.required", shipping.getFirstName());
+            addErrorIfStringEmpty(errors, "shipToLastName", "order.error.shipToLastName.required", shipping.getLastName());
+            addErrorIfStringEmpty(errors, "shipToAddress1", "order.error.shipToAddress1.required", shipping.getAddr1());
+            addErrorIfStringEmpty(errors, "shipToCity", "order.error.shipToCity.required", shipping.getCity());
+            addErrorIfStringEmpty(errors, "shipToState", "order.error.shipToState.required", shipping.getState());
+            addErrorIfStringEmpty(errors, "shipToZip", "order.error.shipToZip.required", shipping.getZip());
+            addErrorIfStringEmpty(errors, "shipToCountry", "order.error.shipToCountry.required", shipping.getCountry());
+        }
+
+        // sets the ship address the same as the bill-to address
+        if(!isShippingAddressRequired() && errors.size() > 0)
+        {
+            order.setShippingAddressIsBillingAddress(true);
+        }
+
+        return errors;
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/OrderForm.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/OrderForm.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.forms;
+
+import org.apache.beehive.netui.pageflow.FormData;
+import org.apache.beehive.samples.petstore.model.Order;
+
+public class OrderForm
+    extends AbstractPetstoreForm
+{
+    private Order _order;
+
+    public void setOrder(Order order)
+    {
+        _order = order;
+    }
+
+    public Order getOrder()
+    {
+        return _order;
+    }
+}
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/ReturnToForm.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/ReturnToForm.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,30 @@
+package org.apache.beehive.samples.petstore.forms; 
+
+import org.apache.beehive.netui.pageflow.FormData;
+
+/**
+ * This class stores the state of the app when the user entered the
+ * auth controller i.e. return to previous page or return to previous action
+ */
+public class ReturnToForm
+    extends FormData
+{
+    private boolean _returnToPreviousAction;
+
+    public ReturnToForm() {}
+
+    public ReturnToForm(boolean returnToPreviousAction)
+    {
+        _returnToPreviousAction = returnToPreviousAction;
+    }
+
+    public void setReturnToPreviousAction(boolean returnToPreviousAction)
+    {
+        _returnToPreviousAction = returnToPreviousAction;
+    }
+
+    public boolean getReturnToPreviousAction()
+    {
+        return _returnToPreviousAction;
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/SearchForm.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/SearchForm.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,12 @@
+package org.apache.beehive.samples.petstore.forms; 
+
+import org.apache.beehive.netui.pageflow.FormData;
+
+public class SearchForm
+    extends FormData
+{
+    private String _keyword = null;
+
+    public String getKeyword() {return _keyword;}
+    public void setKeyword(String keyword) {_keyword = keyword;}
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Account.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Account.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,187 @@
+package org.apache.beehive.samples.petstore.model;
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+
+/**
+ *
+ */
+public class Account
+    implements java.io.Serializable
+{
+    private String _userId;
+    private String _password;
+    private String _email;
+    private String _phone;
+    private String _firstName;
+    private String _lastName;
+    private String _status;
+
+    private Address _address;
+
+    private String _favCategory;
+    private String _langPref;
+    private String _bannerData;
+    private String _bannerName;
+    private boolean _myListOpt;
+    private boolean _bannerOpt;
+
+    public Account()
+    {
+    }
+
+    public String getPassword()
+    {
+        return _password;
+    }
+
+    public void setPassword(String password)
+    {
+        _password = password;    
+    }
+
+    public Address getAddress()
+    {
+        return _address;
+    }
+
+    public void setAddress(Address address)
+    {
+        _address = address;
+    }
+
+    public String getUserId()
+    {
+        return _userId;
+    }
+
+    public void setUserId(String userId)
+    {
+        _userId = userId;
+    }
+
+    public String getEmail()
+    {
+        return _email;
+    }
+
+    public void setEmail(String email)
+    {
+        _email = email;
+    }
+
+    public String getFirstName()
+    {
+        return _firstName;
+    }
+
+    public void setFirstName(String firstName)
+    {
+        _firstName = firstName;
+    }
+
+    public String getLastName()
+    {
+        return _lastName;
+    }
+
+    public void setLastName(String lastName)
+    {
+        _lastName = lastName;
+    }
+
+    public String getStatus()
+    {
+        return _status;
+    }
+
+    public void setStatus(String status)
+    {
+        _status = status;
+    }
+
+    public String getPhone()
+    {
+        return _phone;
+    }
+
+    public void setPhone(String phone)
+    {
+        _phone = phone;
+    }
+
+    public void setFavCategory(String favCategory)
+    {
+        _favCategory = favCategory;
+    }
+
+    public String getFavCategory()
+    {
+        return _favCategory;
+    }
+
+
+    public void setLangPref(String langPref)
+    {
+        _langPref = langPref;
+    }
+
+    public String getLangPref()
+    {
+        return _langPref;
+    }
+
+    public String getBannerData()
+    {
+        return _bannerData;
+    }
+
+    public void setBannerData(String bannerData)
+    {
+        _bannerData = bannerData;
+    }
+
+    public boolean isMyListOpt()
+    {
+        return _myListOpt;
+    }
+
+    public void setMyListOpt(boolean myListOpt)
+    {
+        _myListOpt = myListOpt;
+    }
+
+    public boolean isBannerOpt()
+    {
+        return _bannerOpt;
+    }
+
+    public void setBannerOpt(boolean bannerOpt)
+    {
+        _bannerOpt = bannerOpt;
+    }
+
+    public String getBannerName()
+    {
+        return _bannerName;
+    }
+
+    public void setBannerName(String bannerName)
+    {
+        _bannerName = bannerName;
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Address.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Address.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.model;
+
+public class Address
+{
+    private String _firstName;
+    private String _lastName;
+
+    // shipping address
+    private String _addr1;
+    private String _addr2;
+    private String _city;
+    private String _state;
+    private String _zip;
+    private String _country;
+
+    public Address() {}
+
+    public String getLastName()
+    {
+        return _lastName;
+    }
+
+    public void setLastName(String lastName)
+    {
+        _lastName = lastName;
+    }
+
+    public String getFirstName()
+    {
+        return _firstName;
+    }
+
+    public void setFirstName(String firstName)
+    {
+        _firstName = firstName;
+    }
+
+    public String getAddr1() {
+        return _addr1;
+    }
+
+    public void setAddr1(String addr1) {
+        _addr1 = addr1;
+    }
+
+    public String getAddr2() {
+        return _addr2;
+    }
+
+    public void setAddr2(String addr2) {
+        _addr2 = addr2;
+    }
+
+    public String getCity() {
+        return _city;
+    }
+
+    public void setCity(String city) {
+        _city = city;
+    }
+
+    public String getState() {
+        return _state;
+    }
+
+    public void setState(String state) {
+        _state = state;
+    }
+
+    public String getZip() {
+        return _zip;
+    }
+
+    public void setZip(String zip) {
+        _zip = zip;
+    }
+
+    public String getCountry() {
+        return _country;
+    }
+
+    public void setCountry(String country) {
+        _country = country;
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Cart.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Cart.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.model;
+
+import java.math.*;
+import java.util.*;
+
+/**
+ * 
+ */
+public class Cart
+    implements java.io.Serializable
+{
+    private List<LineItem> _itemList;
+
+    public Cart()
+    {
+        _itemList = new ArrayList<LineItem>();
+    }
+
+    public List<LineItem> getLineItems()
+    {
+        return _itemList;
+    }
+
+    public int getNumberOfItems()
+    {
+        return _itemList.size();
+    }
+
+    /**
+     * Add an item to the cart.  If the item does not exist in the cart,
+     * it is added to the cart and the CartItem's quantity is incremented.
+     */
+    public void addItem(Item item)
+    {
+        LineItem lineItem = getLineItem(item.getItemId());
+        if(lineItem == null)
+        {
+            lineItem = new LineItem();
+            lineItem.setItem(item);
+            lineItem.setQuantity(0);
+            _itemList.add(lineItem);
+        }
+
+        lineItem.incrementQuantity();
+    }
+
+    public boolean containsItemId(String itemId)
+    {
+        return (getLineItem(itemId) != null);
+    }
+
+    public Item removeItemById(String itemId)
+    {
+        LineItem lineItem = getLineItem(itemId);
+
+        if(lineItem != null)
+            _itemList.remove(lineItem);
+
+        return lineItem.getItem();
+    }
+
+    public void incrementQuantityByItemId(String itemId)
+    {
+        LineItem lineItem = getLineItem(itemId);
+
+        if(lineItem == null)
+            throw new IllegalStateException("Can not increment the quanitty of a Cart item when the item is not in the cart");
+
+        lineItem.incrementQuantity();
+
+        getSubTotal();
+    }
+
+    public void setQuantityByItemId(String itemId, int quantity)
+    {
+        LineItem lineItem = getLineItem(itemId);
+
+        if(lineItem == null)
+            throw new IllegalStateException("Can not set the item's quantity in a Cart that does not contain the item.");
+
+        lineItem.setQuantity(quantity);
+    }
+
+    public BigDecimal getSubTotal()
+    {
+        BigDecimal subTotal = new BigDecimal("0");
+
+        Iterator items = _itemList.iterator();
+        while (items.hasNext())
+        {
+            LineItem lineItem = (LineItem)items.next();
+            Item item = lineItem.getItem();
+            BigDecimal listPrice = item.getListPrice();
+            BigDecimal quantity = new BigDecimal(String.valueOf(lineItem.getQuantity()));
+            subTotal = subTotal.add(listPrice.multiply(quantity));
+        }
+
+        return subTotal;
+    }
+
+    /**
+     * Internal method to lookup a CartItem based on an itemId.
+     */
+    private LineItem getLineItem(String itemId)
+    {
+        for(int i = 0; i < _itemList.size(); i++)
+        {
+            if(_itemList.get(i).getItem().getItemId().equals(itemId))
+                return _itemList.get(i);
+        }
+        return null;
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Category.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Category.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.model;
+
+public class Category
+    implements java.io.Serializable
+{
+    private String _catId;
+    private String _name;
+    private String _description;
+    private String _image;
+
+    public Category()
+    {
+    }
+
+    public String getCatId()
+    {
+        return _catId;
+    }
+
+    public void setCatId(String catId)
+    {
+        _catId = catId.trim();
+    }
+
+    public String getImage()
+    {
+        return _image;
+    }
+
+    public void setImage(String image)
+    {
+        _image = image;
+    }
+
+    public String getName()
+    {
+        return _name;
+    }
+
+    public void setName(String name)
+    {
+        _name = name;
+    }
+
+    public String getDescription()
+    {
+        return _description;
+    }
+
+    public void setDescription(String description)
+    {
+        _description = description;
+    }
+
+    public String toString()
+    {
+        return getCatId();
+    }
+
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Item.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Item.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.model;
+
+import java.math.BigDecimal;
+
+/**
+ *
+ */
+public class Item
+    implements java.io.Serializable
+{
+    private Product _product;
+
+    private String _itemId;
+    private String _productId;
+    private String _status;
+    private String _attr1;
+    private String _attr2;
+    private String _attr3;
+    private String _attr4;
+    private String _attr5;
+
+    private BigDecimal _listPrice;
+    private BigDecimal _unitCost;
+    
+    private int _supplier;
+    private int _inventoryQuantity;
+
+    public String getItemId()
+    {
+        return _itemId;
+    }
+
+    public void setItemId(String itemId)
+    {
+        _itemId = itemId.trim();
+    }
+
+    public void setQty(int qty)
+    {
+        _inventoryQuantity = qty;
+    }
+
+    public int getQty()
+    {
+        return _inventoryQuantity;
+    }
+
+    public Product getProduct()
+    {
+        return _product;
+    }
+
+    public void setProduct(Product product)
+    {
+        _product = product;
+    }
+
+    public String getProductId()
+    {
+        return _productId;
+    }
+
+    public void setProductId(String productId)
+    {
+        _productId = productId;
+    }
+
+    public void setSupplier(int supplier)
+    {
+        _supplier = supplier;
+    }
+
+    public int getSupplier()
+    {
+        return _supplier;
+    }
+
+    public BigDecimal getListPrice()
+    {
+        return _listPrice;
+    }
+
+    public void setListPrice(BigDecimal listPrice)
+    {
+        _listPrice = listPrice;
+    }
+
+    public BigDecimal getUnitCost()
+    {
+        return _unitCost;
+    }
+
+    public void setUnitCost(BigDecimal unitCost)
+    {
+        _unitCost = unitCost;
+    }
+
+    public String getStatus()
+    {
+        return _status;
+    }
+
+    public void setStatus(String status)
+    {
+        _status = status;
+    }
+
+    public String getAttr1()
+    {
+        return _attr1;
+    }
+
+    public void setAttr1(String attr1)
+    {
+        _attr1 = attr1;
+    }
+
+    public String getAttr2()
+    {
+        return _attr2;
+    }
+
+    public void setAttr2(String attr2)
+    {
+        _attr2 = attr2;
+    }
+
+    public String getAttr3()
+    {
+        return _attr3;
+    }
+
+    public void setAttr3(String attr3)
+    {
+        _attr3 = attr3;
+    }
+
+    public String getAttr4()
+    {
+        return _attr4;
+    }
+
+    public void setAttr4(String attr4)
+    {
+        _attr4 = attr4;
+    }
+
+    public String getAttr5()
+    {
+        return _attr5;
+    }
+
+    public void setAttr5(String attr5)
+    {
+        _attr5 = attr5;
+    }
+
+    public String toString()
+    {
+        return "(" + getItemId().trim() + "-" + getProductId().trim() + ")";
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/LineItem.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/LineItem.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.model;
+
+import java.math.BigDecimal;
+
+/**
+ *
+ */
+public class LineItem
+    implements java.io.Serializable
+{
+    private int _lineNum;
+    private int _quantity;
+    private int _orderId = -1;
+
+    private Item _item;
+
+    public LineItem()
+    {
+        super();
+    }
+
+    public LineItem(int orderId, int lineNum, Item item)
+    {
+        this();
+        _orderId = orderId;
+        _lineNum = lineNum;
+        _item = item;
+        _quantity = 0;
+    }
+
+    public int getOrderId()
+    {
+        return _orderId;
+    }
+
+    public String getItemId()
+    {
+        return _item.getItemId();
+    }
+
+    public boolean isInStock()
+    {
+        return _item.getQty() > 0;
+    }
+
+    public Item getItem() {
+        return _item;
+    }
+
+    public void setItem(Item item)
+    {
+        _item = item;
+        calculateTotal();
+    }
+
+    public int getLineNum()
+    {
+        return _lineNum;
+    }
+
+    public void setLineNum(int lineNum)
+    {
+        _lineNum = lineNum;
+    }
+
+    public int getQuantity()
+    {
+        return _quantity;
+    }
+
+    public void setQuantity(int quantity)
+    {
+        _quantity = quantity;
+        calculateTotal();
+    }
+
+    public BigDecimal getUnitPrice()
+    {
+        return _item.getListPrice();
+    }
+
+    public BigDecimal getTotal()
+    {
+        return calculateTotal();
+    }
+
+    public void incrementQuantity()
+    {
+        _quantity++;
+    }
+
+    private BigDecimal calculateTotal()
+    {
+        BigDecimal total = null;
+        if (_item != null && _item.getListPrice() != null)
+            total = _item.getListPrice().multiply(new BigDecimal(_quantity));
+
+        return total;
+    }
+
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Order.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Order.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,215 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.model;
+
+import java.math.*;
+import java.util.*;
+
+public class Order
+    implements java.io.Serializable
+{
+    private int _orderId;
+
+    private Date _orderDate;
+    private Date _time;
+
+    private String _courier;
+    private BigDecimal _totalPrice;
+
+    private String _creditCard;
+    private String _exprDate;
+    private String _cardType;
+    private String _locale;
+    private String _status;
+
+    private int _lineNum;
+    private boolean _shippingAddressIsBillingAddress;
+
+    private Account _account = null;
+    private Cart _cart = null;
+
+    private Address _shippingAddress = null;
+    private Address _billingAddress = null;
+
+    public Order(int orderId)
+    {
+        _orderId = orderId;
+    }
+
+    public void initOrder(Account account, Cart cart)
+    {
+        _account = account;
+        _billingAddress = account.getAddress();
+        _cart = cart;
+        _orderDate = new Date();
+        _totalPrice = _cart.getSubTotal();
+    }
+
+    public Account getAccount() {return _account;}
+
+    public Cart getCart() {return _cart;}
+
+    public int getOrderId()
+    {
+        return _orderId;
+    }
+
+    public void setOrderId(int orderId)
+    {
+        _orderId = orderId;
+    }
+
+    public Date getOrderDate()
+    {
+        return _orderDate;
+    }
+
+    public void setOrderDate(Date orderDate)
+    {
+        _orderDate = orderDate;
+    }
+
+    public Date getTime() {
+        return _time;
+    }
+
+    public void setTime(Date time)
+    {
+        _time = time;
+    }
+
+    public String getCourier()
+    {
+        return _courier;
+    }
+
+    public void setCourier(String courier)
+    {
+        _courier = courier;
+    }
+
+    public BigDecimal getTotalPrice()
+    {
+        return _totalPrice;
+    }
+
+    public void setTotalPrice(BigDecimal totalPrice)
+    {
+        _totalPrice = totalPrice;
+    }
+
+    public String getCreditCard()
+    {
+        return _creditCard;
+    }
+
+    public void setCreditCard(String creditCard)
+    {
+        _creditCard = creditCard;
+    }
+
+    public String getExprDate()
+    {
+        return _exprDate;
+    }
+
+    public void setExprDate(String exprDate)
+    {
+        _exprDate = exprDate;
+    }
+
+    public String getCardType()
+    {
+        return _cardType;
+    }
+
+    public void setCardType(String cardType)
+    {
+        _cardType = cardType;
+    }
+
+    public String getLocale()
+    {
+        return _locale;
+    }
+
+    public void setLocale(String locale)
+    {
+        _locale = locale;
+    }
+
+    public String getStatus()
+    {
+        return _status;
+    }
+
+    public void setStatus(String status)
+    {
+        _status = status;
+    }
+
+    public int getLineNum() {
+        return _lineNum;
+    }
+
+    public void setLineNum(int lineNum)
+    {
+        _lineNum = lineNum;
+    }
+
+    public void setShippingAddressIsBillingAddress(boolean shippingAddressIsBillingAddress)
+    {
+        _shippingAddressIsBillingAddress = shippingAddressIsBillingAddress;
+    }
+
+    public boolean getShippingAddressIsBillingAddress()
+    {
+        return _shippingAddressIsBillingAddress;
+    }
+
+    public Address getShippingAddress()
+    {
+        if(_shippingAddress == null)
+            _shippingAddress = createAddress();
+
+        return _shippingAddress;
+    }
+
+    public void setShippingAddress(Address shippingAddress)
+    {
+        _shippingAddress = shippingAddress;
+    }
+
+    public Address getBillingAddress()
+    {
+        if(_billingAddress == null)
+            _billingAddress = createAddress();
+
+        return _billingAddress;
+    }
+
+    public void setBillingAddress(Address billingAddress)
+    {
+        _billingAddress = billingAddress;
+    }
+
+    private Address createAddress()
+    {
+        return new Address();
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Product.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Product.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.model;
+
+public class Product
+    implements java.io.Serializable
+{
+    private String _productId;
+    private String _category;
+    private String _name;
+    private String _description;
+    private String _image;
+
+    public String getProductId()
+    {
+        return _productId;
+    }
+
+    public void setProductId(String productId)
+    {
+        _productId = productId.trim();
+    }
+
+    public String getImage()
+    {
+        return _image;
+    }
+
+    public void setImage(String image)
+    {
+        _image = image;
+    }
+
+    public String getCategory() {
+        return _category;
+    }
+
+    public void setCategory(String category) {
+        _category = category;
+    }
+
+    public String getName()
+    {
+        return _name;
+    }
+
+    public void setName(String name)
+    {
+        _name = name;
+    }
+
+    public String getDescription()
+    {
+        return _description;
+    }
+
+    public void setDescription(String description)
+    {
+        _description = description;
+    }
+    
+    public String toString()
+    {
+        return getName();
+    }
+
+
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Sequence.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Sequence.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package org.apache.beehive.samples.petstore.model;
+
+public class Sequence
+    implements java.io.Serializable
+{
+    private String _name;
+    private int _nextId = 0;
+
+    public Sequence(String name)
+    {
+        _name = name;
+    }
+
+    public String getName()
+    {
+        return _name;
+    }
+
+    public int getNextId()
+    {
+        return _nextId++;
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/ws/Category.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/ws/Category.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,86 @@
+/*
+ * Category.java
+ * 
+ * Copyright 2001-2004 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
+ *
+ * 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.
+ * 
+ * 
+ * Original author: Jonathan Colwell
+ */
+package org.apache.beehive.samples.petstore.model.ws;
+
+import java.awt.Image;
+
+/*******************************************************************************
+ * 
+ *
+ * @author Jonathan Colwell
+ */
+public class Category 
+    extends org.apache.beehive.samples.petstore.model.Category {
+
+
+    private Image mAttachedImage;
+    //private Product[] mProducts;
+
+    public Category()
+    {
+        super();
+    }
+
+    public Category(org.apache.beehive.samples.petstore.model.Category cat)
+    {
+        super();
+
+        setCatId(cat.getCatId());
+        setName(cat.getName());
+        setDescription(cat.getDescription());
+        setImage(cat.getImage());
+    }
+
+    public Category(org.apache.beehive.samples.petstore.model.Category cat,
+                    Image img
+                    /*, Product[] products*/
+                    )
+    {
+        this(cat);
+
+        setAttachedImage(img);
+        //setProductList(products);
+    }
+
+
+    public Image getAttachedImage()
+    {
+        return mAttachedImage;
+    }
+
+    public void setAttachedImage(Image img)
+    {
+        mAttachedImage = img;
+    }
+
+    /*
+    public Product[] getProductList()
+    {
+        return mProducts;
+    }
+
+    public void setProductList(Product[] products)
+    {
+        mProducts = products;
+    }
+    */
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/ws/Product.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/ws/Product.java	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,81 @@
+/*
+ * Product.java
+ * 
+ * Copyright 2001-2004 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
+ *
+ * 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.
+ * 
+ * 
+ * Original author: Jonathan Colwell
+ */
+package org.apache.beehive.samples.petstore.model.ws;
+
+import java.awt.Image;
+
+/*******************************************************************************
+ * 
+ *
+ * @author Jonathan Colwell
+ */
+public class Product extends org.apache.beehive.samples.petstore.model.Product {
+
+
+    private Image mAttachedImage;
+  
+    public Product()
+    {
+        super();
+    }
+
+    public Product(org.apache.beehive.samples.petstore.model.Product prod)
+    {
+        super();
+
+        setProductId(prod.getProductId());
+        setCategory(prod.getCategory());
+        setName(prod.getName());
+        setDescription(prod.getDescription());
+        setImage(prod.getImage());
+    }
+
+    public Product(org.apache.beehive.samples.petstore.model.Product prod,
+                   Image img
+                   /*, Item[] items*/
+                   )
+    {
+        this(prod);
+        
+        //setItemList(items);
+        setAttachedImage(img);
+    }
+
+    public Image getAttachedImage() {
+        return mAttachedImage;
+    }
+
+    public void setAttachedImage(Image img) {
+        mAttachedImage = img;
+    }
+    /*
+    public Item[] getItemList()
+    {
+        return mItems;
+    }
+
+    public void setItemList(Item[] items)
+    {
+        mItems = items;
+    }
+    */
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/resources/account.properties
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/resources/account.properties	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,40 @@
+# JSP strings.  These are used by the "bundle" databinding context as an example of how to use i18n'ed messages in the application
+accountInformation=Account Information
+firstName=First Name
+lastName=Last Name
+email=E-Mail
+phone=Phone
+address1=Address 1
+address2=Address 2
+city=City
+state=State
+zip=Zip
+country=Country
+profileInformation=Profile Information
+languagePreference=Language Preference
+favoriteCategory=Favorite Category
+enableMyBanner=Enable Favorites Banner
+enableMyList=Enable Favorites List
+
+myOrders=My Orders
+
+# Validation error messages
+account.error.password.mismatch=Passwords did not match.
+account.error.password.missing=Passwords did not match or were not provided.  Matching passwords are required.
+account.error.userid.required=User ID is required.
+account.error.email.required=Email address is required.
+account.error.firstName.required=First name is required.
+account.error.lastName.required=Last name is required.
+account.error.phone.required=Phone number is required.
+account.error.address1.required=Address (1) is required.
+account.error.city.required=City is required.
+account.error.state.required=State is required.
+account.error.zip.required=ZIP is required.
+account.error.country.required=Country is required.
+
+userInformation=User Information
+usernameTaken=Sorry, this username is already taken.  Please choose a different one.
+userIdLabel=User ID
+passwordLabel=New Password
+repeatPasswordLabel=Repeat Password
+listOrdersLabel=List Orders
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/resources/order.properties
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/resources/order.properties	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,22 @@
+# Order validation messages
+order.error.creditCard.required=Fake credit card number required.
+order.error.expirationDate.required=Expiration date is required.
+order.error.cardType.required=Card type is required.
+
+order.error.shipToFirstName.required=Shipping Address: first name is required.
+order.error.shipToLastName.required=Shipping Address: last name is required.
+order.error.shipAddress1.required=Shipping Address: address is required.
+order.error.shipCity.required=Shipping Address: city is required.
+order.error.shipState.required=Shipping Address: state is required.
+order.error.shipZip.required=Shipping Address: zip code is required.
+order.error.shipCountry.required=Shipping Address: country is required.
+
+order.error.billToFirstName.required=Billing Address: first name is required.
+order.error.billToLastName.required=Billing Address: last name is required.
+order.error.billToAddress1.required=Billing Address: address is required.
+order.error.billToCity.required=Billing Address: city is required.
+order.error.billToState.required=Billing Address: state is required.
+order.error.billToZip.required=Billing Address: zip code is required.
+order.error.billToCountry.required=Billing Address: country is required.
+
+order.error.invalidQuantity=Invalid quantity

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/resources/search.properties
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/resources/search.properties	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,3 @@
+searchResultsLabel=Search Results
+searchDoneLabel=Done
+noSearchResults=No products found

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/resources/view.properties
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/resources/view.properties	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,83 @@
+#
+# checkout / shop
+#
+mainMenuLabel=Main Menu
+confirmMessage=Please confirm the information below and then press continue...
+paymentDetailsLabel=Payment Details
+cardTypeLabel=Card type
+cardNumberLabel=Card number
+expirationDateLabel=Expiration date
+firstNameLabel=First Name
+lastNameLabel=Last Name
+address1Label=Address 1
+address2Label=Address 2
+cityLabel=City
+stateLabel=State
+zipLabel=Zip
+countryLabel=Country
+shipToDifferentAddressMessage=Ship to different address...
+billingAddressLabel=Billing Address
+shippingAddressLabel=Shipping Address
+
+orderNumberLabel=Order Number
+orderDateFormat=yyyy/MM/dd hh:mm:ss
+orderStatus=Order Status
+
+priceFormat=$#,##0.00
+orderSubmittedMessage=Thank you, your order has been submitted.
+
+listPriceLabel=List Price
+
+# these are duplicated with the account strings
+itemIdLabel=Item ID
+descriptionLabel=Description
+quantityLabel=Quantity
+unitPriceLabel=Unit Price
+totalCostLabel=Total Cost
+inStockLabel=In Stock
+productIdLabel=Product ID
+nameLabel=Name
+
+shoppingCartLabel=Shopping Cart
+checkoutSummaryLabel=Checkout Summary
+
+backOrderedMessage=Back Ordered
+# need to use a message format here
+inStockMessage=in Stock
+
+emptyCartMessage=Your cart is empty
+
+subTotalLabel=Sub Total
+
+petFavoritesLabel=Pet Favorites
+shopForFavoritesLabel=Shop for more of your favorite pets here
+welcomeLabel=Welcome
+
+userInformation=User Information
+
+orderId=Order ID
+orderDate=Order Date
+orderPrice=Order Price
+
+myOrders=My Orders
+
+#
+# /auth/authController.jpf
+#
+enterUsernamePassword=Please enter your username and password.
+usernameLoginLabel=Username
+passwordLoginLabel=Password
+loginLabel=Login
+createAccountLabel=Create Account
+loginErrorMessage=Sorry, your user name and password were not recognized.
+
+#
+# /Controller.jpf
+#
+indexTitle=Beehive Petstore Demo
+
+#
+# /index.jsp
+#
+enterTheStore=Enter the Store
+welcome=Welcome to the Beehive Pet Store!
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/petstore-build.xml
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/petstore-build.xml	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+
+<!--
+
+  -->
+<project name="jpfPetstore Webapp Build" default="build" basedir="../..">
+
+    <property environment="os"/>
+
+    <property name="webapp.dir" location="${basedir}"/>
+    <property name="context.path" value="petstoreWeb"/>
+
+    <import file="build-dev.xml"/>
+
+    <target name="build">
+        <ant antfile="${deployNetui.ant}" target="deploy.netui" inheritAll="false">
+            <property name="webapp.dir" location="${webapp.dir}"/>
+        </ant>
+
+        <copy todir="${webapp.dir}/WEB-INF/lib">
+            <fileset dir="${os.BEEHIVE_HOME}/wsm/external" includes="**/*.jar"/>
+            <fileset dir="${os.BEEHIVE_HOME}/wsm/build/jars" includes="**/*.jar"/>
+            <fileset file="${velocity14.jar}"/>
+            <fileset file="${velocitydep14.jar}"/>
+        </copy>
+
+        <antcall target="build.webapp"/>
+    </target>
+
+    <target name="clean">
+
+        <ant antfile="${deployNetui.ant}" target="undeploy.netui" inheritAll="false">
+            <property name="webapp.dir" location="${webapp.dir}"/>
+        </ant>
+
+        <antcall target="clean.webapp"/>
+    </target>
+
+</project>
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/accountFields.tag
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/accountFields.tag	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,123 @@
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+
+<%@ tag body-content="empty" %>
+<%@ attribute name="languages" required="false" %>
+<%@ attribute name="categoryNames" required="true" %>
+<%--
+  This tag also implicitly expects that the "actionForm" and "bundle"
+  objects are passed in explicitly.
+
+  Either NetUI or JSP needs to have an <assert> tag.  <g>
+--%>
+
+<netui:span styleClass="boldlabel" value="${bundle.default.accountInformation}"/>
+<table class="tablegreen">
+    <tr class="rowyellow">
+        <td class="celldata"><netui:span value="${bundle.default.firstName}:"/></td>
+        <td class="celldata">
+        <netui:textBox dataSource="actionForm.firstName"/>
+        <br/>
+        <netui:error value="firstName"/>
+        </td>
+    </tr>
+    <tr class="rowyellow">
+        <td class="celldata"><netui:span value="${bundle.default.lastName}:"/></td>
+        <td class="celldata">
+        <netui:textBox dataSource="actionForm.lastName"/>
+        <br/>
+        <netui:error value="lastName"/>
+        </td>
+    </tr>
+    <tr class="rowyellow">
+        <td class="celldata"><netui:span value="${bundle.default.email}:"/></td>
+        <td class="celldata">
+        <netui:textBox dataSource="actionForm.email" size="40"/>
+        <br/>
+        <netui:error value="email"/>
+        </td>
+    </tr>
+    <tr class="rowyellow">
+        <td class="celldata"><netui:span value="${bundle.default.phone}:"/></td>
+        <td class="celldata">
+        <netui:textBox dataSource="actionForm.phone"/>
+        <br/>
+        <netui:error value="phone"/>
+        </td>
+    </tr>
+    <tr class="rowyellow">
+        <td class="celldata"><netui:span value="${bundle.default.address1}:"/></td>
+        <td class="celldata">
+        <netui:textBox dataSource="actionForm.addr1" size="40"/>
+        <br/>
+        <netui:error value="address1"/>
+        </td>
+    </tr>
+    <tr class="rowyellow">
+        <td class="celldata"><netui:span value="${bundle.default.address2}:"/></td>
+        <td class="celldata">
+        <netui:textBox dataSource="actionForm.addr2" size="40"/>
+        <br/>
+        <netui:error value="address2"/>
+        </td>
+    </tr>
+    <tr class="rowyellow">
+        <td class="celldata"><netui:span value="${bundle.default.city}:"/></td>
+        <td class="celldata">
+        <netui:textBox dataSource="actionForm.city"/>
+        <br/>
+        <netui:error value="city"/>
+        </td>
+    </tr>
+    <tr class="rowyellow">
+        <td class="celldata"><netui:span value="${bundle.default.state}:"/></td>
+        <td class="celldata">
+        <netui:textBox size="4" dataSource="actionForm.state"/>
+        <br/>
+        <netui:error value="state"/>
+        </td>
+    </tr>
+    <tr class="rowyellow">
+        <td class="celldata"><netui:span value="${bundle.default.zip}:"/></td>
+        <td class="celldata">
+        <netui:textBox size="10" dataSource="actionForm.zip"/>
+        <br/>
+        <netui:error value="zip"/>
+        </td>
+    </tr>
+    <tr class="rowyellow">
+        <td class="celldata"><netui:span value="${bundle.default.country}"/></td>
+        <td class="celldata">
+        <netui:textBox size="15" dataSource="actionForm.country"/>
+        <br/>
+        <netui:error value="country"/>
+        </td>
+    </tr>
+</table>
+<netui:span styleClass="boldlabel" value="${bundle.default.profileInformation}"/>
+<table class="tablegreen">
+    <tr class="rowyellow">
+        <td class="celldata"><netui:span value="${bundle.default.languagePreference}:"/></td>
+        <td class="celldata">
+        <netui:select dataSource="actionForm.langPref" optionsDataSource="${languages}"/>
+        </td>
+    </tr>
+    <tr class="rowyellow">
+        <td class="celldata"><netui:span value="${bundle.default.favoriteCategory}:"/></td>
+        <td class="celldata">
+        <netui:select dataSource="actionForm.favCategory" optionsDataSource="${categoryNames}"/>
+        </td>
+    </tr>
+    <tr class="rowyellow">
+        <td colspan=2>
+        <netui:checkBox dataSource="actionForm.myListOpt"/>
+        <netui:span value="${bundle.default.enableMyList}"/>
+        </td>
+    </tr>
+    <tr class="rowyellow">
+        <td colspan=2>
+        <netui:checkBox dataSource="actionForm.bannerOpt"/>
+        <netui:span value="${bundle.default.enableMyBanner}"/>
+        </td>
+    </tr>
+</table>

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/catalogNav.tag
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/catalogNav.tag	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,23 @@
+<%@ tag body-content="empty" %>
+<%@ attribute name="action" required="true" %>
+<%@ attribute name="paramName" required="false" %>
+<%@ attribute name="paramValue" required="false" %>
+<%@ attribute name="labelValue" required="true" %>
+
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+
+<p>
+<table class="tablegreen" align="left">
+    <tr class="rowyellow">
+      <td>
+        <netui:anchor action="${action}">
+          <c:if test="${paramName != null && paramValue != null}">
+            <netui:parameter name="${paramName}" value="${paramValue}"/>
+          </c:if>
+          <netui:span styleClass="smalllabel" value="<< ${labelValue}"/>
+        </netui:anchor>
+      </td>
+    </tr>
+  </table>
+</p>
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/categoryNavHeader.tag
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/categoryNavHeader.tag	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,30 @@
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+
+<%@ tag body-content="empty" %>
+<%@ attribute name="contextPath" required="true" %>
+
+<center>
+<netui:imageAnchor action="globalViewCategory" border="0" src="${contextPath}/images/sm_fish.gif">
+    <netui:parameter name="catId" value="FISH"/>
+</netui:imageAnchor>
+<netui:image border="0" src="${contextPath}/images/separator.gif"/>
+
+<netui:imageAnchor action="globalViewCategory" border="0" src="${contextPath}/images/sm_dogs.gif">
+    <netui:parameter name="catId" value="DOGS"/>
+</netui:imageAnchor>
+<netui:image border="0" src="${contextPath}/images/separator.gif"/>
+
+<netui:imageAnchor action="globalViewCategory" border="0" src="${contextPath}/images/sm_reptiles.gif">
+    <netui:parameter name="catId" value="REPTILES"/>
+</netui:imageAnchor>
+<netui:image border="0" src="${contextPath}/images/separator.gif"/>
+
+<netui:imageAnchor action="globalViewCategory" border="0" src="${contextPath}/images/sm_cats.gif">
+    <netui:parameter name="catId" value="CATS"/>
+</netui:imageAnchor>
+<netui:image border="0" src="${contextPath}/images/separator.gif"/>
+
+<netui:imageAnchor action="globalViewCategory" border="0" src="${contextPath}/images/sm_birds.gif">
+    <netui:parameter name="catId" value="BIRDS"/>
+</netui:imageAnchor>
+</center>
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/copyright.tag
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/copyright.tag	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,29 @@
+<%@ tag body-content="empty" %>
+<%@ attribute name="contextPath" required="true" %>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<table width="100%">
+    <tr>
+        <td colspan="2"><hr noshade="noshade" size="1"/></td>
+    </tr>
+    <tr>
+        <td align="left">
+        Licensed under the
+        <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License,
+        Version 2.0</a>.
+        </td>
+        <td align="right">
+        <table>
+            <tr>
+                <td valign="center">
+                <netui:anchor href="http://incubator.apache.org/beehive">
+                    <netui:image src="${contextPath}/images/beehive_logo.gif" style="height:20px;width:20px;border:none;"/>
+                </netui:anchor>
+                </td>
+                <td valign="center">
+                <netui:span style="font-size:12;font-color:#00cccc;" value="Powered by Apache Beehive"/>
+                </td>
+            </tr>
+        </table>
+        </tr>
+</table>

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/footer.tag
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/footer.tag	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,20 @@
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+
+<%@ tag body-content="empty" %>
+<%@ attribute name="contextPath" required="true" %>
+
+<c:if test="${sharedFlow.account != null && sharedFlow.account.bannerOpt == true}">
+  <p>
+  <table background="${pageContext.request.contextPath}/images/bkg-topbar.gif" border="0" cellspacing="0" cellpadding="5" width="100%">
+    <tbody>
+    <tr>
+      <td width="100%">
+          <center>
+          <netui:image border="0" src="${pageContext.request.contextPath}/images/${sharedFlow.account.bannerName}"/>
+          </center>
+      </td>
+    </tr>
+    </tbody>
+  </table>
+</c:if>

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/headerMenu.tag
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/headerMenu.tag	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,43 @@
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+
+<%@ tag body-content="empty" %>
+<%@ attribute name="contextPath" required="true" %>
+
+<table background="${contextPath}/images/bkg-topbar.gif" border="0" cellspacing="0" cellpadding="5" width="100%">
+  <tbody>
+  <tr>
+    <td>
+      <%-- shop --%>
+      <netui:imageAnchor action="globalShop" border="0" src="${contextPath}/images/logo-topbar.gif"/>
+    </td>
+    <td valign="top" align="right" nowrap>
+      <br clear="all"/>
+      <%-- view cart --%>
+      <netui:imageAnchor action="globalViewCart" border="0" src="${contextPath}/images/cart.gif"/>
+      <netui:image border="0" src="${contextPath}/images/separator.gif"/>
+      <c:choose>
+        <c:when test="${sharedFlow.account == null}">
+          <%-- sharedFlow.signon --%>
+          <netui:imageAnchor action="signon" border="0" src="${pageContext.request.contextPath}/images/sign-in.gif"/>
+        </c:when>
+        <c:otherwise>
+          <%-- sharedFlow.signoff --%>
+          <netui:imageAnchor action="signoff" border="0" src="${pageContext.request.contextPath}/images/sign-out.gif"/>
+          <netui:image border="0" src="${pageContext.request.contextPath}/images/separator.gif"/>
+          <netui:imageAnchor action="globalEditAccount" border="0" src="${pageContext.request.contextPath}/images/my_account.gif"/>
+        </c:otherwise>
+      </c:choose>
+      <netui:image border="0" src="${contextPath}/images/separator.gif"/>
+      <netui:imageAnchor action="globalShowHelp" border="0" src="${contextPath}/images/help.gif"/>
+    </td>
+    <td valign="top" align="left" nowrap>
+      <br clear="all"/>
+      <netui:form action="search">
+        <netui:textBox dataSource="actionForm.keyword" size="14"/>
+        <netui:imageButton src="${contextPath}/images/search.gif"/>
+      </netui:form>
+    </td>
+  </tr>
+</tbody>
+</table>

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/orderSummary.tag
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/orderSummary.tag	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,195 @@
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+
+<%@ tag body-content="empty" %>
+<%@ attribute name="order" required="false" type="org.apache.beehive.samples.petstore.model.Order"%>
+<%--
+  This tag also implicitly expects that the "actionForm" and "bundle"
+  objects are passed in explicitly.
+
+  Either NetUI or JSP needs to have an <assert> tag.  <g>
+--%>
+<netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+
+<table class="tablegreen" width="60%" align="center">
+  <tr class="rowyellow">
+    <td align="center" colspan="2">
+      <netui:span styleClass="boldlabel" value="${bundle.view.orderNumberLabel} ${order.orderId}"/>
+      <br/>
+      <netui:span styleClass="boldlabel" value="${order.orderDate}">
+          <netui:formatDate pattern="${bundle.view.orderDateFormat}"/>
+      </netui:span>
+    </td>
+  </tr>
+  <tr class="rowyellow">
+    <td colspan="2">
+      <netui:span styleClass="boldlabel" value="${bundle.view.paymentDetailsLabel}"/>
+    </td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.cardTypeLabel}:</td>
+    <td class="celldata">
+      <netui:span value="${order.cardType}"/>
+    </td>
+  </tr>
+  <tr class="rowyellow">
+      <td class="celldata">${bundle.view.cardNumberLabel}:</td>
+      <td class="celldata"><netui:span value="${order.creditCard}"/>
+          <netui:span styleClass="error" value="* Fake number!"/>
+      </td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.expirationDateLabel}:</td>
+    <td class="celldata"><netui:span value="${order.exprDate}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td colspan="2">
+      <netui:span styleClass="greenboldlabel" value="${bundle.view.billingAddressLabel}"/>
+    </td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.firstNameLabel}:</td>
+    <td class="celldata"><netui:span value="${order.billingAddress.firstName}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.lastNameLabel}:</td>
+    <td class="celldata"><netui:span value="${order.billingAddress.lastName}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.address1Label}:</td>
+    <td class="celldata"><netui:span value="${order.billingAddress.addr1}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.address2Label}:</td>
+    <td class="celldata"><netui:span value="${order.billingAddress.addr2}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.cityLabel}:</td>
+    <td class="celldata"><netui:span value="${order.billingAddress.city}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.stateLabel}:</td>
+    <td class="celldata"><netui:span value="${order.billingAddress.state}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.zipLabel}:</td>
+    <td class="celldata"><netui:span value="${order.billingAddress.zip}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.countryLabel}:</td>
+    <td class="celldata"><netui:span value="${order.billingAddress.country}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td colspan="2">
+      <netui:span styleClass="boldlabel" value="${bundle.view.shippingAddressLabel}"/>
+    </td>
+  </tr>
+  <c:choose>
+    <c:when test="${order.shippingAddressIsBillingAddress == false}">
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.firstNameLabel}:</td>
+    <td class="celldata"><netui:span value="${order.shippingAddress.firstName}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.lastNameLabel}:</td>
+    <td class="celldata"><netui:span value="${order.shippingAddress.lastName}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.address1Label}:</td>
+    <td class="celldata"><netui:span value="${order.shippingAddress.addr1}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.address2Label}:</td>
+    <td class="celldata"><netui:span value="${order.shippingAddress.addr2}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.cityLabel}:</td>
+    <td class="celldata"><netui:span value="${order.shippingAddress.city}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.stateLabel}:</td>
+    <td class="celldata"><netui:span value="${order.shippingAddress.state}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.zipLabel}:</td>
+    <td class="celldata"><netui:span value="${order.shippingAddress.zip}"/></td>
+  </tr>
+  <tr class="rowyellow">
+    <td class="celldata">${bundle.view.countryLabel}:</td>
+    <td class="celldata"><netui:span value="${order.shippingAddress.country}"/></td>
+  </tr>
+    </c:when>
+    <c:otherwise>
+  <tr class="rowyellow">
+    <td class="celldata" colspan="2">Use Billing Address.</td>
+  </tr>
+    </c:otherwise>
+  </c:choose>
+  <tr class="rowyellow">
+    <td colspan="2">
+      <netui:span styleClass="greenboldlabel" value="${bundle.view.orderStatus} ${order.status}"/>
+    </td>
+  </tr>
+  <tr>
+  <td colspan="2">
+  <table class="tablegreen" align="center" width="100%">
+    <tr class="rowgrey">
+      <td class="celldata"><b>${bundle.view.itemIdLabel}</b></td>
+      <td class="celldata"><b>${bundle.view.descriptionLabel}</b></td>
+      <td class="celldata"><b>${bundle.view.quantityLabel}</b></td>
+      <td class="celldata"><b>${bundle.view.unitPriceLabel}</b></td>
+      <td class="celldata"><b>${bundle.view.totalCostLabel}</b></td>
+    </tr>
+    <netui-data:repeater dataSource="pageInput.order.cart.lineItems">
+      <tr class="rowyellow">
+        <td class="celldata"><b>
+        <c:choose>
+          <c:when test="${pageScope.checkout == false}">
+            <netui:anchor action="viewItem.do">
+              <netui:parameter name="itemId" value="${container.item.item.itemId}"/>
+              <netui:span value="${container.item.item.itemId}"/>
+            </netui:anchor>
+          </c:when>
+          <c:otherwise>
+            <netui:span value="${container.item.item.itemId}"/>
+          </c:otherwise>
+        </c:choose>
+        </b>
+        </td>
+        <td class="celldata">
+          <netui:span value="${container.item.item.attr1}"/>
+          <netui:span value="${container.item.item.attr2}"/>
+          <netui:span value="${container.item.item.attr3}"/>
+          <netui:span value="${container.item.item.attr4}"/>
+          <netui:span value="${container.item.item.attr5}"/>
+          <netui:span value="${container.item.item.product.name}"/>
+        </td>
+        <td align="center">
+          <netui:span value="${container.item.quantity}"/>
+        </td>
+        <td align="right">
+          <netui:span value="${container.item.item.listPrice}">
+            <netui:formatNumber pattern="${bundle.view.priceFormat}"/>
+          </netui:span>
+        </td>
+        <td align="right">
+          <netui:span value="${container.item.total}">
+            <netui:formatNumber pattern="${bundle.view.priceFormat}"/>
+          </netui:span>
+        </td>
+      </tr>
+    </netui-data:repeater>
+    <tr class="rowyellow">
+      <td colspan="6" align="right">
+        <b>${bundle.view.totalCostLabel}:
+        <netui:span value="${order.totalPrice}">
+          <netui:formatNumber pattern="${bundle.view.priceFormat}"/>
+        </netui:span>
+        </b><br/>
+      </td>
+    </tr>
+  </table>
+  </td>
+  </tr>
+</table>
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/productFavorites.tag
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/productFavorites.tag	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,34 @@
+<%@ tag body-content="empty" %>
+
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+
+<netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+<p>
+  &nbsp;
+</p>
+<table class="tablegreen">
+    <tr class="rowgrey">
+        <td>
+        <netui:span styleClass="boldlabel" value="${bundle.view.petFavoritesLabel}"/>
+        <br/>
+        <i>${bundle.view.shopForFavoritesLabel}.</i>
+        </td>
+    </tr>
+    <tr class="rowyellow">
+        <td>
+        <netui-data:repeater dataSource="sharedFlow.myList">
+            <netui:anchor action="viewProduct">
+                <netui:parameter name="productId" value="${container.item.productId}"/>
+                <netui:span value="${container.item.name}"/>
+            </netui:anchor>
+            <br/>
+            <netui:span value="(${container.item.productId})"/>
+            <br/>
+        </netui-data:repeater>
+        </td>
+    </tr>
+</table>
+
+
+

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/validation_1_1.dtd
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/validation_1_1.dtd	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,251 @@
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    
+     Refer to the below DTD Instead:
+    
+    <!DOCTYPE form-validation PUBLIC
+          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
+          "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
+
+
+    $Id: validation_1_1.dtd,v 1.5 2002/11/14 20:33:13 rleland Exp $
+-->
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+    The "form-validation" element is the root of the configuration file
+     hierarchy, and contains nested elements for all of the other
+     configuration settings.
+-->
+<!ELEMENT form-validation (global*, formset+)>
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+    Global "constants" may be defined for use of other elements.
+-->
+<!ELEMENT global (constant*)>
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "constant" element defines a static value that can be used as
+     replacement parameters within "field" elements. The "constant-name" and
+     "constant-value" elements define the constant's reference id and
+     replacement value.
+-->
+<!ELEMENT constant (constant-name, constant-value)>
+<!ELEMENT constant-name  (#PCDATA)>
+<!ELEMENT constant-value (#PCDATA)>
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+      The "formset" element defines a set of forms for a locale. Formsets for
+      specific locales can override only those fields that change. The
+      localization is properly scoped, so that a formset can override just the
+      language, or just the country, or both.
+-->
+<!ELEMENT formset (constant*, form+)>
+<!ATTLIST formset language     CDATA #IMPLIED
+                  country      CDATA #IMPLIED >
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "form" element defines a set of fields to be validated. The name
+     corresponds to the identifer the application assigns to the form. In the
+     case of the Struts framework, this is the attribute property from
+     the ActionMapping. Struts also offers the alternative of using the
+     the path property as the Validator form name.
+-->
+<!ELEMENT form    (field+ )>
+<!ATTLIST form    name CDATA #REQUIRED>
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "field" element defines the properties to be validated. In a
+     web application, a field would also correspond to a control on
+     a HTML form. To validate the properties, the validator works through
+     a JavaBean representation, like a Struts ActionForm. The field element
+     can accept up to 4 attributes:
+
+     property        The property on the JavaBean corresponding to this
+                     field element.
+
+     depends         The comma-delimited list of validators to apply against
+                     this field. For the field to succeed, all the
+                     validators must succeed.
+
+     page            The JavaBean corresponding to this form may include
+                     a page property. Only fields with a "page" attribute
+                     value that is equal to or less than the page property
+                     on the form JavaBean are processed. This is useful when
+                     using a "wizard" approach to completing a large form,
+                     to ensure that a page is not skipped.
+                     [0]
+
+     indexedListProperty
+                     The "indexedListProperty" is the method name that will
+                     return an array or a Collection used to retrieve the
+                     list and then loop through the list performing the
+                     validations for this field.
+
+     fieldOrder      [:FIXME: is this still supported?]
+-->
+<!ELEMENT field   (msg?, arg0?, arg1?, arg2?, arg3?, var* )>
+<!ATTLIST field   property CDATA #REQUIRED
+                  depends  CDATA #IMPLIED
+                  page     CDATA #IMPLIED
+                  indexedListProperty CDATA #IMPLIED >
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "msg" element defines a custom message key to use when one of the
+     validators for this field fails. Each validator has a default message
+     property that is used when a corresonding field msg is not specified.
+     Each validator applied to a field may have its own msg element.
+     The msg element accepts up to three attributes.
+
+      name        The name of the validator corresponding to this msg.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT msg     EMPTY>
+<!ATTLIST msg     name     CDATA #IMPLIED
+                  key      CDATA #IMPLIED
+                  resource CDATA #IMPLIED >
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "arg0" element defines the first replacement value to use with the
+     message template for this validator or this field.
+     The arg0 element accepts up to three attributes.
+
+      name        The name of the validator corresponding to this msg.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT arg0    EMPTY>
+<!ATTLIST arg0    name     CDATA #IMPLIED
+                  key      CDATA #IMPLIED
+                  resource CDATA #IMPLIED >
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "arg1" element defines the second replacement value to use with the
+     message template for this validator or this field.
+     The arg1 element accepts up to three attributes.
+
+      name        The name of the validator corresponding to this msg.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT arg1    EMPTY>
+<!ATTLIST arg1    name     CDATA #IMPLIED
+                  key      CDATA #IMPLIED
+                  resource CDATA #IMPLIED >
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "arg2" element defines the third replacement value to use with the
+     message template for this validator or this field.
+     The arg2 element accepts up to three attributes.
+
+      name        The name of the validator corresponding to this msg.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT arg2    EMPTY>
+<!ATTLIST arg2    name     CDATA #IMPLIED
+                  key      CDATA #IMPLIED
+                  resource CDATA #IMPLIED >
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "arg3" element defines the fourth replacement value to use with the
+     message template for this validator or this field.
+     The arg0 element accepts up to three attributes.
+
+      name        The name of the validator corresponding to this msg.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT arg3    EMPTY>
+<!ATTLIST arg3    name     CDATA #IMPLIED
+                  key      CDATA #IMPLIED
+                  resource CDATA #IMPLIED >
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "var" element can set parameters that a field may need to pass to
+     one of its validators, such as the minimum and maximum values in a
+     range validation. These parameters may also be referenced by one of the
+     arg? elements using a shell syntax: ${var:var-name}.
+-->
+<!ELEMENT var (var-name, var-value)>
+
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The name of the var parameter to provide to a field's validators.
+-->
+<!ELEMENT var-name  (#PCDATA)>
+
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The value of the var parameter to provide to a field's validators.
+-->
+<!ELEMENT var-value (#PCDATA)>
+
+<!-- eof -->
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/validator-rules.xml
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/validator-rules.xml	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,1044 @@
+<!DOCTYPE form-validation PUBLIC
+          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
+          "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
+<!--
+
+   This file contains the default Struts Validator pluggable validator
+   definitions.  It should be placed somewhere under /WEB-INF and
+   referenced in the struts-config.xml under the plug-in element
+   for the ValidatorPlugIn.
+
+      <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
+        <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
+                                                  /WEB-INF/validation.xml"/>
+      </plug-in>
+
+   These are the default error messages associated with
+   each validator defined in this file.  They should be
+   added to your projects ApplicationResources.properties
+   file or you can associate new ones by modifying the
+   pluggable validators msg attributes in this file.
+
+   # Struts Validator Error Messages
+   errors.required={0} is required.
+   errors.minlength={0} can not be less than {1} characters.
+   errors.maxlength={0} can not be greater than {1} characters.
+   errors.invalid={0} is invalid.
+
+   errors.byte={0} must be a byte.
+   errors.short={0} must be a short.
+   errors.integer={0} must be an integer.
+   errors.long={0} must be a long.
+   errors.float={0} must be a float.
+   errors.double={0} must be a double.
+
+   errors.date={0} is not a date.
+   errors.range={0} is not in the range {1} through {2}.
+   errors.creditcard={0} is an invalid credit card number.
+   errors.email={0} is an invalid e-mail address.
+
+-->
+
+<form-validation>
+
+   <global>
+
+      <validator name="required"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateRequired"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+                  msg="errors.required">
+
+         <javascript><![CDATA[
+            function validateRequired(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oRequired = new required();
+                for (x in oRequired) {
+                	var field = form[oRequired[x][0]];
+                	
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'file' ||
+                        field.type == 'select-one' ||
+                        field.type == 'radio' ||
+                        field.type == 'password') {
+                        
+                        var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+							if (si >= 0) {
+								value = field.options[si].value;
+							}
+						} else {
+							value = field.value;
+						}
+                        
+                        if (trim(value).length == 0) {
+                        
+	                        if (i == 0) {
+	                            focusField = field;
+	                        }
+	                        fields[i++] = oRequired[x][1];
+	                        isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return isValid;
+            }
+            
+            // Trim whitespace from left and right sides of s.
+            function trim(s) {
+                return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
+            }
+            
+            ]]>
+         </javascript>
+
+      </validator>
+
+      <validator name="requiredif"
+                 classname="org.apache.struts.validator.FieldChecks"
+                 method="validateRequiredIf"
+                 methodParams="java.lang.Object,
+                               org.apache.commons.validator.ValidatorAction,
+                               org.apache.commons.validator.Field,
+                               org.apache.struts.action.ActionErrors,
+                               org.apache.commons.validator.Validator,
+                               javax.servlet.http.HttpServletRequest"
+                 msg="errors.required">
+      </validator>
+
+      <validator name="minlength"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateMinLength"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.minlength">
+
+         <javascript><![CDATA[
+            function validateMinLength(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oMinLength = new minlength();
+                for (x in oMinLength) {
+                    var field = form[oMinLength[x][0]];
+                    
+                    if (field.type == 'text' ||
+                        field.type == 'textarea') {
+                        
+                        var iMin = parseInt(oMinLength[x][2]("minlength"));
+                        if ((trim(field.value).length > 0) && (field.value.length < iMin)) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oMinLength[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return isValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="maxlength"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateMaxLength"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.maxlength">
+
+         <javascript><![CDATA[
+            function validateMaxLength(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oMaxLength = new maxlength();
+                for (x in oMaxLength) {
+                    var field = form[oMaxLength[x][0]];
+                    
+                    if (field.type == 'text' ||
+                        field.type == 'textarea') {
+                        
+                        var iMax = parseInt(oMaxLength[x][2]("maxlength"));
+                        if (field.value.length > iMax) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oMaxLength[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return isValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="mask"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateMask"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.invalid">
+
+         <javascript><![CDATA[
+            function validateMask(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oMasked = new mask();
+                for (x in oMasked) {
+                    var field = form[oMasked[x][0]];
+                    
+                    if ((field.type == 'text' || 
+                         field.type == 'textarea') && 
+                         (field.value.length > 0)) {
+                        
+                        if (!matchPattern(field.value, oMasked[x][2]("mask"))) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oMasked[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return isValid;
+            }
+
+            function matchPattern(value, mask) {
+               return mask.exec(value);
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="byte"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateByte"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.byte"
+       jsFunctionName="ByteValidations">
+
+         <javascript><![CDATA[
+            function validateByte(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oByte = new ByteValidations();
+                for (x in oByte) {
+                	var field = form[oByte[x][0]];
+                	
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'select-one' ||
+						field.type == 'radio') {
+
+						var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+							if (si >= 0) {
+								value = field.options[si].value;
+							}
+						} else {
+							value = field.value;
+						}
+                        
+                        if (value.length > 0) {
+                            if (!isAllDigits(value)) {
+                                bValid = false;
+                                if (i == 0) {
+                                    focusField = field;
+                                }
+                                fields[i++] = oByte[x][1];
+
+                            } else {
+
+	                            var iValue = parseInt(value);
+	                            if (isNaN(iValue) || !(iValue >= -128 && iValue <= 127)) {
+	                                if (i == 0) {
+	                                    focusField = field;
+	                                }
+	                                fields[i++] = oByte[x][1];
+	                                bValid = false;
+	                            }
+                            }
+						}
+						
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return bValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="short"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateShort"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.short"
+       jsFunctionName="ShortValidations">
+
+         <javascript><![CDATA[
+            function validateShort(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oShort = new ShortValidations();
+                for (x in oShort) {
+                	var field = form[oShort[x][0]];
+                	
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'select-one' ||
+                        field.type == 'radio') {
+                        
+                        var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+							if (si >= 0) {
+								value = field.options[si].value;
+							}
+						} else {
+							value = field.value;
+						}
+                        
+                        if (value.length > 0) {
+                            if (!isAllDigits(value)) {
+                                bValid = false;
+                                if (i == 0) {
+                                    focusField = field;
+                                }
+                                fields[i++] = oShort[x][1];
+
+                            } else {
+                        
+	                            var iValue = parseInt(value);
+	                            if (isNaN(iValue) || !(iValue >= -32768 && iValue <= 32767)) {
+	                                if (i == 0) {
+	                                    focusField = field;
+	                                }
+	                                fields[i++] = oShort[x][1];
+	                                bValid = false;
+	                            }
+	                       }
+                       }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return bValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="integer"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateInteger"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.integer"
+       jsFunctionName="IntegerValidations">
+
+         <javascript><![CDATA[
+            function validateInteger(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oInteger = new IntegerValidations();
+                for (x in oInteger) {
+                	var field = form[oInteger[x][0]];
+
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'select-one' ||
+                        field.type == 'radio') {
+                        
+                        var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+						    if (si >= 0) {
+							    value = field.options[si].value;
+						    }
+						} else {
+							value = field.value;
+						}
+                        
+                        if (value.length > 0) {
+                        
+                            if (!isAllDigits(value)) {
+                                bValid = false;
+                                if (i == 0) {
+	                                focusField = field;
+	                            }
+						        fields[i++] = oInteger[x][1];
+						        
+                            } else {
+	                            var iValue = parseInt(value);
+	                            if (isNaN(iValue) || !(iValue >= -2147483648 && iValue <= 2147483647)) {
+	                                if (i == 0) {
+	                                    focusField = field;
+	                                }
+	                                fields[i++] = oInteger[x][1];
+	                                bValid = false;
+	                           }
+                           }
+                       }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return bValid;
+            }
+
+            function isAllDigits(argvalue) {
+                argvalue = argvalue.toString();
+                var validChars = "0123456789";
+                var startFrom = 0;
+                if (argvalue.substring(0, 2) == "0x") {
+                   validChars = "0123456789abcdefABCDEF";
+                   startFrom = 2;
+                } else if (argvalue.charAt(0) == "0") {
+                   validChars = "01234567";
+                   startFrom = 1;
+                } else if (argvalue.charAt(0) == "-") {
+                    startFrom = 1;
+                }
+                
+                for (var n = startFrom; n < argvalue.length; n++) {
+                    if (validChars.indexOf(argvalue.substring(n, n+1)) == -1) return false;
+                }
+                return true;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="long"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateLong"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.long"/>
+
+
+      <validator name="float"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateFloat"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.float"
+       jsFunctionName="FloatValidations">
+
+         <javascript><![CDATA[
+            function validateFloat(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oFloat = new FloatValidations();
+                for (x in oFloat) {
+                	var field = form[oFloat[x][0]];
+                	
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'select-one' ||
+                        field.type == 'radio') {
+                        
+                    	var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+							if (si >= 0) {
+							    value = field.options[si].value;
+							}
+						} else {
+							value = field.value;
+						}
+                        
+                        if (value.length > 0) {
+                            // remove '.' before checking digits
+                            var tempArray = value.split('.');
+                            var joinedString= tempArray.join('');
+
+                            if (!isAllDigits(joinedString)) {
+                                bValid = false;
+                                if (i == 0) {
+                                    focusField = field;
+                                }
+                                fields[i++] = oFloat[x][1];
+
+                            } else {
+	                            var iValue = parseFloat(value);
+	                            if (isNaN(iValue)) {
+	                                if (i == 0) {
+	                                    focusField = field;
+	                                }
+	                                fields[i++] = oFloat[x][1];
+	                                bValid = false;
+	                            }
+                            }
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return bValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="double"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateDouble"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.double"/>
+
+
+      <validator name="date"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateDate"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.date"
+       jsFunctionName="DateValidations">
+
+         <javascript><![CDATA[
+            function validateDate(form) {
+               var bValid = true;
+               var focusField = null;
+               var i = 0;
+               var fields = new Array();
+               oDate = new DateValidations();
+               for (x in oDate) {
+                   var value = form[oDate[x][0]].value;
+                   var datePattern = oDate[x][2]("datePatternStrict");
+                   if ((form[oDate[x][0]].type == 'text' ||
+                        form[oDate[x][0]].type == 'textarea') &&
+                       (value.length > 0) &&
+                       (datePattern.length > 0)) {
+                     var MONTH = "MM";
+                     var DAY = "dd";
+                     var YEAR = "yyyy";
+                     var orderMonth = datePattern.indexOf(MONTH);
+                     var orderDay = datePattern.indexOf(DAY);
+                     var orderYear = datePattern.indexOf(YEAR);
+                     if ((orderDay < orderYear && orderDay > orderMonth)) {
+                         var iDelim1 = orderMonth + MONTH.length;
+                         var iDelim2 = orderDay + DAY.length;
+                         var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
+                         var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
+                         if (iDelim1 == orderDay && iDelim2 == orderYear) {
+                            dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
+                         } else if (iDelim1 == orderDay) {
+                            dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
+                         } else if (iDelim2 == orderYear) {
+                            dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
+                         } else {
+                            dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
+                         }
+                         var matched = dateRegexp.exec(value);
+                         if(matched != null) {
+                            if (!isValidDate(matched[2], matched[1], matched[3])) {
+                               if (i == 0) {
+                                   focusField = form[oDate[x][0]];
+                               }
+                               fields[i++] = oDate[x][1];
+                               bValid =  false;
+                            }
+                         } else {
+                            if (i == 0) {
+                                focusField = form[oDate[x][0]];
+                            }
+                            fields[i++] = oDate[x][1];
+                            bValid =  false;
+                         }
+                     } else if ((orderMonth < orderYear && orderMonth > orderDay)) {
+                         var iDelim1 = orderDay + DAY.length;
+                         var iDelim2 = orderMonth + MONTH.length;
+                         var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
+                         var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
+                         if (iDelim1 == orderMonth && iDelim2 == orderYear) {
+                             dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
+                         } else if (iDelim1 == orderMonth) {
+                             dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
+                         } else if (iDelim2 == orderYear) {
+                             dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
+                         } else {
+                             dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
+                         }
+                         var matched = dateRegexp.exec(value);
+                         if(matched != null) {
+                             if (!isValidDate(matched[1], matched[2], matched[3])) {
+                                 if (i == 0) {
+                                     focusField = form[oDate[x][0]];
+                                 }
+                                 fields[i++] = oDate[x][1];
+                                 bValid =  false;
+                              }
+                         } else {
+                             if (i == 0) {
+                                 focusField = form[oDate[x][0]];
+                             }
+                             fields[i++] = oDate[x][1];
+                             bValid =  false;
+                         }
+                     } else if ((orderMonth > orderYear && orderMonth < orderDay)) {
+                         var iDelim1 = orderYear + YEAR.length;
+                         var iDelim2 = orderMonth + MONTH.length;
+                         var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
+                         var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
+                         if (iDelim1 == orderMonth && iDelim2 == orderDay) {
+                             dateRegexp = new RegExp("^(\\d{4})(\\d{2})(\\d{2})$");
+                         } else if (iDelim1 == orderMonth) {
+                             dateRegexp = new RegExp("^(\\d{4})(\\d{2})[" + delim2 + "](\\d{2})$");
+                         } else if (iDelim2 == orderDay) {
+                             dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})(\\d{2})$");
+                         } else {
+                             dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{2})$");
+                         }
+                         var matched = dateRegexp.exec(value);
+                         if(matched != null) {
+                             if (!isValidDate(matched[3], matched[2], matched[1])) {
+                                 if (i == 0) {
+                                     focusField = form[oDate[x][0]];
+                                  }
+                                  fields[i++] = oDate[x][1];
+                                  bValid =  false;
+                              }
+                          } else {
+                              if (i == 0) {
+                                  focusField = form[oDate[x][0]];
+                              }
+                              fields[i++] = oDate[x][1];
+                              bValid =  false;
+                          }
+                     } else {
+                         if (i == 0) {
+                             focusField = form[oDate[x][0]];
+                         }
+                         fields[i++] = oDate[x][1];
+                         bValid =  false;
+                     }
+                  }
+               }
+               if (fields.length > 0) {
+                  focusField.focus();
+                  alert(fields.join('\n'));
+               }
+               return bValid;
+            }
+
+	    function isValidDate(day, month, year) {
+	        if (month < 1 || month > 12) {
+                    return false;
+                }
+                if (day < 1 || day > 31) {
+                    return false;
+                }
+                if ((month == 4 || month == 6 || month == 9 || month == 11) &&
+                    (day == 31)) {
+                    return false;
+                }
+                if (month == 2) {
+                    var leap = (year % 4 == 0 &&
+                               (year % 100 != 0 || year % 400 == 0));
+                    if (day>29 || (day == 29 && !leap)) {
+                        return false;
+                    }
+                }
+                return true;
+            }]]>
+         </javascript>
+
+      </validator>
+
+<!-- range is deprecated use intRange instead -->
+      <validator name="range"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateIntRange"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends="integer"
+                  msg="errors.range">
+
+         <javascript><![CDATA[
+            function validateRange(form) {
+                return validateIntRange(form);
+            }]]>
+         </javascript>
+
+      </validator>
+
+      <validator name="intRange"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateIntRange"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends="integer"
+                  msg="errors.range">
+
+         <javascript><![CDATA[
+            function validateIntRange(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oRange = new intRange();
+                for (x in oRange) {
+                    var field = form[oRange[x][0]];
+                    
+                    if ((field.type == 'text' ||
+                         field.type == 'textarea') &&
+                        (field.value.length > 0)) {
+                        
+                        var iMin = parseInt(oRange[x][2]("min"));
+                        var iMax = parseInt(oRange[x][2]("max"));
+                        var iValue = parseInt(field.value);
+                        if (!(iValue >= iMin && iValue <= iMax)) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oRange[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                    focusField.focus();
+                    alert(fields.join('\n'));
+                }
+                return isValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+      <validator name="floatRange"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateFloatRange"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends="float"
+                  msg="errors.range">
+
+         <javascript><![CDATA[
+            function validateFloatRange(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oRange = new floatRange();
+                for (x in oRange) {
+                    var field = form[oRange[x][0]];
+                    
+                    if ((field.type == 'text' ||
+                         field.type == 'textarea') &&
+                        (field.value.length > 0)) {
+                        
+                        var fMin = parseFloat(oRange[x][2]("min"));
+                        var fMax = parseFloat(oRange[x][2]("max"));
+                        var fValue = parseFloat(field.value);
+                        if (!(fValue >= fMin && fValue <= fMax)) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oRange[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                    focusField.focus();
+                    alert(fields.join('\n'));
+                }
+                return isValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+      <validator name="creditCard"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateCreditCard"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.creditcard">
+
+         <javascript><![CDATA[
+            function validateCreditCard(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oCreditCard = new creditCard();
+                for (x in oCreditCard) {
+                    if ((form[oCreditCard[x][0]].type == 'text' ||
+                         form[oCreditCard[x][0]].type == 'textarea') &&
+                        (form[oCreditCard[x][0]].value.length > 0)) {
+                        if (!luhnCheck(form[oCreditCard[x][0]].value)) {
+                            if (i == 0) {
+                                focusField = form[oCreditCard[x][0]];
+                            }
+                            fields[i++] = oCreditCard[x][1];
+                            bValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                    focusField.focus();
+                    alert(fields.join('\n'));
+                }
+                return bValid;
+            }
+
+            /**
+             * Reference: http://www.ling.nwu.edu/~sburke/pub/luhn_lib.pl
+             */
+            function luhnCheck(cardNumber) {
+                if (isLuhnNum(cardNumber)) {
+                    var no_digit = cardNumber.length;
+                    var oddoeven = no_digit & 1;
+                    var sum = 0;
+                    for (var count = 0; count < no_digit; count++) {
+                        var digit = parseInt(cardNumber.charAt(count));
+                        if (!((count & 1) ^ oddoeven)) {
+                            digit *= 2;
+                            if (digit > 9) digit -= 9;
+                        };
+                        sum += digit;
+                    };
+                    if (sum == 0) return false;
+                    if (sum % 10 == 0) return true;
+                };
+                return false;
+            }
+
+            function isLuhnNum(argvalue) {
+                argvalue = argvalue.toString();
+                if (argvalue.length == 0) {
+                    return false;
+                }
+                for (var n = 0; n < argvalue.length; n++) {
+                    if ((argvalue.substring(n, n+1) < "0") ||
+                        (argvalue.substring(n,n+1) > "9")) {
+                        return false;
+                    }
+                }
+                return true;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="email"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateEmail"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.email">
+
+         <javascript><![CDATA[
+            function validateEmail(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oEmail = new email();
+                for (x in oEmail) {
+                    if ((form[oEmail[x][0]].type == 'text' ||
+                         form[oEmail[x][0]].type == 'textarea') &&
+                        (form[oEmail[x][0]].value.length > 0)) {
+                        if (!checkEmail(form[oEmail[x][0]].value)) {
+                            if (i == 0) {
+                                focusField = form[oEmail[x][0]];
+                            }
+                            fields[i++] = oEmail[x][1];
+                            bValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                    focusField.focus();
+                    alert(fields.join('\n'));
+                }
+                return bValid;
+            }
+
+            /**
+             * Reference: Sandeep V. Tamhankar (stamhankar@hotmail.com),
+             * http://javascript.internet.com
+             */
+            function checkEmail(emailStr) {
+               if (emailStr.length == 0) {
+                   return true;
+               }
+               var emailPat=/^(.+)@(.+)$/;
+               var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
+               var validChars="\[^\\s" + specialChars + "\]";
+               var quotedUser="(\"[^\"]*\")";
+               var ipDomainPat=/^(\d{1,3})[.](\d{1,3})[.](\d{1,3})[.](\d{1,3})$/;
+               var atom=validChars + '+';
+               var word="(" + atom + "|" + quotedUser + ")";
+               var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
+               var domainPat=new RegExp("^" + atom + "(\\." + atom + ")*$");
+               var matchArray=emailStr.match(emailPat);
+               if (matchArray == null) {
+                   return false;
+               }
+               var user=matchArray[1];
+               var domain=matchArray[2];
+               if (user.match(userPat) == null) {
+                   return false;
+               }
+               var IPArray = domain.match(ipDomainPat);
+               if (IPArray != null) {
+                   for (var i = 1; i <= 4; i++) {
+                      if (IPArray[i] > 255) {
+                         return false;
+                      }
+                   }
+                   return true;
+               }
+               var domainArray=domain.match(domainPat);
+               if (domainArray == null) {
+                   return false;
+               }
+               var atomPat=new RegExp(atom,"g");
+               var domArr=domain.match(atomPat);
+               var len=domArr.length;
+               if ((domArr[domArr.length-1].length < 2) ||
+                   (domArr[domArr.length-1].length > 3)) {
+                   return false;
+               }
+               if (len < 2) {
+                   return false;
+               }
+               return true;
+            }]]>
+         </javascript>
+
+      </validator>
+
+   </global>
+
+</form-validation>

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/validator-rules_1_1.dtd
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/validator-rules_1_1.dtd	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,282 @@
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+    
+     Refer to the below DTD Instead:
+    
+    <!DOCTYPE form-validation PUBLIC
+          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
+          "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
+
+
+    $Id: validator-rules_1_1.dtd,v 1.6 2002/11/14 20:33:13 rleland Exp $
+-->
+
+
+<!-- =================================================== Top Level Elements -->
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "form-validation" element is the root of the configuration file
+     hierarchy, and contains nested elements for all of the other
+     configuration settings.
+-->
+<!ELEMENT form-validation (global+)>
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+    The elements defined here are all global and must be nested within a
+    "global" element.
+-->
+<!ELEMENT global (validator+)>
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "validator" element defines what validators objects can be used with
+     the fields referenced by the formset elements. The validator element can
+     accept 4 properties: name, classname, method, methodparams, msg, depends,
+     and jsFunctionName.
+-->
+<!ELEMENT validator (javascript?)>
+<!ATTLIST validator name           CDATA #REQUIRED
+                    classname      CDATA #REQUIRED
+                    method         CDATA #REQUIRED
+                    methodParams   CDATA #REQUIRED
+                    msg            CDATA #REQUIRED
+                    depends        CDATA #IMPLIED
+                    jsFunctionName CDATA #IMPLIED >
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "javascript" element defines a JavaScript that can be used to perform
+     client-side validators.
+-->
+<!ELEMENT javascript (#PCDATA)>
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "constant" element defines a static value that can be used as
+     replacement parameters within "field" elements. The "constant-name" and
+     "constant-value" elements define the constant's reference id and replacement
+     value.
+-->
+<!ELEMENT constant (constant-name, constant-value)>
+<!ELEMENT constant-name  (#PCDATA)>
+<!ELEMENT constant-value (#PCDATA)>
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+      The "formset" element defines a set of forms for a locale. Formsets for
+      specific locales can override only those fields that change. The
+      localization is properly scoped, so that a formset can override just the
+      language, or just the country, or both.
+-->
+<!ELEMENT formset (constant*, form+)>
+<!ATTLIST formset language     CDATA #IMPLIED
+                  country      CDATA #IMPLIED >
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "form" element defines a set of fields to be validated. The name
+     corresponds to the identifer the application assigns to the form. In the
+     case of the Struts framework, this is the attribute property from
+     the ActionMapping. Struts also offers the alternative of using the
+     the path property as the Validator form name.
+-->
+<!ELEMENT form    (field+ )>
+<!ATTLIST form    name CDATA #REQUIRED>
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "field" element defines the properties to be validated. In a
+     web application, a field would also correspond to a control on
+     a HTML form. To validate the properties, the validator works through
+     a JavaBean representation, like a Struts ActionForm. The field element
+     can accept up to 4 attributes:
+
+     property        The property on the JavaBean corresponding to this
+                     field element.
+
+     depends         The comma-delimited list of validators to apply against
+                     this field. For the field to succeed, all the
+                     validators must succeed.
+
+     page            The JavaBean corresponding to this form may include
+                     a page property. Only fields with a "page" attribute
+                     value that is equal to or less than the page property
+                     on the form JavaBean are processed. This is useful when
+                     using a "wizard" approach to completing a large form,
+                     to ensure that a page is not skipped.
+                     [0]
+
+     indexedListProperty
+                     The "indexedListProperty" is the method name that will
+                     return an array or a Collection used to retrieve the
+                     list and then loop through the list performing the
+                     validations for this field.
+
+     fieldOrder      [:FIXME: is this still supported?]
+-->
+<!ELEMENT field   (msg|arg0|arg1|arg2|arg3|var)*>
+<!ATTLIST field   property CDATA #REQUIRED
+                  depends  CDATA #IMPLIED
+                  page     CDATA #IMPLIED
+                  indexedListProperty CDATA #IMPLIED >
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "msg" element defines a custom message key to use when one of the
+     validators for this field fails. Each validator has a default message
+     property that is used when a corresonding field msg is not specified.
+     Each validator applied to a field may have its own msg element.
+     The msg element accepts up to three attributes.
+
+      name        The name of the validator corresponding to this msg.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT msg     EMPTY>
+<!ATTLIST msg     name     CDATA #IMPLIED
+                  key      CDATA #IMPLIED
+                  resource CDATA #IMPLIED >
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "arg0" element defines the first replacement value to use with the
+     message template for this validator or this field.
+     The arg0 element accepts up to three attributes.
+
+      name        The name of the validator corresponding to this msg.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT arg0    EMPTY>
+<!ATTLIST arg0    name     CDATA #IMPLIED
+                  key      CDATA #IMPLIED
+                  resource CDATA #IMPLIED >
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "arg1" element defines the second replacement value to use with the
+     message template for this validator or this field.
+     The arg1 element accepts up to three attributes.
+
+      name        The name of the validator corresponding to this msg.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT arg1    EMPTY>
+<!ATTLIST arg1    name     CDATA #IMPLIED
+                  key      CDATA #IMPLIED
+                  resource CDATA #IMPLIED >
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "arg2" element defines the third replacement value to use with the
+     message template for this validator or this field.
+     The arg2 element accepts up to three attributes.
+
+      name        The name of the validator corresponding to this msg.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT arg2    EMPTY>
+<!ATTLIST arg2    name     CDATA #IMPLIED
+                  key      CDATA #IMPLIED
+                  resource CDATA #IMPLIED >
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "arg3" element defines the fourth replacement value to use with the
+     message template for this validator or this field.
+     The arg0 element accepts up to three attributes.
+
+      name        The name of the validator corresponding to this msg.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT arg3    EMPTY>
+<!ATTLIST arg3    name     CDATA #IMPLIED
+                  key      CDATA #IMPLIED
+                  resource CDATA #IMPLIED >
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The "var" element can set parameters that a field may need to pass to
+     one of its validators, such as the minimum and maximum values in a
+     range validation. These parameters may also be referenced by one of the
+     arg? elements using a shell syntax: ${var:var-name}.
+-->
+<!ELEMENT var (var-name, var-value)>
+
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The name of the var parameter to provide to a field's validators.
+-->
+<!ELEMENT var-name  (#PCDATA)>
+
+
+
+<!--
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED
+    DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED ** DEPRECATED 
+     The value of the var parameter to provide to a field's validators.
+-->
+<!ELEMENT var-value (#PCDATA)>
+
+<!-- eof -->

Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/web.xml
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/web.xml	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+    version="2.4">
+
+    <display-name>PageFlow Petstore Application</display-name>
+
+    <filter>
+        <filter-name>ControlFilter</filter-name>
+        <filter-class>org.apache.beehive.controls.runtime.servlet.ControlFilter</filter-class>
+    </filter>
+
+    <filter>
+        <filter-name>PageFlowJspFilter</filter-name>
+        <filter-class>org.apache.beehive.netui.pageflow.PageFlowJspFilter</filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>ControlFilter</filter-name>
+        <url-pattern>*.jws</url-pattern>
+    </filter-mapping>
+
+    <filter-mapping>
+        <filter-name>PageFlowJspFilter</filter-name>
+        <url-pattern>*.jsp</url-pattern>
+        <dispatcher>FORWARD</dispatcher>        
+        <dispatcher>REQUEST</dispatcher>
+        <dispatcher>INCLUDE</dispatcher>
+    </filter-mapping>
+
+    <servlet>
+        <servlet-name>AxisServlet</servlet-name>
+        <display-name>Apache-Axis Servlet</display-name>
+        <servlet-class>
+            org.apache.axis.transport.http.AxisServlet
+        </servlet-class>
+    </servlet>
+
+    <!-- Standard Action Servlet Configuration (with debugging) -->
+    <servlet>
+        <servlet-name>action</servlet-name>
+        <servlet-class>org.apache.beehive.netui.pageflow.PageFlowActionServlet</servlet-class>
+        <init-param>
+            <param-name>config</param-name>
+            <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
+        </init-param>
+        <init-param>
+            <param-name>debug</param-name>
+            <param-value>2</param-value>
+        </init-param>
+        <init-param>
+            <param-name>detail</param-name>
+            <param-value>2</param-value>
+        </init-param>
+        <load-on-startup>2</load-on-startup>
+    </servlet>
+
+    <!-- Struts Action Servlet Mappings -->
+    <!-- Note that because Struts takes the *last* mapping here as the extension to add to
+         actions posted from forms, we must have *.do come after *.jpf. -->
+    <servlet-mapping>
+        <servlet-name>action</servlet-name>
+        <url-pattern>*.jpf</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>AxisServlet</servlet-name>
+        <url-pattern>*.jws</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>action</servlet-name>
+        <url-pattern>*.do</url-pattern>
+    </servlet-mapping>
+
+
+    <welcome-file-list>
+        <welcome-file>index.jsp</welcome-file>
+    </welcome-file-list>
+
+    <error-page>
+        <error-code>500</error-code>
+        <location>/error.jsp</location>
+    </error-page>
+
+    <jsp-config>
+        <!-- Define the NetUI tag library TLDs -->
+        <taglib>
+            <taglib-uri>http://beehive.apache.org/netui/tags-html-1.0</taglib-uri>
+            <taglib-location>/WEB-INF/beehive-netui-tags-html.tld</taglib-location>
+        </taglib>
+
+        <taglib>
+            <taglib-uri>http://beehive.apache.org/netui/tags-databinding-1.0</taglib-uri>
+            <taglib-location>/WEB-INF/beehive-netui-tags-databinding.tld</taglib-location>
+        </taglib>
+
+        <taglib>
+            <taglib-uri>http://beehive.apache.org/netui/tags-template-1.0</taglib-uri>
+            <taglib-location>/WEB-INF/beehive-netui-tags-template.tld</taglib-location>
+        </taglib>
+    </jsp-config>
+
+<!--
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>AccountPageFlow</web-resource-name>
+            <description>Protect the page flow that allows account manipulation.</description>
+            <url-pattern>/account/*</url-pattern>
+            <http-method>GET</http-method>
+        </web-resource-collection>
+        <web-resource-collection>
+            <web-resource-name>AccountPageFlow</web-resource-name>
+            <description>Protect the page flow that allows checkout.</description>
+            <url-pattern>/checkout/*</url-pattern>
+            <http-method>GET</http-method>
+        </web-resource-collection>
+        <auth-constraint>
+            <description>Roles who have access to the account manipulation pages.</description>
+            <role-name>Users</role-name>
+        </auth-constraint>
+        <user-data-constraint>
+            <description>This is how the user data must be transmitted.</description>
+            <transport-guarantee>NONE</transport-guarantee>
+        </user-data-constraint>
+    </security-constraint>
+-->
+    <login-config>
+        <auth-method>FORM</auth-method>
+        <realm-name>default</realm-name>
+        <form-login-config>
+            <form-login-page>/auth/login.jsp</form-login-page>
+            <form-error-page>/auth/loginFail.jsp</form-error-page>
+        </form-login-config>
+    </login-config>
+
+    <security-role>
+        <description>Site customers</description>
+        <role-name>Users</role-name>
+    </security-role>
+
+</web-app>

Added: incubator/beehive/trunk/samples/petstoreWeb/account/create/Controller.jpf
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/account/create/Controller.jpf	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,227 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package account.create;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+import org.apache.struts.action.ActionError;
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.action.ActionMapping;
+
+import org.apache.beehive.samples.petstore.controller.AccountController;
+import org.apache.beehive.samples.petstore.controls.AccountControl;
+import org.apache.beehive.samples.petstore.controls.CatalogControl;
+import org.apache.beehive.samples.petstore.controls.exceptions.NoSuchAccountException;
+import org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
+import org.apache.beehive.samples.petstore.controls.exceptions.AccountAlreadyExistsException;
+import org.apache.beehive.samples.petstore.controls.exceptions.UserAlreadyExistsException;
+import org.apache.beehive.samples.petstore.forms.AccountForm;
+import org.apache.beehive.samples.petstore.model.Account;
+import org.apache.beehive.samples.petstore.model.Address;
+
+@Jpf.Controller(
+    messageResources={@Jpf.MessageResource(name = "org.apache.beehive.samples.petstore.resources.account")}
+)
+public class Controller
+    extends AccountController
+{
+    @org.apache.beehive.controls.api.bean.Control()
+    protected CatalogControl _catalogControl;
+
+    @org.apache.beehive.controls.api.bean.Control()
+    protected AccountControl _accountControl;
+
+    @Jpf.SharedFlowField
+    private webappRoot.SharedFlow _sharedFlow = null;
+
+    private boolean _isUsernameTaken;
+    private CreateAccountForm _createForm = null;
+
+    public boolean isUsernameTaken()
+    {
+        return _isUsernameTaken;
+    }
+
+    @Jpf.Action(
+        forwards = { 
+            @Jpf.Forward(name = "viewCreateAccount", path = "viewCreateAccount.do")
+        }
+    )
+    protected Forward begin()
+    {
+        return new Forward("viewCreateAccount");
+    }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(name = "success", path = "create.jsp",
+                         actionOutputs = { 
+                             @Jpf.ActionOutput(name = "languages",
+                                               type = java.lang.String[].class,
+                                               required = true),
+                             @Jpf.ActionOutput(name = "categoryNames",
+                                               type = java.util.List.class,
+                                               required = true)
+                         })
+        }
+    )
+    protected Forward viewCreateAccount()
+    {
+        Account account = new Account();
+        account.setAddress(new Address());
+
+        _createForm = new CreateAccountForm(account);
+
+        Forward forward = new Forward("success", _createForm);
+        forward.addActionOutput("categoryNames", _sharedFlow.getCategoryNames());
+        forward.addActionOutput("languages", LANGUAGES);
+        return forward;
+    }
+
+    // @todo: the "failure" forward below is broken in WLW
+    @Jpf.Action(
+        useFormBean = "_createForm",
+        forwards = {
+            @Jpf.Forward(
+                redirect = true,
+                name = "shop",
+                path = "/shop/Controller.jpf"
+            )
+        },
+        validationErrorForward = @Jpf.Forward(name = "failure", navigateTo = Jpf.NavigateTo.currentPage)
+    )
+    protected Forward createAccount(CreateAccountForm form)
+        throws AccountAlreadyExistsException, InvalidIdentifierException, UserAlreadyExistsException, NoSuchAccountException
+    {
+        // ensure unique user name
+        _isUsernameTaken = false;
+        if(_accountControl.checkAccountExists(form.getUserId()))
+        {
+            _isUsernameTaken = true;
+            return new Forward("failure");
+        }
+
+        Account userAccount = AccountForm.getAccount(form);
+
+        _accountControl.insertAccount(userAccount);
+        _sharedFlow.updateAccount(userAccount);
+
+        return new Forward("shop");
+    }
+
+    public static class CreateAccountForm
+        extends AccountForm
+    {
+        private String _repeatedPassword;
+
+        public CreateAccountForm()
+        {
+            super();
+        }
+        
+        public CreateAccountForm(Account account)
+        {
+            super(account);
+        }
+
+        public void setUserId(String userId)
+        {
+            getAccount().setUserId(userId);
+        }
+        
+        public String getPassword()
+        {
+            return getAccount().getPassword();
+        }
+
+        public void setPassword(String password)
+        {
+            getAccount().setPassword(password);
+        }
+
+        public String getRepeatedPassword()
+        {
+            return _repeatedPassword;
+        }
+
+        public void setRepeatedPassword(String repeatedPassword)
+        {
+            _repeatedPassword = repeatedPassword;
+        }
+
+        public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
+        {
+            ActionErrors errors = new ActionErrors();
+            Account account = getAccount();
+            account.setStatus("OK");
+
+            addErrorIfStringEmpty(errors, "userId", "account.error.userid.required", account.getUserId());
+
+            if (account.getPassword() == null ||
+                account.getPassword().length() < 1 ||
+                !account.getPassword().equals(getRepeatedPassword()))
+            {
+                errors.add("repeatedPassword", new ActionError("account.error.password.missing"));
+            }
+
+            baseValidate(errors, mapping, request);
+
+            return errors;
+        }
+    }
+}
+
+@Jpf.ViewProperties(value = {
+    "<!-- This data is auto-generated. Hand-editing this section is not recommended. -->",
+    "<view-properties>",
+    "<pageflow-object id='pageflow:/account/create/Controller.jpf'/>",
+    "<pageflow-object id='page:create.jsp'>",
+    "  <property value='420' name='x'/>",
+    "  <property value='220' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='message-resource:null#org.apache.beehive.samples.petstore.resources.account#@pageflow:/account/create/Controller.jpf@'/>",
+    "<pageflow-object id='action:begin.do'>",
+    "  <property value='80' name='x'/>",
+    "  <property value='220' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='action:viewCreateAccount.do'><property name='x' value='240'/><property name='y' value='220'/></pageflow-object>",
+    "<pageflow-object id='action:createAccount.do#account.create.Controller.CreateAccountForm'><property name='x' value='600'/><property name='y' value='220'/></pageflow-object>",
+    "<pageflow-object id='control:org.apache.beehive.samples.petstore.controls.CatalogControl#_catalogControl'/>",
+    "<pageflow-object id='control:org.apache.beehive.samples.petstore.controls.AccountControl#_accountControl'/>",
+    "<pageflow-object id='forward:path#viewCreateAccount#viewCreateAccount.do#@action:begin.do@'><property name='elbowsX' value='116,160,160,204'/><property name='elbowsY' value='212,212,212,212'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='viewCreateAccount'/></pageflow-object>",
+    "<pageflow-object id='forward:path#success#create.jsp#@action:viewCreateAccount.do@'><property name='elbowsX' value='276,330,330,384'/><property name='elbowsY' value='212,212,212,212'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='external-jpf:/shop/Controller.jpf'>",
+    "  <property value='740' name='x'/>",
+    "  <property value='180' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='forward:path#shop#/shop/Controller.jpf#@action:createAccount.do#account.create.Controller.CreateAccountForm@'><property name='elbowsX' value='636,670,670,704'/><property name='elbowsY' value='212,212,172,172'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='shop'/></pageflow-object>",
+    "<pageflow-object id='return-to:@forward:returnTo#failure#currentPage#@action:createAccount.do#account.create.Controller.CreateAccountForm@@'><property name='x' value='740'/><property name='y' value='280'/></pageflow-object>",
+    "<pageflow-object id='forward:returnTo#failure#currentPage#@action:createAccount.do#account.create.Controller.CreateAccountForm@'><property name='elbowsX' value='636,670,670,704'/><property name='elbowsY' value='223,223,272,272'/><property name='fromPort' value='East_2'/><property name='toPort' value='West_1'/><property name='label' value='failure'/></pageflow-object>",
+    "<pageflow-object id='action-output:languages#@forward:path#success#create.jsp#@action:viewCreateAccount.do@@'/>",
+    "<pageflow-object id='action-output:categoryNames#@forward:path#success#create.jsp#@action:viewCreateAccount.do@@'/>",
+    "<pageflow-object id='action-call:@page:create.jsp@#@action:createAccount.do#account.create.Controller.CreateAccountForm@'><property name='elbowsX' value='456,510,510,564'/><property name='elbowsY' value='212,212,212,212'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/></pageflow-object>",
+    "<pageflow-object id='formbean:CreateAccountForm'/>",
+    "</view-properties>"
+})
+interface VIEW_PROPERTIES
+{
+}
+

Added: incubator/beehive/trunk/samples/petstoreWeb/account/create/create.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/account/create/create.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,65 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib prefix="beehive-petstore" tagdir="/WEB-INF/tags/beehive/petstore" %>
+<netui-data:declarePageInput name="categoryNames" type="java.util.List"/>
+<netui-data:declarePageInput name="languages" type="java.lang.String[]"/>
+
+
+
+
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="leftnav"> &nbsp; </netui-template:section>
+    <netui-template:section name="body">
+    <netui:errors/>
+    <netui:form action="createAccount">
+    <center>
+        <table cellpadding=10 cellspacing=0 align=center border=1 bgcolor=#dddddd>
+            <tr>
+                <td>
+                <netui:span styleClass="boldlabel" value="${bundle.default.userInformation}"/>
+                <table bgcolor="#008800" border=0 cellpadding=3 cellspacing=1>
+                    <tr class="rowyellow">
+                        <td>${bundle.default.userIdLabel}:
+                        </td>
+                        <td>
+                        <c:if test="${pageFlow.usernameTaken == true}">
+                        <netui:span styleClass="error" value="${bundle.default.usernameTaken}"/>
+                        <br/>
+                        </c:if>
+                        <netui:textBox dataSource="actionForm.userId"/>
+                        <br/>
+                        <netui:error value="userId"/>
+                        </td>
+                    </tr>
+                    <tr class="rowyellow">
+                        <td>${bundle.default.passwordLabel}:
+                        </td>
+                        <td>
+                        <netui:textBox password="true" dataSource="actionForm.password"/>
+                        <br/>
+                        <netui:error value="password"/>
+                        </td>
+                    </tr>
+                    <tr class="rowyellow">
+                        <td>${bundle.default.repeatPasswordLabel}:
+                        </td>
+                        <td>
+                        <netui:textBox dataSource="actionForm.repeatedPassword" password="true"/>
+                        <br/>
+                        <netui:error value="password"/>
+                        </td>
+                    </tr>
+                </table>
+                <beehive-petstore:accountFields categoryNames="${pageInput.accountFields" languages="${pageInput.languages}"/>
+                </td>
+                </tr>
+                </table>
+        <br/>
+        <netui:imageButton src="${pageContext.request.contextPath}/images/button_submit.gif"/>
+        </center>
+    </netui:form>
+    </netui-template:section>
+</netui-template:template>

Added: incubator/beehive/trunk/samples/petstoreWeb/account/edit/Controller.jpf
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/account/edit/Controller.jpf	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,254 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package account.edit;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.action.ActionMapping;
+import org.apache.beehive.netui.pageflow.Forward;
+
+import org.apache.beehive.samples.petstore.controls.exceptions.NoSuchOrderException;
+import org.apache.beehive.samples.petstore.model.*;
+import org.apache.beehive.samples.petstore.controls.*;
+import org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
+import org.apache.beehive.samples.petstore.controls.exceptions.NoSuchAccountException;
+import org.apache.beehive.samples.petstore.controls.exceptions.NoSuchUserException;
+import org.apache.beehive.samples.petstore.forms.AccountForm;
+import org.apache.beehive.samples.petstore.forms.OrderForm;
+import org.apache.beehive.samples.petstore.controller.AccountController;
+
+@Jpf.Controller(
+    messageResources = { 
+        @Jpf.MessageResource(name = "org.apache.beehive.samples.petstore.resources.account")
+    },
+    simpleActions={
+        @Jpf.SimpleAction(name="begin", path="edit.jsp")
+    }
+)
+public class Controller
+    extends AccountController
+{
+    @org.apache.beehive.controls.api.bean.Control()
+    private OrderControl _orderControl;
+
+    @org.apache.beehive.controls.api.bean.Control()
+    private AccountControl _accountControl;
+
+    @Jpf.SharedFlowField
+    private webappRoot.SharedFlow _sharedFlow;
+
+    private UpdateAccountForm _updateForm;
+    private Order[] orders;
+
+    @Jpf.Action(
+        forwards = { 
+            @Jpf.Forward(name = "update", path = "edit.jsp",
+                         actionOutputs = { 
+                             @Jpf.ActionOutput(name = "languages",
+                                               type = java.lang.String[].class,
+                                               required = true),
+                             @Jpf.ActionOutput(name = "categoryNames",
+                                               type = java.util.List.class,
+                                               required = true)
+                         })
+        }
+   )
+    protected Forward viewUpdateAccount()
+    {
+        _sharedFlow.ensureLogin();
+
+        _updateForm = new UpdateAccountForm(_sharedFlow.getAccount());
+
+        Forward forward = new Forward("update");
+        forward.addOutputForm(_updateForm);
+        forward.addActionOutput("languages", LANGUAGES);
+        forward.addActionOutput("categoryNames", _sharedFlow.getCategoryNames());
+        return forward;
+    }
+
+    @Jpf.Action(
+        useFormBean = "_updateForm",
+        forwards = { 
+            @Jpf.Forward(
+                redirect = true, 
+                name = "success", 
+                path = "/shop/Controller.jpf"
+           )
+        }, 
+        validationErrorForward = @Jpf.Forward(name = "failure", navigateTo = Jpf.NavigateTo.currentPage)
+   )
+    protected Forward updateAccount(UpdateAccountForm form)
+        throws InvalidIdentifierException, NoSuchAccountException, NoSuchUserException
+    {
+        _sharedFlow.ensureLogin();
+
+        Account account = AccountForm.getAccount(form);
+
+        _accountControl.updateAccount(account);
+
+        _sharedFlow.updateAccount(account);
+
+        return new Forward("success");
+    }
+
+    @Jpf.Action(
+        forwards = { 
+            @Jpf.Forward(name = "success", path = "/checkout/viewOrder.do")
+        }
+   )
+    protected Forward viewOrder()
+        throws NoSuchOrderException
+    {
+        _sharedFlow.ensureLogin();
+
+        Order order = _orderControl.getOrder(getRequest().getParameter("orderId"));
+
+        OrderForm form = new OrderForm();
+        form.setOrder(order);
+
+        return new Forward("success", form);
+    }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(name = "success", path = "listOrders.jsp",
+                         actionOutputs = { 
+                             @Jpf.ActionOutput(name = "orders",
+                                               type = org.apache.beehive.samples.petstore.model.Order[].class,
+                                               required = false)
+                         })
+        }
+    )
+    protected Forward listOrders()
+    {
+        _sharedFlow.ensureLogin();
+
+        orders = _orderControl.getOrdersByUserId(_sharedFlow.getAccount().getUserId());
+
+        Forward forward = new Forward("success");
+        forward.addActionOutput("orders", orders);
+        return forward;
+    }
+
+    /**
+     *
+     */
+    public static class UpdateAccountForm
+        extends AccountForm
+    {
+        private String _newPassword;
+        private String _repeatedPassword;
+
+        public UpdateAccountForm()
+        {
+            super();
+        }
+        
+        public UpdateAccountForm(Account account)
+        {
+            super(account);
+        }
+        
+        public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
+        {
+            ActionErrors errors = new ActionErrors();
+            baseValidate(errors, mapping, request);
+            return errors;
+        }
+
+        public String getNewPassword()
+        {
+            return _newPassword;
+        }
+
+        public void setNewPassword(String value)
+        {
+            _newPassword = value;
+        }
+
+        public String getRepeatedPassword()
+        {
+            return _repeatedPassword;
+        }
+
+        public void setRepeatedPassword(String value)
+        {
+            _repeatedPassword = value;
+        }
+    }
+}
+
+@Jpf.ViewProperties(value = {
+    "<!-- This data is auto-generated. Hand-editing this section is not recommended. -->",
+    "<view-properties>",
+    "<pageflow-object id='pageflow:/account/edit/Controller.jpf'/>",
+    "<pageflow-object id='page:edit.jsp'>",
+    "  <property value='260' name='x'/>",
+    "  <property value='140' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='page:listOrders.jsp'>",
+    "  <property value='260' name='x'/>",
+    "  <property value='400' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='message-resource:null#org.apache.beehive.samples.petstore.resources.account#@pageflow:/account/edit/Controller.jpf@'/>",
+    "<pageflow-object id='action:viewUpdateAccount.do'>",
+    "  <property value='80' name='x'/>",
+    "  <property value='140' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='action:updateAccount.do#account.edit.Controller.UpdateAccountForm'><property name='x' value='480'/><property name='y' value='140'/></pageflow-object>",
+    "<pageflow-object id='action:viewOrder.do'>",
+    "  <property value='260' name='x'/>",
+    "  <property value='540' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='action:listOrders.do'>",
+    "  <property value='260' name='x'/>",
+    "  <property value='260' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='control:org.apache.beehive.samples.petstore.controls.OrderControl#_orderControl'/>",
+    "<pageflow-object id='control:org.apache.beehive.samples.petstore.controls.AccountControl#_accountControl'/>",
+    "<pageflow-object id='forward:path#update#edit.jsp#@action:viewUpdateAccount.do@'>",
+    "  <property value='116,170,170,224' name='elbowsX'/>",
+    "  <property value='132,132,132,132' name='elbowsY'/>",
+    "  <property value='East_1' name='fromPort'/>",
+    "  <property value='West_1' name='toPort'/>",
+    "  <property value='update' name='label'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='external-jpf:/shop/Controller.jpf'>",
+    "  <property value='680' name='x'/>",
+    "  <property value='80' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='forward:path#success#/shop/Controller.jpf#@action:updateAccount.do#account.edit.Controller.UpdateAccountForm@'><property name='elbowsX' value='516,580,580,644'/><property name='elbowsY' value='132,132,72,72'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='return-to:@forward:returnTo#failure#currentPage#@action:updateAccount.do#account.edit.Controller.UpdateAccountForm@@'><property name='x' value='680'/><property name='y' value='220'/></pageflow-object>",
+    "<pageflow-object id='forward:returnTo#failure#currentPage#@action:updateAccount.do#account.edit.Controller.UpdateAccountForm@'><property name='elbowsX' value='516,580,580,644'/><property name='elbowsY' value='143,143,212,212'/><property name='fromPort' value='East_2'/><property name='toPort' value='West_1'/><property name='label' value='failure'/></pageflow-object>",
+    "<pageflow-object id='action:/checkout/viewOrder.do#org.apache.beehive.samples.petstore.forms.CheckoutForm'><property name='x' value='520'/><property name='y' value='540'/></pageflow-object>",
+    "<pageflow-object id='forward:path#success#/checkout/viewOrder.do#@action:viewOrder.do@'><property name='elbowsX' value='296,390,390,484'/><property name='elbowsY' value='532,532,532,532'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='forward:path#success#listOrders.jsp#@action:listOrders.do@'><property name='elbowsX' value='260,260,260,260'/><property name='elbowsY' value='304,330,330,356'/><property name='fromPort' value='South_1'/><property name='toPort' value='North_1'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='action-output:languages#@forward:path#update#edit.jsp#@action:viewUpdateAccount.do@@'/>",
+    "<pageflow-object id='action-output:categoryNames#@forward:path#update#edit.jsp#@action:viewUpdateAccount.do@@'/>",
+    "<pageflow-object id='action-output:orders#@forward:path#success#listOrders.jsp#@action:listOrders.do@@'/>",
+    "<pageflow-object id='action-call:@page:edit.jsp@#@action:listOrders.do@'><property name='elbowsX' value='260,260,260,260'/><property name='elbowsY' value='184,200,200,216'/><property name='fromPort' value='South_1'/><property name='toPort' value='North_1'/></pageflow-object>",
+    "<pageflow-object id='action-call:@page:edit.jsp@#@action:updateAccount.do#account.edit.Controller.UpdateAccountForm@'><property name='elbowsX' value='296,370,370,444'/><property name='elbowsY' value='132,132,132,132'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/></pageflow-object>",
+    "<pageflow-object id='formbean:UpdateAccountForm'/>",
+    "</view-properties>"
+})
+interface VIEW_PROPERTIES
+{
+}
+

Added: incubator/beehive/trunk/samples/petstoreWeb/account/edit/edit.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/account/edit/edit.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,56 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<%@ taglib prefix="beehive-petstore" tagdir="/WEB-INF/tags/beehive/petstore" %>
+
+<netui-data:declarePageInput name="categoryNames" type="java.util.List"/>
+<netui-data:declarePageInput name="languages" type="java.lang.String[]"/>
+
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="leftnav"> &nbsp; </netui-template:section>
+
+    <netui-template:section name="body"> <center>
+    <netui:form action="updateAccount">
+        <table cellpadding="10" cellspacing="0" align="center" bgcolor="#dddddd">
+            <tr>
+                <td>
+                <netui:span styleClass="boldlabel" value="${bundle.default.userInformation}"/>
+                <table class="tablegreen">
+                    <tr class="rowyellow">
+                        <td>${bundle.default.userIdLabel}:
+                        </td>
+                        <td><netui:span value="${actionForm.userId}"/></td>
+                    </tr>
+                    <tr class="rowyellow">
+                        <td>${bundle.default.passwordLabel}:
+                        </td>
+                        <td>
+                        <netui:textBox dataSource="actionForm.newPassword" password="true"/>
+                        </td>
+                    </tr>
+                    <tr class="rowyellow">
+                        <td>${bundle.default.repeatPasswordLabel}:
+                        </td>
+                        <td>
+                        <netui:textBox dataSource="actionForm.repeatedPassword" password="true"/>
+                        </td>
+                    </tr>
+                </table>
+                <beehive-petstore:accountFields categoryNames="${pageInput.accountFields}" languages="${pageInput.languages}"/> 
+                </td>
+            </tr>
+            <tr>
+                <td>
+                <center>
+                <br/>
+                <netui:imageButton src="${pageContext.request.contextPath}/images/button_submit.gif"/>
+                <br/>
+                <br/>
+                <netui:anchor action="listOrders">
+                    <b>${bundle.default.listOrdersLabel}</b>
+                </netui:anchor>
+                </center>
+                </netui:form>
+    </td> </tr> </table> </netui-template:section>
+</netui-template:template>

Added: incubator/beehive/trunk/samples/petstoreWeb/account/edit/listOrders.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/account/edit/listOrders.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,45 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<%@ taglib prefix="beehive-petstore" tagdir="/WEB-INF/tags/beehive/petstore" %>
+<netui-data:declarePageInput name="orders" type="org.apache.beehive.samples.petstore.model.Order[]" required="false"/>
+
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="leftnav">
+    <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+    <beehive-petstore:catalogNav action="globalShop" labelValue="${bundle.view.mainMenuLabel}"/> </netui-template:section>
+    <netui-template:section name="body">
+    <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+    <p/>
+    <center> <netui:span styleClass="boldlabel" value="${bundle.view.myOrders}"/>
+    <p/>
+    <netui-data:repeater dataSource="pageInput.orders" defaultText="No orders found">
+        <netui-data:repeaterHeader>
+            <table class="tablebody" border="1">
+                <tr class="tablehead" valign="top">
+                    <th>${bundle.view.orderId}</th>
+                    <th>${bundle.view.orderDate}</th>
+                    <th>${bundle.view.orderPrice}</th>
+                </tr>
+        </netui-data:repeaterHeader>
+        <netui-data:repeaterItem>
+            <tr valign="top">
+                <td>
+                    <netui:label value="${container.item.orderId}"/>
+                </td>
+                <td>
+                    <netui:span value="${container.item.orderDate}" defaultValue="&nbsp;"/>
+                </td>
+                <td>
+                    <netui:span value="${container.item.totalPrice}" defaultValue="&nbsp;">
+                        <netui:formatNumber pattern="${bundle.view.priceFormat}"/>
+                    </netui:span>
+                </td>
+            </tr>
+        </netui-data:repeaterItem>
+        <netui-data:repeaterFooter> </table> </netui-data:repeaterFooter>
+    </netui-data:repeater>
+    </center>
+    </netui-template:section>
+</netui-template:template>

Added: incubator/beehive/trunk/samples/petstoreWeb/auth/Controller.jpf
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/auth/Controller.jpf	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,174 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package auth;
+
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.FormData;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+
+import org.apache.beehive.samples.petstore.forms.ReturnToForm;
+
+@Jpf.Controller(nested = true)
+public class Controller
+    extends PageFlowController
+{
+    @Jpf.SharedFlowField
+    private webappRoot.SharedFlow _sharedFlow = null;
+
+    private ReturnToForm _initForm;
+
+    @Jpf.Action(
+        forwards = { 
+            @Jpf.Forward(name = "success", path = "login.jsp")
+        }
+    )
+    protected Forward begin(ReturnToForm initForm)
+    {
+        _initForm = initForm;
+        return new Forward("success");
+    }
+
+    @Jpf.Action(
+        forwards = { 
+            @Jpf.Forward(name = "success", path = "login.jsp")
+        }
+    )
+    protected Forward viewLogin()
+    {
+        return new Forward("success");
+    }
+
+    @Jpf.Action(
+        forwards = { 
+            @Jpf.Forward(name = "failure", path = "loginError.jsp"),
+            @Jpf.Forward(
+                name = "success", 
+                returnAction = "loginDone", 
+                outputFormBean = "_initForm"
+            )
+        }
+    )
+    protected Forward securityCheck(SecurityCheckForm form)
+    {
+        _sharedFlow.handleLogin(form.getj_username());
+
+        if(!_sharedFlow.isUserLoggedIn())
+            return new Forward("failure");
+
+        return new Forward("success");
+    }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(name = "success", path = "/Controller.jpf")
+        }
+    )
+    protected Forward logout()
+    {
+        _sharedFlow.handleLogout();
+        return new Forward("success");
+    }
+
+    public static class SecurityCheckForm
+        extends FormData
+    {
+        private String _j_username;
+        private String _j_password;
+
+        public void setj_password(String j_password)
+        {
+            _j_password = j_password;
+        }
+
+        public String getj_password()
+        {
+            return _j_password;
+        }
+
+        public void setj_username(String j_username)
+        {
+            _j_username = j_username;
+        }
+
+        public String getj_username()
+        {
+            return _j_username;
+        }
+    }
+
+}
+
+@Jpf.ViewProperties(value = {
+    "<!-- This data is auto-generated. Hand-editing this section is not recommended. -->",
+    "<view-properties>",
+    "<pageflow-object id='pageflow:/auth/Controller.jpf'/>",
+    "<pageflow-object id='page:login.jsp'>",
+    "  <property value='380' name='x'/>",
+    "  <property value='200' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='page:loginError.jsp'>",
+    "  <property value='580' name='x'/>",
+    "  <property value='380' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='formbean:SecurityCheckForm'/>",
+    "<pageflow-object id='action:begin.do#org.apache.beehive.samples.petstore.forms.ReturnToForm'><property name='x' value='120'/><property name='y' value='200'/></pageflow-object>",
+    "<pageflow-object id='action:viewLogin.do'>",
+    "  <property value='380' name='x'/>",
+    "  <property value='80' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='action:logout.do'>",
+    "  <property value='120' name='x'/>",
+    "  <property value='380' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='formbean:org.apache.beehive.samples.petstore.forms.ReturnToForm'/>",
+    "<pageflow-object id='forward:path#success#login.jsp#@action:begin.do#org.apache.beehive.samples.petstore.forms.ReturnToForm@'><property name='elbowsX' value='156,250,250,344'/><property name='elbowsY' value='192,192,192,192'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='forward:path#success#login.jsp#@action:viewLogin.do@'>",
+    "  <property value='380,380,380,380' name='elbowsX'/>",
+    "  <property value='124,140,140,156' name='elbowsY'/>",
+    "  <property value='South_1' name='fromPort'/>",
+    "  <property value='North_1' name='toPort'/>",
+    "  <property value='success' name='label'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='external-jpf:/Controller.jpf'>",
+    "  <property value='380' name='x'/>",
+    "  <property value='380' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='forward:path#success#/Controller.jpf#@action:logout.do@'>",
+    "  <property value='156,250,250,344' name='elbowsX'/>",
+    "  <property value='372,372,372,372' name='elbowsY'/>",
+    "  <property value='East_1' name='fromPort'/>",
+    "  <property value='West_1' name='toPort'/>",
+    "  <property value='success' name='label'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='action:globalViewCreateAccount.do'><property name='x' value='580'/><property name='y' value='500'/></pageflow-object>",
+    "<pageflow-object id='action-call:@page:login.jsp@#@action:globalViewCreateAccount.do@'><property name='elbowsX' value='416,480,480,544'/><property name='elbowsY' value='192,192,492,492'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/></pageflow-object>",
+    "<pageflow-object id='action:securityCheck.do#auth.Controller.SecurityCheckForm'><property name='x' value='120'/><property name='y' value='460'/></pageflow-object>",
+    "<pageflow-object id='forward:path#failure#loginError.jsp#@action:securityCheck.do#auth.Controller.SecurityCheckForm@'><property name='elbowsX' value='580,580,580,580'/><property name='elbowsY' value='244,290,290,336'/><property name='fromPort' value='South_1'/><property name='toPort' value='North_1'/><property name='label' value='failure'/></pageflow-object>",
+    "<pageflow-object id='exit:loginDone'>",
+    "  <property value='720' name='x'/>",
+    "  <property value='200' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='forward:returnAction#success#loginDone#@action:securityCheck.do#auth.Controller.SecurityCheckForm@'><property name='elbowsX' value='616,650,650,684'/><property name='elbowsY' value='192,192,192,192'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='action-call:@page:login.jsp@#@action:securityCheck.do#auth.Controller.SecurityCheckForm@'><property name='elbowsX' value='344,250,250,156'/><property name='elbowsY' value='203,203,441,441'/><property name='fromPort' value='West_2'/><property name='toPort' value='East_0'/></pageflow-object>",
+    "</view-properties>"
+})
+interface VIEW_PROPERTIES
+{
+}
+

Added: incubator/beehive/trunk/samples/petstoreWeb/auth/login.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/auth/login.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,46 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="leftnav"> &nbsp; </netui-template:section>
+    <netui-template:section name="body">
+    <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+    <%-- set focus on the username box--%>
+    <script language="javascript">
+    <!--
+    document.forms[1].j_username.focus();
+    -->
+    </script> <center>
+    <netui:form action="securityCheck">
+        <table align="center" border="0">
+            <tr>
+                <td colspan="2">${bundle.view.enterUsernamePassword}<br />
+                &nbsp;
+                </td>
+            </tr>
+            <tr>
+                <td>${bundle.view.usernameLoginLabel}:
+                </td>
+                <td>
+                <input type="text" name="j_username" value="java">
+                </td>
+            </tr>
+            <tr>
+                <td>${bundle.view.passwordLoginLabel}:
+                </td>
+                <td>
+                <input type="password" name="j_password" value="java">
+                </td>
+            </tr>
+            <tr>
+                <td colspan="2" align="center">
+                <netui:imageButton src="${pageContext.request.contextPath}/images/button_submit.gif"/>
+                </td>
+            </tr>
+        </table>
+    </netui:form>
+                <%-- this is defined in the global app but isn't picked up --%>
+                <netui:imageAnchor action="globalViewCreateAccount" border="0" src="${pageContext.request.contextPath}/images/button_register_now.gif"/>
+    </center> </netui-template:section>
+</netui-template:template>

Added: incubator/beehive/trunk/samples/petstoreWeb/auth/loginError.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/auth/loginError.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,22 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="leftnav">
+      &nbsp;
+    </netui-template:section>
+    <netui-template:section name="body">
+    <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+    <p/>
+    <center>
+    <p>
+        <b>${bundle.view.loginErrorMessage}</b>
+        <b><netui:anchor href="login.jsp">${bundle.view.loginLabel}</netui:anchor></b>
+        &nbsp;&nbsp;&nbsp;
+        <b><netui:anchor action="globalViewCreateAccount.do">${bundle.view.createAccountLabel}</netui:anchor></b>
+    </p>
+    </center>
+    </netui-template:section>
+</netui-template:template>
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/checkout/Controller.jpf
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/checkout/Controller.jpf	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,283 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package checkout;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+
+import org.apache.beehive.samples.petstore.controls.OrderControl;
+import org.apache.beehive.samples.petstore.controls.CatalogControl;
+import org.apache.beehive.samples.petstore.controls.exceptions.NoSuchOrderException;
+import org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
+import org.apache.beehive.samples.petstore.controls.exceptions.OrderAlreadyExistsException;
+import org.apache.beehive.samples.petstore.model.Order;
+import org.apache.beehive.samples.petstore.forms.OrderForm;
+import org.apache.beehive.samples.petstore.forms.CheckoutForm;
+
+@Jpf.Controller(
+    nested=true, 
+    messageResources={ 
+        @Jpf.MessageResource(name="org.apache.beehive.samples.petstore.resources.order")
+    },
+    simpleActions={
+        @Jpf.SimpleAction(name="viewItem", path="/shop/viewItem.do")
+    }
+)
+public class Controller
+    extends PageFlowController
+{
+    @org.apache.beehive.controls.api.bean.Control()
+    private CatalogControl _catalogControl;
+
+    @org.apache.beehive.controls.api.bean.Control()
+    private OrderControl _orderControl;
+
+    @Jpf.SharedFlowField
+    private webappRoot.SharedFlow _sharedFlow;
+
+    private Order _order = null;
+    private CheckoutForm _orderForm = null;
+
+    @Jpf.Action(
+        forwards={ 
+            @Jpf.Forward(name="success", path="viewCart.jsp")
+        }
+    )
+    public Forward begin()
+    {
+        return new Forward("success");
+    }
+
+    @Jpf.Action(
+        forwards={
+            @Jpf.Forward(name="success", path="newOrder.jsp",
+                         actionOutputs = {
+                             @Jpf.ActionOutput(name = "creditCardTypes",
+                                               type = java.util.List.class,
+                                               required = true),
+                             @Jpf.ActionOutput(name = "order",
+                                               type = org.apache.beehive.samples.petstore.model.Order.class,
+                                               required = true)
+                         })
+        }
+    )
+    protected Forward viewCreateOrder()
+    {
+        _sharedFlow.ensureLogin();
+
+        _order=_orderControl.createOrder();
+    	_order.initOrder(_sharedFlow.getAccount(), _sharedFlow.getCart());
+
+        _orderForm=new CheckoutForm();
+        _orderForm.setCheckOut(true);
+        _orderForm.setOrder(_order);
+
+        Forward forward = new Forward("success");
+        forward.addOutputForm(_orderForm);
+        forward.addActionOutput("order", _order);
+        forward.addActionOutput("creditCardTypes", _orderControl.getCreditCards());
+
+        return forward;
+    }
+
+    @Jpf.Action(
+        forwards={ 
+            @Jpf.Forward(name="done", returnAction="checkoutDone")
+        }
+    )
+    public Forward done()
+    {
+        return new Forward("done");
+    }
+
+    @Jpf.Action(
+        useFormBean="_orderForm",
+        forwards={ 
+            @Jpf.Forward(name="confirm", path="confirm.jsp",
+                         actionOutputs = { 
+                             @Jpf.ActionOutput(name = "order",
+                                               type = org.apache.beehive.samples.petstore.model.Order.class,
+                                               required = true),
+                             @Jpf.ActionOutput(name = "checkout",
+                                               type = java.lang.Boolean.class,
+                                               required = true)
+                         })
+        }
+    )
+    protected Forward viewConfirm(CheckoutForm orderForm)
+    {
+        Boolean isCheckOut=new Boolean(orderForm.isCheckOut());
+
+        Forward f=new Forward("confirm", orderForm);
+        f.addActionOutput("checkout", isCheckOut);
+        f.addActionOutput("order", _order);
+        return f;
+    }
+
+    @Jpf.Action(
+        useFormBean="_orderForm",
+        forwards={ 
+            @Jpf.Forward(name="success", path="viewOrder.jsp",
+                         actionOutputs = { 
+                             @Jpf.ActionOutput(name = "checkout",
+                                               type = java.lang.Boolean.class,
+                                               required = true),
+                             @Jpf.ActionOutput(name = "order",
+                                               type = org.apache.beehive.samples.petstore.model.Order.class,
+                                               required = true)
+                         })
+        }
+    )
+    protected Forward confirm(CheckoutForm orderForm)
+        throws NoSuchOrderException, InvalidIdentifierException, OrderAlreadyExistsException
+    {
+        _sharedFlow.ensureLogin();
+
+        Order order = orderForm.getOrder();
+        _orderControl.commitOrder(order);
+
+        _sharedFlow.handleCheckout();
+
+        Boolean isCheckOut=new Boolean(orderForm.isCheckOut());
+
+        Forward f=new Forward("success");
+        f.addActionOutput("order", _order);
+        f.addActionOutput("checkout", isCheckOut);
+        return f;
+    }
+
+    @Jpf.Action(
+        useFormBean="_orderForm",
+        forwards={ 
+            @Jpf.Forward(name="success", path="shipping.jsp")
+        }
+    )
+    protected Forward viewShipping(CheckoutForm orderForm)
+    {
+        return new Forward("success", orderForm);
+    }
+
+    @Jpf.Action(
+        forwards={ 
+            @Jpf.Forward(name="success", path="viewOrder.jsp",
+                         actionOutputs = { 
+                             @Jpf.ActionOutput(name = "order",
+                                               type = org.apache.beehive.samples.petstore.model.Order.class,
+                                               required = true),
+                             @Jpf.ActionOutput(name = "checkout",
+                                               type = java.lang.Boolean.class,
+                                               required = true)
+                         })
+        }
+    )
+    protected Forward viewOrder(CheckoutForm form)
+    {
+        _sharedFlow.ensureLogin();
+        _order=form.getOrder();
+
+        Forward f=new Forward("success");
+        Boolean isCheckOut=new Boolean(form.isCheckOut());
+        f.addActionOutput("checkout", isCheckOut);
+        f.addActionOutput("order", _order);
+        return f;
+    }
+
+    @Jpf.Action(
+        useFormBean="_orderForm",
+        forwards={ 
+            @Jpf.Forward(name="success", path="viewConfirm.do")
+        }
+    )
+    protected Forward shipping(OrderForm orderForm)
+    {
+        return new Forward("success", orderForm);
+    }
+
+    @Jpf.Action(
+        useFormBean="_orderForm", 
+        forwards={ 
+            @Jpf.Forward(name="viewShipping", path="viewShipping.do"), 
+            @Jpf.Forward(name="viewConfirm", path="viewConfirm.do")
+        }, 
+        validationErrorForward=@Jpf.Forward(name="failure", navigateTo=Jpf.NavigateTo.currentPage)
+    )
+    protected Forward order(CheckoutForm checkoutForm)
+    {
+        _sharedFlow.ensureLogin();
+        if(checkoutForm.isShippingAddressRequired())
+            return new Forward("viewShipping", checkoutForm);
+        else return new Forward("viewConfirm");
+    }
+}
+
+@Jpf.ViewProperties(value = {
+    "<!-- This data is auto-generated. Hand-editing this section is not recommended. -->",
+    "<view-properties>",
+    "<pageflow-object id='pageflow:/checkout/Controller.jpf'/>",
+    "<pageflow-object id='page:confirm.jsp'><property name='x' value='620'/><property name='y' value='460'/></pageflow-object>",
+    "<pageflow-object id='page:newOrder.jsp'><property name='x' value='100'/><property name='y' value='300'/></pageflow-object>",
+    "<pageflow-object id='page:shipping.jsp'><property name='x' value='480'/><property name='y' value='100'/></pageflow-object>",
+    "<pageflow-object id='page:viewCart.jsp'><property name='x' value='220'/><property name='y' value='400'/></pageflow-object>",
+    "<pageflow-object id='page:viewOrder.jsp'><property name='x' value='300'/><property name='y' value='580'/></pageflow-object>",
+    "<pageflow-object id='message-resource:null#org.apache.beehive.samples.petstore.resources.order#@pageflow:/checkout/Controller.jpf@'/>",
+    "<pageflow-object id='action:begin.do'><property name='x' value='60'/><property name='y' value='400'/></pageflow-object>",
+    "<pageflow-object id='action:viewCreateOrder.do'><property name='x' value='100'/><property name='y' value='100'/></pageflow-object>",
+    "<pageflow-object id='action:done.do'><property name='x' value='100'/><property name='y' value='1140'/></pageflow-object>",
+    "<pageflow-object id='action:viewConfirm.do#org.apache.beehive.samples.petstore.forms.CheckoutForm'><property name='x' value='240'/><property name='y' value='100'/></pageflow-object>",
+    "<pageflow-object id='action:confirm.do#org.apache.beehive.samples.petstore.forms.CheckoutForm'><property name='x' value='760'/><property name='y' value='280'/></pageflow-object>",
+    "<pageflow-object id='action:viewShipping.do#org.apache.beehive.samples.petstore.forms.CheckoutForm'><property name='x' value='640'/><property name='y' value='360'/></pageflow-object>",
+    "<pageflow-object id='action:viewOrder.do#org.apache.beehive.samples.petstore.forms.CheckoutForm'><property name='x' value='440'/><property name='y' value='380'/></pageflow-object>",
+    "<pageflow-object id='action:shipping.do#org.apache.beehive.samples.petstore.forms.OrderForm'><property name='x' value='680'/><property name='y' value='80'/></pageflow-object>",
+    "<pageflow-object id='action:order.do#org.apache.beehive.samples.petstore.forms.CheckoutForm'><property name='x' value='540'/><property name='y' value='260'/></pageflow-object>",
+    "<pageflow-object id='control:org.apache.beehive.samples.petstore.controls.CatalogControl#_catalogControl'/>",
+    "<pageflow-object id='control:org.apache.beehive.samples.petstore.controls.OrderControl#_orderControl'/>",
+    "<pageflow-object id='forward:path#success#viewCart.jsp#@action:begin.do@'><property name='elbowsX' value='96,140,140,184'/><property name='elbowsY' value='392,392,392,392'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='forward:path#success#newOrder.jsp#@action:viewCreateOrder.do@'><property name='elbowsX' value='100,100,100,100'/><property name='elbowsY' value='144,200,200,256'/><property name='fromPort' value='South_1'/><property name='toPort' value='North_1'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='exit:checkoutDone'><property name='x' value='240'/><property name='y' value='1140'/></pageflow-object>",
+    "<pageflow-object id='forward:returnAction#done#checkoutDone#@action:done.do@'><property name='elbowsX' value='136,170,170,204'/><property name='elbowsY' value='1132,1132,1132,1132'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='done'/></pageflow-object>",
+    "<pageflow-object id='forward:path#confirm#confirm.jsp#@action:viewConfirm.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@'><property name='elbowsX' value='276,430,430,584'/><property name='elbowsY' value='92,92,452,452'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='confirm'/></pageflow-object>",
+    "<pageflow-object id='forward:path#success#viewOrder.jsp#@action:confirm.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@'><property name='elbowsX' value='724,530,530,336'/><property name='elbowsY' value='272,272,561,561'/><property name='fromPort' value='West_1'/><property name='toPort' value='East_0'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='forward:path#success#shipping.jsp#@action:viewShipping.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@'><property name='elbowsX' value='604,560,560,516'/><property name='elbowsY' value='352,352,103,103'/><property name='fromPort' value='West_1'/><property name='toPort' value='East_2'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='forward:path#success#viewOrder.jsp#@action:viewOrder.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@'><property name='elbowsX' value='404,370,370,336'/><property name='elbowsY' value='372,372,572,572'/><property name='fromPort' value='West_1'/><property name='toPort' value='East_1'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='forward:path#success#viewConfirm.do#@action:shipping.do#org.apache.beehive.samples.petstore.forms.OrderForm@'><property name='elbowsX' value='644,460,460,276'/><property name='elbowsY' value='72,72,103,103'/><property name='fromPort' value='West_1'/><property name='toPort' value='East_2'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='forward:path#viewShipping#viewShipping.do#@action:order.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@'><property name='elbowsX' value='576,590,590,604'/><property name='elbowsY' value='252,252,341,341'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_0'/><property name='label' value='viewShipping'/></pageflow-object>",
+    "<pageflow-object id='forward:path#viewConfirm#viewConfirm.do#@action:order.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@'><property name='elbowsX' value='504,390,390,276'/><property name='elbowsY' value='241,241,103,103'/><property name='fromPort' value='West_0'/><property name='toPort' value='East_2'/><property name='label' value='viewConfirm'/></pageflow-object>",
+    "<pageflow-object id='return-to:@forward:returnTo#failure#currentPage#@action:order.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@@'><property name='x' value='700'/><property name='y' value='200'/></pageflow-object>",
+    "<pageflow-object id='forward:returnTo#failure#currentPage#@action:order.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@'><property name='elbowsX' value='576,620,620,664'/><property name='elbowsY' value='263,263,192,192'/><property name='fromPort' value='East_2'/><property name='toPort' value='West_1'/><property name='label' value='failure'/></pageflow-object>",
+    "<pageflow-object id='action-output:creditCardTypes#@forward:path#success#newOrder.jsp#@action:viewCreateOrder.do@@'/>",
+    "<pageflow-object id='action-output:order#@forward:path#success#newOrder.jsp#@action:viewCreateOrder.do@@'/>",
+    "<pageflow-object id='action-output:order#@forward:path#confirm#confirm.jsp#@action:viewConfirm.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@@'/>",
+    "<pageflow-object id='action-output:checkout#@forward:path#confirm#confirm.jsp#@action:viewConfirm.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@@'/>",
+    "<pageflow-object id='action-output:checkout#@forward:path#success#viewOrder.jsp#@action:confirm.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@@'/>",
+    "<pageflow-object id='action-output:order#@forward:path#success#viewOrder.jsp#@action:confirm.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@@'/>",
+    "<pageflow-object id='action-output:order#@forward:path#success#viewOrder.jsp#@action:viewOrder.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@@'/>",
+    "<pageflow-object id='action-output:checkout#@forward:path#success#viewOrder.jsp#@action:viewOrder.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@@'/>",
+    "<pageflow-object id='action-call:@page:newOrder.jsp@#@action:order.do#org.apache.beehive.samples.petstore.forms.CheckoutForm@'><property name='elbowsX' value='136,320,320,504'/><property name='elbowsY' value='292,292,263,263'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_2'/></pageflow-object>",
+    "<pageflow-object id='action-call:@page:shipping.jsp@#@action:shipping.do#org.apache.beehive.samples.petstore.forms.OrderForm@'><property name='elbowsX' value='516,580,580,644'/><property name='elbowsY' value='92,92,61,61'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_0'/></pageflow-object>",
+    "<pageflow-object id='formbean:org.apache.beehive.samples.petstore.forms.CheckoutForm'/>",
+    "<pageflow-object id='formbean:org.apache.beehive.samples.petstore.forms.OrderForm'/>",
+    "</view-properties>"
+})
+interface VIEW_PROPERTIES
+{
+}
+

Added: incubator/beehive/trunk/samples/petstoreWeb/checkout/confirm.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/checkout/confirm.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,39 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib prefix="beehive-petstore" tagdir="/WEB-INF/tags/beehive/petstore" %>
+<netui-data:declarePageInput name="checkout" type="java.lang.Boolean"/>
+<netui-data:declarePageInput name="order" type="org.apache.beehive.samples.petstore.model.Order"/>
+
+
+
+
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="leftnav">
+      <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+      <beehive-petstore:catalogNav action="globalShop" labelValue="${bundle.view.mainMenuLabel}"/>
+    </netui-template:section>
+    <netui-template:section name="body">
+      <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+
+      <netui-data:getData resultId="checkout" value="${pageInput.checkout}"/>
+
+      <netui:errors/><p>
+
+      <br clear="all"/>
+      <p>
+      <center>
+      <netui:span styleClass="boldlabel" value="${bundle.view.confirmMessage}"/>
+      </center>
+      <p>
+      <beehive-petstore:orderSummary order="${pageInput.order}"/>
+      <p>
+      <center>
+      <netui:imageAnchor action="confirm" border="0" src="${pageContext.request.contextPath}/images/button_continue.gif">
+          <netui:parameter name="confirmed" value="true"/>
+      </netui:imageAnchor>
+      </center>
+    </netui-template:section>
+</netui-template:template>

Added: incubator/beehive/trunk/samples/petstoreWeb/checkout/newOrder.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/checkout/newOrder.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,136 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<netui-data:declarePageInput name="order" type="org.apache.beehive.samples.petstore.model.Order"/>
+<netui-data:declarePageInput name="creditCardTypes" type="java.util.List"/>
+
+
+
+
+<netui-template:template templatePage="/site/template.jsp">
+
+    <netui-template:section name="leftnav"> &nbsp; </netui-template:section>
+
+    <netui-template:section name="body">
+
+    <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+    <netui:form action="order">
+        <center>
+        <table border=0 cellpadding=3 cellspacing=1 bgcolor=#FFFF88>
+            <tr bgcolor=#FFFF88>
+                <td colspan=2>
+                <font color=green size=4><B>${bundle.view.paymentDetailsLabel}</B></font>
+                </td>
+            </tr>
+            <tr bgcolor=#FFFF88>
+                <td>${bundle.view.cardTypeLabel}:
+                </td>
+                <td>
+                <netui:select dataSource="actionForm.order.cardType" optionsDataSource="${pageInput.creditCardTypes}"/>
+                </td>
+            </tr>
+            <tr bgcolor=#FFFF88>
+                <td>${bundle.view.cardNumberLabel}:
+                </td>
+                <td>
+                <netui:textBox dataSource="actionForm.order.creditCard"/>
+                <br/>
+                <netui:error value="creditCard"/>
+                <font color=red size=2>Note, be sure to use an invalid number.</font></td>
+            </tr>
+            <tr bgcolor=#FFFF88>
+                <td>${bundle.view.expirationDateLabel}:
+                </td>
+                <td>
+                <netui:textBox dataSource="actionForm.order.exprDate"/>
+                </td>
+            </tr>
+            <tr bgcolor=#FFFF88>
+                <td colspan=2><font color=green size=4><B>${bundle.view.billingAddressLabel}</B></font></td>
+            </tr>
+            <tr bgcolor=#FFFF88>
+                <td>${bundle.view.firstNameLabel}:
+                </td>
+                <td>
+                <netui:textBox size="40" dataSource="actionForm.order.billingAddress.firstName"/>
+                <br/>
+                <netui:error value="billToFirstName"/>
+                </td>
+            </tr>
+            <tr bgcolor=#FFFF88>
+                <td>${bundle.view.lastNameLabel}:
+                </td>
+                <td>
+                <netui:textBox size="40" dataSource="actionForm.order.billingAddress.lastName"/>
+                <br/>
+                <netui:error value="billToLastName"/>
+                </td>
+            </tr>
+            <tr bgcolor=#FFFF88>
+                <td>${bundle.view.address1Label}:
+                </td>
+                <td>
+                <netui:textBox size="40" dataSource="actionForm.order.billingAddress.addr1"/>
+                <br/>
+                <netui:error value="billToAddress1"/>
+                </td>
+            </tr>
+            <tr bgcolor=#FFFF88>
+                <td>${bundle.view.address2Label}:
+                </td>
+                <td>
+                <netui:textBox size="40" dataSource="actionForm.order.billingAddress.addr2"/>
+                <br/>
+                <netui:error value="billToAddress2"/>
+                </td>
+            </tr>
+            <tr bgcolor=#FFFF88>
+                <td>${bundle.view.cityLabel}:
+                </td>
+                <td>
+                <netui:textBox size="20" dataSource="actionForm.order.billingAddress.city"/>
+                <br/>
+                <netui:error value="billToCity"/>
+                </td>
+            </tr>
+            <tr bgcolor=#FFFF88>
+                <td>${bundle.view.stateLabel}:
+                </td>
+                <td>
+                <netui:textBox size="4" dataSource="actionForm.order.billingAddress.state"/>
+                <br/>
+                <netui:error value="billToState"/>
+                </td>
+            </tr>
+            <tr bgcolor=#FFFF88>
+                <td>${bundle.view.zipLabel}:
+                </td>
+                <td>
+                <netui:textBox size="10" dataSource="actionForm.order.billingAddress.zip"/>
+                <br/>
+                <netui:error value="billToZip"/>
+                </td>
+            </tr>
+            <tr bgcolor=#FFFF88>
+                <td>${bundle.view.countryLabel}:
+                </td>
+                <td>
+                <netui:textBox size="15" dataSource="actionForm.order.billingAddress.country"/>
+                <br/>
+                <netui:error value="billToCountry"/>
+                </td>
+            </tr>
+            <tr bgcolor=#FFFF88>
+                <td colspan=2>
+                <netui:checkBox dataSource="actionForm.shippingAddressRequired"/>
+                ${bundle.view.shipToDifferentAddressMessage}
+                </td>
+            </tr>
+        </table>
+        <p/>
+        <netui:imageButton align="center" src="${pageContext.request.contextPath}/images/button_submit.gif"/>
+        </center>
+        </netui:form>
+    </netui-template:section>
+</netui-template:template>

Added: incubator/beehive/trunk/samples/petstoreWeb/checkout/shipping.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/checkout/shipping.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,56 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="body">
+      <netui:errors/>
+      <netui:form action="shipping">
+          <table class="tablegreen">
+            <tr class="rowyellow">
+              <td colspan=2>
+                <font color=green size=4><B>Shipping Address</B></font>
+              </td>
+            </tr>
+            <tr class="rowyellow">
+              <td>First name:</td>
+              <td><netui:textBox dataSource="actionForm.order.shippingAddress.firstName"/></td>
+            </tr>
+            <tr class="rowyellow">
+              <td>Last name:</td>
+              <td><netui:textBox dataSource="actionForm.order.shippingAddress.lastName"/></td>
+            </tr>
+            <tr class="rowyellow">
+              <td>Address 1:</td>
+              <td><netui:textBox size="40" dataSource="actionForm.order.shippingAddress.addr1"/></td>
+            </tr>
+            <tr class="rowyellow">
+              <td>Address 2:</td>
+              <td><netui:textBox size="40" dataSource="actionForm.order.shippingAddress.addr2"/></td>
+            </tr>
+            <tr class="rowyellow">
+              <td>City: </td>
+              <td><netui:textBox dataSource="actionForm.order.shippingAddress.city"/></td>
+            </tr>
+            <tr class="rowyellow">
+              <td>State:</td>
+              <td><netui:textBox dataSource="actionForm.order.shippingAddress.state" size="4"/></td>
+            </tr>
+            <tr class="rowyellow">
+              <td>Zip:</td>
+              <td><netui:textBox size="10" dataSource="actionForm.order.shippingAddress.zip"/></td>
+            </tr>
+            <tr class="rowyellow">
+              <td>Country: </td>
+              <td><netui:textBox size="15" dataSource="actionForm.order.shippingAddress.country"/></td>
+            </tr>
+          </table>
+          <P>
+          <center>
+            <netui:imageButton src="${pageContext.request.contextPath}/images/button_submit.gif"/>
+          </center>
+          </p>
+      </netui:form>
+    </netui-template:section>
+</netui-template:template>

Added: incubator/beehive/trunk/samples/petstoreWeb/checkout/viewCart.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/checkout/viewCart.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,81 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<%@ taglib prefix="beehive-petstore" tagdir="/WEB-INF/tags/beehive/petstore" %>
+
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="leftnav">
+        <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+        <beehive-petstore:catalogNav action="globalViewCart" labelValue="${bundle.view.shoppingCartLabel}"/>
+    </netui-template:section>
+
+    <netui-template:section name="body">
+
+    <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+    <netui:errors/>
+    <center>
+    <netui:span styleClass="boldlabel" value="${bundle.view.checkoutSummaryLabel}"/>
+    <br/>
+    <br/>
+    <table class="tablegreen">
+        <tr class="rowgrey">
+            <td class="celldata"><b>${bundle.view.itemIdLabel}</b></td>
+            <td class="celldata"><b>${bundle.view.productIdLabel}</b></td>
+            <td class="celldata"><b>${bundle.view.descriptionLabel}</b></td>
+            <td class="celldata"><b>${bundle.view.inStockLabel}</b></td>
+            <td class="celldata"><b>${bundle.view.quantityLabel}</b></td>
+            <td class="celldata"><b>${bundle.view.listPriceLabel}</b></td>
+            <td class="celldata"><b>${bundle.view.totalCostLabel}</b></td>
+        </tr>
+        <netui-data:repeater dataSource="sharedFlow.cart.lineItems">
+            <tr class="rowyellow">
+                <td class="celldata">
+                <b>
+                <netui:anchor href="viewItem.do">
+                    <netui:parameter name="itemId" value="${container.item.item.itemId}"/>
+                    <netui:span value="${container.item.item.itemId}"/>
+                </netui:anchor>
+                </b>
+                </td>
+                <td class="celldata">
+                <netui:span value="${container.item.item.productId}"/>
+                </td>
+                <td class="celldata">
+                <netui:span value="${container.item.item.attr1}"/>
+                <netui:span value="${container.item.item.attr2}"/>
+                <netui:span value="${container.item.item.attr3}"/>
+                <netui:span value="${container.item.item.attr4}"/>
+                <netui:span value="${container.item.item.attr5}"/>
+                <netui:span value="${container.item.item.product.name}"/>
+                </td>
+                <td align="center">
+                <netui:span value="${container.item.inStock}"/>
+                </td>
+                <td align="center">
+                <netui:span value="${container.item.quantity}"/>
+                </td>
+                <td align="right">
+                <netui:span value="${container.item.item.listPrice}">
+                <netui:formatNumber pattern="${bundle.view.priceFormat}"/>
+                </netui:span>
+                </td>
+                <td align="right">
+                <netui:span value="${container.item.total}">
+                <netui:formatNumber pattern="${bundle.view.priceFormat}"/>
+                </netui:span>
+                </td>
+            </tr>
+        </netui-data:repeater>
+        <tr class="rowyellow">
+            <td class="celldata" colspan="7" align="right">
+            <b>Sub Total: <netui:span value="${sharedFlow.cart.subTotal}">
+            <netui:formatNumber pattern="${bundle.view.priceFormat}"/>
+            </netui:span> </b> <br/>
+            </td>
+        </tr>
+    </table>
+    <br/>
+    <netui:imageAnchor action="viewCreateOrder" border="0" src="${pageContext.request.contextPath}/images/button_continue.gif"/>
+    </center> </netui-template:section>
+</netui-template:template>

Added: incubator/beehive/trunk/samples/petstoreWeb/checkout/viewOrder.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/checkout/viewOrder.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,29 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib prefix="beehive-petstore" tagdir="/WEB-INF/tags/beehive/petstore" %>
+
+<netui-data:declarePageInput name="order" type="org.apache.beehive.samples.petstore.model.Order"/>
+<netui-data:declarePageInput name="checkout" type="java.lang.Boolean"/>
+
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="leftnav">
+      <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+      <beehive-petstore:catalogNav action="globalShop" labelValue="${bundle.view.mainMenuLabel}"/>
+    </netui-template:section>
+    <netui-template:section name="body">
+      <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+      <br/>
+      <br/>
+      <c:if test="${pageInput.checkout != null}">
+        <center>
+          <b>${bundle.view.orderSubmittedMessage}</b>
+        </center>
+      </c:if>
+      <br/>
+      <br/>
+      <beehive-petstore:orderSummary order="${pageInput.order}"/>
+    </netui-template:section>
+</netui-template:template>

Added: incubator/beehive/trunk/samples/petstoreWeb/error.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/error.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,69 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<netui:html>
+  <head>
+    <title>NetUI Error</title>
+    <style>
+    table {
+        border: solid 1pt #90180F;
+        background-color: #ffffff;
+    }
+    body {
+        margin: 20pt 5%;
+        background-color: #fdf4b6;
+        font-family: Arial, Helvetica, sans-serif;
+        font-size: 10pt;
+    }
+    .caption {
+        font-weight: bold;
+        font-size: 20pt;
+        text-align: left;
+        width: 500px
+    }
+    th {vertical-align: top;
+        text-align: right;
+        font-size: 12pt;
+        color: #90180F;
+        width: 100px;
+    }
+    td {
+        text-align: left;
+        }
+    hr {
+        color: #90180F;
+    }
+    .posTitle {
+        position: relative; 
+        color: #6C0C06;
+        left: -160pt; 
+        top: -12pt; 
+    }
+    .pfErrorLineOne {
+        color: red;
+        font-size: 12pt;
+        font-style: italic;
+    }
+    img {
+        border: solid 2pt #90180F;
+    }
+    </style>
+    <netui:base/>
+  </head>
+  <netui:body>
+    <div class="caption">
+    <netui:image src="${pageContext.request.contextPath}/images/error-header.jpg" width="338" height="96" alt="Page Flow Error"/>
+    <span class="posTitle">NetUI Error</span>
+    </div>
+    <table border="0" cellspacing='0' cellpadding='4'>
+       <c:if test="${request.errorMessage != null}">
+            <tr><th>Message:</th><td class="pfErrorLineOne"><netui:label value="${request.errorMessage}" defaultValue="&nbsp;"/></td></tr>
+       </c:if> 
+       <tr><th>Exception:</th><td class="pfErrorLineOne"><netui:exceptions showMessage="true"/></td></tr> 
+       <tr><td colspan="2" style="min-width:342"><hr></td></tr>     
+       <tr><th>Stack Trace:</th><td><netui:exceptions showMessage="false" showDevModeStackTrace="true"/></td></tr>
+    </table>      
+  </netui:body>
+</netui:html>
+<%-- Some browsers will not display this page unless the response status code is 200. --%>
+<% response.setStatus(200); %>

Added: incubator/beehive/trunk/samples/petstoreWeb/help.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/help.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,19 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="leftnav">
+        &nbsp;
+    </netui-template:section>
+    <netui-template:section name="body">
+    <table border=0 cellSpacing=0 height="85%" width="100%">
+        <tbody>
+            <tr>
+                <td>This space intentionall left blank.</td>
+            </tr>
+        </tbody>
+    </table>
+    </netui-template:section>
+</netui-template:template>

Added: incubator/beehive/trunk/samples/petstoreWeb/images/beehive_logo.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/birds_icon.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/bkg-topbar.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/button_add_to_cart.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/button_checkout.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/button_continue.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/button_previous.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/button_register_now.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/button_remove.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/button_submit.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/button_update_cart.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/cart.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/cats_icon.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/dogs_icon.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/error-header.jpg
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/fish_icon.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/help.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/my_account.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/reptiles_icon.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/search.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/separator.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/sign-in.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/sign-out.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/sign-outHL.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/sm_birds.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/sm_cats.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/sm_dogs.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/sm_fish.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/images/sm_reptiles.gif
==============================================================================
Binary file. No diff available.

Added: incubator/beehive/trunk/samples/petstoreWeb/index.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/index.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,38 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<%@ taglib prefix="beehive-petstore" tagdir="/WEB-INF/tags/beehive/petstore" %>
+
+<netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+
+<netui:html>
+    <head>
+        <title>
+            ${bundle.view.indexTitle}
+        </title>
+        <link rel="stylesheet" href="${pageContext.request.contextPath}/site/default.css" type="text/css"/>
+        <meta content="text/html; charset=windows-1252" http-equiv=Content-Type>
+    </head>
+    <netui:body>
+        <beehive-petstore:headerMenu contextPath="${pageContext.request.contextPath}"/>
+        <center>
+        <table border=0 cellSpacing=100 width="100%">
+            <tbody>
+                <tr>
+                    <td width=100%>
+                    <p align="center">
+                    <netui:span styleClass="boldlabel" value="${bundle.view.welcome}"/>
+                    <br/>
+                    <netui:anchor href="shop/Controller.jpf">
+                        ${bundle.view.enterTheStore}
+                    </netui:anchor>
+                    </p>
+                    </td>
+                </tr>
+            </tbody>
+        </table>
+        </center>
+        <beehive-petstore:copyright contextPath="${pageContext.request.contextPath}"/>
+    </netui:body>
+</netui:html>

Added: incubator/beehive/trunk/samples/petstoreWeb/petstore.jws
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/petstore.jws	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,223 @@
+/*
+ * petstore.jws
+ * 
+ * Copyright 2001-2004 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
+ *
+ * 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.
+ * 
+ * 
+ * Original author: Jonathan Colwell
+ */
+
+import java.awt.Image;
+import java.net.URL;
+import java.math.BigDecimal;
+import java.util.Date;
+import javax.imageio.ImageIO;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPMessageHandler;
+import javax.jws.soap.SOAPMessageHandlers;
+
+import javax.servlet.ServletContext;
+import javax.xml.rpc.server.ServletEndpointContext;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.Constants;
+import org.apache.axis.MessageContext;
+import org.apache.axis.attachments.ImageDataSource;
+
+import org.apache.beehive.controls.api.bean.Control;
+
+import org.apache.beehive.samples.petstore.controls.CatalogControlBean;
+import org.apache.beehive.samples.petstore.model.Category;
+import org.apache.beehive.samples.petstore.model.Item;
+import org.apache.beehive.samples.petstore.model.Product;
+
+import org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
+
+/*******************************************************************************
+ * A WebService implementation of the Pet Store sample
+ *
+ * @author Jonathan Colwell
+ */
+@WebService(name = "PetStoreInventoryManager",
+            serviceName = "PetStoreInventoryManagementService",
+            targetNamespace = 
+            "http://beehive.apache.org/PetStoreInventoryManager")
+//@SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.ENCODED)
+public class petstore {
+
+    @Control
+    public CatalogControlBean catalogBean;
+
+    /*
+     * Made public to show that @WebMethod really controls which 
+     * methods are exposed as opposed to all public methods in 
+     * standard AXIS .jws files.
+     */
+    public CatalogControlBean getCatalogBean()
+    {
+        try {
+            if (catalogBean == null) {
+                catalogBean = (CatalogControlBean)java.beans.Beans
+                    .instantiate(getClass().getClassLoader(),
+                                 CatalogControlBean.class.getName());
+            }
+            else {
+                System.out.println("AutoInstantiation for controls is in effect");
+            }
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+         
+        }
+
+        return catalogBean;
+    }
+
+
+    private Image obtainImage(String imagePath)
+    {
+
+        ServletEndpointContext sec = (ServletEndpointContext)
+            MessageContext.getCurrentContext()
+            .getProperty(Constants.MC_SERVLET_ENDPOINT_CONTEXT);
+        if (null == sec) {
+            System.out.println("null ServletEndpointContext");
+        }
+        else {
+            try {
+                ServletContext sc = sec.getServletContext();
+                if (null == sc) {
+                    System.out.println("null ServletContext");
+                }
+                else {
+                    /*
+                     * FIXME jcolwell@bea.com 2004-Oct-05 -- shouldn't hard
+                     * code "/images/" into the path, change to an init param.
+                     */
+                    URL imageURL = sc.getResource("/images/" + imagePath);
+                    if (null != imageURL) {
+                        return ImageIO.read(imageURL);
+                    }
+                }
+            }
+            catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
+
+    @WebMethod(action = "listProducts")
+    @WebResult(name = "ProductList")
+    public org.apache.beehive.samples.petstore.model.ws.Product[] listProducts
+        (@WebParam(name = "categoryId")String categoryId)
+    {
+        CatalogControlBean ccb = getCatalogBean();
+        Product[] prods = ccb.getProductListByCategory(categoryId);
+        org.apache.beehive.samples.petstore.model.ws.Product[] outProds = 
+            new org.apache.beehive.samples.petstore.model.ws.Product[prods.length];
+        for (int j = 0; j < prods.length ; j++) {
+            // NOTE jcolwell@bea.com 2004-Oct-08 -- adding images as attachments
+            Image img = obtainImage(prods[j].getImage());
+            outProds[j] = new org.apache.beehive.samples.petstore.model.ws.Product(prods[j],
+                                                               img);
+        }
+        return outProds;
+    }
+
+
+    @WebMethod(action = "listItems")
+    @WebResult(name = "ItemList")
+    public Item[] listItems(@WebParam(name = "productId") String productId)
+    {
+        Item[] items = getCatalogBean().getItemListByProduct(productId);
+        if (items == null) {
+            items = new Item[0];
+        }
+        return items;
+    }
+ 
+   
+    @WebMethod(action = "listCategories")
+    @WebResult(name = "CategoryList")
+    public org.apache.beehive.samples.petstore.model.ws.Category[] listCategories()
+    {
+        System.out.println("listing categories");
+        try {
+            Category[] categories = getCatalogBean().getCategoryList();
+            if (categories != null && categories.length > 0) {
+                System.out.println("got " + categories.length + " categories");
+                org.apache.beehive.samples.petstore.model.ws.Category[] outCats = 
+                    new org.apache.beehive.samples.petstore.model.ws.Category[categories.length];
+            
+                for (int j = 0; j < categories.length ; j++) {
+                    // NOTE jcolwell@bea.com 2004-Oct-08 -- adding inline images
+                    Image img = obtainImage(categories[j].getImage());
+                    outCats[j] = new org.apache.beehive.samples.petstore.model.ws.Category
+                        (categories[j], img);
+                }
+                System.out.println("returning " + outCats.length + " categories");
+                return outCats;
+            }
+            else {
+                System.out.println("got no categories");
+            }
+        }
+        catch (Throwable e) {
+            e.printStackTrace();
+        }
+        return new org.apache.beehive.samples.petstore.model.ws.Category[0];
+    }
+
+    @WebMethod(action = "restockItem")
+    public void restockItem(@WebParam(name = "itemId") String itemId,
+                            @WebParam(name = "quantity") int quantity)
+        throws org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException
+    {
+        CatalogControlBean ccb = getCatalogBean();
+
+        ccb.updateItemQuantity(ccb.getItem(itemId), -quantity);
+    }
+
+    /*
+     * NOTE jcolwell@bea.com 2004-Oct-05 -- a set price method should probably 
+     * be added to the catalog control for the web service to call rather than
+     * having the web service directly manipulate the Item.
+     */
+    @WebMethod(action = "setItemListPrice")
+    public void setItemListPrice
+        (@WebParam(name = "itemId") String itemId,
+         @WebParam(name = "listPrice") BigDecimal listPrice)
+        throws org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException
+    {
+     
+        Item i = getCatalogBean().getItem(itemId);
+        if (i != null) {
+            i.setListPrice(listPrice);
+        }
+        else {
+            throw new org.apache.beehive.samples.petstore.controls.exceptions.
+                InvalidIdentifierException
+                ("A price cannot be set for a null Item");
+        }
+    }
+}

Added: incubator/beehive/trunk/samples/petstoreWeb/search/Controller.jpf
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/search/Controller.jpf	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package search;
+
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+
+import org.apache.beehive.samples.petstore.forms.SearchForm;
+import org.apache.beehive.samples.petstore.model.Product;
+import org.apache.beehive.samples.petstore.controls.CatalogControl;
+
+@Jpf.Controller(
+    nested = true
+)
+public class Controller extends PageFlowController
+{
+    @org.apache.beehive.controls.api.bean.Control()
+    private CatalogControl _catalogControl;
+
+    @Jpf.Action(
+        forwards = { 
+            @Jpf.Forward(name = "success", path = "index.jsp",
+                         actionOutputs = { 
+                             @Jpf.ActionOutput(name = "searchResults",
+                                               type = org.apache.beehive.samples.petstore.model.Product[].class,
+                                               required = false)
+                         })
+        }
+    )
+    protected Forward begin(SearchForm form)
+    {
+        Product[] searchResults = _catalogControl.searchProductList(form.getKeyword());
+        
+        return new Forward("success", "searchResults", searchResults);
+    }
+
+    @Jpf.Action(
+        forwards = { 
+            @Jpf.Forward(name = "done", returnAction = "begin")
+        }
+    )
+    public Forward done()
+    {
+        return new Forward("done");
+    }
+}
+@Jpf.ViewProperties(value = {
+    "<!-- This data is auto-generated. Hand-editing this section is not recommended. -->",
+    "<view-properties>",
+    "<pageflow-object id='pageflow:/search/Controller.jpf'/>",
+    "<pageflow-object id='page:index.jsp'>",
+    "  <property value='240' name='x'/>",
+    "  <property value='100' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='action:globalViewProductById.do'><property name='x' value='240'/><property name='y' value='220'/></pageflow-object>",
+    "<pageflow-object id='action:done.do'>",
+    "  <property value='400' name='x'/>",
+    "  <property value='100' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='action-call:@page:index.jsp@#@action:globalViewProductById.do@'><property name='elbowsX' value='240,240,240,240'/><property name='elbowsY' value='144,160,160,176'/><property name='fromPort' value='South_1'/><property name='toPort' value='North_1'/></pageflow-object>",
+    "<pageflow-object id='action-call:@page:index.jsp@#@action:done.do@'><property name='elbowsX' value='276,320,320,364'/><property name='elbowsY' value='92,92,92,92'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/></pageflow-object>",
+    "<pageflow-object id='action:begin.do#org.apache.beehive.samples.petstore.forms.SearchForm'><property name='x' value='60'/><property name='y' value='100'/></pageflow-object>",
+    "<pageflow-object id='control:org.apache.beehive.samples.petstore.controls.CatalogControl#_catalogControl'/>",
+    "<pageflow-object id='exit:begin'>",
+    "  <property value='560' name='x'/>",
+    "  <property value='100' name='y'/>",
+    "</pageflow-object>",
+    "<pageflow-object id='forward:returnAction#done#begin#@action:done.do@'><property value='436,480,480,524' name='elbowsX'/><property value='92,92,92,92' name='elbowsY'/><property value='East_1' name='fromPort'/><property value='West_1' name='toPort'/><property value='done' name='label'/></pageflow-object>",
+    "<pageflow-object id='forward:path#success#index.jsp#@action:begin.do#org.apache.beehive.samples.petstore.forms.SearchForm@'><property name='elbowsX' value='96,150,150,204'/><property name='elbowsY' value='92,92,92,92'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='formbean:org.apache.beehive.samples.petstore.forms.SearchForm'/>",
+    "<pageflow-object id='action-output:searchResults#@forward:path#success#index.jsp#@action:begin.do#org.apache.beehive.samples.petstore.forms.SearchForm@@'/>",
+    "</view-properties>"
+})
+interface VIEW_PROPERTIES
+{
+}
+

Added: incubator/beehive/trunk/samples/petstoreWeb/search/index.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/search/index.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,63 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<netui-data:declarePageInput name="searchResults" type="org.apache.beehive.samples.petstore.model.Product[]" required="false"/>
+
+
+
+
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="leftnav">
+        &nbsp;
+    </netui-template:section>
+    <netui-template:section name="body">
+    
+    <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+    <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.search" name="search"/>
+
+    <center>
+    <netui:span styleClass="boldlabel" value="${bundle.search.searchResultsLabel}"/>
+
+    <netui-data:repeater dataSource="pageInput.searchResults" defaultText="${bundle.search.noSearchResults}">
+        <netui-data:repeaterHeader>
+            <table class="tablegreen">
+                <tr class="rowgrey">
+                    <td>&nbsp;</td>
+                    <td><b>${bundle.view.productIdLabel}</b></td>
+                    <td><b>${bundle.view.nameLabel}</b></td>
+                    <td><b>${bundle.view.descriptionLabel}</b></td>
+                </tr>
+            </netui-data:repeaterHeader>
+        <netui-data:repeaterItem>
+            <tr class="rowyellow">
+                <td class="celldata">
+                    <netui:imageAnchor action="globalViewProductById"border="0" src="${pageContext.request.contextPath}/images/${container.item.image}">
+                        <netui:parameter name="productId" value="${container.item.productId}"/>
+                    </netui:imageAnchor>                        
+                </td>
+                <td class="celldata">
+                    <b>
+                    <netui:anchor action="globalViewProductById">
+                        <netui:parameter name="productId" value="${container.item.productId}"/>
+                        <font color="black"><netui:span value="${container.item.productId}"/></font>
+                    </netui:anchor>
+                    </b>
+                </td>
+                <td class="celldata">
+                    <netui:span value="${container.item.name}"/>
+                </td>
+                <td class="celldata">
+                    <netui:span value="${container.item.description}"/>
+               </td>
+            </tr>
+        </netui-data:repeaterItem>
+        <netui-data:repeaterFooter>
+          </table>
+        </netui-data:repeaterFooter>
+    </netui-data:repeater>
+    </p>
+    <netui:anchor action="done">${bundle.search.searchDoneLabel}</netui:anchor>
+    </center>
+    </netui-template:section>
+</netui-template:template>

Added: incubator/beehive/trunk/samples/petstoreWeb/shop/Controller.jpf
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/shop/Controller.jpf	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,352 @@
+/*
+ * Copyright 2004 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
+ *
+ * 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:$
+ */
+package shop;
+
+import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.beehive.netui.pageflow.FormData;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+import org.apache.beehive.samples.petstore.controls.CatalogControl;
+import org.apache.beehive.samples.petstore.model.Cart;
+import org.apache.beehive.samples.petstore.model.Category;
+import org.apache.beehive.samples.petstore.model.Item;
+import org.apache.beehive.samples.petstore.model.LineItem;
+import org.apache.beehive.samples.petstore.model.Product;
+
+import org.apache.struts.action.ActionError;
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.action.ActionMapping;
+
+@Jpf.Controller(
+    forwards = { 
+        @Jpf.Forward(name = "cart", path = "cart.jsp"), 
+        @Jpf.Forward(name = "viewCart", path = "viewCart.do")
+    },
+    simpleActions={
+        @Jpf.SimpleAction(name="checkout", path="/checkout/Controller.jpf")
+    }
+)
+public class Controller
+    extends PageFlowController
+{
+    @Jpf.SharedFlowField
+    private webappRoot.SharedFlow _sharedFlow = null;
+
+    @org.apache.beehive.controls.api.bean.Control()
+    private CatalogControl _catalogControl;
+
+    // @todo: this should be shared for all users
+    private Category[] _categories; // the list of categories
+
+    private Category _currentCategory; // the current category being viewed
+    private Product _currentProduct; // the current product being viewed
+    private Item _currentItem; // the current item being viewed
+
+    private CartForm _cartForm;
+
+    protected void onCreate()
+    {
+        _cartForm = new CartForm();
+        _cartForm.setCart(_sharedFlow.getCart());
+    }
+
+    @Jpf.Action(
+        forwards = { 
+            @Jpf.Forward(name = "success", path = "index.jsp",
+                         actionOutputs = { 
+                             @Jpf.ActionOutput(name = "categories",
+                                               type = org.apache.beehive.samples.petstore.model.Category[].class,
+                                               required = true)
+                         })
+        }
+    )
+    protected Forward begin()
+    {
+        if(_categories == null)
+            _categories = _catalogControl.getCategoryList();
+
+        return new Forward("success", "categories", _categories);
+    }
+
+    @Jpf.Action(
+        forwards = { 
+            @Jpf.Forward(name = "category", path = "category.jsp",
+                         actionOutputs = { 
+                             @Jpf.ActionOutput(name = "category",
+                                               type = org.apache.beehive.samples.petstore.model.Category.class,
+                                               required = true),
+                             @Jpf.ActionOutput(name = "products",
+                                               type = org.apache.beehive.samples.petstore.model.Product[].class,
+                                               required = false)
+                         })
+        }
+    )
+    protected Forward viewCategory()
+    {
+        String categoryId = getRequest().getParameter("catId");
+
+        if(categoryId == null || categoryId.equals(""))
+            throw new IllegalStateException("Found a null catId executing action viewCategory");
+
+        _currentCategory = _catalogControl.getCategory(categoryId);
+        Product[] productArray = _catalogControl.getProductListByCategory(categoryId);
+
+        Forward forward = new Forward("category");
+        forward.addActionOutput("products", productArray);
+        forward.addActionOutput("category", _currentCategory);
+        return forward;
+    }
+
+    @Jpf.Action(
+        forwards = { 
+            @Jpf.Forward(name = "product", path = "product.jsp",
+                         actionOutputs = { 
+                             @Jpf.ActionOutput(name = "product",
+                                               type = org.apache.beehive.samples.petstore.model.Product.class,
+                                               required = true),
+                             @Jpf.ActionOutput(name = "items",
+                                               type = org.apache.beehive.samples.petstore.model.Item[].class,
+                                               required = true)
+                         })
+        }
+    )
+    protected Forward viewProduct()
+    {
+        String productId = getRequest().getParameter("productId");
+
+        if(productId == null || productId.equals(""))
+            throw new IllegalStateException("Found a null productId executing action viewProduct");
+
+        _currentProduct = _catalogControl.getProduct(productId);
+        Item[] items = _catalogControl.getItemListByProduct(productId);
+
+        Forward f = new Forward("product");
+        f.addActionOutput("product", _currentProduct);
+        f.addActionOutput("items", items);
+        return f;
+    }
+
+    /**
+     */
+    @Jpf.Action(
+        forwards = { 
+            @Jpf.Forward(name = "item", path = "item.jsp",
+                         actionOutputs = { 
+                             @Jpf.ActionOutput(name = "product",
+                                               type = org.apache.beehive.samples.petstore.model.Product.class,
+                                               required = true),
+                             @Jpf.ActionOutput(name = "item",
+                                               type = org.apache.beehive.samples.petstore.model.Item.class,
+                                               required = true)
+                         })
+        }
+    )
+    protected Forward viewItem()
+    {
+        String itemId = getRequest().getParameter("itemId");
+
+        if(itemId == null || itemId.equals(""))
+            throw new IllegalStateException("Found a null itemId executing action viewProduct");
+
+        _currentItem = _catalogControl.getItem(itemId);
+        _currentProduct = _catalogControl.getProduct(_currentItem.getProductId());
+
+        Forward f = new Forward("item");
+        f.addActionOutput("item", _currentItem);
+        f.addActionOutput("product", _currentProduct);
+        return f;
+    }
+
+    @Jpf.Action(useFormBean = "_cartForm",
+                forwards = { 
+                    @Jpf.Forward(name = "success",
+                                 path = "cart.jsp",
+                                 actionOutputs = { 
+                                     @Jpf.ActionOutput(name = "myList",
+                                                       type = org.apache.beehive.samples.petstore.model.Product[].class,
+                                                       required = false)
+                                 }),
+                    @Jpf.Forward(name="cart", path="cart.jsp")
+                })
+    protected Forward addItemToCart(CartForm form)
+    {
+        Cart cart = form.getCart();
+        if (cart.containsItemId(form.getWorkingItemId()))
+        {
+            cart.incrementQuantityByItemId(form.getWorkingItemId());
+        }
+        else
+        {
+            Item toAddItem = _catalogControl.getItem(form.getWorkingItemId());
+            if (toAddItem != null)
+            {
+                toAddItem.setProduct(_currentProduct);
+                cart.addItem(toAddItem);
+            }
+            // @todo: error handling path
+        }
+
+        return new Forward("cart", "product", _currentProduct);
+    }
+
+    @Jpf.Action(useFormBean = "_cartForm", forwards={@Jpf.Forward(name="cart", path="cart.jsp")})
+    protected Forward viewCart(CartForm form)
+    {
+        return new Forward("cart");
+    }
+
+    @Jpf.Action(useFormBean = "_cartForm",
+                forwards = { 
+                    @Jpf.Forward(name = "cart",
+                                 path = "cart.jsp",
+                                 actionOutputs = { 
+                                     @Jpf.ActionOutput(name = "myList",
+                                                       type = org.apache.beehive.samples.petstore.model.Product[].class,
+                                                       required = false)
+                                 })
+                })
+    protected Forward updateCartQuantities(CartForm form)
+    {
+        return new Forward("cart", "product", _currentProduct);
+    }
+
+    @Jpf.Action(useFormBean = "_cartForm",
+                forwards = { 
+                    @Jpf.Forward(name = "success",
+                                 path = "cart.jsp",
+                                 actionOutputs = { 
+                                     @Jpf.ActionOutput(name = "myList",
+                                                       type = org.apache.beehive.samples.petstore.model.Product[].class,
+                                                       required = false)
+                                 }),
+                    @Jpf.Forward(name="cart", path="cart.jsp")
+                })
+    protected Forward removeItemFromCart(CartForm form)
+    {
+        if(_cartForm.getCart().containsItemId(form.getWorkingItemId()))
+            _cartForm.getCart().removeItemById(form.getWorkingItemId());
+
+        return new Forward("cart", "product", _currentProduct);
+    }
+
+    /**
+     *
+     */
+    public static class CartForm
+        extends FormData
+    {
+        private String _workingItemId;
+        private Cart _cart;
+
+        public void setCart(Cart cart)
+        {
+            _cart = cart;
+        }
+
+        public Cart getCart()
+        {
+            return _cart;
+        }
+
+        public void setWorkingItemId(String workingItemId)
+        {
+            _workingItemId = workingItemId;
+        }
+
+        public String getWorkingItemId()
+        {
+            return _workingItemId;
+        }
+
+        public void reset(ActionMapping mapping, HttpServletRequest request)
+        {
+            super.reset(mapping, request);
+
+            _workingItemId = null;
+        }
+
+        public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
+        {
+            ActionErrors errors = new ActionErrors();
+
+            List<LineItem> items = getCart().getLineItems();
+            if(items != null && items.size() > 0)
+            {
+                for(int i = 0; i < items.size(); i++)
+                {
+                    errors.add("invalidQuantity" + i, new ActionError("order.error.invalidQuantity"));
+                }
+            }
+            
+            return errors;
+        }
+    }
+}
+
+@Jpf.ViewProperties(value = {
+    "<!-- This data is auto-generated. Hand-editing this section is not recommended. -->",
+    "<view-properties>",
+    "<pageflow-object id='pageflow:/shop/Controller.jpf'/>",
+    "<pageflow-object id='page:cart.jsp'><property name='x' value='340'/><property name='y' value='340'/></pageflow-object>",
+    "<pageflow-object id='page:category.jsp'><property name='x' value='260'/><property name='y' value='180'/></pageflow-object>",
+    "<pageflow-object id='page:index.jsp'><property name='x' value='260'/><property name='y' value='80'/></pageflow-object>",
+    "<pageflow-object id='page:item.jsp'><property name='x' value='660'/><property name='y' value='500'/></pageflow-object>",
+    "<pageflow-object id='page:product.jsp'><property name='x' value='660'/><property name='y' value='180'/></pageflow-object>",
+    "<pageflow-object id='formbean:CartForm'/>",
+    "<pageflow-object id='action:begin.do'><property name='x' value='60'/><property name='y' value='80'/></pageflow-object>",
+    "<pageflow-object id='action:viewCategory.do'><property name='x' value='60'/><property name='y' value='180'/></pageflow-object>",
+    "<pageflow-object id='action:viewProduct.do'><property name='x' value='480'/><property name='y' value='180'/></pageflow-object>",
+    "<pageflow-object id='action:viewItem.do'><property name='x' value='660'/><property name='y' value='340'/></pageflow-object>",
+    "<pageflow-object id='action:addItemToCart.do#shop.Controller.CartForm'><property name='x' value='160'/><property name='y' value='340'/></pageflow-object>",
+    "<pageflow-object id='action:viewCart.do#shop.Controller.CartForm'><property name='x' value='60'/><property name='y' value='500'/></pageflow-object>",
+    "<pageflow-object id='action:updateCartQuantities.do#shop.Controller.CartForm'><property name='x' value='340'/><property name='y' value='500'/></pageflow-object>",
+    "<pageflow-object id='action:removeItemFromCart.do#shop.Controller.CartForm'><property name='x' value='500'/><property name='y' value='500'/></pageflow-object>",
+    "<pageflow-object id='control:org.apache.beehive.samples.petstore.controls.CatalogControl#_catalogControl'/>",
+    "<pageflow-object id='forward:path#cart#cart.jsp'/>",
+    "<pageflow-object id='forward:path#viewCart#viewCart.do'/>",
+    "<pageflow-object id='forward:path#success#index.jsp#@action:begin.do@'><property name='elbowsX' value='96,160,160,224'/><property name='elbowsY' value='72,72,72,72'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='forward:path#category#category.jsp#@action:viewCategory.do@'><property name='elbowsX' value='96,160,160,224'/><property name='elbowsY' value='172,172,172,172'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='category'/></pageflow-object>",
+    "<pageflow-object id='forward:path#product#product.jsp#@action:viewProduct.do@'><property name='elbowsX' value='516,570,570,624'/><property name='elbowsY' value='172,172,172,172'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/><property name='label' value='product'/></pageflow-object>",
+    "<pageflow-object id='forward:path#item#item.jsp#@action:viewItem.do@'><property name='elbowsX' value='660,660,660,660'/><property name='elbowsY' value='384,420,420,456'/><property name='fromPort' value='South_1'/><property name='toPort' value='North_1'/><property name='label' value='item'/></pageflow-object>",
+    "<pageflow-object id='forward:path#success#cart.jsp#@action:addItemToCart.do#shop.Controller.CartForm@'><property name='elbowsX' value='160,160,250,340'/><property name='elbowsY' value='296,296,296,296'/><property name='fromPort' value='North_1'/><property name='toPort' value='North_1'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='forward:path#cart#cart.jsp#@action:updateCartQuantities.do#shop.Controller.CartForm@'><property name='elbowsX' value='304,304,304,304'/><property name='elbowsY' value='492,492,412,332'/><property name='fromPort' value='West_1'/><property name='toPort' value='West_1'/><property name='label' value='cart'/></pageflow-object>",
+    "<pageflow-object id='forward:path#success#cart.jsp#@action:removeItemFromCart.do#shop.Controller.CartForm@'><property name='elbowsX' value='464,420,420,376'/><property name='elbowsY' value='492,492,343,343'/><property name='fromPort' value='West_1'/><property name='toPort' value='East_2'/><property name='label' value='success'/></pageflow-object>",
+    "<pageflow-object id='action-output:categories#@forward:path#success#index.jsp#@action:begin.do@@'/>",
+    "<pageflow-object id='action-output:category#@forward:path#category#category.jsp#@action:viewCategory.do@@'/>",
+    "<pageflow-object id='action-output:products#@forward:path#category#category.jsp#@action:viewCategory.do@@'/>",
+    "<pageflow-object id='action-output:product#@forward:path#product#product.jsp#@action:viewProduct.do@@'/>",
+    "<pageflow-object id='action-output:items#@forward:path#product#product.jsp#@action:viewProduct.do@@'/>",
+    "<pageflow-object id='action-output:product#@forward:path#item#item.jsp#@action:viewItem.do@@'/>",
+    "<pageflow-object id='action-output:item#@forward:path#item#item.jsp#@action:viewItem.do@@'/>",
+    "<pageflow-object id='action-output:myList#@forward:path#success#cart.jsp#@action:addItemToCart.do#shop.Controller.CartForm@@'/>",
+    "<pageflow-object id='action-output:myList#@forward:path#cart#cart.jsp#@action:updateCartQuantities.do#shop.Controller.CartForm@@'/>",
+    "<pageflow-object id='action-output:myList#@forward:path#success#cart.jsp#@action:removeItemFromCart.do#shop.Controller.CartForm@@'/>",
+    "<pageflow-object id='action-call:@page:cart.jsp@#@action:viewItem.do@'><property name='elbowsX' value='376,500,500,624'/><property name='elbowsY' value='332,332,332,332'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/></pageflow-object>",
+    "<pageflow-object id='action-call:@page:product.jsp@#@action:viewItem.do@'><property name='elbowsX' value='660,660,660,660'/><property name='elbowsY' value='224,260,260,296'/><property name='fromPort' value='South_1'/><property name='toPort' value='North_1'/></pageflow-object>",
+    "<pageflow-object id='action-call:@page:cart.jsp@#@action:updateCartQuantities.do#shop.Controller.CartForm@'><property name='elbowsX' value='340,340,340,340'/><property name='elbowsY' value='384,420,420,456'/><property name='fromPort' value='South_1'/><property name='toPort' value='North_1'/></pageflow-object>",
+    "<pageflow-object id='action-call:@page:category.jsp@#@action:viewProduct.do@'><property name='elbowsX' value='296,370,370,444'/><property name='elbowsY' value='172,172,172,172'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/></pageflow-object>",
+    "</view-properties>"
+})
+interface VIEW_PROPERTIES
+{
+}
+

Added: incubator/beehive/trunk/samples/petstoreWeb/shop/cart.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/shop/cart.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,116 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
+<%@ taglib prefix="beehive-petstore" tagdir="/WEB-INF/tags/beehive/petstore" %>
+<netui-data:declarePageInput name="myList" type="org.apache.beehive.samples.petstore.model.Product[]" required="false"/>
+
+
+
+
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="leftnav">
+        <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+        <beehive-petstore:catalogNav action="begin" labelValue="${bundle.view.mainMenuLabel}"/>
+        <br/>
+        <c:choose>
+            <c:when test="${sharedFlow.account != null}">
+                <c:if test="${sharedFlow.account.myListOpt != null}">
+                    <beehive-petstore:productFavorites/>
+                </c:if>
+            </c:when>
+            <c:otherwise>
+                &nbsp;
+            </c:otherwise>
+        </c:choose>
+    </netui-template:section>
+
+    <netui-template:section name="body">
+    <center>
+    <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+    <netui:errors/>
+    <netui:span styleClass="boldlabel" value="${bundle.view.shoppingCartLabel}"/>
+    <netui:form action="updateCartQuantities">
+        <table class="tablegreen">
+            <tr class="rowgrey">
+                <td class="celldata"><b>${bundle.view.itemIdLabel}</b></td>
+                <td class="celldata"><b>${bundle.view.productIdLabel}</b></td>
+                <td class="celldata"><b>${bundle.view.descriptionLabel}</b></td>
+                <td class="celldata"><b>${bundle.view.inStockLabel} </b></td>
+                <td class="celldata"><b>${bundle.view.quantityLabel}</b></td>
+                <td class="celldata"><b>${bundle.view.listPriceLabel}</b></td>
+                <td class="celldata"><b>${bundle.view.totalCostLabel}</b></td>
+                <td class="celldata">&nbsp;</td>
+            </tr>
+            <c:choose>
+            <c:when test="${actionForm.cart.lineItems != null && fn:length(actionForm.cart.lineItems) > 0}">
+            <netui-data:repeater dataSource="actionForm.cart.lineItems">
+                <tr class="rowyellow">
+                    <td class="celldata">
+                    <b>
+                    <netui:anchor action="viewItem">
+                        <netui:parameter name="itemId" value="${container.item.item.itemId}"/>
+                        <netui:span value="${container.item.item.itemId}"/>
+                    </netui:anchor>
+                    </b>
+                    </td>
+                    <td class="celldata"><netui:span value="${container.item.item.productId}"/></td>
+                    <td class="celldata">
+                    <netui:span value="${container.item.item.attr1}"/>
+                    <netui:span value="${container.item.item.attr2}"/>
+                    <netui:span value="${container.item.item.attr3}"/>
+                    <netui:span value="${container.item.item.attr4}"/>
+                    <netui:span value="${container.item.item.attr5}"/>
+                    <netui:span value="${container.item.item.product.name}"/>
+                    </td>
+                    <td class="celldata">
+                    <netui:span value="${container.item.inStock}"/>
+                    </td>
+                    <td align="center">
+                    <netui:textBox size="3" dataSource="container.item.quantity"/>
+                    <br/>
+                    <netui:error value="invalidQuantity${container.index}"/>
+                    </td>
+                    <td align="right">
+                    <netui:span value="${container.item.item.listPrice}">
+                    <netui:formatNumber pattern="${bundle.view.priceFormat}"/>
+                    </netui:span>
+                    </td>
+                    <td align="right">
+                    <netui:span value="${container.item.total}">
+                    <netui:formatNumber pattern="${bundle.view.priceFormat}"/>
+                    </netui:span>
+                    </td>
+                    <td class="celldata">
+                    <netui:imageAnchor action="removeItemFromCart" border="0" src="${pageContext.request.contextPath}/images/button_remove.gif">
+                        <netui:parameter name="workingItemId" value="${container.item.item.itemId}"/>
+                    </netui:imageAnchor>
+                    </td>
+                </tr>
+            </netui-data:repeater>
+            </c:when> <c:otherwise>
+            <tr class="rowyellow">
+                <td class="celldata" colspan="8"><b>${bundle.view.emptyCartMessage}.</b></td>
+            </tr>
+            </c:otherwise> </c:choose>
+            <tr class="rowyellow">
+                <td class="celldata" colspan="7" align="right">
+                <b>${bundle.view.subTotalLabel}:
+                <netui:span value="${actionForm.cart.subTotal}">
+                <netui:formatNumber pattern="${bundle.view.priceFormat}"/>
+                </netui:span> </b><br />
+                <netui:imageButton src="${pageContext.request.contextPath}/images/button_update_cart.gif"/>
+                </td>
+                <td class="celldata">&nbsp;</td>
+            </tr>
+        </table>
+        <c:if test="${actionForm.cart.lineItems != null && fn:length(actionForm.cart.lineItems) > 0}">
+        <br/>
+        <netui:imageAnchor action="checkout" border="0" src="${pageContext.request.contextPath}/images/button_checkout.gif"/>
+        </c:if>
+    </netui:form>
+    </center>
+    </netui-template:section>
+</netui-template:template>

Added: incubator/beehive/trunk/samples/petstoreWeb/shop/category.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/shop/category.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,47 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib prefix="beehive-petstore" tagdir="/WEB-INF/tags/beehive/petstore" %>
+<netui-data:declarePageInput name="products" type="org.apache.beehive.samples.petstore.model.Product[]" required="false"/>
+<netui-data:declarePageInput name="category" type="org.apache.beehive.samples.petstore.model.Category"/>
+
+
+
+
+<netui-template:template templatePage="/site/template.jsp">
+
+    <netui-template:section name="leftnav">
+        <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+    <beehive-petstore:catalogNav action="begin" labelValue="${bundle.view.mainMenuLabel}"/> </netui-template:section>
+
+    <netui-template:section name="body">
+    <netui:errors/>
+    <center>
+    <netui:span styleClass="boldlabel" value="${pageInput.category.name}"/>
+    <br/>
+    <font size="2"><i>(<netui:span value="${pageInput.category.description}"/>)</i></font>
+    <br/>
+    <br/>
+    <table class="tablegreen">
+        <tr class="rowgrey">
+            <td><b>${bundle.view.productIdLabel}</b></td>
+            <td><b>${bundle.view.nameLabel}</b></td>
+            <td><b>${bundle.view.descriptionLabel}</b></td>
+        </tr>
+        <netui-data:repeater dataSource="pageInput.products">
+            <tr class="rowyellow">
+                <td class="celldata"><b>
+                <netui:anchor action="viewProduct">
+                    <font color="black"><netui:span value="${container.item.productId}"/></font>
+                    <netui:parameter name="productId" value="${container.item.productId}"/>
+                </netui:anchor>
+                </b></td>
+                <td class="celldata"><netui:span value="${container.item.name}"/></td>
+                <td class="celldata"><netui:span value="${container.item.description}"/></td>
+            </tr>
+        </netui-data:repeater>
+    </table>
+    </center> </netui-template:section>
+</netui-template:template>

Added: incubator/beehive/trunk/samples/petstoreWeb/shop/index.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/shop/index.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,51 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<netui-data:declarePageInput name="categories" type="org.apache.beehive.samples.petstore.model.Category[]"/>
+
+
+
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="leftnav">
+      <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+      <table class="tablegreen" width="200">
+        <tbody>
+        <tr class="rowyellow">
+          <td>
+          <c:if test="${sharedFlow.account != null}">
+              <netui:span styleClass="meditaliclabel" value="${bundle.view.welcomeLabel} ${sharedFlow.account.firstName}"/>!
+          </c:if>
+          &nbsp;
+          </td>
+        </tr>
+        <netui-data:repeater dataSource="pageInput.categories">
+        <tr class="rowyellow">
+          <td>
+          <netui:imageAnchor action="viewCategory" border="0" src="${pageContext.request.contextPath}/images/${container.item.image}">
+          <netui:parameter name="catId" value="${container.item.catId}"/>
+          </netui:imageAnchor>
+          <br/>
+          <netui:span styleClass="meditaliclabel" value="${container.item.description}"/>
+          </td>
+        </tr>
+        </netui-data:repeater>
+        </tbody>
+      </table>
+    </netui-template:section>
+    <netui-template:section name="body">
+      <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+
+      <netui:errors/>
+      <map name="beehivepetstoremap">
+        <area alt="Birds" coords="72,2,280,250" href="globalViewCategory.do?catId=BIRDS" shape="RECT" />
+        <area alt="Fish" coords="2,180,72,250" href="globalViewCategory.do?catId=FISH" shape="RECT" />
+        <area alt="Dogs" coords="60,250,130,320" href="globalViewCategory.do?catId=DOGS" shape="RECT" />
+        <area alt="Reptiles" coords="140,270,210,340" href="globalViewCategory.do?catId=REPTILES" shape="RECT" />
+        <area alt="Cats" coords="225,240,295,310" href="globalViewCategory.do?catId=CATS" shape="RECT" />
+        <area alt="Birds" coords="280,180,350,250" href="globalViewCategory.do?catId=BIRDS" shape="RECT" />
+      </map>
+      <img vspace="10" hspace="15" border="0" height="347" width="357" src="${pageContext.request.contextPath}/images/splash.gif" align="center" usemap="#beehivepetstoremap"/>
+    </netui-template:section>
+</netui-template:template>
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/shop/item.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/shop/item.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,77 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib prefix="beehive-petstore" tagdir="/WEB-INF/tags/beehive/petstore" %>
+<netui-data:declarePageInput name="item" type="org.apache.beehive.samples.petstore.model.Item"/>
+<netui-data:declarePageInput name="product" type="org.apache.beehive.samples.petstore.model.Product"/>
+
+
+
+
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="leftnav">
+        <beehive-petstore:catalogNav action="viewProduct"
+                                paramName="productId" paramValue="${pageInput.product.productId}"
+                                labelValue="${pageInput.product.name}"/>
+    </netui-template:section>
+    <netui-template:section name="body">
+    <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+    <netui:errors/>
+      <center>
+      <table class="tablegreen" width="60%">
+      <tr class="rowyellow">
+        <td rowspan="6" class="cellwhite">
+          <netui:image src="${pageContext.request.contextPath}/images/${pageInput.product.image}"/>
+        </td>
+        <td class="cellgrey" width="100%">
+          <b><netui:span value="${pageInput.item.itemId}"/></b>
+        </td>
+      </tr>
+      <tr class="rowyellow">
+        <td class="celldata">
+          <span class="boldlabel">
+            <netui:span value="${pageInput.item.attr1}"/>
+            <netui:span value="${pageInput.item.attr2}"/>
+            <netui:span value="${pageInput.item.attr3}"/>
+            <netui:span value="${pageInput.item.attr4}"/>
+            <netui:span value="${pageInput.item.attr5}"/>
+            <netui:span value="${pageInput.product.name}"/>
+          </span>
+        </td>
+      </tr>
+      <tr class="rowyellow">
+        <td class="celldata"><netui:span styleClass="meditaliclabel" value="${pageInput.product.description}"/></td>
+      </tr>
+      <tr class="rowyellow">
+        <td class="celldata">
+          <c:choose>
+          <c:when test="${pageInput.item.qty <= 0}">
+            <netui:span styleClass="error" value="${bundle.view.backOrderedMessage}."/>
+          </c:when>
+          <c:otherwise>
+            <netui:span value="${pageInput.item.qty} ${bundle.view.inStockMessage}"/>
+          </c:otherwise>
+          </c:choose>
+        </td>
+      </tr>
+      <tr class="rowyellow">
+        <td class="celldata">
+          <netui:span value="${pageInput.item.listPrice}">
+            <netui:formatNumber pattern="${bundle.view.priceFormat}"/>
+          </netui:span>
+        </td>
+      </tr>
+      <tr class="rowyellow">
+        <td class="celldata">
+          <netui:imageAnchor action="addItemToCart" border="0" src="${pageContext.request.contextPath}/images/button_add_to_cart.gif">
+            <netui:parameter name="workingItemId" value="${pageInput.item.itemId}"/>
+          </netui:imageAnchor>
+        </td>
+      </tr>
+      </table>
+      </center>
+    </div>
+    </netui-template:section>
+</netui-template:template>
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/shop/product.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/shop/product.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,66 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<%@ taglib prefix="beehive-petstore" tagdir="/WEB-INF/tags/beehive/petstore" %>
+<netui-data:declarePageInput name="items" type="org.apache.beehive.samples.petstore.model.Item[]"/>
+<netui-data:declarePageInput name="product" type="org.apache.beehive.samples.petstore.model.Product"/>
+
+
+
+
+<netui-template:template templatePage="/site/template.jsp">
+    <netui-template:section name="leftnav">
+        <beehive-petstore:catalogNav action="viewCategory" paramName="catId" paramValue="${pageInput.product.category}"
+                                labelValue="${pageInput.product.category}"/>
+    </netui-template:section>
+    <netui-template:section name="body">
+    <netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+
+    <netui:errors/>
+        <center>
+          <netui:span styleClass="boldlabel" value="${pageInput.product.name}"/>
+          <br/>
+          <netui:span styleClass="meditaliclabel" value="{${pageInput.product.description})"/>
+        <table class="tablegreen">
+          <tr class="rowgrey">
+            <td><b>${bundle.view.itemIdLabel}</b></td>
+            <td><b>${bundle.view.productIdLabel}</b></td>
+            <td><b>${bundle.view.descriptionLabel}</b></td>
+            <td><b>${bundle.view.listPriceLabel}</b></td>
+            <td>&nbsp;</td>
+          </tr>
+          <netui-data:repeater dataSource="pageInput.items">
+          <tr class="rowyellow">
+            <td class="celldata">
+              <netui:anchor action="viewItem">
+                <netui:parameter name="itemId" value="${container.item.itemId}"/>
+                <b><netui:span value="${container.item.itemId}"/></b>
+              </netui:anchor>
+            </td>
+            <td class="celldata"><netui:span value="${container.item.productId}"/></td>
+            <td class="celldata">
+              <netui:span value="${container.item.attr1}"/>
+              <netui:span value="${container.item.attr2}"/>
+              <netui:span value="${container.item.attr3}"/>
+              <netui:span value="${container.item.attr4}"/>
+              <netui:span value="${container.item.attr5}"/>
+              <netui:span value="${pageInput.product.name}"/>
+            </td>
+            <td class="celldata">
+              <netui:span value="${container.item.listPrice}">
+                <netui:formatNumber pattern="${bundle.view.priceFormat}"/>
+              </netui:span>
+            </td>
+            <td class="celldata">
+              <netui:imageAnchor action="addItemToCart" border="0"
+                                 src="${pageContext.request.contextPath}/images/button_add_to_cart.gif">
+              <netui:parameter name="workingItemId" value="${container.item.itemId}"/>
+              </netui:imageAnchor>
+            </td>
+          </tr>
+          </netui-data:repeater>
+        </table>
+        </center>
+    </netui-template:section>
+</netui-template:template>
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/site/default.css
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/site/default.css	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,74 @@
+body {
+  background-color:#ffffff;
+}
+
+table.tablegreen {
+  background-color: #008800;
+  left-margin: auto;
+  right-margin: auto;
+}
+
+tr.rowyellow {
+  background-color: #ffff88;
+}
+
+tr.rowgrey {
+  background-color: #cccccc;
+}
+
+td.celldata {
+  padding: 3px;
+  border-spacing: 2px;
+}
+
+td.cellwhite {
+  background-color: #ffffff;
+}
+
+td.cellgrey {
+  background-color: #cccccc;
+}
+
+span.boldlabel {
+  font-size: large;
+  font-weight: bold;
+}
+
+span.smalllabel {
+  font-size: small;
+  font-weight: bold;
+}
+
+span.meditaliclabel {
+  font-size: medium;
+  font-style: italic;
+}
+
+span.boldlabelgreen {
+  font-size: large;
+  font-weight: bold;
+  color: #00ff00;
+}
+
+span.error {
+  font-color: #ff0000;
+  font-size: 2;
+  font-style: italic;
+}
+
+#leftnav {
+   float: left;
+   left: 5px;
+   top: 120px;
+}
+
+#main {
+    left: 200px;
+    top: 120px;
+    text-align: center;
+}
+
+#footer {
+    width: 100%;
+    clear: both;
+}
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/site/emptyLeftNav.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/site/emptyLeftNav.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,5 @@
+<%@page contentType="text/html;charset=UTF-8" language="java"%>
+
+<!-- start left nav -->
+&nbsp;
+<!-- end left nav -->
\ No newline at end of file

Added: incubator/beehive/trunk/samples/petstoreWeb/site/template.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/petstoreWeb/site/template.jsp	Tue Oct 19 19:23:27 2004
@@ -0,0 +1,40 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib prefix="beehive-petstore" tagdir="/WEB-INF/tags/beehive/petstore" %>
+
+<netui-data:declareBundle bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
+
+<netui:html>
+    <head>
+        <title>
+            ${bundle.view.indexTitle}
+        </title>
+        <link rel="stylesheet" href="${pageContext.request.contextPath}/site/default.css" type="text/css"/>
+    </head>
+    <netui:body>
+        <beehive-petstore:headerMenu contextPath="${pageContext.request.contextPath}"/>
+        <br/>
+        <div>
+            <%-- Include the template's "leftnav" section --%>
+            <div id="leftnav">
+                <%-- @bug: when the defaultPage is included, it ends up at the top of the page instead of in-line --%>
+                <netui-template:includeSection name="leftnav" defaultPage="/site/emptyLeftNav.jsp"/>
+                <br/>
+            </div>
+            <%-- Include the template's "body" section --%>
+            <div id="main">
+                <beehive-petstore:categoryNavHeader contextPath="${pageContext.request.contextPath}"/>
+                <br/>
+                <netui-template:includeSection name="body"/>
+            </div>
+            <div id="footer">
+                <%-- dynamically display the banner --%>
+                <beehive-petstore:footer contextPath="${pageContext.request.contextPath}"/>
+                <beehive-petstore:copyright contextPath="${pageContext.request.contextPath}"/>
+            </div>
+        </div>
+    </netui:body>
+</netui:html>