-Cleaning up the build - moving to Spring 2.1-m3

-Refactored for more modularization of the flows
This commit is contained in:
Jeremy Grelle
2007-08-09 17:28:37 +00:00
parent 41143046a3
commit e2f0d821cb
25 changed files with 59 additions and 55 deletions

View File

@@ -5,9 +5,9 @@
version="1.0">
<persistence-unit name="bookingDatabase">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>org.springframework.webflow.samples.booking.User</class>
<class>org.springframework.webflow.samples.booking.Booking</class>
<class>org.springframework.webflow.samples.booking.Hotel</class>
<class>org.springframework.webflow.samples.booking.model.User</class>
<class>org.springframework.webflow.samples.booking.model.Booking</class>
<class>org.springframework.webflow.samples.booking.model.Hotel</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop" />

View File

@@ -2,11 +2,13 @@ package org.springframework.webflow.samples.booking;
import java.util.List;
import javax.faces.context.FacesContext;
import org.springframework.webflow.action.MultiAction;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;
import org.springframework.webflow.samples.booking.model.Booking;
import org.springframework.webflow.samples.booking.model.Hotel;
import org.springframework.webflow.samples.booking.model.User;
import org.springframework.webflow.samples.booking.service.BookingService;
public class SearchAction extends MultiAction {
@@ -37,15 +39,6 @@ public class SearchAction extends MultiAction {
return success();
}
public String nextPage() {
HotelSearch search = (HotelSearch) FacesContext.getCurrentInstance().getApplication().getVariableResolver()
.resolveVariable(FacesContext.getCurrentInstance(), "hotelSearch");
search.setPage(search.getPage() + 1);
return "findHotels";
}
public void setBookingService(BookingService bookingService) {
this.bookingService = bookingService;
}

View File

@@ -8,6 +8,7 @@ import javax.faces.context.FacesContext;
import org.springframework.webflow.action.AbstractAction;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;
import org.springframework.webflow.samples.booking.model.Booking;
public class ValidateBookingAction extends AbstractAction {

View File

@@ -1,4 +1,4 @@
package org.springframework.webflow.samples.booking;
package org.springframework.webflow.samples.booking.model;
import java.io.Serializable;
import java.math.BigDecimal;
@@ -16,6 +16,7 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
//import org.hibernate.validator.Length;
//import org.hibernate.validator.NotNull;
//import org.hibernate.validator.Pattern;

View File

@@ -1,4 +1,4 @@
package org.springframework.webflow.samples.booking;
package org.springframework.webflow.samples.booking.model;
import java.io.Serializable;
import java.math.BigDecimal;

View File

@@ -1,4 +1,4 @@
package org.springframework.webflow.samples.booking;
package org.springframework.webflow.samples.booking.model;
import java.io.Serializable;

View File

@@ -1,7 +1,11 @@
package org.springframework.webflow.samples.booking;
package org.springframework.webflow.samples.booking.service;
import java.util.List;
import org.springframework.webflow.samples.booking.model.Booking;
import org.springframework.webflow.samples.booking.model.Hotel;
import org.springframework.webflow.samples.booking.model.User;
public interface BookingService {
public List<Booking> findBookings(User user);

View File

@@ -1,4 +1,4 @@
package org.springframework.webflow.samples.booking;
package org.springframework.webflow.samples.booking.service;
import java.util.List;
@@ -8,6 +8,9 @@ import javax.persistence.PersistenceContext;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.webflow.samples.booking.model.Booking;
import org.springframework.webflow.samples.booking.model.Hotel;
import org.springframework.webflow.samples.booking.model.User;
@Repository
public class JpaBookingService implements BookingService {

View File

@@ -25,7 +25,7 @@
<tx:annotation-driven transaction-manager="txManager"/>
<bean id="bookingService"
class="org.springframework.webflow.samples.booking.JpaBookingService" />
class="org.springframework.webflow.samples.booking.service.JpaBookingService" />
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">

View File

@@ -1,4 +1,4 @@
package org.springframework.webflow.samples.booking;
package org.springframework.webflow.samples.booking.util;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;

View File

@@ -0,0 +1,2 @@
Manifest-Version: 1.0

View File

@@ -12,7 +12,7 @@
</application>
<lifecycle>
<phase-listener>org.springframework.webflow.samples.booking.DebuggingPhaseListener</phase-listener>
<phase-listener>org.springframework.webflow.samples.booking.util.DebuggingPhaseListener</phase-listener>
<phase-listener>org.springframework.webflow.executor.jsf.FlowPhaseListener</phase-listener>
</lifecycle>

View File

@@ -7,7 +7,7 @@
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:org/springframework/webflow/samples/booking/services-config-jpa.xml
classpath:org/springframework/webflow/samples/booking/service/services-config-jpa.xml
/WEB-INF/webflow-config.xml
</param-value>
</context-param>

View File

@@ -1,17 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:flow="http://www.springframework.org/schema/webflow-config"
xmlns:flow="http://www.springframework.org/schema/webflow-config"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.1.xsd">
http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<flow:enable-scopes/>
<bean id="user" class="org.springframework.webflow.samples.booking.User" scope="conversation">
<bean id="user" class="org.springframework.webflow.samples.booking.model.User" scope="conversation">
<property name="username" value="jeremy"/>
<property name="password" value="barfoo"/>
<property name="name" value="Jeremy Grelle"/>

View File

@@ -5,7 +5,7 @@
http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd">
<var name="hotelSearch" class="org.springframework.webflow.samples.booking.HotelSearch" scope="flow"/>
<var name="user" bean="user"/>
<var name="user" bean="user"/> <!-- Can replace this when we can replace searchAction with bean-actions -->
<start-state idref="findBookings"/>

View File

@@ -11,12 +11,9 @@
<div align="left">
<p>
<h:form>
<h:commandLink value="Book Hotels" action="flowId:main-flow"/> (launch with a JSF command link)
<h:commandLink value="Book Hotels" action="flowId:main-flow"/>
</h:form>
</p>
<p>
<a href="controller.swf?_flowId=main-flow">Book Hotels</a> (launch with a regular anchor tag)
</p>
</div>
<hr/>
</f:view>