package reorg
This commit is contained in:
@@ -1,69 +0,0 @@
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||||
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
|
||||
|
||||
<tiles:insertTemplate template="/WEB-INF/layouts/standard.jsp">
|
||||
<tiles:putAttribute name="content">
|
||||
|
||||
<form:form modelAttribute="searchCriteria">
|
||||
<div class="section">
|
||||
<span class="errors">
|
||||
<form:errors path="*"/>
|
||||
</span>
|
||||
<h1>Search Hotels</h1>
|
||||
<fieldset>
|
||||
<form:input path="searchString"/>
|
||||
<label for="pageSize">Maximum results:</label>
|
||||
<form:select path="pageSize">
|
||||
<form:option label="5" value="5"/>
|
||||
<form:option label="10" value="10"/>
|
||||
<form:option label="20" value="20"/>
|
||||
</form:select>
|
||||
<input type="submit" class="button" name="_eventId_search" value="Find Hotels" />
|
||||
</fieldset>
|
||||
</div>
|
||||
</form:form>
|
||||
|
||||
<security:authorize ifAllGranted="ROLE_USER">
|
||||
<div class="section">
|
||||
<h1>Current Hotel Bookings</h1>
|
||||
|
||||
<table class="summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Address</th>
|
||||
<th>City, State</th>
|
||||
<th>Check in Date</th>
|
||||
<th>Check out Date</th>
|
||||
<th>Confirmation Number</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach var="booking" items="${bookings}">
|
||||
<tr>
|
||||
<td>${booking.hotel.name}</td>
|
||||
<td>${booking.hotel.address}</td>
|
||||
<td>${booking.hotel.city}, ${booking.hotel.state}</td>
|
||||
<td>${booking.checkinDate}</td>
|
||||
<td>${booking.checkoutDate}</td>
|
||||
<td>${booking.id}</td>
|
||||
<td>
|
||||
<a href="${flowExecutionUrl}&_eventId=cancelBooking&bookingId=${booking.id}">Cancel</a>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
<c:if test="${empty bookings}">
|
||||
<tr>
|
||||
<td colspan="7">No booking history</td>
|
||||
</tr>
|
||||
</c:if>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</security:authorize>
|
||||
|
||||
</tiles:putAttribute>
|
||||
</tiles:insertTemplate>
|
||||
@@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow xmlns="http://www.springframework.org/schema/webflow"
|
||||
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">
|
||||
|
||||
<var name="searchCriteria" class="org.springframework.webflow.samples.booking.SearchCriteria" />
|
||||
|
||||
<view-state id="enterSearchCriteria" model="searchCriteria">
|
||||
<on-render>
|
||||
<evaluate expression="bookingService.findBookings(currentUser.name)" result="requestScope.bookings" />
|
||||
</on-render>
|
||||
<transition on="search" to="reviewHotels" />
|
||||
<transition on="cancelBooking" to="cancelBooking" bind="false" />
|
||||
</view-state>
|
||||
|
||||
<view-state id="reviewHotels">
|
||||
<on-render>
|
||||
<evaluate expression="bookingService.findHotels(searchCriteria)" result="requestScope.hotels" />
|
||||
</on-render>
|
||||
<transition on="previous">
|
||||
<evaluate expression="searchCriteria.previousPage()" />
|
||||
</transition>
|
||||
<transition on="next">
|
||||
<evaluate expression="searchCriteria.nextPage()" />
|
||||
</transition>
|
||||
<transition on="select" to="reviewHotel">
|
||||
<set name="flowScope.hotelId" value="requestParameters.hotelId" type="long"/>
|
||||
</transition>
|
||||
<transition on="changeSearch" to="enterSearchCriteria" />
|
||||
</view-state>
|
||||
|
||||
<view-state id="reviewHotel">
|
||||
<on-render>
|
||||
<evaluate expression="bookingService.findHotelById(hotelId)" result="requestScope.hotel" />
|
||||
</on-render>
|
||||
<transition on="book" to="bookHotel" />
|
||||
<transition on="cancel" to="enterSearchCriteria" />
|
||||
</view-state>
|
||||
|
||||
<subflow-state id="bookHotel" subflow="booking">
|
||||
<input name="hotelId" />
|
||||
<transition on="bookingConfirmed" to="finish" />
|
||||
<transition on="cancel" to="enterSearchCriteria" />
|
||||
</subflow-state>
|
||||
|
||||
<action-state id="cancelBooking">
|
||||
<evaluate expression="bookingService.cancelBooking(requestParameters.bookingId)" />
|
||||
<transition on="success" to="enterSearchCriteria" />
|
||||
</action-state>
|
||||
|
||||
<end-state id="finish"/>
|
||||
|
||||
</flow>
|
||||
@@ -1,56 +0,0 @@
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||||
|
||||
<tiles:insertTemplate template="/WEB-INF/layouts/standard.jsp">
|
||||
<tiles:putAttribute name="content">
|
||||
|
||||
<div class="section">
|
||||
<h1>View Hotel</h1>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<form:form id="hotel" modelAttribute="hotel" method="get">
|
||||
<input type="hidden" name="execution" value="${flowExecutionKey}" />
|
||||
<fieldset>
|
||||
<div class="field">
|
||||
<div class="label">Name:</div>
|
||||
<div class="output">${hotel.name}</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="label">Address:</div>
|
||||
<div class="output">${hotel.address}</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="label">City:</div>
|
||||
<div class="output">${hotel.city}</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="label">State:</div>
|
||||
<div class="output">${hotel.state}</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="label">Zip:</div>
|
||||
<div class="output">${hotel.zip}</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="label">Country:</div>
|
||||
<div class="output">${hotel.country}</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="label">Nightly rate:</div>
|
||||
<div class="output">
|
||||
<spring:bind path="price">${status.value}</spring:bind>
|
||||
</div>
|
||||
</div>
|
||||
<div class="buttonGroup">
|
||||
<input type="submit" name="_eventId_book" value="Book Hotel"/> 
|
||||
<input type="submit" name="_eventId_cancel" value="Back to Search"/> 
|
||||
</div>
|
||||
</fieldset>
|
||||
</form:form>
|
||||
</div>
|
||||
|
||||
</tiles:putAttribute>
|
||||
</tiles:insertTemplate>
|
||||
@@ -1,47 +0,0 @@
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||||
|
||||
<tiles:insertTemplate template="/WEB-INF/layouts/standard.jsp">
|
||||
<tiles:putAttribute name="content">
|
||||
|
||||
<div class="section">
|
||||
<h1>Hotel Results</h1>
|
||||
</div>
|
||||
|
||||
<c:if test="${not empty hotels}">
|
||||
<div class="section">
|
||||
<table class="summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Address</th>
|
||||
<th>City, State</th>
|
||||
<th>Zip</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach var="hotel" items="${hotels}">
|
||||
<tr>
|
||||
<td>${hotel.name}</td>
|
||||
<td>${hotel.address}</td>
|
||||
<td>${hotel.city}, ${hotel.state}, ${hotel.country}</td>
|
||||
<td>${hotel.zip}</td>
|
||||
<td>
|
||||
<a href="${flowExecutionUrl}&_eventId=select&hotelId=${hotel.id}">View Hotel</a>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
<c:if test="${empty hotels}">
|
||||
<tr>
|
||||
<td colspan="5">No hotels found</td>
|
||||
</tr>
|
||||
</c:if>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
</tiles:putAttribute>
|
||||
</tiles:insertTemplate>
|
||||
@@ -53,8 +53,7 @@
|
||||
|
||||
<!-- The registry of executable flow definitions -->
|
||||
<web:flow-registry id="flowRegistry">
|
||||
<web:flow-location path="WEB-INF/flows/main/main.xml" />
|
||||
<web:flow-location path="WEB-INF/flows/booking/booking.xml" />
|
||||
<web:flow-location path="WEB-INF/hotels/booking/booking.xml" />
|
||||
</web:flow-registry>
|
||||
|
||||
<!-- Installs a listener that manages JPA persistence contexts for flows that require them -->
|
||||
|
||||
Reference in New Issue
Block a user