tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r306877 - in /jakarta/tapestry/trunk/examples/Vlib/src: context/ context/WEB-INF/ java/org/apache/tapestry/vlib/components/ java/org/apache/tapestry/vlib/pages/ java/org/apache/tapestry/vlib/pages/admin/
Date Thu, 06 Oct 2005 20:26:52 GMT
Author: hlship
Date: Thu Oct  6 13:26:42 2005
New Revision: 306877

URL: http://svn.apache.org/viewcvs?rev=306877&view=rev
Log:
Continue revving Virtual Library for Tapestry 4.0

Modified:
    jakarta/tapestry/trunk/examples/Vlib/src/context/Register.html
    jakarta/tapestry/trunk/examples/Vlib/src/context/TransferBooksSelect.html
    jakarta/tapestry/trunk/examples/Vlib/src/context/TransferBooksTransfer.html
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ColumnSorter.html
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ColumnSorter.jwc
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Register.page
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Register.properties
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowError.html
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowMessage.html
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowValidationError.html
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksSelect.page
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksSelect.properties
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksTransfer.page
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksTransfer.properties
    jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/ColumnSorter.java
    jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Register.java
    jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/TransferBooksSelect.java
    jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/TransferBooksTransfer.java

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/Register.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/Register.html?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/Register.html (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/Register.html Thu Oct  6 13:26:42 2005
@@ -1,7 +1,7 @@
 <html jwcid="$content$">
 <body jwcid="@Border">
 
-<form jwcid="@Form" listener="listener:attemptRegister" delegate="ognl:beans.delegate">
+<form jwcid="form">
 	
 <p>
 	Please enter your registration information here; this will allow you to access the Virtual
Library.
@@ -10,38 +10,38 @@
 </p>
 
 <span jwcid="@ShowError"/>
-<span jwcid="@ShowValidationError" delegate="ognl:beans.delegate"/>
+<span jwcid="@ShowValidationError"/>
 
   <table class="form">
     <tr>
       <th>First Name</th>
       <td></td>
-      <td><input jwcid="inputFirstName@TextField" value="ognl:firstName" type="text"
size="30" maxlength="30"/>
+      <td><input jwcid="firstName@TextField" value="ognl:firstName" type="text"
size="30" maxlength="30"/>
       </td>
     </tr>
     <tr>
-      <th><span jwcid="@FieldLabel" field="ognl:components.inputLastName">Last
Name</span>
+      <th><span jwcid="@FieldLabel" field="component:lastName">Last Name</span>
       </th>
       <td><span class="required-field">*</span></td>
-      <td><input jwcid="inputLastName" type="text" size="30" maxlength="30"/>
+      <td><input jwcid="lastName" type="text" size="30" maxlength="30"/>
       </td>
     </tr>
     <tr>
-      <th><span jwcid="@FieldLabel" field="ognl:components.inputEmail">E-mail</span>
     </th>
+      <th><span jwcid="@FieldLabel" field="component:email">E-mail</span>
     </th>
       <td><span class="required-field">*</span></td>
-      <td><input jwcid="inputEmail" type="text" size="30" maxlength="60"/>
+      <td><input jwcid="email" type="text" size="30" maxlength="60"/>
       </td>
     </tr>
     <tr>
-      <th><span jwcid="@FieldLabel" field="ognl:components.inputPassword1">Password</span>
     </th>
+      <th><span jwcid="@FieldLabel" field="component:password1">Password</span>
     </th>
       <td><span class="required-field">*</span></td>
-      <td><input jwcid="inputPassword1" type="password" size="20" maxlength="20"/>
+      <td><input jwcid="password1" type="password" size="20" maxlength="20"/>
       </td>
     </tr>
     <tr>
-      <th><span jwcid="@FieldLabel" field="ognl:components.inputPassword2">Password
(again)</span>      </th>
+      <th><span jwcid="@FieldLabel" field="component:password2">Password (again)</span>
     </th>
       <td><span class="required-field">*</span></td>
-      <td><input jwcid="inputPassword2" type="password" size="20" maxlength="20"/>
+      <td><input jwcid="password2" type="password" size="20" maxlength="20"/>
       </td>
     </tr>
    	<tr>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/TransferBooksSelect.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/TransferBooksSelect.html?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/TransferBooksSelect.html (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/TransferBooksSelect.html Thu Oct  6 13:26:42
2005
@@ -1,5 +1,5 @@
 <html jwcid="$content$">
-<body jwcid="@Border">
+<body jwcid="border@Border">
 	
 <p>This form allows you to transfer ownership of books from one user to another.  It
consists of a two-part
 	wizard.</p>
@@ -15,21 +15,22 @@
 
 <span jwcid="@ShowMessage"/>
 <span jwcid="@ShowError"/>
+<span jwcid="@ShowValidationError"/>
 
-<form jwcid="@Form" listener="listener:formSubmit">
+<form jwcid="form">
   <table class="form">
     <tr>
       <th>Move from:
       </th>
       <td>
-        <select jwcid="from@PropertySelection" value="ognl:fromUserId" model="ognl:engine.personModel"/>
+        <select jwcid="from"/>
       </td>
     </tr>
     <tr>
       <th>Move to:
       </th>
       <td>
-        <select jwcid="to@PropertySelection" value="ognl:toUserId" model="ognl:engine.personModel"/>
+        <select jwcid="to"/>
       </td>
     </tr>
     <tr>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/TransferBooksTransfer.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/TransferBooksTransfer.html?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/TransferBooksTransfer.html (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/TransferBooksTransfer.html Thu Oct  6
13:26:42 2005
@@ -1,5 +1,5 @@
 <html jwcid="$content$">
-<body jwcid="@Border">
+<body jwcid="border@Border">
 	
 <p>This form allows you to transfer ownership of books from one user to another.  It
consists of a two-part
 	wizard.</p>
@@ -17,8 +17,9 @@
 <br clear="left"/>
 
 <span jwcid="@ShowError"/>
-
-<form jwcid="@Form" listener="listener:formSubmit">
+<span jwcid="@ShowValidationError"/>
+    
+<form jwcid="form">
 
 <select jwcid="selectBooks"/>
 

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ColumnSorter.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ColumnSorter.html?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ColumnSorter.html (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ColumnSorter.html Thu Oct  6
13:26:42 2005
@@ -1,6 +1,6 @@
 <span jwcid="$content$">
 <a jwcid="link"><span jwcid="@RenderBody"/></a>
-<span jwcid="@Conditional" condition="ognl:sortColumn == selected">
+<span jwcid="@If" condition="ognl:sortColumn == selected">
 <a jwcid="iconLink"><img jwcid="rollover" width="17" height="16" alt="Re-sort Column"/></a>
 </span>
 </span>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ColumnSorter.jwc
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ColumnSorter.jwc?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ColumnSorter.jwc (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ColumnSorter.jwc Thu Oct  6 13:26:42
2005
@@ -16,36 +16,19 @@
 -->
 
 <!DOCTYPE component-specification PUBLIC 
-  "-//Apache Software Foundation//Tapestry Specification 3.0//EN" 
-  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
-
-<component-specification
-	class="org.apache.tapestry.vlib.components.ColumnSorter"
-  allow-body="yes" allow-informal-parameters="no">
-
-  <parameter name="selected" type="org.apache.tapestry.vlib.ejb.SortColumn" required="yes"
direction="auto"/>
-  <parameter name="descending" type="boolean" required="yes" direction="auto"/>
-  <parameter name="sortColumn" type="org.apache.tapestry.vlib.ejb.SortColumn" required="yes"
direction="auto"/>
-  <parameter name="listener" type="org.apache.tapestry.IActionListener" required="yes"
direction="auto"/>
-  
+  "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
+  "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
+<component-specification allow-body="yes" allow-informal-parameters="no">
   <component id="link" type="DirectLink">
-  	<binding name="listener" expression="listeners.handleClick"/>	
+    <binding name="listener" value="listener:handleClick"/>
   </component>
-  
   <component id="iconLink" copy-of="link"/>
-  
   <component id="rollover" type="Rollover">
-  		<binding name="image">
-  			descending ? assets.down : assets.up	
-  		</binding>
-  		<binding name="focus">
-  			descending ? assets.down_h : assets.up_h
-  		</binding>
+    <binding name="image"> descending ? assets.down : assets.up </binding>
+    <binding name="focus"> descending ? assets.down_h : assets.up_h </binding>
   </component>
-  
-  <context-asset name="up" path="images/sort-up.png"/>
-  <context-asset name="up_h" path="images/sort-up_h.png"/>
-  <context-asset name="down" path="images/sort-down.png"/>
-  <context-asset name="down_h" path="images/sort-down_h.png"/>
-  
-</component-specification>
\ No newline at end of file
+  <asset name="up" path="images/sort-up.png"/>
+  <asset name="up_h" path="images/sort-up_h.png"/>
+  <asset name="down" path="images/sort-down.png"/>
+  <asset name="down_h" path="images/sort-down_h.png"/>
+</component-specification>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Register.page
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Register.page?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Register.page (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Register.page Thu Oct  6 13:26:42
2005
@@ -16,52 +16,41 @@
 -->
 
 <!DOCTYPE page-specification PUBLIC 
-  "-//Apache Software Foundation//Tapestry Specification 3.0//EN" 
-  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
+  "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
+  "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
 	
-<page-specification class="org.apache.tapestry.vlib.pages.Register">
+<page-specification>
 
-  <property name="page-type" value="Login"/>
-
-  <property-specification name="error" type="java.lang.String"/>
-  <property-specification name="firstName" type="java.lang.String"/>
-  <property-specification name="lastName" type="java.lang.String"/>
-  <property-specification name="email" type="java.lang.String"/>
-  <property-specification name="password1" type="java.lang.String"/>
-  <property-specification name="password2" type="java.lang.String"/>
-  
-   <bean name="delegate" class="org.apache.tapestry.vlib.VirtualLibraryDelegate"/>
-  
-  <bean name="validator" class="org.apache.tapestry.valid.StringValidator" lifecycle="page">
-  	<set-property name="required" expression="true"/>
-  	<set-property name="clientScriptingEnabled" expression="true"/>
-  </bean>
-  
-  <component id="inputLastName" type="ValidField">
-    <binding name="value" expression="lastName"/>
-    <static-binding name="displayName" value="Last Name"/>
-    <binding name="validator" expression="beans.validator"/>
+  <component id="form" type="Form">
+    <binding name="delegate" value="validationDelegate"/>
+    <binding name="listener" value="listener:attemptRegister"/>
+    <binding name="clientValidationEnabled" value="true"/>
   </component>
   
-  <component id="inputEmail" type="ValidField">
-    <binding name="value" expression="email"/>
-    <binding name="validator" expression="beans.validator"/>
-    <static-binding name="displayName" value="E-Mail"/>
+  <component id="lastName" type="TextField">
+    <binding name="value" value="lastName"/>
+    <binding name="displayName" value="message:last-name-label"/>
+    <binding name="validators" value="validators:required"/>
   </component>
   
-  <component id="inputPassword1" type="ValidField">
-    <binding name="value" expression="password1"/>
-    <static-binding name="displayName" value="Password"/>
-    <binding name="validator" expression="beans.validator"/>
-    <binding name="hidden" expression="true"/>
+  <component id="email" type="TextField">
+    <binding name="value" value="email"/>
+    <binding name="validators" value="validators:required"/>
+    <binding name="displayName" value="message:email-label"/>
   </component>
   
-  
-  <component id="inputPassword2" type="ValidField">
-    <binding name="value" expression="password2"/>
-    <static-binding name="displayName" value="Password (again)"/>
-    <binding name="validator" expression="beans.validator"/>
-    <binding name="hidden" expression="true"/>
+  <component id="password1" type="TextField">
+    <binding name="value" value="password1"/>
+    <binding name="displayName" value="message:password-label"/>
+    <binding name="validators" value="validators:required"/>
+    <binding name="hidden" value="true"/>
   </component>
+  
+  <component id="password2" type="TextField">
+    <binding name="value" value="password2"/>
+    <binding name="displayName" value="message:password2-label"/>
+    <binding name="validators" value="validators:required"/>
+    <binding name="hidden" value="true"/>
+  </component>  
 
 </page-specification>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Register.properties
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Register.properties?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Register.properties (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Register.properties Thu Oct 
6 13:26:42 2005
@@ -12,4 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-password-must-match=Enter the same password in both fields.
\ No newline at end of file
+password-must-match=Enter the same password in both fields.
+last-name-label=Last Name
+email-label=E-Mail
+password-label=Password
+password2-label=Password (again)
\ No newline at end of file

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowError.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowError.html?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowError.html (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowError.html Thu Oct  6 13:26:42
2005
@@ -1,5 +1,5 @@
 <span jwcid="$content$">
-	<span jwcid="@If" condition="ognl:page.error">
+	<span jwcid="@If" condition="ognl:page.error" volatile="true">
 		<div class="error">
 			<table>
 				<tr>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowMessage.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowMessage.html?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowMessage.html (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowMessage.html Thu Oct  6 13:26:42
2005
@@ -1,6 +1,6 @@
 <span jwcid="$content$">
 
-<span jwcid="@If" condition="ognl:page.message">
+<span jwcid="@If" condition="ognl:page.message" volatile="true">
 
 <span jwcid="@Information">
     <span class="message" jwcid="@Insert" value="ognl:page.message">Info Message</span>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowValidationError.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowValidationError.html?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowValidationError.html (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ShowValidationError.html Thu
Oct  6 13:26:42 2005
@@ -1,5 +1,5 @@
 <span jwcid="$content$">
-	<span jwcid="@If" condition="ognl:delegate.hasErrors">
+	<span jwcid="@If" condition="ognl:delegate.hasErrors" volatile="true">
 		<div class="error">
 			<table>
 				<tr>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksSelect.page
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksSelect.page?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksSelect.page (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksSelect.page Thu
Oct  6 13:26:42 2005
@@ -16,18 +16,30 @@
 -->
 
 <!DOCTYPE page-specification PUBLIC 
-  "-//Apache Software Foundation//Tapestry Specification 3.0//EN" 
-  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
+  "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
+  "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
 
 <page-specification class="org.apache.tapestry.vlib.pages.admin.TransferBooksSelect">
 
-  <property name="page-type" value="TransferBooks"/>
+  <component id="form" type="Form">
+    <binding name="success" value="listener:formSubmit"/>
+    <binding name="clientValidationEnabled" value="true"/>
+  </component>
   
-  <property-specification name="message" type="java.lang.String"/>
-  <property-specification name="error" type="java.lang.String"/>
+  <component id="from" type="PropertySelection">
+    <binding name="value" value="fromUserId"/>
+    <binding name="model" value="engine.personModel"/>
+    <binding name="displayName" value="message:from-label"/>
+    <binding name="validators" value="validators:required"/>
+  </component>
   
-  <property-specification name="fromUserId" type="java.lang.Integer" persistent="yes"/>
-  <property-specification name="toUserId" type="java.lang.Integer" persistent="yes"/>
+  
+  <component id="to" type="PropertySelection">
+    <binding name="value" value="toUserId"/>
+    <binding name="model" value="engine.personModel"/>
+    <binding name="displayName" value="message:to-label"/>
+    <binding name="validators" value="validators:required"/>
+  </component>  
   
 </page-specification>
 

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksSelect.properties
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksSelect.properties?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksSelect.properties
(original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksSelect.properties
Thu Oct  6 13:26:42 2005
@@ -12,4 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-select-different-users=Select two different users.
\ No newline at end of file
+select-different-users=Select two different users.
+from-label=From User
+to-label=To User
\ No newline at end of file

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksTransfer.page
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksTransfer.page?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksTransfer.page (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksTransfer.page Thu
Oct  6 13:26:42 2005
@@ -16,29 +16,25 @@
 -->
 
 <!DOCTYPE page-specification PUBLIC 
-  "-//Apache Software Foundation//Tapestry Specification 3.0//EN" 
-  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
+  "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
+  "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
 
 <page-specification class="org.apache.tapestry.vlib.pages.admin.TransferBooksTransfer">
 
-  <property name="page-type" value="TransferBooks"/>
-  
-  <property-specification name="message" type="java.lang.String"/>
-  <property-specification name="error" type="java.lang.String"/>
-  
-  <property-specification name="fromUserId" type="java.lang.Integer" persistent="yes"/>
-  <property-specification name="fromUser" type="org.apache.tapestry.vlib.ejb.Person"/>
-  <property-specification name="toUserId" type="java.lang.Integer" persistent="yes"/>
-  <property-specification name="toUser" type="org.apache.tapestry.vlib.ejb.Person"/>
-  <property-specification name="userBookModel" type="org.apache.tapestry.form.IPropertySelectionModel"/>
-  <property-specification name="selectedBooks" type="java.util.List"/>
-    
+  <component id="form" type="Form">
+    <binding name="success" value="listener:formSubmit"/>
+    <binding name="clientValidationEnabled" value="true"/>
+    <binding name="delegate" value="validationDelegate"/>
+  </component>
+
   <component id="selectBooks" type="contrib:Palette">
-    <binding name="model" expression="userBookModel"/>
-    <binding name="sort" expression="@org.apache.tapestry.contrib.palette.SortMode@LABEL"/>
-    <binding name="selected" expression="selectedBooks"/>
-    <binding name="selectedTitleBlock" expression="components.selectedTitle"/>
-    <binding name="availableTitleBlock" expression="components.availableTitle"/>
+    <binding name="model" value="userBookModel"/>
+    <binding name="sort" value="@org.apache.tapestry.contrib.palette.SortMode@LABEL"/>
+    <binding name="selected" value="selectedBooks"/>
+    <binding name="selectedTitleBlock" value="component:selectedTitle"/>
+    <binding name="availableTitleBlock" value="component:availableTitle"/>
+    <binding name="displayName" value="message:select-label"/>
+    <binding name="validators" value="validators:required"/>
   </component>
   
 </page-specification>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksTransfer.properties
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksTransfer.properties?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksTransfer.properties
(original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/TransferBooksTransfer.properties
Thu Oct  6 13:26:42 2005
@@ -14,4 +14,5 @@
 
 user-has-no-books=User {0} owns no books to transfer.
 no-books-selected=You must select at least one book to transfer.
-transfered-books=Transfered {0} books from {1} to {2}.
\ No newline at end of file
+transfered-books=Transfered {0} books from {1} to {2}.
+select-label=Books
\ No newline at end of file

Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/ColumnSorter.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/ColumnSorter.java?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/ColumnSorter.java
(original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/ColumnSorter.java
Thu Oct  6 13:26:42 2005
@@ -18,6 +18,7 @@
 import org.apache.tapestry.IActionListener;
 import org.apache.tapestry.IRequestCycle;
 import org.apache.tapestry.Tapestry;
+import org.apache.tapestry.annotations.Parameter;
 import org.apache.tapestry.vlib.ejb.SortColumn;
 
 /**
@@ -29,16 +30,20 @@
 
 public abstract class ColumnSorter extends BaseComponent
 {
+    @Parameter(required = true)
     public abstract SortColumn getSortColumn();
 
+    @Parameter(required = true)
     public abstract SortColumn getSelected();
 
     public abstract void setSelected(SortColumn selected);
 
+    @Parameter(required = true)
     public abstract boolean isDescending();
 
     public abstract void setDescending(boolean descending);
 
+    @Parameter(required = true)
     public abstract IActionListener getListener();
 
     public void handleClick(IRequestCycle cycle)

Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Register.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Register.java?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Register.java
(original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Register.java
Thu Oct  6 13:26:42 2005
@@ -19,11 +19,16 @@
 import javax.ejb.CreateException;
 
 import org.apache.hivemind.ApplicationRuntimeException;
-import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.annotations.Bean;
+import org.apache.tapestry.annotations.InjectComponent;
+import org.apache.tapestry.annotations.InjectPage;
+import org.apache.tapestry.annotations.Message;
+import org.apache.tapestry.annotations.Meta;
 import org.apache.tapestry.form.IFormComponent;
 import org.apache.tapestry.html.BasePage;
 import org.apache.tapestry.valid.IValidationDelegate;
 import org.apache.tapestry.vlib.IErrorProperty;
+import org.apache.tapestry.vlib.VirtualLibraryDelegate;
 import org.apache.tapestry.vlib.VirtualLibraryEngine;
 import org.apache.tapestry.vlib.ejb.IOperations;
 import org.apache.tapestry.vlib.ejb.Person;
@@ -35,9 +40,9 @@
  * @author Howard Lewis Ship
  */
 
+@Meta("page-type=Login")
 public abstract class Register extends BasePage implements IErrorProperty
 {
-
     public abstract String getFirstName();
 
     public abstract String getLastName();
@@ -52,30 +57,30 @@
 
     public abstract void setPassword2(String value);
 
-    private IValidationDelegate getValidationDelegate()
-    {
-        return (IValidationDelegate) getBeans().getBean("delegate");
-    }
+    @Bean(VirtualLibraryDelegate.class)
+    public abstract IValidationDelegate getValidationDelegate();
 
-    private void setErrorField(String componentId, String message)
-    {
-        IValidationDelegate delegate = getValidationDelegate();
-        IFormComponent field = (IFormComponent) getComponent(componentId);
+    @InjectComponent("password1")
+    public abstract IFormComponent getPassword1Field();
 
-        delegate.setFormComponent(field);
-        delegate.record(message, null);
-    }
+    @InjectComponent("password2")
+    public abstract IFormComponent getPassword2Field();
+
+    @Message
+    public abstract String passwordMustMatch();
+
+    @InjectPage("Login")
+    public abstract Login getLogin();
 
-    private void clear(String componentId)
+    private void clear(IFormComponent field)
     {
         IValidationDelegate delegate = getValidationDelegate();
-        IFormComponent component = (IFormComponent) getComponent(componentId);
 
-        delegate.setFormComponent(component);
+        delegate.setFormComponent(field);
         delegate.recordFieldInputValue(null);
     }
 
-    public void attemptRegister(IRequestCycle cycle)
+    public void attemptRegister()
     {
         IValidationDelegate delegate = getValidationDelegate();
 
@@ -85,22 +90,23 @@
         setPassword1(null);
         setPassword2(null);
 
-        clear("inputPassword1");
-        clear("inputPassword2");
+        clear(getPassword1Field());
+        clear(getPassword1Field());
 
         if (delegate.getHasErrors())
             return;
+
         // Note: we know password1 and password2 are not null
         // because they are required fields.
 
         if (!password1.equals(password2))
         {
-            setErrorField("inputPassword1", getMessage("password-must-match"));
+            delegate.record(getPassword1Field(), passwordMustMatch());
             return;
         }
 
         VirtualLibraryEngine vengine = (VirtualLibraryEngine) getEngine();
-        Login login = (Login) cycle.getPage("Login");
+        Login login = getLogin();
 
         int i = 0;
         while (true)

Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/TransferBooksSelect.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/TransferBooksSelect.java?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/TransferBooksSelect.java
(original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/TransferBooksSelect.java
Thu Oct  6 13:26:42 2005
@@ -14,35 +14,54 @@
 
 package org.apache.tapestry.vlib.pages.admin;
 
-import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.annotations.Bean;
+import org.apache.tapestry.annotations.InjectComponent;
+import org.apache.tapestry.annotations.InjectPage;
+import org.apache.tapestry.annotations.Message;
+import org.apache.tapestry.annotations.Meta;
+import org.apache.tapestry.form.IFormComponent;
+import org.apache.tapestry.valid.IValidationDelegate;
 import org.apache.tapestry.vlib.AdminPage;
+import org.apache.tapestry.vlib.VirtualLibraryDelegate;
 
 /**
  * First page in Transfer Books wizard; allows the two users to be selected.
  * 
  * @author Howard Lewis Ship
  */
-
+@Meta("page-type=TransferBooks")
 public abstract class TransferBooksSelect extends AdminPage
 {
     public abstract Integer getFromUserId();
 
     public abstract Integer getToUserId();
 
-    public void formSubmit(IRequestCycle cycle)
+    @Message
+    public abstract String selectDifferentUsers();
+
+    @InjectComponent("to")
+    public abstract IFormComponent getToField();
+
+    @Bean(VirtualLibraryDelegate.class)
+    public abstract IValidationDelegate getValidationDelegate();
+
+    @InjectPage("TransferBooksTransfer")
+    public abstract TransferBooksTransfer getNextPage();
+
+    public void formSubmit()
     {
         Integer fromUserId = getFromUserId();
         Integer toUserId = getToUserId();
 
         if (fromUserId.equals(toUserId))
         {
-            setError(getMessage("select-different-users"));
+            getValidationDelegate().record(getToField(), selectDifferentUsers());
             return;
         }
 
-        TransferBooksTransfer next = (TransferBooksTransfer) cycle.getPage("TransferBooksTransfer");
+        TransferBooksTransfer next = getNextPage();
 
-        next.activate(cycle, fromUserId, toUserId);
+        next.activate(fromUserId, toUserId);
     }
 
 }

Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/TransferBooksTransfer.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/TransferBooksTransfer.java?rev=306877&r1=306876&r2=306877&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/TransferBooksTransfer.java
(original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/TransferBooksTransfer.java
Thu Oct  6 13:26:42 2005
@@ -20,15 +20,20 @@
 import javax.ejb.FinderException;
 
 import org.apache.hivemind.ApplicationRuntimeException;
-import org.apache.tapestry.IRequestCycle;
-import org.apache.tapestry.Tapestry;
+import org.apache.tapestry.IPage;
+import org.apache.tapestry.annotations.Bean;
+import org.apache.tapestry.annotations.InjectPage;
+import org.apache.tapestry.annotations.Message;
+import org.apache.tapestry.annotations.Meta;
+import org.apache.tapestry.annotations.Persist;
+import org.apache.tapestry.event.PageBeginRenderListener;
 import org.apache.tapestry.event.PageEvent;
-import org.apache.tapestry.event.PageRenderListener;
 import org.apache.tapestry.form.IPropertySelectionModel;
+import org.apache.tapestry.valid.IValidationDelegate;
 import org.apache.tapestry.vlib.AdminPage;
 import org.apache.tapestry.vlib.EntitySelectionModel;
 import org.apache.tapestry.vlib.IErrorProperty;
-import org.apache.tapestry.vlib.IMessageProperty;
+import org.apache.tapestry.vlib.VirtualLibraryDelegate;
 import org.apache.tapestry.vlib.VirtualLibraryEngine;
 import org.apache.tapestry.vlib.ejb.Book;
 import org.apache.tapestry.vlib.ejb.IBookQuery;
@@ -43,16 +48,19 @@
  * @since 3.0
  */
 
-public abstract class TransferBooksTransfer extends AdminPage implements PageRenderListener
+@Meta("page-type=TransferBooks")
+public abstract class TransferBooksTransfer extends AdminPage implements PageBeginRenderListener
 {
     public abstract Person getFromUser();
 
     public abstract void setFromUser(Person fromUser);
 
+    @Persist("client")
     public abstract Integer getFromUserId();
 
     public abstract void setFromUserId(Integer fromUserId);
 
+    @Persist("client")
     public abstract Integer getToUserId();
 
     public abstract void setToUserId(Integer toUserId);
@@ -67,7 +75,19 @@
 
     public abstract void setUserBookModel(IPropertySelectionModel userBookModel);
 
-    public void activate(IRequestCycle cycle, Integer fromUserId, Integer toUserId)
+    @Bean(VirtualLibraryDelegate.class)
+    public abstract IValidationDelegate getValidationDelegate();
+
+    @Message
+    public abstract String userHasNoBooks(String userName);
+
+    @InjectPage("TransferBooksSelect")
+    public abstract TransferBooksSelect getSelectPage();
+
+    @Message
+    public abstract String transferedBooks(int count, String fromName, String toName);
+
+    public void activate(Integer fromUserId, Integer toUserId)
     {
         Person fromUser = readPerson(fromUserId);
 
@@ -75,8 +95,8 @@
 
         if (model.getOptionCount() == 0)
         {
-            IErrorProperty page = (IErrorProperty) cycle.getPage();
-            page.setError(format("user-has-no-books", fromUser.getNaturalName()));
+            IErrorProperty page = getSelectPage();
+            page.setError(userHasNoBooks(fromUser.getNaturalName()));
             return;
         }
 
@@ -87,7 +107,7 @@
 
         setUserBookModel(model);
 
-        cycle.activate(this);
+        getRequestCycle().activate(this);
     }
 
     /**
@@ -116,19 +136,11 @@
         }
     }
 
-    public void formSubmit(IRequestCycle cycle)
+    public IPage formSubmit()
     {
         List selectedBooks = getSelectedBooks();
 
-        int count = Tapestry.size(selectedBooks);
-
-        if (count == 0)
-        {
-            setError(getMessage("no-books-selected"));
-            return;
-        }
-
-        Integer[] keys = (Integer[]) selectedBooks.toArray(new Integer[count]);
+        Integer[] keys = (Integer[]) selectedBooks.toArray(new Integer[0]);
         Person toUser = getToUser();
 
         VirtualLibraryEngine vengine = (VirtualLibraryEngine) getEngine();
@@ -155,10 +167,13 @@
         }
 
         Person fromUser = getFromUser();
-        IMessageProperty selectPage = (TransferBooksSelect) cycle.getPage("TransferBooksSelect");
-        selectPage.setMessage(format("transfered-books", Integer.toString(count), fromUser
-                .getNaturalName(), toUser.getNaturalName()));
-        cycle.activate(selectPage);
+
+        TransferBooksSelect selectPage = getSelectPage();
+
+        selectPage.setMessage(transferedBooks(keys.length, fromUser.getNaturalName(), toUser
+                .getNaturalName()));
+
+        return selectPage;
     }
 
     private IPropertySelectionModel buildUserBookModel(Person user)



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message