You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2005/09/28 00:43:56 UTC
svn commit: r292065 - in /jakarta/tapestry/trunk:
config/jboss/data/hypersonic/ examples/Vlib/ examples/Vlib/src/context/
examples/Vlib/src/context/WEB-INF/
examples/Vlib/src/java/org/apache/tapestry/vlib/pages/
Author: hlship
Date: Tue Sep 27 15:43:49 2005
New Revision: 292065
URL: http://svn.apache.org/viewcvs?rev=292065&view=rev
Log:
VirtualLibrary: EditBook changes, friendly URLs, more data
Added:
jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/hivemodule.xml
jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/vlib.properties
Modified:
jakarta/tapestry/trunk/config/jboss/data/hypersonic/localDB.properties
jakarta/tapestry/trunk/config/jboss/data/hypersonic/localDB.script
jakarta/tapestry/trunk/examples/Vlib/src/context/EditBook.html
jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/EditBook.page
jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/vlib.application
jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/web.xml
jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/EditBook.java
jakarta/tapestry/trunk/examples/Vlib/upgrade-notes.txt
Modified: jakarta/tapestry/trunk/config/jboss/data/hypersonic/localDB.properties
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/config/jboss/data/hypersonic/localDB.properties?rev=292065&r1=292064&r2=292065&view=diff
==============================================================================
--- jakarta/tapestry/trunk/config/jboss/data/hypersonic/localDB.properties (original)
+++ jakarta/tapestry/trunk/config/jboss/data/hypersonic/localDB.properties Tue Sep 27 15:43:49 2005
@@ -1,5 +1,5 @@
#HSQL Database Engine
-#Tue Sep 27 16:57:35 EDT 2005
+#Tue Sep 27 18:40:12 EDT 2005
hsqldb.cache_file_scale=1
runtime.gc_interval=0
hsqldb.first_identity=0
Modified: jakarta/tapestry/trunk/config/jboss/data/hypersonic/localDB.script
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/config/jboss/data/hypersonic/localDB.script?rev=292065&r1=292064&r2=292065&view=diff
==============================================================================
--- jakarta/tapestry/trunk/config/jboss/data/hypersonic/localDB.script (original)
+++ jakarta/tapestry/trunk/config/jboss/data/hypersonic/localDB.script Tue Sep 27 15:43:49 2005
@@ -28,9 +28,49 @@
INSERT INTO JMS_ROLES VALUES('subscriber','john')
INSERT INTO JMS_ROLES VALUES('noacc','nobody')
INSERT INTO PUBLISHER VALUES(5000,'O''Reilly')
+INSERT INTO PUBLISHER VALUES(5050,'Apress')
+INSERT INTO PUBLISHER VALUES(5052,'Addison-Wesley')
+INSERT INTO PUBLISHER VALUES(5056,'Pragmatic Bookshelf')
+INSERT INTO PUBLISHER VALUES(5059,'Manning')
+INSERT INTO PUBLISHER VALUES(5062,'SAMS')
+INSERT INTO PUBLISHER VALUES(5068,'Charles Scribner''s Sons')
+INSERT INTO PUBLISHER VALUES(5070,'Tor Books')
+INSERT INTO PUBLISHER VALUES(5072,'BasicBooks')
+INSERT INTO PUBLISHER VALUES(5074,'Grove Press')
+INSERT INTO PUBLISHER VALUES(5076,'Farrar Straus Giroux')
+INSERT INTO PUBLISHER VALUES(5078,'Bantam New Age Books')
+INSERT INTO PUBLISHER VALUES(5080,'Harper & Row')
+INSERT INTO PUBLISHER VALUES(5082,'Doubleday')
+INSERT INTO PUBLISHER VALUES(5084,'Houghton Mifflin Company')
+INSERT INTO PUBLISHER VALUES(5086,'Doubleday Science Fiction')
+INSERT INTO PUBLISHER VALUES(5100,'Vintage Books')
INSERT INTO PERSON VALUES(1000,'ringbearer@bagend.shire','secret','Frodo','Baggins',FALSE,TRUE,'2005-09-27 17:21:25.0')
-INSERT INTO PERSON VALUES(1001,'squeue@bug.org','secret','Suzy','Queue',FALSE,FALSE,'2005-09-27 17:22:12.0')
-INSERT INTO PERSON VALUES(1002,'dilbert@bigco.com','secret','Dilbert','CubeDweller',FALSE,TRUE,'2005-09-27 16:56:01.761')
+INSERT INTO PERSON VALUES(1001,'squeue@bug.org','secret','Suzy','Queue',FALSE,FALSE,'2005-09-27 18:37:45.688')
+INSERT INTO PERSON VALUES(1002,'dilbert@bigco.com','secret','Dilbert','CubeDweller',FALSE,TRUE,'2005-09-27 17:37:34.896')
INSERT INTO BOOK VALUES(5001,'Very quick and light introduction to installing and deploying into JBoss.',5000,1002,'0-596-10007-8',1002,'JBoss A Developer''s Notebook','Norman Richards, Sam Griffith, Jr.',FALSE,TRUE,'2005-09-27 16:53:00.44')
-INSERT INTO PROP VALUES('next-key',5050)
+INSERT INTO BOOK VALUES(5051,NULL,5050,1002,'1-59059-511-4',1002,'Pro Hibernate 3','Dave Minter, Jeff Linwood',FALSE,TRUE,'2005-09-27 17:38:10.738')
+INSERT INTO BOOK VALUES(5053,'Dated but still handy reference.',5052,1002,'0-201-74095-8',1002,'Essential XML Quick Reference','Skonnard and Gudgin',FALSE,TRUE,'2005-09-27 17:39:03.604')
+INSERT INTO BOOK VALUES(5054,'Well thumbed, well worn, used constantly.',5000,1002,'1-56592-494-0',1002,'Dynamic HTML: The Definitive Reference','Danny Googman',FALSE,FALSE,'2005-09-27 17:40:07.025')
+INSERT INTO BOOK VALUES(5055,NULL,5000,1002,'1-56592-433-9',1002,'TCL/TK In A Nutshell','Paul Raines and Jeff Tranter',FALSE,TRUE,'2005-09-27 17:40:46.191')
+INSERT INTO BOOK VALUES(5057,'2nd edition of "The Pick-axe", covers Ruby 1.8. This is the book I had to replace after spilling Nyquill all over it.',5056,1002,'074514055',1002,'Programming Ruby','Dave Thomas',FALSE,TRUE,'2005-09-27 17:41:59.026')
+INSERT INTO BOOK VALUES(5058,'Hard cover, heavy duty, indispensible',5052,1002,'0-201-63361-2',1002,'Design Patterns: Elements of Reusable Object-Oriented Software','Gamma, Helm, Johnson, Vlissides',FALSE,TRUE,'2005-09-27 17:43:19.151')
+INSERT INTO BOOK VALUES(5060,NULL,5059,1002,'1-932394-35-4',1002,'Spring In Action','Craig Walls, Ryan Breidenbach',FALSE,TRUE,'2005-09-27 17:44:01.442')
+INSERT INTO BOOK VALUES(5061,'Getting more use now, what with all the AJAX buzz.',5000,1002,'1-56592-392-8',1002,'JavaScript The Definitive Guide','David Flannagan',FALSE,TRUE,'2005-09-27 17:44:54.458')
+INSERT INTO BOOK VALUES(5063,'More of a cookbook, less of a language guide than "The Pickaxe"',5062,1002,'0-672-32083-5',1002,'The Ruby Way','Hal Fulton',FALSE,TRUE,'2005-09-27 17:46:19.781')
+INSERT INTO BOOK VALUES(5064,NULL,5059,1002,'1-932394-28-1',1002,'Lucene in Action','Erik Hatcher, Otis Gospodnetic',FALSE,TRUE,'2005-09-27 17:46:58.366')
+INSERT INTO BOOK VALUES(5065,NULL,5052,1002,'0-321-20068-3',1002,'Enterprise Integration Patterns','Gregor Hohpe, Bobby Woolf',FALSE,TRUE,'2005-09-27 17:47:37.943')
+INSERT INTO BOOK VALUES(5066,NULL,5059,1002,'1-930110-58-8',1002,'Java Development with Ant','Erik Hatcher, Steve Loughram',FALSE,TRUE,'2005-09-27 17:48:06.194')
+INSERT INTO BOOK VALUES(5067,NULL,5000,1002,'0-596-00525-3',1002,'Cascading Style Sheets The Definitive Guide','Eric A. Meyer',FALSE,TRUE,'2005-09-27 17:48:41.615')
+INSERT INTO BOOK VALUES(5069,NULL,5068,1001,'0-684-14103-5',1001,'Designs in Metal','Paul Bridge, Austin Crossland',FALSE,TRUE,'2005-09-27 17:51:38.77')
+INSERT INTO BOOK VALUES(5071,'Combines "Ender''s Game" with "Speaker for the Dead"',5070,1001,NULL,1001,'Ender''s War','Orson Scott Card',FALSE,TRUE,'2005-09-27 17:52:38.856')
+INSERT INTO BOOK VALUES(5073,NULL,5072,1001,'0-465-04566-9',1001,'Metamagical Themas: Questing for the Essence of Mind and Pattern','Douglas R. Hofstadter',FALSE,TRUE,'2005-09-27 17:53:25.303')
+INSERT INTO BOOK VALUES(5075,NULL,5074,1001,'0-8021-3507-2',1001,'Stripper Lessons','John O''Brien',FALSE,TRUE,'2005-09-27 17:53:59.091')
+INSERT INTO BOOK VALUES(5077,NULL,5076,1001,'0-374-28645-0',1001,'War Fever','J. G. Ballard',FALSE,TRUE,'2005-09-27 17:54:53.479')
+INSERT INTO BOOK VALUES(5079,NULL,5078,1001,'0-533-34668-7',1001,'"Surely You''re Joking, Mr. Feynman" Adventures of a Curious Character','Richard P. Feynman',FALSE,TRUE,'2005-09-27 17:55:47.047')
+INSERT INTO BOOK VALUES(5081,NULL,5080,1001,NULL,1001,'An Alien Heat','Michael Moorcock',FALSE,TRUE,'2005-09-27 17:57:05.059')
+INSERT INTO BOOK VALUES(5083,NULL,5082,1001,NULL,1001,'The Stone That Never Came Down','John Brunner',FALSE,TRUE,'2005-09-27 17:58:05.285')
+INSERT INTO BOOK VALUES(5085,NULL,5084,1001,NULL,1001,'Best American Short Stories 1995','Smiley, Kenison',FALSE,TRUE,'2005-09-27 17:59:01.917')
+INSERT INTO BOOK VALUES(5087,NULL,5086,1001,'0-385-19134-0',1001,'Universe 14','Terry Carr',FALSE,TRUE,'2005-09-27 17:59:59.64')
+INSERT INTO BOOK VALUES(5101,NULL,5100,1001,'0-394-75682-7',1001,'Godel, Escher, Bach: An Eternal Golden Braid','Douglas R. Hofstadter',FALSE,TRUE,'2005-09-27 18:06:16.331')
+INSERT INTO PROP VALUES('next-key',5150)
INSERT INTO HILOSEQUENCES VALUES('general',0)
Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/EditBook.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/EditBook.html?rev=292065&r1=292064&r2=292065&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/EditBook.html (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/EditBook.html Tue Sep 27 15:43:49 2005
@@ -9,8 +9,7 @@
<span jwcid="@ShowError"/>
<span jwcid="@ShowValidationError" delegate="ognl:validationDelegate"/>
-<form jwcid="@Form" listener="listener:formSubmit" delegate="ognl:validationDelegate">
-<span jwcid="@Hidden" value="ognl:bookId"/>
+<form jwcid="form">
<table class="form">
<tr>
<th><span jwcid="@FieldLabel" field="ognl:components.inputTitle">Title</span></th>
Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/EditBook.page
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/EditBook.page?rev=292065&r1=292064&r2=292065&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/EditBook.page (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/EditBook.page Tue Sep 27 15:43:49 2005
@@ -16,49 +16,39 @@
-->
<!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.EditBook">
+<page-specification>
- <property name="page-type" value="MyLibrary"/>
+ <meta key="page-type" value="MyLibrary"/>
- <property-specification name="error" type="java.lang.String"/>
- <property-specification name="attributes" type="java.util.Map"/>
- <property-specification name="bookId" type="java.lang.Integer"/>
- <property-specification name="publisherName" type="java.lang.String"/>
-
- <bean name="required" class="org.apache.tapestry.valid.StringValidator" lifecycle="page">
- <set-property name="required" expression="true"/>
- <set-property name="clientScriptingEnabled" expression="true"/>
- </bean>
-
- <bean name="optional" class="org.apache.tapestry.valid.StringValidator" lifecycle="page">
- <set-property name="required" expression="true"/>
- </bean>
+ <component id="form" type="Form">
+ <binding name="success" value="listener:formSubmit"/>
+ <binding name="delegate" value="validationDelegate"/>
+ <binding name="clientValidationEnabled" value="true"/>
+ </component>
- <component id="inputTitle" type="ValidField">
- <binding name="value" expression="attributes.title"/>
- <static-binding name="displayName" value="Title"/>
- <binding name="validator" expression="beans.required"/>
+ <component id="inputTitle" type="TextField">
+ <binding name="value" value="attributes.title"/>
+ <binding name="displayName" value="message:title-label"/>
+ <binding name="validators" value="validators:required"/>
</component>
- <component id="inputAuthor" type="ValidField">
- <binding name="value" expression="attributes.author"/>
- <static-binding name="displayName" value="Author"/>
- <binding name="validator" expression="beans.required"/>
+ <component id="inputAuthor" type="TextField">
+ <binding name="value" value="attributes.author"/>
+ <binding name="displayName" value="message:author-label"/>
+ <binding name="validators" value="validators:required"/>
</component>
<component id="inputPublisher" type="PropertySelection">
- <binding name="value" expression="attributes.publisherId"/>
- <binding name="model" expression="engine.publisherModel"/>
+ <binding name="value" value="attributes.publisherId"/>
+ <binding name="model" value="engine.publisherModel"/>
</component>
- <component id="inputPublisherName" type="ValidField">
- <binding name="value" expression="publisherName"/>
- <static-binding name="displayName" value="Publisher"/>
- <binding name="validator" expression="beans.optional"/>
+ <component id="inputPublisherName" type="TextField">
+ <binding name="value" value="publisherName"/>
+ <binding name="displayName" value="message:publisher-label"/>
</component>
-
</page-specification>
Added: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/hivemodule.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/hivemodule.xml?rev=292065&view=auto
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/hivemodule.xml (added)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/hivemodule.xml Tue Sep 27 15:43:49 2005
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+
+<module id="vlib" version="4.0.0">
+
+ <contribution configuration-id="tapestry.url.ServiceEncoders">
+ <direct-service-encoder id="direct" stateless-extension="direct" stateful-extension="sdirect"/>
+ <page-service-encoder id="page" extension="page" service="page"/>
+ <page-service-encoder id="external" extension="external" service="external"/>
+ <asset-encoder id="asset" path="/assets/"/>
+ <extension-encoder id="ext" extension="svc" after="*"/>
+ </contribution>
+</module>
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/vlib.application
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/vlib.application?rev=292065&r1=292064&r2=292065&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/vlib.application (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/vlib.application Tue Sep 27 15:43:49 2005
@@ -26,6 +26,8 @@
<property name="org.apache.tapestry.visit-class" value="org.apache.tapestry.vlib.Visit"/>
<property name="org.apache.tapestry.global-class" value="org.apache.tapestry.vlib.Global"/>
+ <property name="org.apache.tapestry.page-class-packages" value="org.apache.tapestry.vlib.pages"/>
+
<library id="contrib" specification-path="/org/apache/tapestry/contrib/Contrib.library"/>
</application>
Added: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/vlib.properties
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/vlib.properties?rev=292065&view=auto
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/vlib.properties (added)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/vlib.properties Tue Sep 27 15:43:49 2005
@@ -0,0 +1,3 @@
+title-label=Title
+author-label=Author
+publisher-label=Publisher
Modified: jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/web.xml?rev=292065&r1=292064&r2=292065&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/web.xml (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/context/WEB-INF/web.xml Tue Sep 27 15:43:49 2005
@@ -20,34 +20,49 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Tapestry Virtual Library Demo</display-name>
-
<!-- distributable/ -->
-
- <filter>
- <filter-name>redirect</filter-name>
- <filter-class>org.apache.tapestry.RedirectFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>redirect</filter-name>
- <url-pattern>/</url-pattern>
- </filter-mapping>
-
+ <filter>
+ <filter-name>redirect</filter-name>
+ <filter-class>org.apache.tapestry.RedirectFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>redirect</filter-name>
+ <url-pattern>/</url-pattern>
+ </filter-mapping>
<servlet>
<servlet-name>vlib</servlet-name>
<servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
- <load-on-startup>0</load-on-startup>
+ <load-on-startup>0</load-on-startup>
</servlet>
-
- <!-- The single mapping used for the Virtual Library application -->
-
<servlet-mapping>
<servlet-name>vlib</servlet-name>
<url-pattern>/app</url-pattern>
</servlet-mapping>
-
+ <servlet-mapping>
+ <servlet-name>vlib</servlet-name>
+ <url-pattern>*.page</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>vlib</servlet-name>
+ <url-pattern>*.external</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>vlib</servlet-name>
+ <url-pattern>*.direct</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>vlib</servlet-name>
+ <url-pattern>*.sdirect</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>vlib</servlet-name>
+ <url-pattern>*.svc</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>vlib</servlet-name>
+ <url-pattern>/assets/*</url-pattern>
+ </servlet-mapping>
<session-config>
- <session-timeout>15</session-timeout>
+ <session-timeout>15</session-timeout>
</session-config>
-
</web-app>
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/EditBook.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/EditBook.java?rev=292065&r1=292064&r2=292065&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/EditBook.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/EditBook.java Tue Sep 27 15:43:49 2005
@@ -22,10 +22,13 @@
import javax.ejb.FinderException;
import org.apache.hivemind.ApplicationRuntimeException;
+import org.apache.hivemind.HiveMind;
+import org.apache.tapestry.IPage;
import org.apache.tapestry.IRequestCycle;
-import org.apache.tapestry.Tapestry;
+import org.apache.tapestry.annotations.Message;
+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.Protected;
import org.apache.tapestry.vlib.VirtualLibraryEngine;
import org.apache.tapestry.vlib.ejb.IOperations;
@@ -36,7 +39,7 @@
* @author Howard Lewis Ship
*/
-public abstract class EditBook extends Protected implements PageRenderListener
+public abstract class EditBook extends Protected implements PageBeginRenderListener
{
public abstract Map getAttributes();
@@ -44,6 +47,7 @@
public abstract String getPublisherName();
+ @Persist("client")
public abstract Integer getBookId();
public abstract void setBookId(Integer bookId);
@@ -88,33 +92,42 @@
cycle.activate(this);
}
+ @Message
+ public abstract String needPublisherName();
+
+ @Message
+ public abstract String leavePublisherNameEmpty();
+
+ @Message
+ public abstract String updatedBook(Object title);
+
/**
* Used to update the book when the form is submitted.
*/
- public void formSubmit(IRequestCycle cycle)
+ public IPage formSubmit(IRequestCycle cycle)
{
Map attributes = getAttributes();
Integer publisherId = (Integer) attributes.get("publisherId");
String publisherName = getPublisherName();
- if (publisherId == null && Tapestry.isBlank(publisherName))
+ if (publisherId == null && HiveMind.isBlank(publisherName))
{
- setErrorField("inputPublisherName", getMessage("need-publisher-name"));
- return;
+ setErrorField("inputPublisherName", needPublisherName());
+ return null;
}
- if (publisherId != null && Tapestry.isNonBlank(publisherName))
+ if (publisherId != null && HiveMind.isNonBlank(publisherName))
{
- setErrorField("inputPublisherName", getMessage("leave-publisher-name-empty"));
- return;
+ setErrorField("inputPublisherName", leavePublisherNameEmpty());
+ return null;
}
// Check for an error from a validation field
if (isInError())
- return;
+ return null;
// OK, do the update.
@@ -155,9 +168,10 @@
}
MyLibrary page = (MyLibrary) cycle.getPage("MyLibrary");
- page.setMessage(format("updated-book", attributes.get("title")));
- page.activate(cycle);
+ page.setMessage(updatedBook(attributes.get("title")));
+
+ return page;
}
public void pageBeginRender(PageEvent event)
Modified: jakarta/tapestry/trunk/examples/Vlib/upgrade-notes.txt
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/upgrade-notes.txt?rev=292065&r1=292064&r2=292065&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/upgrade-notes.txt (original)
+++ jakarta/tapestry/trunk/examples/Vlib/upgrade-notes.txt Tue Sep 27 15:43:49 2005
@@ -9,25 +9,26 @@
- Changed signature (ResponseOutputStream no longer exists)
-Border
+Border.java
-getBrowserBinding()
- - No longer exists (no binding properties, just connected parameter properties)
-selectBrowserPage() (listener method)
- - removed IRequestCycle parameter (no longer needed)
- - added page parameter
-
-Login
-- Changed interface from PageRenderListener to PageBeginRenderListener
-loginUser()
- - IEngine.getServletPath() has been removed, as has RequestContext.addCookie()
- - Replaced with calls to infrastructure:cookieSource [TAPESTRY-438]
- - Replace IEngine.forgetPage() with IRequestCycle.forgetPage()
-pageBeginRender()
- - Replaced with calls to infrastructure:cookieSource (to read the user's email)
+ getBrowserBinding()
+ - No longer exists (no binding properties, just connected parameter properties)
+ selectBrowserPage() (listener method)
+ - removed IRequestCycle parameter (no longer needed)
+ - added page parameter
+
+Login.java
+ - Changed interface from PageRenderListener to PageBeginRenderListener
+ loginUser()
+ - IEngine.getServletPath() has been removed, as has RequestContext.addCookie()
+ - Replaced with calls to infrastructure:cookieSource [TAPESTRY-438]
+ - Replace IEngine.forgetPage() with IRequestCycle.forgetPage()
+ pageBeginRender()
+ - Replaced with calls to infrastructure:cookieSource (to read the user's email)
application.xml
- Can't deploy vlib.war as "/" due to conflict, deployed as "/vlib"
+ Can't deploy vlib.war as "/" due to conflict with built-in JBoss default app,
+ deployed as "/vlib" (for the moment)
Publisher.script
org.apache.tapestry.form.AbstractTextField no longer exists, replaced with
@@ -35,4 +36,34 @@
EditBook.html
Inline inputPublisher conflicted with <component> in EditBook.page and was removed
+ Converted Form to specified component
+ Converted ValidFields to TextFields
+ Removed the Hidden for the bookId property
+
+EditBook.page
+ Updated to 4.0 DTD
+ Removed <property-specification>s
+ Made displayName attributes reference global messages keys
+
+EditBook.java
+ Change return type of formSubmit() to IPage
+ Used @Message annotation
+ Made the bookId property persist on the client
+
+
+
+vlib.css
+ Added IMG {border:none;} because Tapestry Image/Rollover/etc. components
+ no longer render border="0" automatically.
+
+web.xml/hivemodule.xml
+ Added boilerplate friendly URL support
+
+
+vlib.application
+ Set up org.apache.tapestry.vlib.pages as the default page package
+
+vlib.properties
+ Created to hold common strings
+
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org