From da15ce813831896d04d4b67bd3ff2a280fd2c681 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Wed, 7 Mar 2012 05:30:57 -0500 Subject: [PATCH] Upgrade sample to PrimeFaces 3.1.1 Issues: SWF-1523 --- .../booking-faces/.classpath | 28 +++++++++---------- .../org.eclipse.wst.common.component | 26 ++++++++--------- spring-webflow-samples/booking-faces/pom.xml | 4 +-- .../samples/booking/HotelLazyDataModel.java | 13 +++++++-- .../flows/booking/enterBookingDetails.xhtml | 2 +- .../WEB-INF/flows/booking/reviewBooking.xhtml | 2 +- .../flows/main/enterSearchCriteria.xhtml | 2 +- .../webapp/WEB-INF/flows/main/main-flow.xml | 6 ++-- .../WEB-INF/flows/main/reviewHotel.xhtml | 2 +- .../WEB-INF/flows/main/reviewHotels.xhtml | 8 +++--- .../webapp/WEB-INF/layouts/standard.xhtml | 2 +- 11 files changed, 53 insertions(+), 42 deletions(-) diff --git a/spring-webflow-samples/booking-faces/.classpath b/spring-webflow-samples/booking-faces/.classpath index 4a22c3c6..3e73170c 100755 --- a/spring-webflow-samples/booking-faces/.classpath +++ b/spring-webflow-samples/booking-faces/.classpath @@ -66,30 +66,30 @@ - + - - - + + + - - - - + + + + - + - + - - - + + + - + \ No newline at end of file diff --git a/spring-webflow-samples/booking-faces/.settings/org.eclipse.wst.common.component b/spring-webflow-samples/booking-faces/.settings/org.eclipse.wst.common.component index 820e3a2e..0539dc5b 100755 --- a/spring-webflow-samples/booking-faces/.settings/org.eclipse.wst.common.component +++ b/spring-webflow-samples/booking-faces/.settings/org.eclipse.wst.common.component @@ -78,7 +78,7 @@ uses - + uses @@ -87,34 +87,34 @@ uses - + uses - + uses - + uses uses - + uses - + uses - + uses - + uses uses - + uses @@ -123,7 +123,7 @@ uses - + uses @@ -135,16 +135,16 @@ uses - + uses - + uses uses - + uses diff --git a/spring-webflow-samples/booking-faces/pom.xml b/spring-webflow-samples/booking-faces/pom.xml index 8e89d7b8..176fc473 100644 --- a/spring-webflow-samples/booking-faces/pom.xml +++ b/spring-webflow-samples/booking-faces/pom.xml @@ -8,11 +8,11 @@ Hotel Booking : Spring MVC + Web Flow + JSF/PrimeFaces 2.3.1.BUILD-SNAPSHOT - 3.0.5.RELEASE + 3.1.1.RELEASE 3.0.2.RELEASE 1.5.10 2.1.7 - 2.2.1 + 3.1.1 diff --git a/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/HotelLazyDataModel.java b/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/HotelLazyDataModel.java index 9e914e91..cdcb2cbf 100644 --- a/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/HotelLazyDataModel.java +++ b/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/HotelLazyDataModel.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.Map; import org.primefaces.model.LazyDataModel; +import org.primefaces.model.SortOrder; public class HotelLazyDataModel extends LazyDataModel { @@ -24,9 +25,9 @@ public class HotelLazyDataModel extends LazyDataModel { } @Override - public List load(int first, int pageSize, String sortField, boolean sortOrder, Map filters) { + public List load(int first, int pageSize, String sortField, SortOrder sortOrder, Map filters) { searchCriteria.setCurrentPage(first / pageSize + 1); - return bookingService.findHotels(searchCriteria, first, sortField, sortOrder); + return bookingService.findHotels(searchCriteria, first, sortField, sortOrder.equals(SortOrder.ASCENDING)); } @Override @@ -42,4 +43,12 @@ public class HotelLazyDataModel extends LazyDataModel { this.selected = selected; } + public int getCurrentPage() { + return this.searchCriteria.getCurrentPage(); + } + + public int getPageSize() { + return this.searchCriteria.getPageSize(); + } + } \ No newline at end of file diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml index 784d0dd0..fe286ec7 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml @@ -3,7 +3,7 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" - xmlns:p="http://primefaces.prime.com.tr/ui" + xmlns:p="http://primefaces.org/ui" template="/WEB-INF/layouts/standard.xhtml">

diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml index bd22b15e..1f150988 100755 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml @@ -3,7 +3,7 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" - xmlns:p="http://primefaces.prime.com.tr/ui" + xmlns:p="http://primefaces.org/ui" template="/WEB-INF/layouts/standard.xhtml">

diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml index 346c3914..1d8e38b0 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml @@ -3,7 +3,7 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" - xmlns:p="http://primefaces.prime.com.tr/ui" + xmlns:p="http://primefaces.org/ui" template="/WEB-INF/layouts/standard.xhtml"> diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/main-flow.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/main-flow.xml index db77b19c..0ad4cc84 100755 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/main-flow.xml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/main-flow.xml @@ -1,7 +1,9 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" + http://www.springframework.org/schema/webflow + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml index 363168c8..cbe13aa2 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml @@ -3,7 +3,7 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" - xmlns:p="http://primefaces.prime.com.tr/ui" + xmlns:p="http://primefaces.org/ui" template="/WEB-INF/layouts/standard.xhtml">

diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml index d9f63389..8a79fe30 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml @@ -3,7 +3,7 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" - xmlns:p="http://primefaces.prime.com.tr/ui" + xmlns:p="http://primefaces.org/ui" template="/WEB-INF/layouts/standard.xhtml">

@@ -18,8 +18,8 @@ - + Hotel Search Results
@@ -42,7 +42,7 @@ Action - + diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml index d17cbcff..bb14d6b4 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml @@ -4,7 +4,7 @@ xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ui="http://java.sun.com/jsf/facelets" - xmlns:p="http://primefaces.prime.com.tr/ui"> + xmlns:p="http://primefaces.org/ui">