tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r306946 - in /jakarta/tapestry/trunk/examples/Vlib/src: context/ context/WEB-INF/ java/org/apache/tapestry/vlib/components/ java/org/apache/tapestry/vlib/pages/
Date Thu, 06 Oct 2005 22:39:08 GMT
Author: hlship
Date: Thu Oct  6 15:38:49 2005
New Revision: 306946

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

Added:
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Borrow.properties
Removed:
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Browser.jwc
Modified:
    jakarta/tapestry/trunk/examples/Vlib/src/context/ViewBook.html
    jakarta/tapestry/trunk/examples/Vlib/src/context/ViewPerson.html
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/BookLink.jwc
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Borrow.jwc
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Information.html
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Information.jwc
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/PersonLink.jwc
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Question.html
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Question.jwc
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ViewBook.page
    jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ViewPerson.page
    jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/BookLink.java
    jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Borrow.java
    jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Browser.java
    jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewBook.java
    jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewPerson.java

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/ViewBook.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/ViewBook.html?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/ViewBook.html (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/ViewBook.html Thu Oct  6 15:38:49 2005
@@ -1,5 +1,5 @@
 <html jwcid="$content$">
-<body jwcid="@Border" subtitle="ognl:book.title">
+<body jwcid="border@Border" subtitle="ognl:book.title">
 <table class="form">
   <tr>
     <th>Title</th>
@@ -31,7 +31,7 @@
     <td><span jwcid="@Insert" value="ognl:book.dateAdded" format="ognl:dateFormat">Dec
24 1966</span>
     </td>
   </tr>
-<span jwcid="@Conditional" condition="ognl:! @org.apache.commons.lang.StringUtils@isEmpty(book.description)">
+<span jwcid="@If" condition="ognl:@org.apache.hivemind.HiveMind@isNonBlank(book.description)">
   <tr>
     <th>Description</th>
     <td><span jwcid="@InsertText" value="ognl:book.description">
@@ -41,7 +41,7 @@
     </td>
   </tr>
 </span>
-<span jwcid="@Conditional" condition="book.ownerPrimaryKey != book.holderPrimaryKey">
+<span jwcid="@If" condition="book.ownerPrimaryKey != book.holderPrimaryKey">
   <tr>
     <th>Held By</th>
     <td><a jwcid="holderLink" href="#">Howard Lewis Ship</a>
@@ -49,7 +49,7 @@
   </tr>
 </span>
 						
-<span jwcid="@Conditional" condition="ognl:!book.lendable">
+<span jwcid="@If" condition="ognl:!book.lendable">
   <tr>
     <td>
     </td>
@@ -59,7 +59,7 @@
 </span>
   <tr>
     <th>Borrow</th>
-    <td><a jwcid="@Borrow" book="ognl:book" href="#">Borrow</a>
+    <td><a jwcid="borrow@Borrow" book="ognl:book" href="#">Borrow</a>
     </td>
   </tr>
 </table>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/ViewPerson.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/ViewPerson.html?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/ViewPerson.html (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/ViewPerson.html Thu Oct  6 15:38:49 2005
@@ -1,5 +1,5 @@
 <html jwcid="$content$">
-<body jwcid="@Border" subtitle="ognl:person.naturalName" browser="ognl:components.browser">
+<body jwcid="border@Border" subtitle="ognl:person.naturalName" browser="component:browser">
 	
 <table class="form">
   <tr>
@@ -13,7 +13,7 @@
 </table>
 
 
-<span jwcid="@Conditional" condition="ognl:components.browser.resultCount  == 0">
+<span jwcid="@If" condition="ognl:components.browser.resultCount  == 0">
 
 <span jwcid="@Information">
 <span jwcid="@Insert" value="ognl:person.naturalName">Jim Moran</span>
@@ -21,7 +21,7 @@
 </span>
 </span>
 
-<span jwcid="@Conditional" condition="ognl:components.browser.resultCount != 0">
+<span jwcid="@If" condition="ognl:components.browser.resultCount != 0">
 
 						 
 <table class="data">
@@ -33,7 +33,7 @@
     <th>Borrow</th>
   </tr>
   <tr jwcid="browser@Browser" query="ognl:query" value="ognl:currentMatch" listener="listener:requery">
-    <td><a href="#" jwcid="@BookLink" book="ognl:currentMatch">DocBook:The Definitive
Guide</a>
+    <td><a href="#" jwcid="book@BookLink" book="ognl:currentMatch">DocBook:The
Definitive Guide</a>
     </td>
     <td><span jwcid="@Insert" value="ognl:currentMatch.author">Walsh &#38;
Muellner</span>
     </td>
@@ -41,7 +41,7 @@
     </td>
     <td><a jwcid="holderLink" href="#">Jim Moran</a>
     </td>
-    <td class="icon"><a jwcid="@Borrow" book="ognl:currentMatch" href="#"><img
src="images/checkout.png" width="25" height="26" border="0"></a>
+    <td class="icon"><a jwcid="borrow@Borrow" book="ognl:currentMatch" href="#"><img
src="images/checkout.png" width="25" height="26" border="0"/></a>
     </td>
   </tr>
 </table>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/BookLink.jwc
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/BookLink.jwc?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/BookLink.jwc (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/BookLink.jwc Thu Oct  6 15:38:49
2005
@@ -16,18 +16,14 @@
 -->
 
 <!DOCTYPE component-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">
 	
-<component-specification class="org.apache.tapestry.vlib.components.BookLink"
-	allow-body="no" 
-	allow-informal-parameters="no">
-  
-  <parameter name="book" type="org.apache.tapestry.vlib.ejb.Book" required="yes" direction="in"/>
+<component-specification allow-body="no" allow-informal-parameters="no">
   
   <component id="link" type="ExternalLink">
-    <static-binding name="page" value="ViewBook"/>
-    <binding name="parameters" expression="book.id"/>
+    <binding name="page" value="literal:ViewBook"/>
+    <binding name="parameters" value="book.id"/>
   </component>
    
 </component-specification>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Borrow.jwc
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Borrow.jwc?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Borrow.jwc (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Borrow.jwc Thu Oct  6 15:38:49
2005
@@ -16,29 +16,20 @@
 -->
 
 <!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.Borrow"
-	allow-body="no" 
-	allow-informal-parameters="no">
-	
-  <parameter name="book" type="org.apache.tapestry.vlib.ejb.Book" required="yes" direction="in"/>
-    
+  "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
+  "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
+<component-specification allow-body="no" allow-informal-parameters="no">
   <component id="link" type="DirectLink">
-    <binding name="parameters" expression="book.id"/>
-    <binding name="listener" expression="listeners.borrow"/>
-    <binding name="disabled" expression="linkDisabled"/>
+    <binding name="parameters" value="book.id"/>
+    <binding name="listener" value="listener:borrow"/>
+    <binding name="disabled" value="linkDisabled"/>
   </component>
-  
   <component id="rollover" type="Rollover">
-  	<binding name="image" expression="assets.enabled"/>
-  	<binding name="disabled" expression="assets.disabled"/>
-  	<binding name="focus" expression="assets.focus"/>
+    <binding name="image" value="asset:enabled"/>
+    <binding name="disabled" value="asset:disabled"/>
+    <binding name="focus" value="asset:focus"/>
   </component>
-  
-  <context-asset name="enabled" path="images/checkout.png"/>
-  <context-asset name="focus" path="images/checkout_h.png"/>
-  <context-asset name="disabled" path="images/spacer.png"/>
-  
+  <asset name="enabled" path="images/checkout.png"/>
+  <asset name="focus" path="images/checkout_h.png"/>
+  <asset name="disabled" path="images/spacer.png"/>
 </component-specification>

Added: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Borrow.properties
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Borrow.properties?rev=306946&view=auto
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Borrow.properties (added)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Borrow.properties Thu Oct  6
15:38:49 2005
@@ -0,0 +1,15 @@
+# Copyright 2005 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+
+borrowed-book=Borrowed: {0}
\ No newline at end of file

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Information.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Information.html?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Information.html (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Information.html Thu Oct  6 15:38:49
2005
@@ -3,7 +3,7 @@
 <div class="message">
 	<table>
 		<tr> <td>
-    <img src="images/info-icon.png" width="50" height="50" alt="Info" border="0" vspace="10">
+    <img src="images/info-icon.png" width="50" height="50" alt="Info" border="0" vspace="10"/>
     	</td>
 	<td>
     <span class="message">

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Information.jwc
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Information.jwc?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Information.jwc (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Information.jwc Thu Oct  6 15:38:49
2005
@@ -16,11 +16,6 @@
 -->
 
 <!DOCTYPE component-specification PUBLIC
-  "-//Apache Software Foundation//Tapestry Specification 3.0//EN" 
-  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
-  
-<component-specification 
-	allow-body="yes" 
-	allow-informal-parameters="no">
-  
-</component-specification>
+  "-//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"/>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/PersonLink.jwc
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/PersonLink.jwc?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/PersonLink.jwc (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/PersonLink.jwc Thu Oct  6 15:38:49
2005
@@ -16,22 +16,14 @@
 -->
 
 <!DOCTYPE component-specification PUBLIC
-  "-//Apache Software Foundation//Tapestry Specification 3.0//EN" 
-  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
-  
-<component-specification 
-	allow-body="no" 
-	allow-informal-parameters="no">
-  
-  <parameter name="name" type="java.lang.String" required="yes" direction="in"/>
-  
-  <parameter name="id" type="java.lang.Integer" required="yes" direction="in" property-name="personId"/>
-  
-  <parameter name="omit" type="boolean" direction="in"/>
-   
+  "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
+  "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
+<component-specification allow-body="no" allow-informal-parameters="no">
+  <parameter name="name" required="yes"/>
+  <parameter name="id" required="yes" property="personId"/>
+  <parameter name="omit"/>
   <component id="link" type="ExternalLink">
-    <static-binding name="page" value="ViewPerson"/>
-    <binding name="parameters" expression="personId"/>
-  </component>  
-  
+    <binding name="page" value="literal:ViewPerson"/>
+    <binding name="parameters" value="personId"/>
+  </component>
 </component-specification>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Question.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Question.html?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Question.html (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Question.html Thu Oct  6 15:38:49
2005
@@ -3,7 +3,7 @@
 <div class="message">
 	<table>
 		<tr> <td>
-    <img src="images/question-icon.png" width="50" height="50" alt="Question" border="0"
vspace="10">
+    <img src="images/question-icon.png" width="50" height="50" alt="Question" border="0"
vspace="10"/>
     	</td>
 	<td>
     <span class="message">

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Question.jwc
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Question.jwc?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Question.jwc (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/Question.jwc Thu Oct  6 15:38:49
2005
@@ -16,8 +16,8 @@
 -->
 
 <!DOCTYPE component-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">
   
 <component-specification 
 	allow-body="yes" 

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ViewBook.page
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ViewBook.page?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ViewBook.page (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ViewBook.page Thu Oct  6 15:38:49
2005
@@ -16,25 +16,15 @@
 -->
 
 <!DOCTYPE page-specification PUBLIC 
-  "-//Apache Software Foundation//Tapestry Specification 3.0//EN" 
-  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
-	
-<page-specification class="org.apache.tapestry.vlib.pages.ViewBook">
-  
-  <property name="page-type" value="Search"/>
-  
-  <property-specification name="bookId" type="java.lang.Integer" persistent="yes"/>
-  <property-specification name="book" type="org.apache.tapestry.vlib.ejb.Book"/>
-  
+  "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
+  "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
+<page-specification>
   <component id="ownerLink" type="PersonLink">
-    <binding name="id" expression="book.ownerId"/>
-    <binding name="name" expression="book.ownerName"/>
+    <binding name="id" value="book.ownerId"/>
+    <binding name="name" value="book.ownerName"/>
   </component>
-
-  
   <component id="holderLink" type="PersonLink">
-    <binding name="id" expression="book.holderId"/>
-    <binding name="name" expression="book.holderName"/>
+    <binding name="id" value="book.holderId"/>
+    <binding name="name" value="book.holderName"/>
   </component>
-
 </page-specification>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ViewPerson.page
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ViewPerson.page?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ViewPerson.page (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/ViewPerson.page Thu Oct  6 15:38:49
2005
@@ -16,54 +16,31 @@
 -->
 
 <!DOCTYPE page-specification PUBLIC 
-  "-//Apache Software Foundation//Tapestry Specification 3.0//EN" 
-  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
-	
-<page-specification class="org.apache.tapestry.vlib.pages.ViewPerson">
-
-  <property name="page-type" value="Search"/>
-
-  <property-specification name="personId" type="java.lang.Integer" persistent="yes"/>
-  <property-specification name="person" type="org.apache.tapestry.vlib.ejb.Person"/>
-  
-  <property-specification name="query" type="org.apache.tapestry.vlib.ejb.IBookQuery"
persistent="yes"/>
-  <property-specification name="currentMatch" type="org.apache.tapestry.vlib.ejb.Book"/>
-
-  <property-specification name="sortColumn" type="org.apache.tapestry.vlib.ejb.SortColumn"
persistent="yes">
-  	@org.apache.tapestry.vlib.ejb.SortColumn@TITLE
-  </property-specification>
-  <property-specification name="descending" type="boolean" persistent="yes"/>
-
+  "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
+  "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
+<page-specification>
+  <property name="currentMatch"/>
   <component id="sortTitle" type="ColumnSorter">
-    <binding name="selected" expression="sortColumn"/>
-    <binding name="sortColumn" expression="@org.apache.tapestry.vlib.ejb.SortColumn@TITLE"/>
-    <binding name="descending" expression="descending"/>
-    <binding name="listener" expression="listeners.requery"/>
-  </component>   
-    
+    <binding name="selected" value="sortColumn"/>
+    <binding name="sortColumn" value="@org.apache.tapestry.vlib.ejb.SortColumn@TITLE"/>
+    <binding name="descending" value="descending"/>
+    <binding name="listener" value="listeners.requery"/>
+  </component>
   <component id="sortAuthor" copy-of="sortTitle">
-    <binding name="sortColumn" expression="@org.apache.tapestry.vlib.ejb.SortColumn@AUTHOR"/>
+    <binding name="sortColumn" value="@org.apache.tapestry.vlib.ejb.SortColumn@AUTHOR"/>
   </component>
-  
   <component id="sortPublisher" copy-of="sortTitle">
-    <binding name="sortColumn" expression="@org.apache.tapestry.vlib.ejb.SortColumn@PUBLISHER"/>

+    <binding name="sortColumn" value="@org.apache.tapestry.vlib.ejb.SortColumn@PUBLISHER"/>
   </component>
-  
   <component id="sortBorrower" copy-of="sortTitle">
-    <binding name="sortColumn" expression="@org.apache.tapestry.vlib.ejb.SortColumn@HOLDER"/>
-  </component>
-  
-  <component id="mailLink" type="Any">
-    <binding name="href">
-    	"mailto:" + person.email
-    </binding>
-    <static-binding name="element" value="a"/>
+    <binding name="sortColumn" value="@org.apache.tapestry.vlib.ejb.SortColumn@HOLDER"/>
   </component>
-
   <component id="holderLink" type="PersonLink">
-    <binding name="id" expression="currentMatch.holderId"/>
-    <binding name="name" expression="currentMatch.holderName"/>
-    <binding name="omit" expression="! currentMatch.borrowed"/>
+    <binding name="id" value="currentMatch.holderId"/>
+    <binding name="name" value="currentMatch.holderName"/>
+    <binding name="omit" value="! currentMatch.borrowed"/>
+  </component>
+  <component id="mailLink" type="Any">
+    <binding name="href"> "mailto:" + person.email </binding>
   </component>
- 
 </page-specification>

Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/BookLink.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/BookLink.java?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/BookLink.java
(original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/BookLink.java
Thu Oct  6 15:38:49 2005
@@ -17,7 +17,9 @@
 import java.sql.Timestamp;
 
 import org.apache.tapestry.BaseComponent;
-import org.apache.tapestry.IEngine;
+import org.apache.tapestry.annotations.InjectState;
+import org.apache.tapestry.annotations.InjectStateFlag;
+import org.apache.tapestry.annotations.Parameter;
 import org.apache.tapestry.vlib.Visit;
 import org.apache.tapestry.vlib.ejb.Book;
 
@@ -57,14 +59,21 @@
 
     private static final long ONE_WEEK_MILLIS = 1000l * 60l * 60l * 24l * 7l;
 
+    @Parameter(required = true)
+    public abstract Book getBook();
+
+    @InjectState("visit")
+    public abstract Visit getVisitState();
+
+    @InjectStateFlag("visit")
+    public abstract boolean getVisitExists();
+
     public boolean isNewlyAdded()
     {
-        IEngine engine = getPage().getEngine();
-        Visit visit = (Visit) engine.getVisit();
         Timestamp lastAccess = null;
 
-        if (visit != null)
-            lastAccess = visit.getLastAccess();
+        if (getVisitExists())
+            lastAccess = getVisitState().getLastAccess();
 
         Book book = getBook();
 
@@ -91,5 +100,4 @@
         return lastAccess.compareTo(dateAdded) <= 0;
     }
 
-    public abstract Book getBook();
 }

Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Borrow.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Borrow.java?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Borrow.java
(original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Borrow.java
Thu Oct  6 15:38:49 2005
@@ -20,7 +20,12 @@
 
 import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.tapestry.BaseComponent;
+import org.apache.tapestry.IPage;
 import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.annotations.InjectPage;
+import org.apache.tapestry.annotations.InjectState;
+import org.apache.tapestry.annotations.Message;
+import org.apache.tapestry.annotations.Parameter;
 import org.apache.tapestry.vlib.VirtualLibraryEngine;
 import org.apache.tapestry.vlib.Visit;
 import org.apache.tapestry.vlib.ejb.Book;
@@ -55,11 +60,21 @@
 
 public abstract class Borrow extends BaseComponent
 {
+    @Parameter(required = true)
     public abstract Book getBook();
 
+    @InjectState("visit")
+    public abstract Visit getVisit();
+
+    @InjectPage("Home")
+    public abstract Home getHome();
+
+    @Message
+    public abstract String borrowedBook(String title);
+
     public boolean isLinkDisabled()
     {
-        Visit visit = (Visit) getPage().getVisit();
+        Visit visit = getVisit();
 
         if (!visit.isUserLoggedIn())
             return true;
@@ -79,13 +94,11 @@
         return visit.isLoggedInUser(book.getHolderId());
     }
 
-    public void borrow(IRequestCycle cycle)
+    public IPage borrow(IRequestCycle cycle, Integer bookPK)
     {
-        Object[] parameters = cycle.getServiceParameters();
-        Integer bookPK = (Integer) parameters[0];
+        Visit visit = getVisit();
+        Home home = getHome();
 
-        Visit visit = (Visit) getPage().getVisit();
-        Home home = (Home) cycle.getPage("Home");
         VirtualLibraryEngine vengine = (VirtualLibraryEngine) cycle.getEngine();
 
         int i = 0;
@@ -96,14 +109,14 @@
                 IOperations bean = vengine.getOperations();
                 Book book = bean.borrowBook(bookPK, visit.getUserId());
 
-                home.setMessage("Borrowed: " + book.getTitle());
+                home.setMessage(borrowedBook(book.getTitle()));
 
                 break;
             }
             catch (BorrowException ex)
             {
                 vengine.presentError(ex.getMessage(), cycle);
-                return;
+                return null;
             }
             catch (FinderException ex)
             {
@@ -115,7 +128,7 @@
             }
         }
 
-        cycle.activate(home);
+        return home;
     }
 
 }

Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Browser.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Browser.java?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Browser.java
(original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Browser.java
Thu Oct  6 15:38:49 2005
@@ -22,22 +22,24 @@
 import org.apache.tapestry.IPage;
 import org.apache.tapestry.IRequestCycle;
 import org.apache.tapestry.Tapestry;
+import org.apache.tapestry.annotations.ComponentClass;
+import org.apache.tapestry.annotations.Parameter;
+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.vlib.VirtualLibraryEngine;
 import org.apache.tapestry.vlib.ejb.Book;
 import org.apache.tapestry.vlib.ejb.IBookQuery;
 
 /**
  * Implements a paging browser for the results of a {@link IBookQuery}.
+ * Renders its body multiple times, once for each book provided by the query.
  * 
  * @author Howard Lewis Ship
  */
-
-public abstract class Browser extends AbstractComponent implements PageRenderListener
+@ComponentClass(allowInformalParameters = true, allowBody = true)
+public abstract class Browser extends AbstractComponent implements PageBeginRenderListener
 {
-    public abstract IBookQuery getQuery();
-
     /**
      * Default for the page size; the number of results viewed on each page.
      */
@@ -50,22 +52,31 @@
 
     private int _pageSize = DEFAULT_PAGE_SIZE;
 
+    @Parameter(required = true)
+    public abstract IBookQuery getQuery();
+
+    @Persist
     public abstract int getResultCount();
 
     public abstract void setResultCount(int resultCount);
 
+    @Persist
     public abstract int getCurrentPage();
 
     public abstract void setCurrentPage(int currentPage);
 
     public abstract void setElement(String element);
 
+    @Parameter
     public abstract String getElement();
 
+    @Parameter(required = true)
     public abstract void setValue(Object value);
 
+    @Parameter(required = true)
     public abstract IActionListener getListener();
 
+    @Persist
     public abstract Object[] getPageResults();
 
     public abstract void setPageResults(Object[] pageResults);
@@ -82,6 +93,7 @@
         setPageCount(computePageCount());
     }
 
+    @Persist
     public abstract int getPageCount();
 
     public abstract void setPageCount(int pageCount);

Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewBook.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewBook.java?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewBook.java
(original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewBook.java
Thu Oct  6 15:38:49 2005
@@ -21,8 +21,10 @@
 
 import org.apache.tapestry.IExternalPage;
 import org.apache.tapestry.IRequestCycle;
+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.html.BasePage;
 import org.apache.tapestry.vlib.VirtualLibraryEngine;
 import org.apache.tapestry.vlib.ejb.Book;
@@ -33,11 +35,12 @@
  * 
  * @author Howard Lewis Ship
  */
-
-public abstract class ViewBook extends BasePage implements IExternalPage, PageRenderListener
+@Meta("page-type=Search")
+public abstract class ViewBook extends BasePage implements IExternalPage, PageBeginRenderListener
 {
     private DateFormat _dateFormat;
 
+    @Persist
     public abstract Integer getBookId();
 
     public abstract void setBookId(Integer bookId);

Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewPerson.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewPerson.java?rev=306946&r1=306945&r2=306946&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewPerson.java
(original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewPerson.java
Thu Oct  6 15:38:49 2005
@@ -18,8 +18,11 @@
 
 import org.apache.tapestry.IExternalPage;
 import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.annotations.InjectComponent;
+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.html.BasePage;
 import org.apache.tapestry.vlib.VirtualLibraryEngine;
 import org.apache.tapestry.vlib.components.Browser;
@@ -35,30 +38,37 @@
  * 
  * @author Howard Lewis Ship
  */
-
-public abstract class ViewPerson extends BasePage implements IExternalPage, PageRenderListener
+@Meta("page-type=Search")
+public abstract class ViewPerson extends BasePage implements IExternalPage, PageBeginRenderListener
 {
     public abstract Integer getPersonId();
 
+    @Persist
     public abstract void setPersonId(Integer personId);
 
     public abstract void setPerson(Person value);
 
     public abstract Person getPerson();
 
+    @Persist
     public abstract IBookQuery getQuery();
 
     public abstract void setQuery(IBookQuery value);
 
+    @Persist
     public abstract SortColumn getSortColumn();
 
+    public abstract void setSortColumn(SortColumn sortColumn);
+
+    @Persist
     public abstract boolean isDescending();
 
-    private Browser _browser;
+    @InjectComponent("browser")
+    public abstract Browser getBrowser();
 
     public void finishLoad()
     {
-        _browser = (Browser) getComponent("browser");
+        setSortColumn(SortColumn.TITLE);
     }
 
     /**
@@ -75,15 +85,15 @@
 
         int count = runQuery();
 
-        _browser.initializeForResultCount(count);
+        getBrowser().initializeForResultCount(count);
     }
 
     public void requery(IRequestCycle cycle)
     {
         int count = runQuery();
 
-        if (_browser.getResultCount() != count)
-            _browser.setResultCount(count);
+        if (getBrowser().getResultCount() != count)
+            getBrowser().setResultCount(count);
     }
 
     private int runQuery()



---------------------------------------------------------------------
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