[jboss-cvs] jboss-seam/examples/jpa/resources ...
Michael Yuan
michael.yuan at jboss.com
Wed Nov 8 04:38:58 EST 2006
User: myuan
Date: 06/11/08 04:38:58
Added: examples/jpa/resources faces-config.xml import.sql
navigation.xml pages.xml persistence.xml
seam.properties web.xml
Log:
add jpa
Revision Changes Path
1.1 date: 2006/11/08 09:38:58; author: myuan; state: Exp;jboss-seam/examples/jpa/resources/faces-config.xml
Index: faces-config.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config
PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<lifecycle>
<phase-listener>
org.jboss.seam.jsf.TransactionalSeamPhaseListener
</phase-listener>
</lifecycle>
<!--
<lifecycle>
<phase-listener>
org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener
</phase-listener>
</lifecycle>
-->
</faces-config>
1.1 date: 2006/11/08 09:38:58; author: myuan; state: Exp;jboss-seam/examples/jpa/resources/import.sql
Index: import.sql
===================================================================
insert into Customer (username, password, name) values ('gavin', 'foobar', 'Gavin King')
insert into Customer (username, password, name) values ('demo', 'demo', 'Demo User')
insert into Hotel (id, name, address, city, state, zip, country) values (1, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
insert into Hotel (id, name, address, city, state, zip, country) values (2, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
insert into Hotel (id, name, address, city, state, zip, country) values (3, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA')
insert into Hotel (id, name, address, city, state, zip, country) values (4, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA')
insert into Hotel (id, name, address, city, state, zip, country) values (5, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA')
insert into Hotel (id, name, address, city, state, zip, country) values (6, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA')
insert into Hotel (id, name, address, city, state, zip, country) values (8, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA')
insert into Hotel (id, name, address, city, state, zip, country) values (9, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA')
insert into Hotel (id, name, address, city, state, zip, country) values (10, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA')
insert into Hotel (id, name, address, city, state, zip, country) values (11, 'Marriot Downtown', '55 Fourth Street', 'San Francisco', 'CA', '94103', 'USA')
insert into Hotel (id, name, address, city, state, zip, country) values (12, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona', 'Catalunya', '08019', 'Spain')
insert into Hotel (id, name, address, city, state, zip, country) values (13, 'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '', '63405', 'Israel')
insert into Hotel (id, name, address, city, state, zip, country) values (14, 'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo', '', '105', 'Japan')
insert into Hotel (id, name, address, city, state, zip, country) values (15, 'Hotel Beaulac', ' Esplanade Léopold-Robert 2', 'Neuchatel', '', '2000', 'Switzerland')
insert into Hotel (id, name, address, city, state, zip, country) values (16, 'Conrad Treasury Place', 'William & George Streets', 'Brisbane', 'QLD', '4001', 'Australia')
insert into Hotel (id, name, address, city, state, zip, country) values (17, 'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal', 'Quebec', 'H3G1H6', 'Canada')
insert into Hotel (id, name, address, city, state, zip, country) values (18, 'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA', '30326', 'USA')
insert into Hotel (id, name, address, city, state, zip, country) values (19, 'Swissotel', '68 Market Street', 'Sydney', 'NSW', '2000', 'Australia')
insert into Hotel (id, name, address, city, state, zip, country) values (20, 'Meliá White House', 'Albany Street', 'Regents Park London', '', 'NW13UP', 'Great Britain')
insert into Hotel (id, name, address, city, state, zip, country) values (21, 'Hotel Allegro', '171 West Randolph Street', 'Chicago', 'IL', '60601', 'USA')
1.1 date: 2006/11/08 09:38:58; author: myuan; state: Exp;jboss-seam/examples/jpa/resources/navigation.xml
Index: navigation.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config
PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<navigation-rule>
<navigation-case>
<from-outcome>login</from-outcome>
<to-view-id>/home.xhtml</to-view-id>
<redirect />
</navigation-case>
<navigation-case>
<from-outcome>register</from-outcome>
<to-view-id>/register.xhtml</to-view-id>
<redirect />
</navigation-case>
<navigation-case>
<from-outcome>password</from-outcome>
<to-view-id>/password.xhtml</to-view-id>
<redirect />
</navigation-case>
<navigation-case>
<from-outcome>main</from-outcome>
<to-view-id>/main.xhtml</to-view-id>
<redirect />
</navigation-case>
<navigation-case>
<from-outcome>hotel</from-outcome>
<to-view-id>/hotel.xhtml</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/hotel.xhtml</from-view-id>
<navigation-case>
<from-outcome>book</from-outcome>
<to-view-id>/book.xhtml</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/book.xhtml</from-view-id>
<navigation-case>
<from-outcome>confirm</from-outcome>
<to-view-id>/confirm.xhtml</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/confirm.xhtml</from-view-id>
<navigation-case>
<from-outcome>confirmed</from-outcome>
<to-view-id>/main.xhtml</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>back</from-outcome>
<to-view-id>/book.xhtml</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
</faces-config>
1.1 date: 2006/11/08 09:38:58; author: myuan; state: Exp;jboss-seam/examples/jpa/resources/pages.xml
Index: pages.xml
===================================================================
<pages>
<page view-id="/hotel.xhtml">View hotel: #{hotel.name}</page>
<page view-id="/book.xhtml">Book hotel: #{hotel.name}</page>
<page view-id="/confirm.xhtml">Confirm: #{booking.description}</page>
</pages>
1.1 date: 2006/11/08 09:38:58; author: myuan; state: Exp;jboss-seam/examples/jpa/resources/persistence.xml
Index: persistence.xml
===================================================================
<persistence>
<persistence-unit name="bookingDatabase" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/DefaultDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
<!-- alternative
<property name="jboss.entity.manager.factory.jndi.name"
value="java:/jpaBookingEntityManagerFactory"/>
-->
</properties>
</persistence-unit>
</persistence>
1.1 date: 2006/11/08 09:38:58; author: myuan; state: Exp;jboss-seam/examples/jpa/resources/seam.properties
<<Binary file>>
1.1 date: 2006/11/08 09:38:58; author: myuan; state: Exp;jboss-seam/examples/jpa/resources/web.xml
Index: web.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/navigation.xml</param-value>
</context-param>
<!-- Ajax4jsf (must come first!) -->
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
<url-pattern>*.seam</url-pattern>
</filter-mapping>
<context-param>
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</param-value>
</context-param>
<!-- Seam -->
<listener>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
<!-- Propagate conversations across redirects -->
<filter>
<filter-name>Seam Redirect Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Seam Redirect Filter</filter-name>
<url-pattern>*.seam</url-pattern>
</filter-mapping>
<filter>
<filter-name>Seam Exception Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Seam Exception Filter</filter-name>
<url-pattern>*.seam</url-pattern>
</filter-mapping>
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.seam</url-pattern>
</servlet-mapping>
<!-- JSF parameters -->
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<!-- MyFaces -->
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
</web-app>
More information about the jboss-cvs-commits
mailing list