Author: hlship
Date: Thu Jan 10 10:41:08 2008
New Revision: 610864

URL: http://svn.apache.org/viewvc?rev=610864&view=rev
Log:
TAPESTRY-2012: Add BeanEditor support for data types "password" and "longtext"

Added:
    
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/TextOutput.java
    
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/TextOutputTest.java
Modified:
    
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/TextArea.java
    
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.java
    
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyEditBlocks.java
    
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
    
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.tml
    
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyEditBlocks.tml
    tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt
    
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
    
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/RegistrationData.java

Modified: 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/TextArea.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/TextArea.java?rev=610864&r1=610863&r2=610864&view=diff
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/TextArea.java
 (original)
+++ 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/TextArea.java
 Thu Jan 10 10:41:08 2008
@@ -20,6 +20,8 @@
 /**
  * TextArea component corresponds to a <textarea> element. The value 
parameter is almost
  * always bound to a string, but this is not an absolute requirement.
+ *
+ * @see TextOutput
  */
 public final class TextArea extends AbstractTextField
 {

Added: 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/TextOutput.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/TextOutput.java?rev=610864&view=auto
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/TextOutput.java
 (added)
+++ 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/TextOutput.java
 Thu Jan 10 10:41:08 2008
@@ -0,0 +1,58 @@
+// Copyright 2008 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.
+
+package org.apache.tapestry.corelib.components;
+
+import org.apache.tapestry.MarkupWriter;
+import org.apache.tapestry.annotations.Mixin;
+import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.corelib.mixins.DiscardBody;
+
+import java.util.regex.Pattern;
+
+/**
+ * Outputs paragraph oriented text, typically collected via a [EMAIL 
PROTECTED] org.apache.tapestry.corelib.components.TextArea}
+ * component.  The TextArea is split into lines, and each line it output 
inside its own <p> element.
+ */
+public class TextOutput
+{
+    @Parameter(required = true)
+    private String _value;
+
+    @Mixin
+    private DiscardBody _discardBody;
+
+    private static final Pattern SPLIT_PATTERN = 
Pattern.compile("((\\r\\n)|\\r|\\n)", Pattern.MULTILINE);
+
+    void beginRender(MarkupWriter writer)
+    {
+        if (_value == null) return;
+
+        String[] lines = SPLIT_PATTERN.split(_value);
+
+        for (String line : lines)
+        {
+            writer.element("p");
+
+            writer.write(line.trim());
+
+            writer.end();
+        }
+    }
+
+    void injectValue(String value)
+    {
+        _value = value;
+    }
+}

Modified: 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.java?rev=610864&r1=610863&r2=610864&view=diff
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.java
 (original)
+++ 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.java
 Thu Jan 10 10:41:08 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -14,6 +14,8 @@
 
 package org.apache.tapestry.corelib.pages;
 
+import org.apache.tapestry.MarkupWriter;
+import org.apache.tapestry.Renderable;
 import org.apache.tapestry.annotations.Environmental;
 import org.apache.tapestry.internal.TapestryInternalUtils;
 import org.apache.tapestry.ioc.annotations.Inject;
@@ -49,5 +51,21 @@
     public PropertyOutputContext getContext()
     {
         return _context;
+    }
+
+    public Renderable getPasswordRenderer()
+    {
+        return new Renderable()
+        {
+            public void render(MarkupWriter writer)
+            {
+
+                Object value = _context.getPropertyValue();
+
+                int length = value == null ? 0 : value.toString().length();
+
+                for (int i = 0; i < length; i++) writer.write("*");
+            }
+        };
     }
 }

Modified: 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyEditBlocks.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyEditBlocks.java?rev=610864&r1=610863&r2=610864&view=diff
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyEditBlocks.java
 (original)
+++ 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyEditBlocks.java
 Thu Jan 10 10:41:08 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -56,15 +56,37 @@
             parameters = {"value=context.propertyValue", 
"label=prop:context.label", "clientId=prop:context.propertyid", 
"validate=prop:dateFieldValidator"})
     private DateField _dateField;
 
+    @Component(
+            parameters = {"value=context.propertyValue", 
"label=prop:context.label", "translate=prop:context.translator", 
"validate=prop:passwordFieldValidator", "clientId=prop:context.propertyId", 
"size=prop:widthOrNull"})
+    private PasswordField _passwordField;
+
+    @Component(
+            parameters = {"value=context.propertyValue", 
"label=prop:context.label", "translate=prop:context.translator", 
"validate=prop:textAreaValidator", "clientId=prop:context.propertyId", 
"cols=prop:widthOrNull"})
+    private TextArea _textArea;
+
+
     public PropertyEditContext getContext()
     {
         return _context;
     }
 
