[jboss-cvs] jboss-seam/examples/contactlist/resources/WEB-INF ...
Gavin King
gavin.king at jboss.com
Tue Jun 19 19:52:40 EDT 2007
User: gavin
Date: 07/06/19 19:52:40
Modified: examples/contactlist/resources/WEB-INF components.xml
pages.xml
Log:
make the test work again
Revision Changes Path
1.20 +38 -5 jboss-seam/examples/contactlist/resources/WEB-INF/components.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: components.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/contactlist/resources/WEB-INF/components.xml,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- components.xml 15 Jun 2007 05:09:30 -0000 1.19
+++ components.xml 19 Jun 2007 23:52:40 -0000 1.20
@@ -1,15 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
+ xmlns:fwk="http://jboss.com/products/seam/framework"
+ xmlns:persistence="http://jboss.com/products/seam/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.3.xsd
+ http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-1.3.xsd
+ http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-1.3.xsd
http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.3.xsd">
- <core:managed-persistence-context name="entityManager"
- persistence-unit-jndi-name="java:/contactlistEntityManagerFactory">
- </core:managed-persistence-context>
+ <persistence:managed-persistence-context name="entityManager"
+ persistence-unit-jndi-name="java:/contactlistEntityManagerFactory"/>
<core:init jndi-pattern="@jndiPattern@"/>
+ <factory name="contact" value="#{contactHome.instance}"/>
+ <fwk:entity-home name="contactHome"
+ entity-class="org.jboss.seam.example.contactlist.Contact"/>
+
+
+ <factory name="comment" value="#{commentHome.instance}"/>
+ <fwk:entity-home name="commentHome"
+ entity-class="org.jboss.seam.example.contactlist.Comment"
+ new-instance="#{newComment}"/>
+
+ <component name="newComment"
+ class="org.jboss.seam.example.contactlist.Comment">
+ <property name="contact">#{contact}</property>
+ <property name="created">#{currentDatetime}</property>
+ </component>
+
+
+ <fwk:entity-query name="contacts"
+ max-results="5">
+ <fwk:ejbql>from Contact</fwk:ejbql>
+ <fwk:order>lastName</fwk:order>
+ <fwk:restrictions>
+ <value>lower(firstName) like lower( #{exampleContact.firstName} + '%' )</value>
+ <value>lower(lastName) like lower( #{exampleContact.lastName} + '%' )</value>
+ </fwk:restrictions>
+ </fwk:entity-query>
+
+ <component name="exampleContact"
+ class="org.jboss.seam.example.contactlist.Contact"/>
+
</components>
1.10 +49 -1 jboss-seam/examples/contactlist/resources/WEB-INF/pages.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: pages.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/contactlist/resources/WEB-INF/pages.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- pages.xml 9 Jun 2007 02:19:26 -0000 1.9
+++ pages.xml 19 Jun 2007 23:52:40 -0000 1.10
@@ -3,6 +3,54 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-1.3.xsd">
+ <page view-id="/viewContact.xhtml">
+
+ <param name="contactId"
+ value="#{contactHome.id}"
+ converterId="javax.faces.Long"/>
+
+ <navigation>
+ <rule if-outcome="persisted">
+ <redirect/>
+ </rule>
+ <rule if-outcome="removed">
+ <redirect view-id="/search.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/editContact.xhtml">
+
+ <param name="contactId"
+ value="#{contactHome.id}"
+ converterId="javax.faces.Long"/>
+
+ <navigation>
+ <rule if-outcome="updated">
+ <redirect view-id="/viewContact.xhtml"/>
+ </rule>
+ <rule if-outcome="persisted">
+ <redirect view-id="/viewContact.xhtml"/>
+ </rule>
+ <rule if-outcome="removed">
+ <redirect view-id="/search.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/search.xhtml">
+
+ <param name="firstName"
+ value="#{exampleContact.firstName}"/>
+ <param name="lastName"
+ value="#{exampleContact.lastName}"/>
+ <param name="firstResult"
+ value="#{contacts.firstResult}"/>
+
+ </page>
+
<exception class="javax.persistence.PersistenceException">
<end-conversation/>
<redirect>
More information about the jboss-cvs-commits
mailing list