Author: ekoneil
Date: Sun Feb 13 10:41:07 2005
New Revision: 153653
URL: http://svn.apache.org/viewcvs?view=rev&rev=153653
Log:
petstoreWeb fixes
- add the shared flow name to actions defined there. This fixes the "no such
action" problem that's been reported in J224
- remove the NetUI taglibs from web.xml
- add a build file for the SVN tree. Note, the distribution build file isn't
done yet because the needed targets aren't defined in beehive-imports.xml for
the distro
- code cleanup / reformatting
- removed unused code from the ws/ JavaBeans
- delete the netui-config.xml file
BB: self
DRT: petstoreWeb builds / runs
Added:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml
(with props)
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build.xml (with
props)
Removed:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/netui-config.xml
Modified:
incubator/beehive/trunk/samples/petstoreWeb/Controller.jpf
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/netui-validator-rules.xml
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/AccountController.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/PetstoreController.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/AccountControl.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/CatalogControl.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/OrderControl.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/SequenceControl.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/AccountAlreadyExistsException.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/InvalidIdentifierException.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchAccountException.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchOrderException.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchSequenceException.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchUserException.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/OrderAlreadyExistsException.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/UserAlreadyExistsException.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/internal/InMemoryObjectStore.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AbstractPetstoreForm.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AccountForm.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/CheckoutForm.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/OrderForm.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/ReturnToForm.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/SearchForm.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Account.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Address.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Cart.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Category.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Item.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/LineItem.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Order.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Product.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/Sequence.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/ws/Category.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/model/ws/Product.java
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/categoryNavHeader.tag
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/footer.tag
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/tags/beehive/petstore/headerMenu.tag
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/web.xml
incubator/beehive/trunk/samples/petstoreWeb/account/create/Controller.jpf
incubator/beehive/trunk/samples/petstoreWeb/account/edit/Controller.jpf
incubator/beehive/trunk/samples/petstoreWeb/account/edit/listOrders.jsp
incubator/beehive/trunk/samples/petstoreWeb/auth/Controller.jpf
incubator/beehive/trunk/samples/petstoreWeb/auth/login.jsp
incubator/beehive/trunk/samples/petstoreWeb/auth/loginError.jsp
incubator/beehive/trunk/samples/petstoreWeb/checkout/Controller.jpf
incubator/beehive/trunk/samples/petstoreWeb/checkout/confirm.jsp
incubator/beehive/trunk/samples/petstoreWeb/checkout/viewCart.jsp
incubator/beehive/trunk/samples/petstoreWeb/checkout/viewOrder.jsp
incubator/beehive/trunk/samples/petstoreWeb/index.jsp
incubator/beehive/trunk/samples/petstoreWeb/search/Controller.jpf
incubator/beehive/trunk/samples/petstoreWeb/search/index.jsp
incubator/beehive/trunk/samples/petstoreWeb/shop/Controller.jpf
incubator/beehive/trunk/samples/petstoreWeb/shop/index.jsp
incubator/beehive/trunk/samples/petstoreWeb/site/emptyLeftNav.jsp
incubator/beehive/trunk/samples/petstoreWeb/webappRoot/SharedFlow.jpfs
Modified: incubator/beehive/trunk/samples/petstoreWeb/Controller.jpf
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/Controller.jpf?view=diff&r1=153652&r2=153653
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb/Controller.jpf (original)
+++ incubator/beehive/trunk/samples/petstoreWeb/Controller.jpf Sun Feb 13
10:41:07 2005
@@ -42,31 +42,4 @@
return new Forward("shop");
else return new Forward("index");
}
-}
-
[EMAIL PROTECTED](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/[EMAIL
PROTECTED]: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#/[EMAIL
PROTECTED]: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
-{
-}
-
+}
\ No newline at end of file
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/netui-validator-rules.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/netui-validator-rules.xml?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/netui-validator-rules.xml
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/netui-validator-rules.xml
Sun Feb 13 10:41:07 2005
@@ -2,1053 +2,36 @@
"-//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.
-
+ This file contains the default NetUI validator definitions. It should be
+ placed in /WEB-INF, and is automatically referenced in Struts config files
+ generated by the Page Flow compiler.
-->
<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"
+ <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"
- 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 ([EMAIL PROTECTED]),
- * 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>
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest,
+ javax.servlet.ServletContext"
+ msg="errors.netui_validwhen"/>
- <validator name="netui_validwhen"
+ <validator name="netui_longRange"
classname="org.apache.beehive.netui.pageflow.validation.ValidatorRules"
- method="validateValidWhen"
+ method="validateLongRange"
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>
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends="long"
+ msg="errors.range"/>
</global>
Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml?view=auto&rev=153653
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml
(added)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml Sun
Feb 13 10:41:07 2005
@@ -0,0 +1,29 @@
+<?xml version="1.0" ?>
+
+<!--
+ 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:$
+ -->
+
+<project name="Beehive/Samples/PetstoreWeb" default="build" basedir="../..">
+
+ <import file="../../../../beehive-imports.xml" />
+
+ <property name="context.path" value="petstoreWeb"/>
+
+ <!-- todo: need to add the clean/build targets to beehive-imports.xml -->
+
+</project>
Propchange:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build.xml?view=auto&rev=153653
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build.xml (added)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build.xml Sun Feb
13 10:41:07 2005
@@ -0,0 +1,62 @@
+<?xml version="1.0" ?>
+
+<!--
+ 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:$
+ -->
+
+<project name="Beehive petstoreWeb sample" default="build" basedir="../..">
+
+ <import file="../../../../beehive-imports.xml" />
+
+ <property name="context.path" value="petstoreWeb"/>
+
+ <!-- =========================================== -->
+ <!-- deploy targets - move the app to the server -->
+ <!-- =========================================== -->
+
+ <target name="deploy">
+ <deploy-webapp webappDir="${basedir}" contextPath="${context.path}"/>
+ </target>
+
+ <target name="undeploy">
+ <undeploy-webapp contextPath="${context.path}"/>
+ </target>
+
+ <target name="redeploy">
+ <redeploy-webapp contextPath="${context.path}"/>
+ </target>
+
+ <!-- ========================================= -->
+ <!-- build - build the webapp -->
+ <!-- ========================================= -->
+
+ <target name="build">
+ <deploy-netui webappDir="${basedir}" />
+ <deploy-wsm webappDir="${basedir}" />
+ <build-webapp webappDir="${basedir}" />
+ </target>
+
+
+ <!-- ========================================= -->
+ <!-- clean - clean the webapp -->
+ <!-- ========================================= -->
+
+ <target name="clean">
+ <clean-webapp webappDir="${basedir}" />
+ </target>
+
+</project>
Propchange: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/AccountController.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/AccountController.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/AccountController.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/AccountController.java
Sun Feb 13 10:41:07 2005
@@ -1,15 +1,31 @@
+/*
+ * 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.controller;
import org.apache.beehive.netui.pageflow.PageFlowController;
-public class AccountController
- extends PageFlowController
-{
+public abstract class AccountController
+ extends PageFlowController {
+
protected static final String[] LANGUAGES;
- static
- {
- LANGUAGES = new String[] {"English", "Japanese"};
+ static {
+ LANGUAGES = new String[]{"English", "Japanese"};
}
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/PetstoreController.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/PetstoreController.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/PetstoreController.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controller/PetstoreController.java
Sun Feb 13 10:41:07 2005
@@ -1,10 +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.controller;
import org.apache.beehive.netui.pageflow.PageFlowController;
-public class PetstoreController
- extends PageFlowController
-{
+public abstract 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
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/AccountControl.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/AccountControl.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/AccountControl.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/AccountControl.java
Sun Feb 13 10:41:07 2005
@@ -25,8 +25,8 @@
import
org.apache.beehive.samples.petstore.controls.exceptions.NoSuchAccountException;
@ControlInterface
-public interface AccountControl
-{
+ public interface AccountControl {
+
public Account getAccount(String userId);
public void insertAccount(Account account)
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/CatalogControl.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/CatalogControl.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/CatalogControl.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/CatalogControl.java
Sun Feb 13 10:41:07 2005
@@ -24,8 +24,8 @@
import
org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
@ControlInterface
-public interface CatalogControl
-{
+ public interface CatalogControl {
+
public Category[] getCategoryList();
public Category getCategory(String categoryId);
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/OrderControl.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/OrderControl.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/OrderControl.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/OrderControl.java
Sun Feb 13 10:41:07 2005
@@ -18,6 +18,7 @@
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;
@@ -25,8 +26,8 @@
import
org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException;
@ControlInterface
-public interface OrderControl
-{
+ public interface OrderControl {
+
public Order createOrder();
public void commitOrder(Order order)
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/SequenceControl.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/SequenceControl.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/SequenceControl.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/SequenceControl.java
Sun Feb 13 10:41:07 2005
@@ -23,8 +23,8 @@
import
org.apache.beehive.samples.petstore.controls.exceptions.NoSuchSequenceException;
@ControlInterface
-public interface SequenceControl
-{
+ public interface SequenceControl {
+
int getNextSequenceId(String name)
throws InvalidIdentifierException, NoSuchSequenceException;
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/AccountAlreadyExistsException.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/AccountAlreadyExistsException.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/AccountAlreadyExistsException.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/AccountAlreadyExistsException.java
Sun Feb 13 10:41:07 2005
@@ -18,10 +18,9 @@
package org.apache.beehive.samples.petstore.controls.exceptions;
public class AccountAlreadyExistsException
- extends Exception
-{
- public AccountAlreadyExistsException(String message)
- {
+ extends Exception {
+
+ public AccountAlreadyExistsException(String message) {
super(message);
}
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/InvalidIdentifierException.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/InvalidIdentifierException.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/InvalidIdentifierException.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/InvalidIdentifierException.java
Sun Feb 13 10:41:07 2005
@@ -18,10 +18,9 @@
package org.apache.beehive.samples.petstore.controls.exceptions;
public class InvalidIdentifierException
- extends Exception
-{
- public InvalidIdentifierException(String message)
- {
+ extends Exception {
+
+ public InvalidIdentifierException(String message) {
super(message);
}
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchAccountException.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchAccountException.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchAccountException.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchAccountException.java
Sun Feb 13 10:41:07 2005
@@ -18,10 +18,9 @@
package org.apache.beehive.samples.petstore.controls.exceptions;
public class NoSuchAccountException
- extends Exception
-{
- public NoSuchAccountException(String message)
- {
+ extends Exception {
+
+ public NoSuchAccountException(String message) {
super(message);
}
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchOrderException.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchOrderException.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchOrderException.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchOrderException.java
Sun Feb 13 10:41:07 2005
@@ -18,10 +18,9 @@
package org.apache.beehive.samples.petstore.controls.exceptions;
public class NoSuchOrderException
- extends Exception
-{
- public NoSuchOrderException(String message)
- {
+ extends Exception {
+
+ public NoSuchOrderException(String message) {
super(message);
}
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchSequenceException.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchSequenceException.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchSequenceException.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchSequenceException.java
Sun Feb 13 10:41:07 2005
@@ -18,10 +18,9 @@
package org.apache.beehive.samples.petstore.controls.exceptions;
public class NoSuchSequenceException
- extends Exception
-{
- public NoSuchSequenceException(String message)
- {
+ extends Exception {
+
+ public NoSuchSequenceException(String message) {
super(message);
}
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchUserException.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchUserException.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchUserException.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/NoSuchUserException.java
Sun Feb 13 10:41:07 2005
@@ -18,10 +18,9 @@
package org.apache.beehive.samples.petstore.controls.exceptions;
public class NoSuchUserException
- extends Exception
-{
- public NoSuchUserException(String message)
- {
+ extends Exception {
+
+ public NoSuchUserException(String message) {
super(message);
}
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/OrderAlreadyExistsException.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/OrderAlreadyExistsException.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/OrderAlreadyExistsException.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/OrderAlreadyExistsException.java
Sun Feb 13 10:41:07 2005
@@ -18,10 +18,9 @@
package org.apache.beehive.samples.petstore.controls.exceptions;
public class OrderAlreadyExistsException
- extends Exception
-{
- public OrderAlreadyExistsException(String message)
- {
+ extends Exception {
+
+ public OrderAlreadyExistsException(String message) {
super(message);
}
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/UserAlreadyExistsException.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/UserAlreadyExistsException.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/UserAlreadyExistsException.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/exceptions/UserAlreadyExistsException.java
Sun Feb 13 10:41:07 2005
@@ -18,10 +18,9 @@
package org.apache.beehive.samples.petstore.controls.exceptions;
public class UserAlreadyExistsException
- extends Exception
-{
- public UserAlreadyExistsException(String message)
- {
+ extends Exception {
+
+ public UserAlreadyExistsException(String message) {
super(message);
}
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/internal/InMemoryObjectStore.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/internal/InMemoryObjectStore.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/internal/InMemoryObjectStore.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/controls/internal/InMemoryObjectStore.java
Sun Feb 13 10:41:07 2005
@@ -15,18 +15,17 @@
*
* $Header:$
*/
-package org.apache.beehive.samples.petstore.controls.internal;
+package org.apache.beehive.samples.petstore.controls.internal;
import java.lang.reflect.Array;
import java.util.HashMap;
import java.util.Map;
-public class InMemoryObjectStore
-{
+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)
- {
+
+ public static final boolean store(String namespace, Object key, Object
value) {
Map store = (Map)getNamespaceStore(namespace);
store.put(key, value);
@@ -34,25 +33,21 @@
return true;
}
- public static final Object find(String namespace, Object key)
- {
+ 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)
- {
+ 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)
- {
+ private static final Map getNamespaceStore(String namespace) {
Map nsStore = OBJECT_STORE.get(namespace);
- if(nsStore == null)
- {
+ if(nsStore == null) {
nsStore = createNamespaceStore();
OBJECT_STORE.put(namespace, nsStore);
}
@@ -60,8 +55,7 @@
return nsStore;
}
- private static final Map createNamespaceStore()
- {
+ private static final Map createNamespaceStore() {
return new HashMap();
}
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AbstractPetstoreForm.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AbstractPetstoreForm.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AbstractPetstoreForm.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AbstractPetstoreForm.java
Sun Feb 13 10:41:07 2005
@@ -19,16 +19,15 @@
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
-{
+ extends FormData {
+
protected final void addErrorIfStringEmpty(ActionErrors errors, String
errorName,
- String resourceKey, String
value)
- {
- if(value == null || value.trim().length() == 0)
- {
+ String resourceKey, String
value) {
+ if(value == null || value.trim().length() == 0) {
errors.add(errorName, new ActionError(resourceKey));
}
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AccountForm.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AccountForm.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AccountForm.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/AccountForm.java
Sun Feb 13 10:41:07 2005
@@ -25,31 +25,27 @@
import javax.servlet.http.HttpServletRequest;
public abstract class AccountForm
- extends AbstractPetstoreForm
-{
+ extends AbstractPetstoreForm {
+
private Account _account;
- public AccountForm()
- {
+ public AccountForm() {
super();
}
-
- public AccountForm(Account account)
- {
+
+ public AccountForm(Account account) {
this();
_account = account;
}
- protected Account getAccount()
- {
+ protected Account getAccount() {
return _account;
}
- public String getUserId()
- {
+ public String getUserId() {
return _account.getUserId();
}
-
+
public String getFirstName() {
return _account.getFirstName();
}
@@ -74,118 +70,95 @@
_account.setEmail(email);
}
- public String getPhone()
- {
+ public String getPhone() {
return _account.getPhone();
}
- public void setPhone(String value)
- {
+ public void setPhone(String value) {
_account.setPhone(value);
}
- public String getAddr1()
- {
+ public String getAddr1() {
return _account.getAddress().getAddr1();
}
- public void setAddr1(String value)
- {
+ public void setAddr1(String value) {
_account.getAddress().setAddr1(value);
}
- public String getAddr2()
- {
+ public String getAddr2() {
return _account.getAddress().getAddr2();
}
- public void setAddr2(String value)
- {
+ public void setAddr2(String value) {
_account.getAddress().setAddr2(value);
}
- public String getCity()
- {
+ public String getCity() {
return _account.getAddress().getCity();
}
- public void setCity(String value)
- {
+ public void setCity(String value) {
_account.getAddress().setCity(value);
}
- public String getState()
- {
+ public String getState() {
return _account.getAddress().getState();
}
- public void setState(String value)
- {
+ public void setState(String value) {
_account.getAddress().setState(value);
}
- public String getZip()
- {
+ public String getZip() {
return _account.getAddress().getZip();
}
- public void setZip(String value)
- {
+ public void setZip(String value) {
_account.getAddress().setZip(value);
}
- public String getCountry()
- {
+ public String getCountry() {
return _account.getAddress().getCountry();
}
- public void setCountry(String value)
- {
+ public void setCountry(String value) {
_account.getAddress().setCountry(value);
}
- public String getFavCategory()
- {
+ public String getFavCategory() {
return _account.getFavCategory();
}
- public void setFavCategory(String value)
- {
+ public void setFavCategory(String value) {
_account.setFavCategory(value);
}
- public String getLangPref()
- {
+ public String getLangPref() {
return _account.getLangPref();
}
- public void setLangPref(String value)
- {
+ public void setLangPref(String value) {
_account.setLangPref(value);
}
- public boolean isMyListOpt()
- {
+ public boolean isMyListOpt() {
return _account.isMyListOpt();
}
- public void setMyListOpt(boolean value)
- {
+ public void setMyListOpt(boolean value) {
_account.setMyListOpt(value);
}
- public boolean isBannerOpt()
- {
+ public boolean isBannerOpt() {
return _account.isBannerOpt();
}
- public void setBannerOpt(boolean value)
- {
+ public void setBannerOpt(boolean value) {
_account.setBannerOpt(value);
}
- public ActionErrors baseValidate(ActionErrors errors, ActionMapping
mapping, HttpServletRequest request)
- {
+ 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());
@@ -201,8 +174,7 @@
return errors;
}
- public static final Account getAccount(AccountForm form)
- {
- return form.getAccount();
+ public static final Account getAccount(AccountForm form) {
+ return form.getAccount();
}
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/CheckoutForm.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/CheckoutForm.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/CheckoutForm.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/CheckoutForm.java
Sun Feb 13 10:41:07 2005
@@ -26,42 +26,37 @@
import javax.servlet.http.HttpServletRequest;
public class CheckoutForm
- extends OrderForm
-{
+ extends OrderForm {
+
private boolean _shippingAddressRequired;
private boolean _isCheckOut;
- public void setShippingAddressRequired(boolean shippingAddressRequired)
- {
+ public void setShippingAddressRequired(boolean shippingAddressRequired) {
_shippingAddressRequired = shippingAddressRequired;
}
- public boolean isShippingAddressRequired()
- {
+ public boolean isShippingAddressRequired() {
return _shippingAddressRequired;
}
- public boolean isCheckOut()
- {
+ public boolean isCheckOut() {
return _isCheckOut;
}
- public void setCheckOut(boolean checkOut)
- {
+ public void setCheckOut(boolean checkOut) {
_isCheckOut = checkOut;
}
// todo: format validation for e-mail, zip, credit card, date
- public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request)
- {
+ 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, "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());
@@ -71,8 +66,7 @@
addErrorIfStringEmpty(errors, "billToZip",
"order.error.billToZip.required", billing.getZip());
addErrorIfStringEmpty(errors, "billToCountry",
"order.error.billToCountry.required", billing.getCountry());
- if(isShippingAddressRequired())
- {
+ if(isShippingAddressRequired()) {
Address shipping = order.getShippingAddress();
addErrorIfStringEmpty(errors, "shipToFirstName",
"order.error.shipToFirstName.required", shipping.getFirstName());
addErrorIfStringEmpty(errors, "shipToLastName",
"order.error.shipToLastName.required", shipping.getLastName());
@@ -84,8 +78,7 @@
}
// sets the ship address the same as the bill-to address
- if(!isShippingAddressRequired() && errors.size() > 0)
- {
+ if(!isShippingAddressRequired() && errors.size() > 0) {
order.setShippingAddressIsBillingAddress(true);
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/OrderForm.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/OrderForm.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/OrderForm.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/OrderForm.java
Sun Feb 13 10:41:07 2005
@@ -18,20 +18,19 @@
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
-{
+ extends AbstractPetstoreForm {
+
private Order _order;
- public void setOrder(Order order)
- {
+ public void setOrder(Order order) {
_order = order;
}
- public Order getOrder()
- {
+ public Order getOrder() {
return _order;
}
}
Modified:
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/ReturnToForm.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/ReturnToForm.java?view=diff&r1=153652&r2=153653
==============================================================================
---
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/ReturnToForm.java
(original)
+++
incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/org/apache/beehive/samples/petstore/forms/ReturnToForm.java
Sun Feb 13 10:41:07 2005
@@ -1,4 +1,4 @@
-package org.apache.beehive.samples.petstore.forms;
+package org.apache.beehive.samples.petstore.forms;
import org.apache.beehive.netui.pageflow.FormData;
@@ -7,24 +7,22 @@
* auth controller i.e. return to previous page or return to previous action
*/
public class ReturnToForm
- extends FormData
-{
+ extends FormData {
+
private boolean _returnToPreviousAction;
- public ReturnToForm() {}
+ public ReturnToForm() {
+ }
- public ReturnToForm(boolean returnToPreviousAction)
- {
+ public ReturnToForm(boolean returnToPreviousAction) {
_returnToPreviousAction = returnToPreviousAction;
}
- public void setReturnToPreviousAction(boolean returnToPreviousAction)
- {
+ public void setReturnToPreviousAction(boolean returnToPreviousAction) {
_returnToPreviousAction = returnToPreviousAction;
}
- public boolean getReturnToPreviousAction()
- {
+ public boolean getReturnToPreviousAction() {
return _returnToPreviousAction;
}
}