+
     public FieldValidator getTextFieldValidator()
     {
         return _context.getValidator(_textField);
     }
+
+    public FieldValidator getPasswordFieldValidator()
+    {
+        return _context.getValidator(_passwordField);
+    }
+
+
+    public FieldValidator getTextAreaValidator()
+    {
+        return _context.getValidator(_textArea);
+    }
+
 
     public FieldValidator getDateFieldValidator()
     {

Modified: 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java?rev=610864&r1=610863&r2=610864&view=diff
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
 (original)
+++ 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
 Thu Jan 10 10:41:08 2008
@@ -343,13 +343,28 @@
 
     public static void 
contributeBeanBlockSource(Configuration<BeanBlockContribution> configuration)
     {
-        addEditBlock(configuration, "text", "text");
-        addEditBlock(configuration, "enum", "enum");
-        addEditBlock(configuration, "checkbox", "checkbox");
-        addEditBlock(configuration, "date", "date");
+        addEditBlock(configuration, "text");
+        addEditBlock(configuration, "enum");
+        addEditBlock(configuration, "checkbox");
+        addEditBlock(configuration, "date");
+        addEditBlock(configuration, "password");
+
+        // longtext uses a text area, not a text field
+
+        addEditBlock(configuration, "longtext");
+
+        addDisplayBlock(configuration, "enum");
+        addDisplayBlock(configuration, "date");
+
+        // Password and long text have special output needs.
+        addDisplayBlock(configuration, "password");
+        addDisplayBlock(configuration, "longtext");
 
-        addDisplayBlock(configuration, "enum", "enum");
-        addDisplayBlock(configuration, "date", "date");
+    }
+
+    private static void addEditBlock(Configuration<BeanBlockContribution> 
configuration, String dataType)
+    {
+        addEditBlock(configuration, dataType, dataType);
     }
 
     private static void addEditBlock(Configuration<BeanBlockContribution> 
configuration, String dataType,
@@ -358,6 +373,11 @@
         configuration.add(new BeanBlockContribution(dataType, 
"PropertyEditBlocks", blockId, true));
     }
 
+    private static void addDisplayBlock(Configuration<BeanBlockContribution> 
configuration, String dataType)
+    {
+        addDisplayBlock(configuration, dataType, dataType);
+    }
+
     private static void addDisplayBlock(Configuration<BeanBlockContribution> 
configuration, String dataType,
                                         String blockId)
     {
@@ -387,16 +407,16 @@
 
     /**
      * Contributes the base set of injection providers:
-     * <ul>
-     * <li>Default -- based on [EMAIL PROTECTED] MasterObjectProvider}</li>
-     * <li>Block -- injects fields of type Block</li>
-     * <li>ComponentResources -- give component access to its resources</li>
-     * <li>CommonResources -- access to properties of resources (log, 
messages, etc.)</li>
-     * <li>Asset -- injection of assets (triggered via [EMAIL PROTECTED] Path} 
annotation), with the path
-     * relative to the component class</li>
-     * <li>Service -- ordered last, for use when Inject is present and nothing 
else works, matches
-     * field type against Tapestry IoC service</li>
-     * </ul>
+     * <dl>
+     * <dt>Default</dt> <dd>based on [EMAIL PROTECTED] 
MasterObjectProvider}</dd>
+     * <dt>Block</dt> <dd>injects fields of type Block</dd>
+     * <dt>ComponentResources</dt> <dd>give component access to its 
resources</dd>
+     * <dt>CommonResources</dt> <dd>access to properties of resources (log, 
messages, etc.)</dd>
+     * <dt>Asset</dt> <dd>injection of assets (triggered via [EMAIL PROTECTED] 
Path} annotation), with the path
+     * relative to the component class</dd>
+     * <dt>Service</dt> <dd>ordered last, for use when Inject is present and 
nothing else works, matches
+     * field type against Tapestry IoC services</dd>
+     * </dl>
      */
     public static void 
contributeInjectionProvider(OrderedConfiguration<InjectionProvider> 
configuration,
 
@@ -428,12 +448,12 @@
 
     /**
      * Contributes two object providers:
-     * <ul>
-     * <li>Alias: Searches by type among [EMAIL PROTECTED] AliasContribution 
contributions} to the
-     * [EMAIL PROTECTED] Alias} service</li>
-     * <li>Asset: Checks for the [EMAIL PROTECTED] Path} annotation, and 
injects an [EMAIL PROTECTED] Asset}</li>
-     * <li>Service: Injects based on the [EMAIL PROTECTED] Service} 
annotation, if present</li>
-     * </ul>
+     * <dl>
+     * <dt>Alias</dt> <dd> Searches by type among [EMAIL PROTECTED] 
AliasContribution contributions} to the
+     * [EMAIL PROTECTED] Alias} service</dd>
+     * <dt>Asset<dt> <dd> Checks for the [EMAIL PROTECTED] Path} annotation, 
and injects an [EMAIL PROTECTED] Asset}</dd>
+     * <dt>Service</dt> <dd>Injects based on the [EMAIL PROTECTED] Service} 
annotation, if present</dd>
+     * </dl>
      */
     public static void 
contributeMasterObjectProvider(OrderedConfiguration<ObjectProvider> 
configuration,
 

Modified: 
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.tml
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.tml?rev=610864&r1=610863&r2=610864&view=diff
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.tml
 (original)
+++ 
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.tml
 Thu Jan 10 10:41:08 2008
@@ -1,11 +1,19 @@
-<div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
-  
-  <t:block id="enum">
-    ${convertedEnumValue}
-  </t:block>
-  
-  <t:block id="date">
-    <t:output value="context.propertyValue" format="dateFormat"/>
-  </t:block>
-  
-</div>
\ No newline at end of file
+<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
+
+    <t:block id="enum">
+        ${convertedEnumValue}
+    </t:block>
+
+    <t:block id="date">
+        <t:output value="context.propertyValue" format="dateFormat"/>
+    </t:block>
+
+    <t:block id="password">
+        <t:delegate to="passwordRenderer"/>
+    </t:block>
+
+    <t:block id="longtext">
+        <t:textoutput value="context.propertyValue"/>
+    </t:block>
+
+</t:container>
\ No newline at end of file

Modified: 
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyEditBlocks.tml
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyEditBlocks.tml?rev=610864&r1=610863&r2=610864&view=diff
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyEditBlocks.tml
 (original)
+++ 
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyEditBlocks.tml
 Thu Jan 10 10:41:08 2008
@@ -1,23 +1,33 @@
 <div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
-  
-  <t:block id="text">
-    <t:label for="textField"/>
-    <input t:id="textField"/>
-  </t:block>  
-  
-  <t:block id="enum">
-    <t:label for="select"/>
-    <input t:id="select"/>
-  </t:block>
-  
-  <t:block id="checkbox">
-    <t:label for="checkboxField"/>
-    <input t:id="checkboxField"/>
-  </t:block>
-  
-  <t:block id="date">
-    <t:label for="dateField"/>
-    <input t:id="dateField"/>
-  </t:block>
-  
+
+    <t:block id="text">
+        <t:label for="textField"/>
+        <input t:id="textField"/>
+    </t:block>
+
+    <t:block id="enum">
+        <t:label for="select"/>
+        <input t:id="select"/>
+    </t:block>
+
+    <t:block id="checkbox">
+        <t:label for="checkboxField"/>
+        <input t:id="checkboxField"/>
+    </t:block>
+
+    <t:block id="date">
+        <t:label for="dateField"/>
+        <input t:id="dateField"/>
+    </t:block>
+
+    <t:block id="password">
+        <t:label for="passwordField"/>
+        <input t:id="passwordField"/>
+    </t:block>
+
+    <t:block id="longtext">
+        <t:label for="textarea"/>
+        <textarea t:id="textarea"/>
+    </t:block>
+
 </div>

Modified: tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt?rev=610864&r1=610863&r2=610864&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt Thu Jan 10 
10:41:08 2008
@@ -13,6 +13,9 @@
   Progress on Tapestry 5 is really taking off. This space lists some cool new 
features that have been added
   recently.
 
+  * Support for "password" and "longtext" data types (for use with the 
BeanEditor), and a new
+    
{{{../apidocs/org/apache/tapestry/corelib/components/TextOutput.html}TextOutput}}
 component.
+
   * The new "var:" binding prefix allows for temporary, untyped storage
     of render-time values without having to define a new component property.
 

Added: 
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/TextOutputTest.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/TextOutputTest.java?rev=610864&view=auto
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/TextOutputTest.java
 (added)
+++ 
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/TextOutputTest.java
 Thu Jan 10 10:41:08 2008
@@ -0,0 +1,55 @@
+// Copyright 2008 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.
+
+package org.apache.tapestry.corelib.components;
+
+import org.apache.tapestry.MarkupWriter;
+import org.apache.tapestry.dom.XMLMarkupModel;
+import org.apache.tapestry.internal.services.MarkupWriterImpl;
+import org.apache.tapestry.internal.test.InternalBaseTestCase;
+import org.testng.annotations.Test;
+
+public class TextOutputTest extends InternalBaseTestCase
+{
+    @Test
+    public void null_value_is_noop()
+    {
+        MarkupWriter writer = mockMarkupWriter();
+
+        replay();
+
+        TextOutput component = new TextOutput();
+
+        component.beginRender(writer);
+
+        verify();
+    }
+
+    @Test
+    public void normal_output()
+    {
+        MarkupWriter writer = new MarkupWriterImpl(new XMLMarkupModel());
+
+        TextOutput component = new TextOutput();
+
+        component.injectValue("Fred\nBarney\rWilma\r\nBetty\nBam-Bam\n");
+
+        writer.element("div");
+        component.beginRender(writer);
+        writer.end();
+
+        assertEquals(writer.toString(),
+                     "<?xml version=\"1.0\"?>\n" + 
"<div><p>Fred</p><p>Barney</p><p>Wilma</p><p>Betty</p><p>Bam-Bam</p></div>");
+    }
+}

Modified: 
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java?rev=610864&r1=610863&r2=610864&view=diff
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
 (original)
+++ 
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
 Thu Jan 10 10:41:08 2008
@@ -548,6 +548,8 @@
         type("birthYear", "");
         select("sex", "label=Martian");
         click("citizen");
+        type("password", "abracadabra");
+        type("notes", "line1\nline2\nline3");
 
         clickAndWait(SUBMIT);
 
@@ -558,13 +560,16 @@
         type("firstName", "Howard");
         type("lastName", "Lewis Ship");
         type("birthYear", "1966");
+        type("password", "supersecret");
 
         clickAndWait(SUBMIT);
 
-        // The XPath support is too week for //[EMAIL 
PROTECTED]'t-beandisplay-value'][%d], so we
+        // The XPath support is too weak for //[EMAIL 
PROTECTED]'t-beandisplay-value'][%d], so we
         // just look for the text itself.
 
-        assertTextPresent("Howard", "Lewis Ship", "1966", "Martian", "U. S. 
Citizen");
+        assertTextPresent("Howard", "Lewis Ship", "1966", "Martian", "U. S. 
Citizen", "***********", "line1", "line2",
+                          "line3");
+
     }
 
     @Test
@@ -577,6 +582,7 @@
 
         type("firstName", "Howard");
         type("lastName", "Lewis Ship");
+        type("password", "supersecret");
 
         clickAndWait("//[EMAIL PROTECTED]'submit\']");
 
@@ -802,6 +808,8 @@
         type("firstName", "Howard");
         type("lastName", "Lewis Ship");
         type("birthYear", "1000");
+        type("password", "supersecret");
+
         click(SUBMIT);
 
         type("birthYear", "1966");

Modified: 
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/RegistrationData.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/RegistrationData.java?rev=610864&r1=610863&r2=610864&view=diff
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/RegistrationData.java
 (original)
+++ 
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/RegistrationData.java
 Thu Jan 10 10:41:08 2008
@@ -14,10 +14,7 @@
 
 package org.apache.tapestry.integration.app1.data;
 
-import org.apache.tapestry.beaneditor.OrderAfter;
-import org.apache.tapestry.beaneditor.OrderBefore;
-import org.apache.tapestry.beaneditor.Validate;
-import org.apache.tapestry.beaneditor.Width;
+import org.apache.tapestry.beaneditor.*;
 
 public class RegistrationData
 {
@@ -31,6 +28,10 @@
 
     private boolean _citizen;
 
+    private String _password;
+
+    private String _notes;
+
     @OrderAfter("lastName")
     @Validate("min=1900,max=2007")
     @Width(4)
@@ -57,6 +58,18 @@
         return _lastName;
     }
 
+    @Validate("required,minlength=6")
+    @DataType("password")
+    public String getPassword()
+    {
+        return _password;
+    }
+
+    public void setPassword(String password)
+    {
+        _password = password;
+    }
+
     public boolean isCitizen()
     {
         return _citizen;
@@ -86,5 +99,16 @@
     public void setCitizen(boolean citizen)
     {
         _citizen = citizen;
+    }
+
+    @DataType("longtext")
+    public String getNotes()
+    {
+        return _notes;
+    }
+
+    public void setNotes(String notes)
+    {
+        _notes = notes;
     }
 }


Reply via email to