diff --git a/.gitignore b/.gitignore index 0f182a0..0533520 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,17 @@ -*.class +*.java.hsp +*.sonarj +*.sw* +.DS_Store -# Package Files # -*.jar -*.war -*.ear +target + +# Eclipse metadata +.classpath +.project +.settings +.springBeans + +# IDEA metadata and output dirs +*.iml +*.ipr +*.iws diff --git a/README.md b/README.md index 74fca80..75462e0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,33 @@ -spring-webflow-samples -====================== \ No newline at end of file +Spring Web Flow Samples +======================= + +This is the official samples repository for the [Spring Web Flow](http://github.com/SpringSource/spring-webflow) project. + +Build and Run +============= + +Running 'mvn package' from this directory generates .war files for all samples. + +Samples without a Portlet dependency can be run with the Tomcat Maven plugin. For example: + +```` +cd booking-mvc +mvn tomcat:run +```` + +Eclipse +======= + +Generate Eclipse settings for all samples: + +```` +mvn eclipse:clean eclipse:eclipse +```` + +Import the projects into Eclipse. The Eclipse preferences must have an `M2_REPO` under "Java", "Build Path", "Classpath Variables". + +Contributing +============ + +[Pull requests](http://help.github.com/send-pull-requests) are welcome. + diff --git a/booking-faces/build.xml b/booking-faces/build.xml new file mode 100755 index 0000000..f1d8198 --- /dev/null +++ b/booking-faces/build.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/booking-faces/pom.xml b/booking-faces/pom.xml new file mode 100644 index 0000000..5447762 --- /dev/null +++ b/booking-faces/pom.xml @@ -0,0 +1,245 @@ + + + 4.0.0 + org.springframework.webflow.samples + booking-faces + war + Hotel Booking : Spring MVC + Web Flow + JSF/PrimeFaces + 1.0.0.BUILD-SNAPSHOT + + + 3.1.1.RELEASE + 3.0.2.RELEASE + 2.3.1.RELEASE + 1.5.10 + 2.1.7 + 3.1.1 + + + + + spring-repository + Spring project snapshots, milestones, and releases + http://repo.springsource.org/snapshot + + + primefaces-repository + Prime Technology Maven Repository + http://repository.primefaces.org + default + + + + + + + org.springframework + spring-context + ${springframework-version} + + + + commons-logging + commons-logging + + + + + org.springframework + spring-jdbc + ${springframework-version} + + + org.springframework + spring-orm + ${springframework-version} + + + org.springframework + spring-webmvc + ${springframework-version} + + + org.springframework.webflow + spring-faces + ${webflow-version} + + + org.springframework.security + spring-security-web + ${springsecurity-version} + + + + commons-logging + commons-logging + + + + + org.springframework.security + spring-security-config + ${springsecurity-version} + + + + commons-logging + commons-logging + + + + + + org.hsqldb + hsqldb + 1.8.0.10 + runtime + + + org.hibernate + hibernate-entitymanager + 3.5.0-Final + + + + com.sun.faces + jsf-api + ${mojarra-version} + + + com.sun.faces + jsf-impl + ${mojarra-version} + + + org.primefaces + primefaces + ${primefaces-version} + + + + org.slf4j + slf4j-api + ${slf4j-version} + + + org.slf4j + jcl-over-slf4j + ${slf4j-version} + + + org.slf4j + slf4j-log4j12 + ${slf4j-version} + runtime + + + log4j + log4j + 1.2.15 + + + javax.mail + mail + + + javax.jms + jms + + + com.sun.jdmk + jmxtools + + + com.sun.jmx + jmxri + + + runtime + + + + javax.servlet + servlet-api + 2.5 + provided + + + + org.hibernate + hibernate-validator + 4.0.2.GA + + + + javax.xml.bind + jaxb-api + 2.1 + + + + org.easymock + easymock + 2.5.2 + test + + + junit + junit + 3.8.2 + test + + + org.springframework + spring-test + ${springframework-version} + test + + + + + swf-booking-faces + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.1.12 + + junit:junit + + **/*Tests.java + + + + + org.apache.tomcat.maven + tomcat7-maven-plugin + 2.0-SNAPSHOT + + + org.apache.maven.plugins + maven-eclipse-plugin + 2.8 + + true + false + 2.0 + + + + + diff --git a/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Amenity.java b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Amenity.java new file mode 100644 index 0000000..9b1c225 --- /dev/null +++ b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Amenity.java @@ -0,0 +1,5 @@ +package org.springframework.webflow.samples.booking; + +public enum Amenity { + OCEAN_VIEW, LATE_CHECKOUT, MINIBAR; +} diff --git a/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Booking.java b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Booking.java new file mode 100755 index 0000000..5bbc7f0 --- /dev/null +++ b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Booking.java @@ -0,0 +1,226 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.util.Calendar; +import java.util.Date; + +import javax.persistence.Basic; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; +import javax.validation.constraints.Future; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; + +import org.hibernate.validator.constraints.NotEmpty; +import org.springframework.binding.message.MessageBuilder; +import org.springframework.binding.message.MessageContext; +import org.springframework.binding.validation.ValidationContext; + +/** + * A Hotel Booking made by a User. + */ +@Entity +public class Booking implements Serializable { + + private static final long serialVersionUID = 1171567558348174963L; + + private Long id; + + private User user; + + private Hotel hotel; + + private Date checkinDate; + + private Date checkoutDate; + + private String creditCard; + + private String creditCardName; + + private int creditCardExpiryMonth; + + private int creditCardExpiryYear; + + private boolean smoking; + + private int beds; + + private Amenity[] amenities; + + public Booking() { + } + + public Booking(Hotel hotel, User user) { + this.hotel = hotel; + this.user = user; + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_MONTH, 1); + setCheckinDate(calendar.getTime()); + calendar.add(Calendar.DAY_OF_MONTH, 1); + setCheckoutDate(calendar.getTime()); + } + + @Transient + public BigDecimal getTotal() { + return hotel.getPrice().multiply(new BigDecimal(getNights())); + } + + @Transient + public int getNights() { + if (checkinDate == null || checkoutDate == null) { + return 0; + } else { + return (int) (checkoutDate.getTime() - checkinDate.getTime()) / 1000 / 60 / 60 / 24; + } + } + + @Id + @GeneratedValue(strategy = GenerationType.TABLE) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @Basic + @Temporal(TemporalType.DATE) + @Future + @NotNull + public Date getCheckinDate() { + return checkinDate; + } + + public void setCheckinDate(Date datetime) { + this.checkinDate = datetime; + } + + @ManyToOne + public Hotel getHotel() { + return hotel; + } + + public void setHotel(Hotel hotel) { + this.hotel = hotel; + } + + @ManyToOne + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + @Basic + @Temporal(TemporalType.DATE) + @Future + @NotNull + public Date getCheckoutDate() { + return checkoutDate; + } + + public void setCheckoutDate(Date checkoutDate) { + this.checkoutDate = checkoutDate; + } + + @Pattern(regexp = "[0-9]{16}", message = "{invalidCreditCardPattern}") + public String getCreditCard() { + return creditCard; + } + + public void setCreditCard(String creditCard) { + this.creditCard = creditCard; + } + + @Transient + public String getDescription() { + DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM); + return hotel == null ? null : hotel.getName() + ", " + df.format(getCheckinDate()) + " to " + + df.format(getCheckoutDate()); + } + + public boolean isSmoking() { + return smoking; + } + + public void setSmoking(boolean smoking) { + this.smoking = smoking; + } + + public int getBeds() { + return beds; + } + + public void setBeds(int beds) { + this.beds = beds; + } + + @NotEmpty + public String getCreditCardName() { + return creditCardName; + } + + public void setCreditCardName(String creditCardName) { + this.creditCardName = creditCardName; + } + + public int getCreditCardExpiryMonth() { + return creditCardExpiryMonth; + } + + public void setCreditCardExpiryMonth(int creditCardExpiryMonth) { + this.creditCardExpiryMonth = creditCardExpiryMonth; + } + + public int getCreditCardExpiryYear() { + return creditCardExpiryYear; + } + + public void setCreditCardExpiryYear(int creditCardExpiryYear) { + this.creditCardExpiryYear = creditCardExpiryYear; + } + + @Transient + public Amenity[] getAmenities() { + return amenities; + } + + public void setAmenities(Amenity[] amenities) { + this.amenities = amenities; + } + + public void validateEnterBookingDetails(ValidationContext context) { + MessageContext messages = context.getMessageContext(); + if (checkinDate.before(today())) { + messages.addMessage(new MessageBuilder().error().source("checkinDate") + .code("booking.checkinDate.beforeToday").build()); + } else if (checkoutDate.before(checkinDate)) { + messages.addMessage(new MessageBuilder().error().source("checkoutDate") + .code("booking.checkoutDate.beforeCheckinDate").build()); + } + } + + private Date today() { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_MONTH, -1); + return calendar.getTime(); + } + + @Override + public String toString() { + return "Booking(" + user + "," + hotel + ")"; + } + +} diff --git a/booking-faces/src/main/java/org/springframework/webflow/samples/booking/BookingService.java b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/BookingService.java new file mode 100755 index 0000000..dc60e9f --- /dev/null +++ b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/BookingService.java @@ -0,0 +1,62 @@ +package org.springframework.webflow.samples.booking; + +import java.util.List; + +/** + * A service interface for retrieving hotels and bookings from a backing repository. Also supports the ability to cancel + * a booking. + */ +public interface BookingService { + + /** + * Find bookings made by the given user + * @param username the user's name + * @return their bookings + */ + public List findBookings(String username); + + /** + * Find hotels available for booking by some criteria. + * @param criteria the search criteria + * @param firstResult the index of the first result to return + * @param sortBy the field to sort by + * @param ascending true if the sorting should be in ascending order, false for descending + * @return a list of hotels meeting the criteria + */ + public List findHotels(SearchCriteria criteria, int firstResult, String sortBy, boolean ascending); + + /** + * Find hotels by their identifier. + * @param id the hotel id + * @return the hotel + */ + public Hotel findHotelById(Long id); + + /** + * Create a new, transient hotel booking instance for the given user. + * @param hotelId the hotelId + * @param userName the user name + * @return the new transient booking instance + */ + public Booking createBooking(Long hotelId, String userName); + + /** + * Persist the booking to the database + * @param booking the booking + */ + public void persistBooking(Booking booking); + + /** + * Cancel an existing booking. + * @param id the booking id + */ + public void cancelBooking(Booking booking); + + /** + * Return the total number of hotels for the given criteria. + * @param criteria the criteria to use + * @return the number of matching hotels + */ + int getNumberOfHotels(SearchCriteria criteria); + +} diff --git a/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Hotel.java b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Hotel.java new file mode 100755 index 0000000..3715a98 --- /dev/null +++ b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Hotel.java @@ -0,0 +1,110 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; + +/** + * A hotel where users may book stays. + */ +@Entity +public class Hotel implements Serializable { + + private static final long serialVersionUID = 4011346719502656269L; + + private Long id; + + private String name; + + private String address; + + private String city; + + private String state; + + private String zip; + + private String country; + + private BigDecimal price; + + @Id + @GeneratedValue + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getZip() { + return zip; + } + + public void setZip(String zip) { + this.zip = zip; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + @Column(precision = 6, scale = 2) + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Booking createBooking(User user) { + return new Booking(this, user); + } + + @Override + public String toString() { + return "Hotel(" + name + "," + address + "," + city + "," + zip + ")"; + } +} diff --git a/booking-faces/src/main/java/org/springframework/webflow/samples/booking/HotelLazyDataModel.java b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/HotelLazyDataModel.java new file mode 100644 index 0000000..cdcb2cb --- /dev/null +++ b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/HotelLazyDataModel.java @@ -0,0 +1,54 @@ +/** + * + */ +package org.springframework.webflow.samples.booking; + +import java.util.List; +import java.util.Map; + +import org.primefaces.model.LazyDataModel; +import org.primefaces.model.SortOrder; + +public class HotelLazyDataModel extends LazyDataModel { + + private static final long serialVersionUID = -8832831134966938627L; + + SearchCriteria searchCriteria; + + BookingService bookingService; + + private Hotel selected; + + public HotelLazyDataModel(SearchCriteria searchCriteria, BookingService bookingService) { + this.searchCriteria = searchCriteria; + this.bookingService = bookingService; + } + + @Override + 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.equals(SortOrder.ASCENDING)); + } + + @Override + public int getRowCount() { + return bookingService.getNumberOfHotels(searchCriteria); + } + + public Hotel getSelected() { + return selected; + } + + public void setSelected(Hotel selected) { + 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/booking-faces/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java new file mode 100755 index 0000000..3f23df1 --- /dev/null +++ b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java @@ -0,0 +1,109 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; +import java.util.List; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; + +import org.springframework.stereotype.Repository; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; + +/** + * A JPA-based implementation of the Booking Service. Delegates to a JPA entity manager to issue data access calls + * against the backing repository. The EntityManager reference is provided by the managing container (Spring) + * automatically. + */ +@Service("bookingService") +@Repository +public class JpaBookingService implements BookingService, Serializable { + + private static final long serialVersionUID = 1L; + + private EntityManager em; + + @PersistenceContext + public void setEntityManager(EntityManager em) { + this.em = em; + } + + @Transactional(readOnly = true) + @SuppressWarnings("unchecked") + public List findBookings(String username) { + if (username != null) { + return em.createQuery("select b from Booking b where b.user.username = :username order by b.checkinDate") + .setParameter("username", username).getResultList(); + } else { + return null; + } + } + + @Transactional(readOnly = true) + @SuppressWarnings("unchecked") + public List findHotels(SearchCriteria criteria, int firstResult, String orderBy, boolean ascending) { + String pattern = getSearchPattern(criteria); + orderBy = (orderBy != null) ? orderBy : "name"; + String orderDirection = (ascending) ? " ASC" : " DESC"; + return em + .createQuery( + "select h from Hotel h where lower(h.name) like :pattern or lower(h.city) like :pattern " + + "or lower(h.zip) like :pattern or lower(h.address) like :pattern order by h." + + orderBy + orderDirection).setParameter("pattern", pattern) + .setMaxResults(criteria.getPageSize()).setFirstResult(firstResult).getResultList(); + } + + @Transactional(readOnly = true) + public int getNumberOfHotels(SearchCriteria criteria) { + String pattern = getSearchPattern(criteria); + Long count = (Long) em + .createQuery( + "select count(h.id) from Hotel h where lower(h.name) like :pattern or lower(h.city) like :pattern " + + "or lower(h.zip) like :pattern or lower(h.address) like :pattern") + .setParameter("pattern", pattern).getSingleResult(); + return count.intValue(); + } + + @Transactional(readOnly = true) + public Hotel findHotelById(Long id) { + return em.find(Hotel.class, id); + } + + @Transactional(readOnly = true) + public Booking createBooking(Long hotelId, String username) { + Hotel hotel = em.find(Hotel.class, hotelId); + User user = findUser(username); + Booking booking = new Booking(hotel, user); + return booking; + } + + @Transactional + public void persistBooking(Booking booking) { + em.persist(booking); + } + + @Transactional + public void cancelBooking(Booking booking) { + booking = em.find(Booking.class, booking.getId()); + if (booking != null) { + em.remove(booking); + } + } + + // helpers + + private String getSearchPattern(SearchCriteria criteria) { + if (StringUtils.hasText(criteria.getSearchString())) { + return "%" + criteria.getSearchString().toLowerCase().replace('*', '%') + "%"; + } else { + return "%"; + } + } + + private User findUser(String username) { + return (User) em.createQuery("select u from User u where u.username = :username") + .setParameter("username", username).getSingleResult(); + } + +} \ No newline at end of file diff --git a/booking-faces/src/main/java/org/springframework/webflow/samples/booking/ReferenceData.java b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/ReferenceData.java new file mode 100644 index 0000000..4c499aa --- /dev/null +++ b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/ReferenceData.java @@ -0,0 +1,83 @@ +package org.springframework.webflow.samples.booking; + +import java.util.ArrayList; +import java.util.List; + +import javax.faces.model.SelectItem; + +import org.springframework.stereotype.Service; + +@Service +public class ReferenceData { + + private List bedOptions; + + private List smokingOptions; + + private List creditCardExpMonths; + + private List creditCardExpYears; + + private List pageSizeOptions; + + public List getBedOptions() { + if (bedOptions == null) { + bedOptions = new ArrayList(); + bedOptions.add(new SelectItem(new Integer(1), "One king-size bed")); + bedOptions.add(new SelectItem(new Integer(2), "Two double beds")); + bedOptions.add(new SelectItem(new Integer(3), "Three beds")); + } + return bedOptions; + } + + public List getSmokingOptions() { + if (smokingOptions == null) { + smokingOptions = new ArrayList(); + smokingOptions.add(new SelectItem(Boolean.TRUE, "Smoking")); + smokingOptions.add(new SelectItem(Boolean.FALSE, "Non-Smoking")); + } + return smokingOptions; + } + + public List getCreditCardExpMonths() { + if (creditCardExpMonths == null) { + creditCardExpMonths = new ArrayList(); + creditCardExpMonths.add(new SelectItem(new Integer(1), "Jan")); + creditCardExpMonths.add(new SelectItem(new Integer(2), "Feb")); + creditCardExpMonths.add(new SelectItem(new Integer(3), "Mar")); + creditCardExpMonths.add(new SelectItem(new Integer(4), "Apr")); + creditCardExpMonths.add(new SelectItem(new Integer(5), "May")); + creditCardExpMonths.add(new SelectItem(new Integer(6), "Jun")); + creditCardExpMonths.add(new SelectItem(new Integer(7), "Jul")); + creditCardExpMonths.add(new SelectItem(new Integer(8), "Aug")); + creditCardExpMonths.add(new SelectItem(new Integer(9), "Sep")); + creditCardExpMonths.add(new SelectItem(new Integer(10), "Oct")); + creditCardExpMonths.add(new SelectItem(new Integer(11), "Nov")); + creditCardExpMonths.add(new SelectItem(new Integer(12), "Dec")); + } + return creditCardExpMonths; + } + + public List getCreditCardExpYears() { + if (creditCardExpYears == null) { + creditCardExpYears = new ArrayList(); + creditCardExpYears.add(new SelectItem(new Integer(2008), "2008")); + creditCardExpYears.add(new SelectItem(new Integer(2009), "2009")); + creditCardExpYears.add(new SelectItem(new Integer(2010), "2010")); + creditCardExpYears.add(new SelectItem(new Integer(2010), "2011")); + creditCardExpYears.add(new SelectItem(new Integer(2010), "2012")); + } + return creditCardExpYears; + } + + public List getPageSizeOptions() { + if (pageSizeOptions == null) { + pageSizeOptions = new ArrayList(); + pageSizeOptions.add(new SelectItem(new Integer(5), "5")); + pageSizeOptions.add(new SelectItem(new Integer(10), "10")); + pageSizeOptions.add(new SelectItem(new Integer(20), "20")); + } + return pageSizeOptions; + } + +} diff --git a/booking-faces/src/main/java/org/springframework/webflow/samples/booking/SearchCriteria.java b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/SearchCriteria.java new file mode 100755 index 0000000..ddae095 --- /dev/null +++ b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/SearchCriteria.java @@ -0,0 +1,65 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; + +import javax.faces.model.DataModel; + +/** + * A backing bean for the main hotel search form. Encapsulates the criteria needed to perform a hotel search. + */ +public class SearchCriteria implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * The user-provided search criteria for finding Hotels. + */ + private String searchString = ""; + + /** + * The maximum page size of the Hotel result list + */ + private int pageSize = 5; + + /** + * The page the user is currently on. + */ + private int currentPage = 1; + + /** + * Returns a {@link DataModel} based on the search criteria. + * @param bookingService the service to use to retrieve hotels. + */ + public DataModel getDataModel(BookingService bookingService) { + return new HotelLazyDataModel(this, bookingService); + } + + public String getSearchString() { + return searchString; + } + + public void setSearchString(String searchString) { + this.searchString = searchString; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getCurrentPage() { + return currentPage; + } + + public void setCurrentPage(int currentPage) { + this.currentPage = currentPage; + } + + public String toString() { + return "[Search Criteria searchString = '" + searchString + "'"; + } + +} \ No newline at end of file diff --git a/booking-faces/src/main/java/org/springframework/webflow/samples/booking/User.java b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/User.java new file mode 100755 index 0000000..494e9dd --- /dev/null +++ b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/User.java @@ -0,0 +1,62 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * A user who can book hotels. + */ +@Entity +@Table(name = "Customer") +public class User implements Serializable { + + private static final long serialVersionUID = -3652559447682574722L; + + private String username; + + private String password; + + private String name; + + public User() { + } + + public User(String username, String password, String name) { + this.username = username; + this.password = password; + this.name = name; + } + + @Id + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return "User(" + username + ")"; + } +} diff --git a/booking-faces/src/main/resources/JsfMessageResources.properties b/booking-faces/src/main/resources/JsfMessageResources.properties new file mode 100644 index 0000000..497baf8 --- /dev/null +++ b/booking-faces/src/main/resources/JsfMessageResources.properties @@ -0,0 +1,6 @@ +# +# Overrides default pattern in JSF for Bean Validation messages from "{0}" to "{1} {0}" where +# the {0} is the Bean Validation constraint message (e.g. "may not be empty") and {1} is the +# field name or the field label if defined (e.g. "First name"). +# +javax.faces.validator.BeanValidator.MESSAGE={1} {0} \ No newline at end of file diff --git a/booking-faces/src/main/resources/META-INF/persistence.xml b/booking-faces/src/main/resources/META-INF/persistence.xml new file mode 100755 index 0000000..f4e3d6a --- /dev/null +++ b/booking-faces/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,18 @@ + + + + org.hibernate.ejb.HibernatePersistence + org.springframework.webflow.samples.booking.User + org.springframework.webflow.samples.booking.Booking + org.springframework.webflow.samples.booking.Hotel + + + + + + + + \ No newline at end of file diff --git a/booking-faces/src/main/resources/ValidationMessages.properties b/booking-faces/src/main/resources/ValidationMessages.properties new file mode 100644 index 0000000..0909702 --- /dev/null +++ b/booking-faces/src/main/resources/ValidationMessages.properties @@ -0,0 +1,2 @@ +# Custom messages for JSR-303 validation +invalidCreditCardPattern=is not a valid 16 digit card number. diff --git a/booking-faces/src/main/resources/import.sql b/booking-faces/src/main/resources/import.sql new file mode 100755 index 0000000..9a7ed4a --- /dev/null +++ b/booking-faces/src/main/resources/import.sql @@ -0,0 +1,27 @@ +insert into Customer (username, name) values ('keith', 'Keith') +insert into Customer (username, name) values ('erwin', 'Erwin') +insert into Customer (username, name) values ('jeremy', 'Jeremy') +insert into Customer (username, name) values ('scott', 'Scott') +insert into Hotel (id, price, name, address, city, state, zip, country) values (1, 199, 'Westin Diplomat', '3555 S. Ocean Drive', 'Hollywood', 'FL', '33019', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 60, 'Jameson Inn', '890 Palm Bay Rd NE', 'Palm Bay', 'FL', '32905', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 199, 'Chilworth Manor', 'The Cottage, Southampton Business Park', 'Southampton', 'Hants', 'SO16 7JF', 'UK') +insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 450, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (7, 450, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (8, 250, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (9, 300, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (10, 300, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (11, 80, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (12, 90, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (13, 160, 'Marriot Downtown', '55 Fourth Street', 'San Francisco', 'CA', '94103', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (14, 200, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona', 'Catalunya', '08019', 'Spain') +insert into Hotel (id, price, name, address, city, state, zip, country) values (15, 210, 'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '', '63405', 'Israel') +insert into Hotel (id, price, name, address, city, state, zip, country) values (16, 240, 'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo', '', '105', 'Japan') +insert into Hotel (id, price, name, address, city, state, zip, country) values (17, 130, 'Hotel Beaulac', ' Esplanade Léopold-Robert 2', 'Neuchatel', '', '2000', 'Switzerland') +insert into Hotel (id, price, name, address, city, state, zip, country) values (18, 140, 'Conrad Treasury Place', 'William & George Streets', 'Brisbane', 'QLD', '4001', 'Australia') +insert into Hotel (id, price, name, address, city, state, zip, country) values (19, 230, 'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal', 'Quebec', 'H3G1H6', 'Canada') +insert into Hotel (id, price, name, address, city, state, zip, country) values (20, 460, 'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA', '30326', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (21, 220, 'Swissotel', '68 Market Street', 'Sydney', 'NSW', '2000', 'Australia') +insert into Hotel (id, price, name, address, city, state, zip, country) values (22, 250, 'Meliá White House', 'Albany Street', 'Regents Park London', '', 'NW13UP', 'Great Britain') +insert into Hotel (id, price, name, address, city, state, zip, country) values (23, 210, 'Hotel Allegro', '171 West Randolph Street', 'Chicago', 'IL', '60601', 'USA') \ No newline at end of file diff --git a/booking-faces/src/main/resources/log4j.xml b/booking-faces/src/main/resources/log4j.xml new file mode 100644 index 0000000..4c3ff1c --- /dev/null +++ b/booking-faces/src/main/resources/log4j.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-faces/src/main/webapp/META-INF/MANIFEST.MF b/booking-faces/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 0000000..58630c0 --- /dev/null +++ b/booking-faces/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/booking-faces/src/main/webapp/WEB-INF/classes/log4j.properties b/booking-faces/src/main/webapp/WEB-INF/classes/log4j.properties new file mode 100755 index 0000000..992d816 --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/classes/log4j.properties @@ -0,0 +1,11 @@ +log4j.rootCategory=INFO, stdout + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n + +# Enable web flow logging +log4j.category.org.springframework.webflow=DEBUG +log4j.category.org.springframework.faces=DEBUG +log4j.category.org.springframework.binding=DEBUG +log4j.category.org.springframework.transaction=DEBUG \ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/config/data-access-config.xml b/booking-faces/src/main/webapp/WEB-INF/config/data-access-config.xml new file mode 100644 index 0000000..581e73b --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/config/data-access-config.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/config/security-config.xml b/booking-faces/src/main/webapp/WEB-INF/config/security-config.xml new file mode 100644 index 0000000..ef58ed9 --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/config/security-config.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/config/web-application-config.xml b/booking-faces/src/main/webapp/WEB-INF/config/web-application-config.xml new file mode 100644 index 0000000..942c9c1 --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/config/web-application-config.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/config/webflow-config.xml b/booking-faces/src/main/webapp/WEB-INF/config/webflow-config.xml new file mode 100644 index 0000000..73b3f04 --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/config/webflow-config.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/config/webmvc-config.xml b/booking-faces/src/main/webapp/WEB-INF/config/webmvc-config.xml new file mode 100644 index 0000000..571e501 --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/config/webmvc-config.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/faces-config.xml b/booking-faces/src/main/webapp/WEB-INF/faces-config.xml new file mode 100644 index 0000000..2893236 --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/faces-config.xml @@ -0,0 +1,11 @@ + + + + + JsfMessageResources + + + diff --git a/booking-faces/src/main/webapp/WEB-INF/flows/booking/booking-flow.xml b/booking-faces/src/main/webapp/WEB-INF/flows/booking/booking-flow.xml new file mode 100755 index 0000000..5deff5b --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/flows/booking/booking-flow.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml b/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml new file mode 100644 index 0000000..fe286ec --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml @@ -0,0 +1,141 @@ + + + +

+ Check the calendar widget and the tooltips on the credit card fields. + The form uses Ajax-based validations to redisplay server-side errors without refreshing the entire page. + The booking bean backing the form is a flow-scoped object (see booking-flow.xml). +

+
+ + + + +
+ ${booking.hotel.name}, + ${booking.hotel.address} + ${booking.hotel.city}, ${booking.hotel.state}, ${booking.hotel.zip} + ${booking.hotel.country} +
+
+
+
+ Nightly Rate: +
+
+

+ + + +

+
+
+
+
+ Check In: +
+
+

+ +

+
+
+ Check Out: +
+
+

+ +

+
+
+
+
+ Room Preference: +
+
+

+ + + +

+
+
+ Smoking: +
+
+ + + +
+
+ +
+
+ Credit Card Number: +
+
+

+ + +

+
+
+ Credit Card Name: +
+
+

+ + +

+
+
+
+
+ Expiration Date: +
+
+

+ + +   + + + +

+
+
+
+ + +
+
+
+
+
\ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/flows/booking/messages.properties b/booking-faces/src/main/webapp/WEB-INF/flows/booking/messages.properties new file mode 100644 index 0000000..cbae4eb --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/flows/booking/messages.properties @@ -0,0 +1,2 @@ +booking.checkinDate.beforeToday=The Check In Date must be a future date +booking.checkoutDate.beforeCheckinDate=The Check Out Date must be later than the Check In Date diff --git a/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml b/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml new file mode 100755 index 0000000..1f15098 --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml @@ -0,0 +1,83 @@ + + + +

+ Note that the command button actions raise events (e.g. "revise") instead of specifying method expressions. + The events result in transitions on the server side (see reviewBooking state in booking-flow.xml). +

+
+ +
+

${booking.hotel.name}

+
+ ${booking.hotel.address} +
+ ${booking.hotel.city}, ${booking.hotel.state}, ${booking.hotel.zip} +
+ ${booking.hotel.country} +
+
+
+ + +
+
Check In:
+
+

+ + + +

+
+
+
+
Check Out:
+
+

+ + + +

+
+
+
+
Nights:
+
+

+ +

+
+
+
+
Total payment:
+
+

+ + + +

+
+
+
+
Credit Card:
+
+

+ #{booking.creditCard} +

+
+
+
+   +   + +
+
+
+
+
+
\ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml b/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml new file mode 100644 index 0000000..1d8e38b --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml @@ -0,0 +1,74 @@ + + + + +

+ This page uses the PrimeFaces panel component to display a search form. + Mouse over the "Search String" field to see its tooltip. + If you are logged a second panel will show your current bookings. + Both panels can be toggled on and off. +

+
+ + + + + + + + Search String: + + Maximum Results: + + + + + + + + + + + + + + + + Hotel + #{booking.hotel.name}
+ #{booking.hotel.address}
+ #{booking.hotel.city}, #{booking.hotel.state} +
+ + Check in + + + + + + Check out + + + + + + Confirmation # + #{booking.id} + + + Action + + +
+
+
+
+ +
+
\ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/flows/main/main-flow.xml b/booking-faces/src/main/webapp/WEB-INF/flows/main/main-flow.xml new file mode 100755 index 0000000..0ad4cc8 --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/flows/main/main-flow.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml b/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml new file mode 100644 index 0000000..cbe13aa --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml @@ -0,0 +1,43 @@ + + + +

+ Clicking "Book" will launch the booking sub-flow (see the subflow state in main-flow.xml). +

+

+ The booking flow is protected with Spring Security (see the secured attribute in booking-flow.xml). +

+

+ Clicking "Back to Search" will take you to the stateful search results. +

+
+ +

${hotel.name}

+
+ ${hotel.address} +
+ ${hotel.city} +
+ ${hotel.state} ${hotel.zip} +
+ ${hotel.country} +
+ +
+ Nightly Rate:  + + + +
+
+ + +
+
+
+
\ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml b/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml new file mode 100644 index 0000000..8a79fe3 --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml @@ -0,0 +1,52 @@ + + + +

+ This page uses the PrimeFaces data table backed by a lazily loaded DataModel (see HotelLazyDataModel.java). + Page navigation is Ajax-based and uses JSF 2 partial rendering. + The name and city columns support forward and reverse sorting. +

+

+ The DataModel is created and stored in view scope when the view is first entered (see main-flow.xml). + When the user makes a selection, the selection is stored in a flow-scoped "hotel" variable before transitioning to the detail page. +

+
+ + + + + Hotel Search Results
+ +
+ + Name + #{h.name} + + + Address + #{h.address} + + + City, State + #{h.city}, #{h.state}, #{h.country} + + + Zip + #{h.zip} + + + Action + + + + +
+
+
+
\ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/intro.xhtml b/booking-faces/src/main/webapp/WEB-INF/intro.xhtml new file mode 100755 index 0000000..d9e3852 --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/intro.xhtml @@ -0,0 +1,44 @@ + + + + +

+ This is a simple standalone JSF page. +

+

+ Clicking the "Start" link below will launch the main to search for hotels (see main-flow.xml). + The main flow in turn launches the booking sub-flow to book the hotel (see booking-flow.xml). +

+

+ The main flow is accessible without logging in while the booking flow requires authentication. +

+
+ + +
+

Welcome to Spring Travel

+

Spring Web Flow and JSF 2 with PrimeFaces components

+
+

+ Key features illustrated in this sample: +

+
    +
  • A declarative navigation model enabling full browser button support and dynamic navigation rules
  • +
  • A fine-grained state management model, including support for conversation, view, and flash scopes
  • +
  • Partial page rendering via Ajax with JSF 2
  • +
  • Modularization of web application functionality by domain use case, illustrating project structure best-practices
  • +
  • Spring Security integration
  • +
  • Page layout with Blueprint CSS
  • +
  • Exception handling support across all layers of the application
  • +
+

+ Start your Spring Travel experience +

+
+
+
\ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml b/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml new file mode 100644 index 0000000..bb14d6b --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml @@ -0,0 +1,63 @@ + + + + + + + + Spring Faces: Hotel Booking Sample Application + + + + + + + + +
+
+

+ + Welcome, ${currentUser.name} | Logout + + + Login + +

+
+
+ Spring Travel +
+
+
+
+

Comments:

+ +
+
+ +
+
+
+
+ + Powered by Spring + +
+
+
+
+ diff --git a/booking-faces/src/main/webapp/WEB-INF/login.xhtml b/booking-faces/src/main/webapp/WEB-INF/login.xhtml new file mode 100755 index 0000000..b37fb94 --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/login.xhtml @@ -0,0 +1,58 @@ + + + +

+ Form-based authentication with Spring Security. + Spring Security is first enabled in web.xml via DelegatingFilterProxy. + It's configuration is located in security-config.xml. + Flow definitions can further be protected using the secured attribute (see booking-flow.xml). +

+
+ +
+

Valid username/passwords are:

+
    +
  • keith/melbourne
  • +
  • erwin/leuven
  • +
  • jeremy/atlanta
  • +
  • scott/rochester
  • +
+
+
+ +
+ Your login attempt was not successful, try again.
+ Reason: #{sessionScope.SPRING_SECURITY_LAST_EXCEPTION.message} +
+
+
+
+ Login Information +

+ User: +
+ + + + +

+

+ Password: +
+ +

+

+ + Don't ask for my password for two weeks: +

+

+ +

+
+
+
+
+
\ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/logoutSuccess.xhtml b/booking-faces/src/main/webapp/WEB-INF/logoutSuccess.xhtml new file mode 100755 index 0000000..618425a --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/logoutSuccess.xhtml @@ -0,0 +1,14 @@ + + + + +
+

Logout

+

You have successfully logged out.

+
+

Continue

+
+
+
\ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/springsecurity.taglib.xml b/booking-faces/src/main/webapp/WEB-INF/springsecurity.taglib.xml new file mode 100644 index 0000000..ea37d89 --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/springsecurity.taglib.xml @@ -0,0 +1,31 @@ + + + + http://www.springframework.org/security/tags + + authorize + org.springframework.faces.security.FaceletsAuthorizeTagHandler + + + areAllGranted + org.springframework.faces.security.FaceletsAuthorizeTagUtils + boolean areAllGranted(java.lang.String) + + + areAnyGranted + org.springframework.faces.security.FaceletsAuthorizeTagUtils + boolean areAnyGranted(java.lang.String) + + + areNotGranted + org.springframework.faces.security.FaceletsAuthorizeTagUtils + boolean areNotGranted(java.lang.String) + + + isAllowed + org.springframework.faces.security.FaceletsAuthorizeTagUtils + boolean isAllowed(java.lang.String, java.lang.String) + + \ No newline at end of file diff --git a/booking-faces/src/main/webapp/WEB-INF/web.xml b/booking-faces/src/main/webapp/WEB-INF/web.xml new file mode 100755 index 0000000..d967883 --- /dev/null +++ b/booking-faces/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,117 @@ + + + + + + contextConfigLocation + + /WEB-INF/config/web-application-config.xml + + + + + + javax.faces.DEFAULT_SUFFIX + .xhtml + + + + + javax.faces.PROJECT_STAGE + Development + + + + + javax.faces.FACELETS_REFRESH_PERIOD + 1 + + + + + + + + javax.faces.FACELETS_LIBRARIES + /WEB-INF/springsecurity.taglib.xml + + + + + charEncodingFilter + org.springframework.web.filter.CharacterEncodingFilter + + encoding + UTF-8 + + + forceEncoding + true + + + + + charEncodingFilter + /* + + + + + springSecurityFilterChain + org.springframework.web.filter.DelegatingFilterProxy + + + + springSecurityFilterChain + /* + + + + + org.springframework.web.context.ContextLoaderListener + + + + + Spring MVC Dispatcher Servlet + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + + + 2 + + + + + Spring MVC Dispatcher Servlet + /spring/* + + + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + + + Faces Servlet + *.faces + + + + index.html + + + \ No newline at end of file diff --git a/booking-faces/src/main/webapp/images/bg.gif b/booking-faces/src/main/webapp/images/bg.gif new file mode 100644 index 0000000..013cfa6 Binary files /dev/null and b/booking-faces/src/main/webapp/images/bg.gif differ diff --git a/booking-faces/src/main/webapp/images/btn.bg.gif b/booking-faces/src/main/webapp/images/btn.bg.gif new file mode 100644 index 0000000..8351684 Binary files /dev/null and b/booking-faces/src/main/webapp/images/btn.bg.gif differ diff --git a/booking-faces/src/main/webapp/images/diplomat.jpg b/booking-faces/src/main/webapp/images/diplomat.jpg new file mode 100644 index 0000000..e1d0c9c Binary files /dev/null and b/booking-faces/src/main/webapp/images/diplomat.jpg differ diff --git a/booking-faces/src/main/webapp/images/header.jpg b/booking-faces/src/main/webapp/images/header.jpg new file mode 100644 index 0000000..6893bd8 Binary files /dev/null and b/booking-faces/src/main/webapp/images/header.jpg differ diff --git a/booking-faces/src/main/webapp/images/input.bg.gif b/booking-faces/src/main/webapp/images/input.bg.gif new file mode 100644 index 0000000..8ebf87e Binary files /dev/null and b/booking-faces/src/main/webapp/images/input.bg.gif differ diff --git a/booking-faces/src/main/webapp/images/powered-by-spring.png b/booking-faces/src/main/webapp/images/powered-by-spring.png new file mode 100644 index 0000000..e773b17 Binary files /dev/null and b/booking-faces/src/main/webapp/images/powered-by-spring.png differ diff --git a/booking-faces/src/main/webapp/images/springone2gx.jpeg b/booking-faces/src/main/webapp/images/springone2gx.jpeg new file mode 100644 index 0000000..b43bcb2 Binary files /dev/null and b/booking-faces/src/main/webapp/images/springone2gx.jpeg differ diff --git a/booking-faces/src/main/webapp/images/th.bg.gif b/booking-faces/src/main/webapp/images/th.bg.gif new file mode 100644 index 0000000..4663cf5 Binary files /dev/null and b/booking-faces/src/main/webapp/images/th.bg.gif differ diff --git a/booking-faces/src/main/webapp/images/tse.gif b/booking-faces/src/main/webapp/images/tse.gif new file mode 100644 index 0000000..b1fa98c Binary files /dev/null and b/booking-faces/src/main/webapp/images/tse.gif differ diff --git a/booking-faces/src/main/webapp/index.html b/booking-faces/src/main/webapp/index.html new file mode 100755 index 0000000..fce3550 --- /dev/null +++ b/booking-faces/src/main/webapp/index.html @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/booking-faces/src/main/webapp/styles/blueprint/icons/cross.png b/booking-faces/src/main/webapp/styles/blueprint/icons/cross.png new file mode 100755 index 0000000..1514d51 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/icons/cross.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/icons/key.png b/booking-faces/src/main/webapp/styles/blueprint/icons/key.png new file mode 100755 index 0000000..a9d5e4f Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/icons/key.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/icons/tick.png b/booking-faces/src/main/webapp/styles/blueprint/icons/tick.png new file mode 100755 index 0000000..a9925a0 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/icons/tick.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/ie.css b/booking-faces/src/main/webapp/styles/blueprint/ie.css new file mode 100755 index 0000000..bbc1e5c --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/ie.css @@ -0,0 +1,36 @@ +/* ----------------------------------------------------------------------- + + + Blueprint CSS Framework 0.9 + http://blueprintcss.org + + * Copyright (c) 2007-Present. See LICENSE for more info. + * See README for instructions on how to use Blueprint. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + +----------------------------------------------------------------------- */ + +/* ie.css */ +body {text-align:center;} +.container {text-align:left;} +* html .column, * html div.span-1, * html div.span-2, * html div.span-3, * html div.span-4, * html div.span-5, * html div.span-6, * html div.span-7, * html div.span-8, * html div.span-9, * html div.span-10, * html div.span-11, * html div.span-12, * html div.span-13, * html div.span-14, * html div.span-15, * html div.span-16, * html div.span-17, * html div.span-18, * html div.span-19, * html div.span-20, * html div.span-21, * html div.span-22, * html div.span-23, * html div.span-24 {display:inline;overflow-x:hidden;} +* html legend {margin:0px -8px 16px 0;padding:0;} +ol {margin-left:2em;} +sup {vertical-align:text-top;} +sub {vertical-align:text-bottom;} +html>body p code {*white-space:normal;} +hr {margin:-8px auto 11px;} +img {-ms-interpolation-mode:bicubic;} +.clearfix, .container {display:inline-block;} +* html .clearfix, * html .container {height:1%;} +fieldset {padding-top:0;} +textarea {overflow:auto;} +input.text, input.title, textarea {background-color:#fff;border:1px solid #bbb;} +input.text:focus, input.title:focus {border-color:#666;} +input.text, input.title, textarea, select {margin:0.5em 0;} +input.checkbox, input.radio {position:relative;top:.25em;} +form.inline div, form.inline p {vertical-align:middle;} +form.inline label {position:relative;top:-0.25em;} +form.inline input.checkbox, form.inline input.radio, form.inline input.button, form.inline button {margin:0.5em 0;} +button, input.button {position:relative;top:0.25em;} \ No newline at end of file diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/icons/cross.png b/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/icons/cross.png new file mode 100755 index 0000000..1514d51 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/icons/cross.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/icons/key.png b/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/icons/key.png new file mode 100755 index 0000000..a9d5e4f Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/icons/key.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/icons/tick.png b/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/icons/tick.png new file mode 100755 index 0000000..a9925a0 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/icons/tick.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/readme.txt b/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/readme.txt new file mode 100755 index 0000000..a8c2b57 --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/readme.txt @@ -0,0 +1,32 @@ +Buttons + +* Gives you great looking CSS buttons, for both and + + + Change Password + + + + Cancel + diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/screen.css b/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/screen.css new file mode 100755 index 0000000..bb66b21 --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/plugins/buttons/screen.css @@ -0,0 +1,97 @@ +/* -------------------------------------------------------------- + + buttons.css + * Gives you some great CSS-only buttons. + + Created by Kevin Hale [particletree.com] + * particletree.com/features/rediscovering-the-button-element + + See Readme.txt in this folder for instructions. + +-------------------------------------------------------------- */ + +a.button, button { + display:block; + float:left; + margin: 0.7em 0.5em 0.7em 0; + padding:5px 10px 5px 7px; /* Links */ + + border:1px solid #dedede; + border-top:1px solid #eee; + border-left:1px solid #eee; + + background-color:#f5f5f5; + font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif; + font-size:100%; + line-height:130%; + text-decoration:none; + font-weight:bold; + color:#565656; + cursor:pointer; +} +button { + width:auto; + overflow:visible; + padding:4px 10px 3px 7px; /* IE6 */ +} +button[type] { + padding:4px 10px 4px 7px; /* Firefox */ + line-height:17px; /* Safari */ +} +*:first-child+html button[type] { + padding:4px 10px 3px 7px; /* IE7 */ +} +button img, a.button img{ + margin:0 3px -3px 0 !important; + padding:0; + border:none; + width:16px; + height:16px; + float:none; +} + + +/* Button colors +-------------------------------------------------------------- */ + +/* Standard */ +button:hover, a.button:hover{ + background-color:#dff4ff; + border:1px solid #c2e1ef; + color:#336699; +} +a.button:active{ + background-color:#6299c5; + border:1px solid #6299c5; + color:#fff; +} + +/* Positive */ +body .positive { + color:#529214; +} +a.positive:hover, button.positive:hover { + background-color:#E6EFC2; + border:1px solid #C6D880; + color:#529214; +} +a.positive:active { + background-color:#529214; + border:1px solid #529214; + color:#fff; +} + +/* Negative */ +body .negative { + color:#d12f19; +} +a.negative:hover, button.negative:hover { + background-color:#fbe3e4; + border:1px solid #fbc2c4; + color:#d12f19; +} +a.negative:active { + background-color:#d12f19; + border:1px solid #d12f19; + color:#fff; +} diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/fancy-type/readme.txt b/booking-faces/src/main/webapp/styles/blueprint/plugins/fancy-type/readme.txt new file mode 100755 index 0000000..85f2491 --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/plugins/fancy-type/readme.txt @@ -0,0 +1,14 @@ +Fancy Type + +* Gives you classes to use if you'd like some + extra fancy typography. + +Credits and instructions are specified above each class +in the fancy-type.css file in this directory. + + +Usage +---------------------------------------------------------------- + +1) Add this plugin to lib/settings.yml. + See compress.rb for instructions. diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/fancy-type/screen.css b/booking-faces/src/main/webapp/styles/blueprint/plugins/fancy-type/screen.css new file mode 100755 index 0000000..028e05b --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/plugins/fancy-type/screen.css @@ -0,0 +1,71 @@ +/* -------------------------------------------------------------- + + fancy-type.css + * Lots of pretty advanced classes for manipulating text. + + See the Readme file in this folder for additional instructions. + +-------------------------------------------------------------- */ + +/* Indentation instead of line shifts for sibling paragraphs. */ + p + p { text-indent:2em; margin-top:-1.5em; } + form p + p { text-indent: 0; } /* Don't want this in forms. */ + + +/* For great looking type, use this code instead of asdf: + asdf + Best used on prepositions and ampersands. */ + +.alt { + color: #666; + font-family: "Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua", Georgia, serif; + font-style: italic; + font-weight: normal; +} + + +/* For great looking quote marks in titles, replace "asdf" with: + asdf” + (That is, when the title starts with a quote mark). + (You may have to change this value depending on your font size). */ + +.dquo { margin-left: -.5em; } + + +/* Reduced size type with incremental leading + (http://www.markboulton.co.uk/journal/comments/incremental_leading/) + + This could be used for side notes. For smaller type, you don't necessarily want to + follow the 1.5x vertical rhythm -- the line-height is too much. + + Using this class, it reduces your font size and line-height so that for + every four lines of normal sized type, there is five lines of the sidenote. eg: + + New type size in em's: + 10px (wanted side note size) / 12px (existing base size) = 0.8333 (new type size in ems) + + New line-height value: + 12px x 1.5 = 18px (old line-height) + 18px x 4 = 72px + 72px / 5 = 14.4px (new line height) + 14.4px / 10px = 1.44 (new line height in em's) */ + +p.incr, .incr p { + font-size: 10px; + line-height: 1.44em; + margin-bottom: 1.5em; +} + + +/* Surround uppercase words and abbreviations with this class. + Based on work by Jørgen Arnor GĂĽrdsø Lom [http://twistedintellect.com/] */ + +.caps { + font-variant: small-caps; + letter-spacing: 1px; + text-transform: lowercase; + font-size:1.2em; + line-height:1%; + font-weight:bold; + padding:0 2px; +} diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/doc.png b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/doc.png new file mode 100755 index 0000000..834cdfa Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/doc.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/email.png b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/email.png new file mode 100755 index 0000000..7348aed Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/email.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/external.png b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/external.png new file mode 100755 index 0000000..cf1cfb4 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/external.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/feed.png b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/feed.png new file mode 100755 index 0000000..315c4f4 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/feed.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/im.png b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/im.png new file mode 100755 index 0000000..79f35cc Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/im.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/pdf.png b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/pdf.png new file mode 100755 index 0000000..8f8095e Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/pdf.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/visited.png b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/visited.png new file mode 100755 index 0000000..ebf206d Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/visited.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/xls.png b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/xls.png new file mode 100755 index 0000000..b977d7e Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/icons/xls.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/readme.txt b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/readme.txt new file mode 100755 index 0000000..3cb1b2c --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/readme.txt @@ -0,0 +1,18 @@ +Link Icons +* Icons for links based on protocol or file type. + +This is not supported in IE versions < 7. + + +Credits +---------------------------------------------------------------- + +* Marc Morgan +* Olav Bjorkoy [bjorkoy.com] + + +Usage +---------------------------------------------------------------- + +1) Add this line to your HTML: + \ No newline at end of file diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/screen.css b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/screen.css new file mode 100755 index 0000000..6d3d47f --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/plugins/link-icons/screen.css @@ -0,0 +1,40 @@ +/* -------------------------------------------------------------- + + link-icons.css + * Icons for links based on protocol or file type. + + See the Readme file in this folder for additional instructions. + +-------------------------------------------------------------- */ + +/* Use this class if a link gets an icon when it shouldn't. */ +body a.noicon { + background:transparent none !important; + padding:0 !important; + margin:0 !important; +} + +/* Make sure the icons are not cut */ +a[href^="http:"], a[href^="mailto:"], a[href^="http:"]:visited, +a[href$=".pdf"], a[href$=".doc"], a[href$=".xls"], a[href$=".rss"], +a[href$=".rdf"], a[href^="aim:"] { + padding:2px 22px 2px 0; + margin:-2px 0; + background-repeat: no-repeat; + background-position: right center; +} + +/* External links */ +a[href^="http:"] { background-image: url(icons/external.png); } +a[href^="mailto:"] { background-image: url(icons/email.png); } +a[href^="http:"]:visited { background-image: url(icons/visited.png); } + +/* Files */ +a[href$=".pdf"] { background-image: url(icons/pdf.png); } +a[href$=".doc"] { background-image: url(icons/doc.png); } +a[href$=".xls"] { background-image: url(icons/xls.png); } + +/* Misc */ +a[href$=".rss"], +a[href$=".rdf"] { background-image: url(icons/feed.png); } +a[href^="aim:"] { background-image: url(icons/im.png); } \ No newline at end of file diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/rtl/readme.txt b/booking-faces/src/main/webapp/styles/blueprint/plugins/rtl/readme.txt new file mode 100755 index 0000000..4c46535 --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/plugins/rtl/readme.txt @@ -0,0 +1,10 @@ +RTL +* Mirrors Blueprint, so it can be used with Right-to-Left languages. + +By Ran Yaniv Hartstein, ranh.co.il + +Usage +---------------------------------------------------------------- + +1) Add this line to your HTML: + \ No newline at end of file diff --git a/booking-faces/src/main/webapp/styles/blueprint/plugins/rtl/screen.css b/booking-faces/src/main/webapp/styles/blueprint/plugins/rtl/screen.css new file mode 100755 index 0000000..7e7ccdb --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/plugins/rtl/screen.css @@ -0,0 +1,110 @@ +/* -------------------------------------------------------------- + + rtl.css + * Mirrors Blueprint for left-to-right languages + + By Ran Yaniv Hartstein [ranh.co.il] + +-------------------------------------------------------------- */ + +body .container { direction: rtl; } +body .column, body div.span-1, body div.span-2, body div.span-3, body div.span-4, body div.span-5, body div.span-6, body div.span-7, body div.span-8, body div.span-9, body div.span-10, body div.span-11, body div.span-12, body div.span-13, body div.span-14, body div.span-15, body div.span-16, body div.span-17, body div.span-18, body div.span-19, body div.span-20, body div.span-21, body div.span-22, body div.span-23, body div.span-24 { + float: right; + margin-right: 0; + margin-left: 10px; + text-align:right; +} + +body div.last { margin-left: 0; } +body table .last { padding-left: 0; } + +body .append-1 { padding-right: 0; padding-left: 40px; } +body .append-2 { padding-right: 0; padding-left: 80px; } +body .append-3 { padding-right: 0; padding-left: 120px; } +body .append-4 { padding-right: 0; padding-left: 160px; } +body .append-5 { padding-right: 0; padding-left: 200px; } +body .append-6 { padding-right: 0; padding-left: 240px; } +body .append-7 { padding-right: 0; padding-left: 280px; } +body .append-8 { padding-right: 0; padding-left: 320px; } +body .append-9 { padding-right: 0; padding-left: 360px; } +body .append-10 { padding-right: 0; padding-left: 400px; } +body .append-11 { padding-right: 0; padding-left: 440px; } +body .append-12 { padding-right: 0; padding-left: 480px; } +body .append-13 { padding-right: 0; padding-left: 520px; } +body .append-14 { padding-right: 0; padding-left: 560px; } +body .append-15 { padding-right: 0; padding-left: 600px; } +body .append-16 { padding-right: 0; padding-left: 640px; } +body .append-17 { padding-right: 0; padding-left: 680px; } +body .append-18 { padding-right: 0; padding-left: 720px; } +body .append-19 { padding-right: 0; padding-left: 760px; } +body .append-20 { padding-right: 0; padding-left: 800px; } +body .append-21 { padding-right: 0; padding-left: 840px; } +body .append-22 { padding-right: 0; padding-left: 880px; } +body .append-23 { padding-right: 0; padding-left: 920px; } + +body .prepend-1 { padding-left: 0; padding-right: 40px; } +body .prepend-2 { padding-left: 0; padding-right: 80px; } +body .prepend-3 { padding-left: 0; padding-right: 120px; } +body .prepend-4 { padding-left: 0; padding-right: 160px; } +body .prepend-5 { padding-left: 0; padding-right: 200px; } +body .prepend-6 { padding-left: 0; padding-right: 240px; } +body .prepend-7 { padding-left: 0; padding-right: 280px; } +body .prepend-8 { padding-left: 0; padding-right: 320px; } +body .prepend-9 { padding-left: 0; padding-right: 360px; } +body .prepend-10 { padding-left: 0; padding-right: 400px; } +body .prepend-11 { padding-left: 0; padding-right: 440px; } +body .prepend-12 { padding-left: 0; padding-right: 480px; } +body .prepend-13 { padding-left: 0; padding-right: 520px; } +body .prepend-14 { padding-left: 0; padding-right: 560px; } +body .prepend-15 { padding-left: 0; padding-right: 600px; } +body .prepend-16 { padding-left: 0; padding-right: 640px; } +body .prepend-17 { padding-left: 0; padding-right: 680px; } +body .prepend-18 { padding-left: 0; padding-right: 720px; } +body .prepend-19 { padding-left: 0; padding-right: 760px; } +body .prepend-20 { padding-left: 0; padding-right: 800px; } +body .prepend-21 { padding-left: 0; padding-right: 840px; } +body .prepend-22 { padding-left: 0; padding-right: 880px; } +body .prepend-23 { padding-left: 0; padding-right: 920px; } + +body .border { + padding-right: 0; + padding-left: 4px; + margin-right: 0; + margin-left: 5px; + border-right: none; + border-left: 1px solid #eee; +} + +body .colborder { + padding-right: 0; + padding-left: 24px; + margin-right: 0; + margin-left: 25px; + border-right: none; + border-left: 1px solid #eee; +} + +body .pull-1 { margin-left: 0; margin-right: -40px; } +body .pull-2 { margin-left: 0; margin-right: -80px; } +body .pull-3 { margin-left: 0; margin-right: -120px; } +body .pull-4 { margin-left: 0; margin-right: -160px; } + +body .push-0 { margin: 0 18px 0 0; } +body .push-1 { margin: 0 18px 0 -40px; } +body .push-2 { margin: 0 18px 0 -80px; } +body .push-3 { margin: 0 18px 0 -120px; } +body .push-4 { margin: 0 18px 0 -160px; } +body .push-0, body .push-1, body .push-2, +body .push-3, body .push-4 { float: left; } + + +/* Typography with RTL support */ +body h1,body h2,body h3, +body h4,body h5,body h6 { font-family: Arial, sans-serif; } +html body { font-family: Arial, sans-serif; } +body pre,body code,body tt { font-family: monospace; } + +/* Mirror floats and margins on typographic elements */ +body p img { float: right; margin: 1.5em 0 1.5em 1.5em; } +body dd, body ul, body ol { margin-left: 0; margin-right: 1.5em;} +body td, body th { text-align:right; } \ No newline at end of file diff --git a/booking-faces/src/main/webapp/styles/blueprint/print.css b/booking-faces/src/main/webapp/styles/blueprint/print.css new file mode 100755 index 0000000..fdb8220 --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/print.css @@ -0,0 +1,29 @@ +/* ----------------------------------------------------------------------- + + + Blueprint CSS Framework 0.9 + http://blueprintcss.org + + * Copyright (c) 2007-Present. See LICENSE for more info. + * See README for instructions on how to use Blueprint. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + +----------------------------------------------------------------------- */ + +/* print.css */ +body {line-height:1.5;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;color:#000;background:none;font-size:10pt;} +.container {background:none;} +hr {background:#ccc;color:#ccc;width:100%;height:2px;margin:2em 0;padding:0;border:none;} +hr.space {background:#fff;color:#fff;visibility:hidden;} +h1, h2, h3, h4, h5, h6 {font-family:"Helvetica Neue", Arial, "Lucida Grande", sans-serif;} +code {font:.9em "Courier New", Monaco, Courier, monospace;} +a img {border:none;} +p img.top {margin-top:0;} +blockquote {margin:1.5em;padding:1em;font-style:italic;font-size:.9em;} +.small {font-size:.9em;} +.large {font-size:1.1em;} +.quiet {color:#999;} +.hide {display:none;} +a:link, a:visited {background:transparent;font-weight:700;text-decoration:underline;} +a:link:after, a:visited:after {content:" (" attr(href) ")";font-size:90%;} \ No newline at end of file diff --git a/booking-faces/src/main/webapp/styles/blueprint/screen.css b/booking-faces/src/main/webapp/styles/blueprint/screen.css new file mode 100755 index 0000000..c18b9a5 --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/screen.css @@ -0,0 +1,280 @@ +/* ----------------------------------------------------------------------- + + + Blueprint CSS Framework 0.9 + http://blueprintcss.org + + * Copyright (c) 2007-Present. See LICENSE for more info. + * See README for instructions on how to use Blueprint. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + +----------------------------------------------------------------------- */ + +/* reset.css */ +html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;} +body {line-height:1.5;} +table {border-collapse:separate;border-spacing:0;} +caption, th, td {text-align:left;font-weight:normal;} +table, td, th {vertical-align:middle;} +blockquote:before, blockquote:after, q:before, q:after {content:"";} +blockquote, q {quotes:"" "";} +a img {border:none;} + +/* typography.css */ +html {font-size:100.01%;} +body {font-size:75%;color:#222;background:#fff;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;} +h1, h2, h3, h4, h5, h6 {font-weight:normal;color:#111;} +h1 {font-size:3em;line-height:1;margin-bottom:0.5em;} +h2 {font-size:2em;margin-bottom:0.75em;} +h3 {font-size:1.5em;line-height:1;margin-bottom:1em;} +h4 {font-size:1.2em;line-height:1.25;margin-bottom:1.25em;} +h5 {font-size:1em;font-weight:bold;margin-bottom:1.5em;} +h6 {font-size:1em;font-weight:bold;} +h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;} +p {margin:0 0 1.5em;} +p img.left {float:left;margin:1.5em 1.5em 1.5em 0;padding:0;} +p img.right {float:right;margin:1.5em 0 1.5em 1.5em;} +a:focus, a:hover {color:#000;} +a {color:#009;text-decoration:underline;} +blockquote {margin:1.5em;color:#666;font-style:italic;} +strong {font-weight:bold;} +em, dfn {font-style:italic;} +dfn {font-weight:bold;} +sup, sub {line-height:0;} +abbr, acronym {border-bottom:1px dotted #666;} +address {margin:0 0 1.5em;font-style:italic;} +del {color:#666;} +pre {margin:1.5em 0;white-space:pre;} +pre, code, tt {font:1em 'andale mono', 'lucida console', monospace;line-height:1.5;} +li ul, li ol {margin:0 1.5em;} +ul, ol {margin:0 1.5em 1.5em 1.5em;} +ul {list-style-type:disc;} +ol {list-style-type:decimal;} +dl {margin:0 0 1.5em 0;} +dl dt {font-weight:bold;} +dd {margin-left:1.5em;} +table {margin-bottom:1.4em;width:100%;} +th {font-weight:bold;} +thead th {background:#c3d9ff;} +th, td, caption {padding:4px 10px 4px 5px;} +tr.even td {background:#e5ecf9;} +tfoot {font-style:italic;} +caption {background:#eee;} +.small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;} +.large {font-size:1.2em;line-height:2.5em;margin-bottom:1.25em;} +.hide {display:none;} +.quiet {color:#666;} +.loud {color:#000;} +.highlight {background:#ff0;} +.added {background:#060;color:#fff;} +.removed {background:#900;color:#fff;} +.first {margin-left:0;padding-left:0;} +.last {margin-right:0;padding-right:0;} +.top {margin-top:0;padding-top:0;} +.bottom {margin-bottom:0;padding-bottom:0;} + +/* forms.css */ +label {font-weight:bold;} +fieldset {padding:1.4em;margin:0 0 1.5em 0;border:1px solid #ccc;} +legend {font-weight:bold;font-size:1.2em;} +input[type=text], input[type=password], input.text, input.title, textarea, select {background-color:#fff;border:1px solid #bbb;} +input[type=text]:focus, input[type=password]:focus, input.text:focus, input.title:focus, textarea:focus, select:focus {border-color:#666;} +input[type=text], input[type=password], input.text, input.title, textarea, select {margin:0.5em 0;} +input.text, input.title {width:300px;padding:5px;} +input.title {font-size:1.5em;} +textarea {width:390px;height:250px;padding:5px;} +input[type=checkbox], input[type=radio], input.checkbox, input.radio {position:relative;top:.25em;} +form.inline {line-height:3;} +form.inline p {margin-bottom:0;} +.error, .notice, .success {padding:.8em;margin-bottom:1em;border:2px solid #ddd;} +.error {background:#FBE3E4;color:#8a1f11;border-color:#FBC2C4;} +.notice {background:#FFF6BF;color:#514721;border-color:#FFD324;} +.success {background:#E6EFC2;color:#264409;border-color:#C6D880;} +.error a {color:#8a1f11;} +.notice a {color:#514721;} +.success a {color:#264409;} + +/* grid.css */ +.container {width:950px;margin:0 auto;} +.showgrid {background:url(src/grid.png);} +.column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 {float:left;margin-right:10px;} +.last, div.last {margin-right:0;} +.span-1 {width:30px;} +.span-2 {width:70px;} +.span-3 {width:110px;} +.span-4 {width:150px;} +.span-5 {width:190px;} +.span-6 {width:230px;} +.span-7 {width:270px;} +.span-8 {width:310px;} +.span-9 {width:350px;} +.span-10 {width:390px;} +.span-11 {width:430px;} +.span-12 {width:470px;} +.span-13 {width:510px;} +.span-14 {width:550px;} +.span-15 {width:590px;} +.span-16 {width:630px;} +.span-17 {width:670px;} +.span-18 {width:710px;} +.span-19 {width:750px;} +.span-20 {width:790px;} +.span-21 {width:830px;} +.span-22 {width:870px;} +.span-23 {width:910px;} +.span-24, div.span-24 {width:950px;margin-right:0;} +input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 {border-left-width:1px!important;border-right-width:1px!important;padding-left:5px!important;padding-right:5px!important;} +input.span-1, textarea.span-1 {width:18px!important;} +input.span-2, textarea.span-2 {width:58px!important;} +input.span-3, textarea.span-3 {width:98px!important;} +input.span-4, textarea.span-4 {width:138px!important;} +input.span-5, textarea.span-5 {width:178px!important;} +input.span-6, textarea.span-6 {width:218px!important;} +input.span-7, textarea.span-7 {width:258px!important;} +input.span-8, textarea.span-8 {width:298px!important;} +input.span-9, textarea.span-9 {width:338px!important;} +input.span-10, textarea.span-10 {width:378px!important;} +input.span-11, textarea.span-11 {width:418px!important;} +input.span-12, textarea.span-12 {width:458px!important;} +input.span-13, textarea.span-13 {width:498px!important;} +input.span-14, textarea.span-14 {width:538px!important;} +input.span-15, textarea.span-15 {width:578px!important;} +input.span-16, textarea.span-16 {width:618px!important;} +input.span-17, textarea.span-17 {width:658px!important;} +input.span-18, textarea.span-18 {width:698px!important;} +input.span-19, textarea.span-19 {width:738px!important;} +input.span-20, textarea.span-20 {width:778px!important;} +input.span-21, textarea.span-21 {width:818px!important;} +input.span-22, textarea.span-22 {width:858px!important;} +input.span-23, textarea.span-23 {width:898px!important;} +input.span-24, textarea.span-24 {width:938px!important;} +.append-1 {padding-right:40px;} +.append-2 {padding-right:80px;} +.append-3 {padding-right:120px;} +.append-4 {padding-right:160px;} +.append-5 {padding-right:200px;} +.append-6 {padding-right:240px;} +.append-7 {padding-right:280px;} +.append-8 {padding-right:320px;} +.append-9 {padding-right:360px;} +.append-10 {padding-right:400px;} +.append-11 {padding-right:440px;} +.append-12 {padding-right:480px;} +.append-13 {padding-right:520px;} +.append-14 {padding-right:560px;} +.append-15 {padding-right:600px;} +.append-16 {padding-right:640px;} +.append-17 {padding-right:680px;} +.append-18 {padding-right:720px;} +.append-19 {padding-right:760px;} +.append-20 {padding-right:800px;} +.append-21 {padding-right:840px;} +.append-22 {padding-right:880px;} +.append-23 {padding-right:920px;} +.prepend-1 {padding-left:40px;} +.prepend-2 {padding-left:80px;} +.prepend-3 {padding-left:120px;} +.prepend-4 {padding-left:160px;} +.prepend-5 {padding-left:200px;} +.prepend-6 {padding-left:240px;} +.prepend-7 {padding-left:280px;} +.prepend-8 {padding-left:320px;} +.prepend-9 {padding-left:360px;} +.prepend-10 {padding-left:400px;} +.prepend-11 {padding-left:440px;} +.prepend-12 {padding-left:480px;} +.prepend-13 {padding-left:520px;} +.prepend-14 {padding-left:560px;} +.prepend-15 {padding-left:600px;} +.prepend-16 {padding-left:640px;} +.prepend-17 {padding-left:680px;} +.prepend-18 {padding-left:720px;} +.prepend-19 {padding-left:760px;} +.prepend-20 {padding-left:800px;} +.prepend-21 {padding-left:840px;} +.prepend-22 {padding-left:880px;} +.prepend-23 {padding-left:920px;} +div.border {padding-right:4px;margin-right:5px;border-right:1px solid #eee;} +div.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #eee;} +.pull-1 {margin-left:-40px;} +.pull-2 {margin-left:-80px;} +.pull-3 {margin-left:-120px;} +.pull-4 {margin-left:-160px;} +.pull-5 {margin-left:-200px;} +.pull-6 {margin-left:-240px;} +.pull-7 {margin-left:-280px;} +.pull-8 {margin-left:-320px;} +.pull-9 {margin-left:-360px;} +.pull-10 {margin-left:-400px;} +.pull-11 {margin-left:-440px;} +.pull-12 {margin-left:-480px;} +.pull-13 {margin-left:-520px;} +.pull-14 {margin-left:-560px;} +.pull-15 {margin-left:-600px;} +.pull-16 {margin-left:-640px;} +.pull-17 {margin-left:-680px;} +.pull-18 {margin-left:-720px;} +.pull-19 {margin-left:-760px;} +.pull-20 {margin-left:-800px;} +.pull-21 {margin-left:-840px;} +.pull-22 {margin-left:-880px;} +.pull-23 {margin-left:-920px;} +.pull-24 {margin-left:-960px;} +.pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18, .pull-19, .pull-20, .pull-21, .pull-22, .pull-23, .pull-24 {float:left;position:relative;} +.push-1 {margin:0 -40px 1.5em 40px;} +.push-2 {margin:0 -80px 1.5em 80px;} +.push-3 {margin:0 -120px 1.5em 120px;} +.push-4 {margin:0 -160px 1.5em 160px;} +.push-5 {margin:0 -200px 1.5em 200px;} +.push-6 {margin:0 -240px 1.5em 240px;} +.push-7 {margin:0 -280px 1.5em 280px;} +.push-8 {margin:0 -320px 1.5em 320px;} +.push-9 {margin:0 -360px 1.5em 360px;} +.push-10 {margin:0 -400px 1.5em 400px;} +.push-11 {margin:0 -440px 1.5em 440px;} +.push-12 {margin:0 -480px 1.5em 480px;} +.push-13 {margin:0 -520px 1.5em 520px;} +.push-14 {margin:0 -560px 1.5em 560px;} +.push-15 {margin:0 -600px 1.5em 600px;} +.push-16 {margin:0 -640px 1.5em 640px;} +.push-17 {margin:0 -680px 1.5em 680px;} +.push-18 {margin:0 -720px 1.5em 720px;} +.push-19 {margin:0 -760px 1.5em 760px;} +.push-20 {margin:0 -800px 1.5em 800px;} +.push-21 {margin:0 -840px 1.5em 840px;} +.push-22 {margin:0 -880px 1.5em 880px;} +.push-23 {margin:0 -920px 1.5em 920px;} +.push-24 {margin:0 -960px 1.5em 960px;} +.push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float:right;position:relative;} +.prepend-top {margin-top:1.5em;} +.append-bottom {margin-bottom:1.5em;} +.box {padding:1.5em;margin-bottom:1.5em;background:#E5ECF9;} +hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:.1em;margin:0 0 1.45em;border:none;} +hr.space {background:#fff;color:#fff;visibility:hidden;} +.clearfix:after, .container:after {content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflow:hidden;} +.clearfix, .container {display:block;} +.clear {clear:both;} + +/* fancy-type */ +p + p {text-indent:2em;margin-top:-1.5em;} +form p + p {text-indent:0;} +.alt {color:#666;font-family:"Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua", Georgia, serif;font-style:italic;font-weight:normal;} +.dquo {margin-left:-.5em;} +p.incr, .incr p {font-size:10px;line-height:1.44em;margin-bottom:1.5em;} +.caps {font-variant:small-caps;letter-spacing:1px;text-transform:lowercase;font-size:1.2em;line-height:1%;font-weight:bold;padding:0 2px;} + +/* buttons */ +a.button, button {display:block;float:left;margin:0.7em 0.5em 0.7em 0;padding:5px 10px 5px 7px;border:1px solid #dedede;border-top:1px solid #eee;border-left:1px solid #eee;background-color:#f5f5f5;font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;font-size:100%;line-height:130%;text-decoration:none;font-weight:bold;color:#565656;cursor:pointer;} +button {width:auto;overflow:visible;padding:4px 10px 3px 7px;} +button[type] {padding:4px 10px 4px 7px;line-height:17px;} +*:first-child+html button[type] {padding:4px 10px 3px 7px;} +button img, a.button img {margin:0 3px -3px 0 !important;padding:0;border:none;width:16px;height:16px;float:none;} +button:hover, a.button:hover {background-color:#dff4ff;border:1px solid #c2e1ef;color:#336699;} +a.button:active {background-color:#6299c5;border:1px solid #6299c5;color:#fff;} +body .positive {color:#529214;} +a.positive:hover, button.positive:hover {background-color:#E6EFC2;border:1px solid #C6D880;color:#529214;} +a.positive:active {background-color:#529214;border:1px solid #529214;color:#fff;} +body .negative {color:#d12f19;} +a.negative:hover, button.negative:hover {background-color:#fbe3e4;border:1px solid #fbc2c4;color:#d12f19;} +a.negative:active {background-color:#d12f19;border:1px solid #d12f19;color:#fff;} \ No newline at end of file diff --git a/booking-faces/src/main/webapp/styles/blueprint/src/forms.css b/booking-faces/src/main/webapp/styles/blueprint/src/forms.css new file mode 100755 index 0000000..b491134 --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/src/forms.css @@ -0,0 +1,65 @@ +/* -------------------------------------------------------------- + + forms.css + * Sets up some default styling for forms + * Gives you classes to enhance your forms + + Usage: + * For text fields, use class .title or .text + * For inline forms, use .inline (even when using columns) + +-------------------------------------------------------------- */ + +label { font-weight: bold; } +fieldset { padding:1.4em; margin: 0 0 1.5em 0; border: 1px solid #ccc; } +legend { font-weight: bold; font-size:1.2em; } + + +/* Form fields +-------------------------------------------------------------- */ + +input[type=text], input[type=password], +input.text, input.title, +textarea, select { + background-color:#fff; + border:1px solid #bbb; +} +input[type=text]:focus, input[type=password]:focus, +input.text:focus, input.title:focus, +textarea:focus, select:focus { + border-color:#666; +} + +input[type=text], input[type=password], +input.text, input.title, +textarea, select { + margin:0.5em 0; +} + +input.text, +input.title { width: 300px; padding:5px; } +input.title { font-size:1.5em; } +textarea { width: 390px; height: 250px; padding:5px; } + +input[type=checkbox], input[type=radio], +input.checkbox, input.radio { + position:relative; top:.25em; +} + +form.inline { line-height:3; } +form.inline p { margin-bottom:0; } + + +/* Success, notice and error boxes +-------------------------------------------------------------- */ + +.error, +.notice, +.success { padding: .8em; margin-bottom: 1em; border: 2px solid #ddd; } + +.error { background: #FBE3E4; color: #8a1f11; border-color: #FBC2C4; } +.notice { background: #FFF6BF; color: #514721; border-color: #FFD324; } +.success { background: #E6EFC2; color: #264409; border-color: #C6D880; } +.error a { color: #8a1f11; } +.notice a { color: #514721; } +.success a { color: #264409; } diff --git a/booking-faces/src/main/webapp/styles/blueprint/src/grid.css b/booking-faces/src/main/webapp/styles/blueprint/src/grid.css new file mode 100755 index 0000000..352e0e2 --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/src/grid.css @@ -0,0 +1,281 @@ +/* -------------------------------------------------------------- + grid.css + * Sets up an easy-to-use grid of 24 columns. + + By default, the grid is 950px wide, with 24 columns + spanning 30px, and a 10px margin between columns. + + If you need fewer or more columns, namespaces or semantic + element names, use the compressor script (lib/compress.rb) + + Note: Changes made in this file will not be applied when + using the compressor: make changes in lib/blueprint/grid.css.rb +-------------------------------------------------------------- */ + +/* A container should group all your columns. */ +.container { + width: 950px; + margin: 0 auto; +} + +/* Use this class on any div.span / container to see the grid. */ +.showgrid { + background: url(src/grid.png); +} + + +/* Columns +-------------------------------------------------------------- */ + +/* Sets up basic grid floating and margin. */ +.column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 { + float: left; + margin-right: 10px; +} + +/* The last column in a row needs this class. */ +.last, div.last { margin-right: 0; } + +/* Use these classes to set the width of a column. */ +.span-1 {width: 30px;} + +.span-2 {width: 70px;} +.span-3 {width: 110px;} +.span-4 {width: 150px;} +.span-5 {width: 190px;} +.span-6 {width: 230px;} +.span-7 {width: 270px;} +.span-8 {width: 310px;} +.span-9 {width: 350px;} +.span-10 {width: 390px;} +.span-11 {width: 430px;} +.span-12 {width: 470px;} +.span-13 {width: 510px;} +.span-14 {width: 550px;} +.span-15 {width: 590px;} +.span-16 {width: 630px;} +.span-17 {width: 670px;} +.span-18 {width: 710px;} +.span-19 {width: 750px;} +.span-20 {width: 790px;} +.span-21 {width: 830px;} +.span-22 {width: 870px;} +.span-23 {width: 910px;} +.span-24, div.span-24 { width:950px; margin-right:0; } + +/* Use these classes to set the width of an input. */ +input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 { + border-left-width: 1px!important; + border-right-width: 1px!important; + padding-left: 5px!important; + padding-right: 5px!important; +} + +input.span-1, textarea.span-1 { width: 18px!important; } +input.span-2, textarea.span-2 { width: 58px!important; } +input.span-3, textarea.span-3 { width: 98px!important; } +input.span-4, textarea.span-4 { width: 138px!important; } +input.span-5, textarea.span-5 { width: 178px!important; } +input.span-6, textarea.span-6 { width: 218px!important; } +input.span-7, textarea.span-7 { width: 258px!important; } +input.span-8, textarea.span-8 { width: 298px!important; } +input.span-9, textarea.span-9 { width: 338px!important; } +input.span-10, textarea.span-10 { width: 378px!important; } +input.span-11, textarea.span-11 { width: 418px!important; } +input.span-12, textarea.span-12 { width: 458px!important; } +input.span-13, textarea.span-13 { width: 498px!important; } +input.span-14, textarea.span-14 { width: 538px!important; } +input.span-15, textarea.span-15 { width: 578px!important; } +input.span-16, textarea.span-16 { width: 618px!important; } +input.span-17, textarea.span-17 { width: 658px!important; } +input.span-18, textarea.span-18 { width: 698px!important; } +input.span-19, textarea.span-19 { width: 738px!important; } +input.span-20, textarea.span-20 { width: 778px!important; } +input.span-21, textarea.span-21 { width: 818px!important; } +input.span-22, textarea.span-22 { width: 858px!important; } +input.span-23, textarea.span-23 { width: 898px!important; } +input.span-24, textarea.span-24 { width: 938px!important; } + +/* Add these to a column to append empty cols. */ + +.append-1 { padding-right: 40px;} +.append-2 { padding-right: 80px;} +.append-3 { padding-right: 120px;} +.append-4 { padding-right: 160px;} +.append-5 { padding-right: 200px;} +.append-6 { padding-right: 240px;} +.append-7 { padding-right: 280px;} +.append-8 { padding-right: 320px;} +.append-9 { padding-right: 360px;} +.append-10 { padding-right: 400px;} +.append-11 { padding-right: 440px;} +.append-12 { padding-right: 480px;} +.append-13 { padding-right: 520px;} +.append-14 { padding-right: 560px;} +.append-15 { padding-right: 600px;} +.append-16 { padding-right: 640px;} +.append-17 { padding-right: 680px;} +.append-18 { padding-right: 720px;} +.append-19 { padding-right: 760px;} +.append-20 { padding-right: 800px;} +.append-21 { padding-right: 840px;} +.append-22 { padding-right: 880px;} +.append-23 { padding-right: 920px;} + +/* Add these to a column to prepend empty cols. */ + +.prepend-1 { padding-left: 40px;} +.prepend-2 { padding-left: 80px;} +.prepend-3 { padding-left: 120px;} +.prepend-4 { padding-left: 160px;} +.prepend-5 { padding-left: 200px;} +.prepend-6 { padding-left: 240px;} +.prepend-7 { padding-left: 280px;} +.prepend-8 { padding-left: 320px;} +.prepend-9 { padding-left: 360px;} +.prepend-10 { padding-left: 400px;} +.prepend-11 { padding-left: 440px;} +.prepend-12 { padding-left: 480px;} +.prepend-13 { padding-left: 520px;} +.prepend-14 { padding-left: 560px;} +.prepend-15 { padding-left: 600px;} +.prepend-16 { padding-left: 640px;} +.prepend-17 { padding-left: 680px;} +.prepend-18 { padding-left: 720px;} +.prepend-19 { padding-left: 760px;} +.prepend-20 { padding-left: 800px;} +.prepend-21 { padding-left: 840px;} +.prepend-22 { padding-left: 880px;} +.prepend-23 { padding-left: 920px;} + + +/* Border on right hand side of a column. */ +div.border { + padding-right: 4px; + margin-right: 5px; + border-right: 1px solid #eee; +} + +/* Border with more whitespace, spans one column. */ +div.colborder { + padding-right: 24px; + margin-right: 25px; + border-right: 1px solid #eee; +} + + +/* Use these classes on an element to push it into the +next column, or to pull it into the previous column. */ + + +.pull-1 { margin-left: -40px; } +.pull-2 { margin-left: -80px; } +.pull-3 { margin-left: -120px; } +.pull-4 { margin-left: -160px; } +.pull-5 { margin-left: -200px; } +.pull-6 { margin-left: -240px; } +.pull-7 { margin-left: -280px; } +.pull-8 { margin-left: -320px; } +.pull-9 { margin-left: -360px; } +.pull-10 { margin-left: -400px; } +.pull-11 { margin-left: -440px; } +.pull-12 { margin-left: -480px; } +.pull-13 { margin-left: -520px; } +.pull-14 { margin-left: -560px; } +.pull-15 { margin-left: -600px; } +.pull-16 { margin-left: -640px; } +.pull-17 { margin-left: -680px; } +.pull-18 { margin-left: -720px; } +.pull-19 { margin-left: -760px; } +.pull-20 { margin-left: -800px; } +.pull-21 { margin-left: -840px; } +.pull-22 { margin-left: -880px; } +.pull-23 { margin-left: -920px; } +.pull-24 { margin-left: -960px; } + +.pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18, .pull-19, .pull-20, .pull-21, .pull-22, .pull-23, .pull-24 {float: left; position:relative;} + + +.push-1 { margin: 0 -40px 1.5em 40px; } +.push-2 { margin: 0 -80px 1.5em 80px; } +.push-3 { margin: 0 -120px 1.5em 120px; } +.push-4 { margin: 0 -160px 1.5em 160px; } +.push-5 { margin: 0 -200px 1.5em 200px; } +.push-6 { margin: 0 -240px 1.5em 240px; } +.push-7 { margin: 0 -280px 1.5em 280px; } +.push-8 { margin: 0 -320px 1.5em 320px; } +.push-9 { margin: 0 -360px 1.5em 360px; } +.push-10 { margin: 0 -400px 1.5em 400px; } +.push-11 { margin: 0 -440px 1.5em 440px; } +.push-12 { margin: 0 -480px 1.5em 480px; } +.push-13 { margin: 0 -520px 1.5em 520px; } +.push-14 { margin: 0 -560px 1.5em 560px; } +.push-15 { margin: 0 -600px 1.5em 600px; } +.push-16 { margin: 0 -640px 1.5em 640px; } +.push-17 { margin: 0 -680px 1.5em 680px; } +.push-18 { margin: 0 -720px 1.5em 720px; } +.push-19 { margin: 0 -760px 1.5em 760px; } +.push-20 { margin: 0 -800px 1.5em 800px; } +.push-21 { margin: 0 -840px 1.5em 840px; } +.push-22 { margin: 0 -880px 1.5em 880px; } +.push-23 { margin: 0 -920px 1.5em 920px; } +.push-24 { margin: 0 -960px 1.5em 960px; } + +.push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float: right; position:relative;} + + +/* Misc classes and elements +-------------------------------------------------------------- */ + +/* In case you need to add a gutter above/below an element */ +.prepend-top { + margin-top:1.5em; +} +.append-bottom { + margin-bottom:1.5em; +} + +/* Use a .box to create a padded box inside a column. */ +.box { + padding: 1.5em; + margin-bottom: 1.5em; + background: #E5ECF9; +} + +/* Use this to create a horizontal ruler across a column. */ +hr { + background: #ddd; + color: #ddd; + clear: both; + float: none; + width: 100%; + height: .1em; + margin: 0 0 1.45em; + border: none; +} + +hr.space { + background: #fff; + color: #fff; + visibility: hidden; +} + + +/* Clearing floats without extra markup + Based on How To Clear Floats Without Structural Markup by PiE + [http://www.positioniseverything.net/easyclearing.html] */ + +.clearfix:after, .container:after { + content: "\0020"; + display: block; + height: 0; + clear: both; + visibility: hidden; + overflow:hidden; +} +.clearfix, .container {display: block;} + +/* Regular clearing + apply to column that should drop below previous ones. */ + +.clear { clear:both; } diff --git a/booking-faces/src/main/webapp/styles/blueprint/src/grid.png b/booking-faces/src/main/webapp/styles/blueprint/src/grid.png new file mode 100755 index 0000000..b7539f6 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/blueprint/src/grid.png differ diff --git a/booking-faces/src/main/webapp/styles/blueprint/src/ie.css b/booking-faces/src/main/webapp/styles/blueprint/src/ie.css new file mode 100755 index 0000000..214b879 --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/src/ie.css @@ -0,0 +1,76 @@ +/* -------------------------------------------------------------- + + ie.css + + Contains every hack for Internet Explorer, + so that our core files stay sweet and nimble. + +-------------------------------------------------------------- */ + +/* Make sure the layout is centered in IE5 */ +body { text-align: center; } +.container { text-align: left; } + +/* Fixes IE margin bugs */ +* html .column, * html div.span-1, * html div.span-2, +* html div.span-3, * html div.span-4, * html div.span-5, +* html div.span-6, * html div.span-7, * html div.span-8, +* html div.span-9, * html div.span-10, * html div.span-11, +* html div.span-12, * html div.span-13, * html div.span-14, +* html div.span-15, * html div.span-16, * html div.span-17, +* html div.span-18, * html div.span-19, * html div.span-20, +* html div.span-21, * html div.span-22, * html div.span-23, +* html div.span-24 { display:inline; overflow-x: hidden; } + + +/* Elements +-------------------------------------------------------------- */ + +/* Fixes incorrect styling of legend in IE6. */ +* html legend { margin:0px -8px 16px 0; padding:0; } + +/* Fixes wrong line-height on sup/sub in IE. */ +sup { vertical-align:text-top; } +sub { vertical-align:text-bottom; } + +/* Fixes IE7 missing wrapping of code elements. */ +html>body p code { *white-space: normal; } + +/* IE 6&7 has problems with setting proper
margins. */ +hr { margin:-8px auto 11px; } + +/* Explicitly set interpolation, allowing dynamically resized images to not look horrible */ +img { -ms-interpolation-mode:bicubic; } + +/* Clearing +-------------------------------------------------------------- */ + +/* Makes clearfix actually work in IE */ +.clearfix, .container { display:inline-block; } +* html .clearfix, +* html .container { height:1%; } + + +/* Forms +-------------------------------------------------------------- */ + +/* Fixes padding on fieldset */ +fieldset { padding-top:0; } + +/* Makes classic textareas in IE 6 resemble other browsers */ +textarea { overflow:auto; } + +/* Fixes rule that IE 6 ignores */ +input.text, input.title, textarea { background-color:#fff; border:1px solid #bbb; } +input.text:focus, input.title:focus { border-color:#666; } +input.text, input.title, textarea, select { margin:0.5em 0; } +input.checkbox, input.radio { position:relative; top:.25em; } + +/* Fixes alignment of inline form elements */ +form.inline div, form.inline p { vertical-align:middle; } +form.inline label { position:relative;top:-0.25em; } +form.inline input.checkbox, form.inline input.radio, +form.inline input.button, form.inline button { + margin:0.5em 0; +} +button, input.button { position:relative;top:0.25em; } \ No newline at end of file diff --git a/booking-faces/src/main/webapp/styles/blueprint/src/print.css b/booking-faces/src/main/webapp/styles/blueprint/src/print.css new file mode 100755 index 0000000..d303029 --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/src/print.css @@ -0,0 +1,85 @@ +/* -------------------------------------------------------------- + + print.css + * Gives you some sensible styles for printing pages. + * See Readme file in this directory for further instructions. + + Some additions you'll want to make, customized to your markup: + #header, #footer, #navigation { display:none; } + +-------------------------------------------------------------- */ + +body { + line-height: 1.5; + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + color:#000; + background: none; + font-size: 10pt; +} + + +/* Layout +-------------------------------------------------------------- */ + +.container { + background: none; +} + +hr { + background:#ccc; + color:#ccc; + width:100%; + height:2px; + margin:2em 0; + padding:0; + border:none; +} +hr.space { + background: #fff; + color: #fff; + visibility: hidden; +} + + +/* Text +-------------------------------------------------------------- */ + +h1,h2,h3,h4,h5,h6 { font-family: "Helvetica Neue", Arial, "Lucida Grande", sans-serif; } +code { font:.9em "Courier New", Monaco, Courier, monospace; } + +a img { border:none; } +p img.top { margin-top: 0; } + +blockquote { + margin:1.5em; + padding:1em; + font-style:italic; + font-size:.9em; +} + +.small { font-size: .9em; } +.large { font-size: 1.1em; } +.quiet { color: #999; } +.hide { display:none; } + + +/* Links +-------------------------------------------------------------- */ + +a:link, a:visited { + background: transparent; + font-weight:700; + text-decoration: underline; +} + +a:link:after, a:visited:after { + content: " (" attr(href) ")"; + font-size: 90%; +} + +/* If you're having trouble printing relative links, uncomment and customize this: + (note: This is valid CSS3, but it still won't go through the W3C CSS Validator) */ + +/* a[href^="/"]:after { + content: " (http://www.yourdomain.com" attr(href) ") "; +} */ diff --git a/booking-faces/src/main/webapp/styles/blueprint/src/reset.css b/booking-faces/src/main/webapp/styles/blueprint/src/reset.css new file mode 100755 index 0000000..fc0788c --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/src/reset.css @@ -0,0 +1,38 @@ +/* -------------------------------------------------------------- + + reset.css + * Resets default browser CSS. + +-------------------------------------------------------------- */ + +html, body, div, span, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, code, +del, dfn, em, img, q, dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +body { + line-height: 1.5; +} + +/* Tables still need 'cellspacing="0"' in the markup. */ +table { border-collapse: separate; border-spacing: 0; } +caption, th, td { text-align: left; font-weight: normal; } +table, td, th { vertical-align: middle; } + +/* Remove possible quote marks (") from ,
. */ +blockquote:before, blockquote:after, q:before, q:after { content: ""; } +blockquote, q { quotes: "" ""; } + +/* Remove annoying border on linked images. */ +a img { border: none; } diff --git a/booking-faces/src/main/webapp/styles/blueprint/src/typography.css b/booking-faces/src/main/webapp/styles/blueprint/src/typography.css new file mode 100755 index 0000000..6cc099c --- /dev/null +++ b/booking-faces/src/main/webapp/styles/blueprint/src/typography.css @@ -0,0 +1,106 @@ +/* -------------------------------------------------------------- + + typography.css + * Sets up some sensible default typography. + +-------------------------------------------------------------- */ + +/* Default font settings. + The font-size percentage is of 16px. (0.75 * 16px = 12px) */ +html { font-size:100.01%; } +body { + font-size: 75%; + color: #222; + background: #fff; + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; +} + + +/* Headings +-------------------------------------------------------------- */ + +h1,h2,h3,h4,h5,h6 { font-weight: normal; color: #111; } + +h1 { font-size: 3em; line-height: 1; margin-bottom: 0.5em; } +h2 { font-size: 2em; margin-bottom: 0.75em; } +h3 { font-size: 1.5em; line-height: 1; margin-bottom: 1em; } +h4 { font-size: 1.2em; line-height: 1.25; margin-bottom: 1.25em; } +h5 { font-size: 1em; font-weight: bold; margin-bottom: 1.5em; } +h6 { font-size: 1em; font-weight: bold; } + +h1 img, h2 img, h3 img, +h4 img, h5 img, h6 img { + margin: 0; +} + + +/* Text elements +-------------------------------------------------------------- */ + +p { margin: 0 0 1.5em; } +p img.left { float: left; margin: 1.5em 1.5em 1.5em 0; padding: 0; } +p img.right { float: right; margin: 1.5em 0 1.5em 1.5em; } + +a:focus, +a:hover { color: #000; } +a { color: #009; text-decoration: underline; } + +blockquote { margin: 1.5em; color: #666; font-style: italic; } +strong { font-weight: bold; } +em,dfn { font-style: italic; } +dfn { font-weight: bold; } +sup, sub { line-height: 0; } + +abbr, +acronym { border-bottom: 1px dotted #666; } +address { margin: 0 0 1.5em; font-style: italic; } +del { color:#666; } + +pre { margin: 1.5em 0; white-space: pre; } +pre,code,tt { font: 1em 'andale mono', 'lucida console', monospace; line-height: 1.5; } + + +/* Lists +-------------------------------------------------------------- */ + +li ul, +li ol { margin: 0; } +ul, ol { margin: 0 1.5em 1.5em 0; padding-left: 3.333em; } + +ul { list-style-type: disc; } +ol { list-style-type: decimal; } + +dl { margin: 0 0 1.5em 0; } +dl dt { font-weight: bold; } +dd { margin-left: 1.5em;} + + +/* Tables +-------------------------------------------------------------- */ + +table { margin-bottom: 1.4em; width:100%; } +th { font-weight: bold; } +thead th { background: #c3d9ff; } +th,td,caption { padding: 4px 10px 4px 5px; } +tr.even td { background: #e5ecf9; } +tfoot { font-style: italic; } +caption { background: #eee; } + + +/* Misc classes +-------------------------------------------------------------- */ + +.small { font-size: .8em; margin-bottom: 1.875em; line-height: 1.875em; } +.large { font-size: 1.2em; line-height: 2.5em; margin-bottom: 1.25em; } +.hide { display: none; } + +.quiet { color: #666; } +.loud { color: #000; } +.highlight { background:#ff0; } +.added { background:#060; color: #fff; } +.removed { background:#900; color: #fff; } + +.first { margin-left:0; padding-left:0; } +.last { margin-right:0; padding-right:0; } +.top { margin-top:0; padding-top:0; } +.bottom { margin-bottom:0; padding-bottom:0; } diff --git a/booking-faces/src/main/webapp/styles/booking.css b/booking-faces/src/main/webapp/styles/booking.css new file mode 100644 index 0000000..0f30e21 --- /dev/null +++ b/booking-faces/src/main/webapp/styles/booking.css @@ -0,0 +1,59 @@ + +a,a:visited,a:link,a:active { + color: #59924B; + background-color: transparent; + text-decoration: none; + font-weight: bold; +} + +a:hover { + color: white; + background-color: #65a242; + text-decoration: none; + font-weight: bold; +} + +input[type=submit] { + color: #fff; + background: #fff url(../images/btn.bg.gif) 0 0 repeat-x; + border-style: none; + margin:0.4em 0.4em 0.4em 0; + height: 1.8em; +} + +input[type=submit]:hover { + color: yellow; + background: #fff url(../images/btn.bg.gif) 0 0 repeat-x; + border-style: none; +} + +label { + margin-right: 0.5em; +} + +.summary { + width: 100%; + border: 1px solid #414f23; + border-collapse: collapse; +} + +.summary thead th { + border-left: 1px solid #414f23; + background: #fff url(../images/th.bg.gif) 0 100% repeat-x; + border-bottom: 1px solid #414f23; + padding: 6px; + text-align: left; + font-size: small; +} + +.summary tbody td { + border-left: 1px solid #9cac7c; + padding: 4px; + border-bottom: 1px solid #9cac7c; + font-size: 8pt; +} + +.label { + font-weight: bold; +} + diff --git a/booking-faces/src/main/webapp/styles/le-frog/images/ui-anim_basic_16x16.gif b/booking-faces/src/main/webapp/styles/le-frog/images/ui-anim_basic_16x16.gif new file mode 100644 index 0000000..085ccae Binary files /dev/null and b/booking-faces/src/main/webapp/styles/le-frog/images/ui-anim_basic_16x16.gif differ diff --git a/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_diagonals-small_0_aaaaaa_40x40.png b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_diagonals-small_0_aaaaaa_40x40.png new file mode 100644 index 0000000..d535973 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_diagonals-small_0_aaaaaa_40x40.png differ diff --git a/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_diagonals-thick_15_444444_40x40.png b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_diagonals-thick_15_444444_40x40.png new file mode 100644 index 0000000..88e46a6 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_diagonals-thick_15_444444_40x40.png differ diff --git a/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_diagonals-thick_95_ffdc2e_40x40.png b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_diagonals-thick_95_ffdc2e_40x40.png new file mode 100644 index 0000000..a4f59e1 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_diagonals-thick_95_ffdc2e_40x40.png differ diff --git a/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_glass_55_fbf5d0_1x400.png b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_glass_55_fbf5d0_1x400.png new file mode 100644 index 0000000..0f45be7 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_glass_55_fbf5d0_1x400.png differ diff --git a/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_highlight-hard_30_285c00_1x100.png b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_highlight-hard_30_285c00_1x100.png new file mode 100644 index 0000000..c341f5e Binary files /dev/null and b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_highlight-hard_30_285c00_1x100.png differ diff --git a/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_highlight-soft_33_3a8104_1x100.png b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_highlight-soft_33_3a8104_1x100.png new file mode 100644 index 0000000..3b32c4f Binary files /dev/null and b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_highlight-soft_33_3a8104_1x100.png differ diff --git a/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_highlight-soft_50_4eb305_1x100.png b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_highlight-soft_50_4eb305_1x100.png new file mode 100644 index 0000000..6551869 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_highlight-soft_50_4eb305_1x100.png differ diff --git a/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_highlight-soft_60_4ca20b_1x100.png b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_highlight-soft_60_4ca20b_1x100.png new file mode 100644 index 0000000..e0c83c0 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_highlight-soft_60_4ca20b_1x100.png differ diff --git a/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_inset-soft_10_285c00_1x100.png b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_inset-soft_10_285c00_1x100.png new file mode 100644 index 0000000..d0e7d80 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/le-frog/images/ui-bg_inset-soft_10_285c00_1x100.png differ diff --git a/booking-faces/src/main/webapp/styles/le-frog/images/ui-icons_4eb305_256x240.png b/booking-faces/src/main/webapp/styles/le-frog/images/ui-icons_4eb305_256x240.png new file mode 100644 index 0000000..bae3420 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/le-frog/images/ui-icons_4eb305_256x240.png differ diff --git a/booking-faces/src/main/webapp/styles/le-frog/images/ui-icons_72b42d_256x240.png b/booking-faces/src/main/webapp/styles/le-frog/images/ui-icons_72b42d_256x240.png new file mode 100644 index 0000000..6108cfe Binary files /dev/null and b/booking-faces/src/main/webapp/styles/le-frog/images/ui-icons_72b42d_256x240.png differ diff --git a/booking-faces/src/main/webapp/styles/le-frog/images/ui-icons_cd0a0a_256x240.png b/booking-faces/src/main/webapp/styles/le-frog/images/ui-icons_cd0a0a_256x240.png new file mode 100644 index 0000000..2ab019b Binary files /dev/null and b/booking-faces/src/main/webapp/styles/le-frog/images/ui-icons_cd0a0a_256x240.png differ diff --git a/booking-faces/src/main/webapp/styles/le-frog/images/ui-icons_ffffff_256x240.png b/booking-faces/src/main/webapp/styles/le-frog/images/ui-icons_ffffff_256x240.png new file mode 100644 index 0000000..42f8f99 Binary files /dev/null and b/booking-faces/src/main/webapp/styles/le-frog/images/ui-icons_ffffff_256x240.png differ diff --git a/booking-faces/src/main/webapp/styles/le-frog/jquery-ui-1.8.2.custom.css b/booking-faces/src/main/webapp/styles/le-frog/jquery-ui-1.8.2.custom.css new file mode 100644 index 0000000..ef94882 --- /dev/null +++ b/booking-faces/src/main/webapp/styles/le-frog/jquery-ui-1.8.2.custom.css @@ -0,0 +1,489 @@ +/* +* jQuery UI CSS Framework +* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + +/* +* jQuery UI CSS Framework +* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande,%20Lucida%20Sans,%20Arial,%20sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=10px&bgColorHeader=3a8104&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=33&borderColorHeader=3f7506&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=285c00&bgTextureContent=05_inset_soft.png&bgImgOpacityContent=10&borderColorContent=72b42d&fcContent=ffffff&iconColorContent=72b42d&bgColorDefault=4ca20b&bgTextureDefault=03_highlight_soft.png&bgImgOpacityDefault=60&borderColorDefault=45930b&fcDefault=ffffff&iconColorDefault=ffffff&bgColorHover=4eb305&bgTextureHover=03_highlight_soft.png&bgImgOpacityHover=50&borderColorHover=8bd83b&fcHover=ffffff&iconColorHover=ffffff&bgColorActive=285c00&bgTextureActive=04_highlight_hard.png&bgImgOpacityActive=30&borderColorActive=72b42d&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=fbf5d0&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=f9dd34&fcHighlight=363636&iconColorHighlight=4eb305&bgColorError=ffdc2e&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=95&borderColorError=fad000&fcError=2b2b2b&iconColorError=cd0a0a&bgColorOverlay=444444&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=15&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=07_diagonals_small.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=0px&offsetTopShadow=4px&offsetLeftShadow=4px&cornerRadiusShadow=4px +*/ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #72b42d; background: #285c00 url(images/ui-bg_inset-soft_10_285c00_1x100.png) 50% bottom repeat-x; color: #ffffff; } +.ui-widget-content a { color: #ffffff; } +.ui-widget-header { border: 1px solid #3f7506; background: #3a8104 url(images/ui-bg_highlight-soft_33_3a8104_1x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } +.ui-widget-header a { color: #ffffff; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #45930b; background: #4ca20b url(images/ui-bg_highlight-soft_60_4ca20b_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #ffffff; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #8bd83b; background: #4eb305 url(images/ui-bg_highlight-soft_50_4eb305_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } +.ui-state-hover a, .ui-state-hover a:hover { color: #ffffff; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #72b42d; background: #285c00 url(images/ui-bg_highlight-hard_30_285c00_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #f9dd34; background: #fbf5d0 url(images/ui-bg_glass_55_fbf5d0_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #fad000; background: #ffdc2e url(images/ui-bg_diagonals-thick_95_ffdc2e_40x40.png) 50% 50% repeat; color: #2b2b2b; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #2b2b2b; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #2b2b2b; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_72b42d_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_72b42d_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_ffffff_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_4eb305_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 10px; -webkit-border-top-left-radius: 10px; border-top-left-radius: 10px; } +.ui-corner-tr { -moz-border-radius-topright: 10px; -webkit-border-top-right-radius: 10px; border-top-right-radius: 10px; } +.ui-corner-bl { -moz-border-radius-bottomleft: 10px; -webkit-border-bottom-left-radius: 10px; border-bottom-left-radius: 10px; } +.ui-corner-br { -moz-border-radius-bottomright: 10px; -webkit-border-bottom-right-radius: 10px; border-bottom-right-radius: 10px; } +.ui-corner-top { -moz-border-radius-topleft: 10px; -webkit-border-top-left-radius: 10px; border-top-left-radius: 10px; -moz-border-radius-topright: 10px; -webkit-border-top-right-radius: 10px; border-top-right-radius: 10px; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 10px; -webkit-border-bottom-left-radius: 10px; border-bottom-left-radius: 10px; -moz-border-radius-bottomright: 10px; -webkit-border-bottom-right-radius: 10px; border-bottom-right-radius: 10px; } +.ui-corner-right { -moz-border-radius-topright: 10px; -webkit-border-top-right-radius: 10px; border-top-right-radius: 10px; -moz-border-radius-bottomright: 10px; -webkit-border-bottom-right-radius: 10px; border-bottom-right-radius: 10px; } +.ui-corner-left { -moz-border-radius-topleft: 10px; -webkit-border-top-left-radius: 10px; border-top-left-radius: 10px; -moz-border-radius-bottomleft: 10px; -webkit-border-bottom-left-radius: 10px; border-bottom-left-radius: 10px; } +.ui-corner-all { -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; } + +/* Overlays */ +.ui-widget-overlay { background: #444444 url(images/ui-bg_diagonals-thick_15_444444_40x40.png) 50% 50% repeat; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: 4px 0 0 4px; padding: 0px; background: #aaaaaa url(images/ui-bg_diagonals-small_0_aaaaaa_40x40.png) 50% 50% repeat; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }/* Resizable +----------------------------------*/ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Selectable +----------------------------------*/ +.ui-selectable-helper { border:1px dotted black } +/* Accordion +----------------------------------*/ +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +/* IE7-/Win - Fix extra vertical space in lists */ +.ui-accordion a { zoom: 1; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; }/* Autocomplete +----------------------------------*/ +.ui-autocomplete { position: absolute; cursor: default; } +.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* Menu +----------------------------------*/ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} +/* Button +----------------------------------*/ + +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ + + + + + +/* Dialog +----------------------------------*/ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* Slider +----------------------------------*/ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs +----------------------------------*/ +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } +/* Datepicker +----------------------------------*/ +.ui-datepicker { width: 17em; padding: .2em .2em 0; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +}/* Progressbar +----------------------------------*/ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/booking-faces/src/test/java/org/springframework/webflow/samples/booking/BookingFlowExecutionTests.java b/booking-faces/src/test/java/org/springframework/webflow/samples/booking/BookingFlowExecutionTests.java new file mode 100644 index 0000000..4276dae --- /dev/null +++ b/booking-faces/src/test/java/org/springframework/webflow/samples/booking/BookingFlowExecutionTests.java @@ -0,0 +1,83 @@ +package org.springframework.webflow.samples.booking; + +import org.easymock.EasyMock; +import org.springframework.faces.model.converter.FacesConversionService; +import org.springframework.webflow.config.FlowDefinitionResource; +import org.springframework.webflow.config.FlowDefinitionResourceFactory; +import org.springframework.webflow.core.collection.LocalAttributeMap; +import org.springframework.webflow.core.collection.MutableAttributeMap; +import org.springframework.webflow.test.MockExternalContext; +import org.springframework.webflow.test.MockFlowBuilderContext; +import org.springframework.webflow.test.execution.AbstractXmlFlowExecutionTests; + +public class BookingFlowExecutionTests extends AbstractXmlFlowExecutionTests { + + private BookingService bookingService; + + protected void setUp() { + bookingService = EasyMock.createMock(BookingService.class); + } + + @Override + protected FlowDefinitionResource getResource(FlowDefinitionResourceFactory resourceFactory) { + return resourceFactory.createFileResource("src/main/webapp/WEB-INF/flows/booking/booking-flow.xml"); + } + + @Override + protected void configureFlowBuilderContext(MockFlowBuilderContext builderContext) { + builderContext.registerBean("bookingService", bookingService); + builderContext.getFlowBuilderServices().setConversionService(new FacesConversionService()); + } + + public void testStartBookingFlow() { + Booking booking = createTestBooking(); + + EasyMock.expect(bookingService.createBooking(1L, "keith")).andReturn(booking); + + EasyMock.replay(bookingService); + + MutableAttributeMap input = new LocalAttributeMap(); + input.put("hotelId", "1"); + MockExternalContext context = new MockExternalContext(); + context.setCurrentUser("keith"); + startFlow(input, context); + + assertCurrentStateEquals("enterBookingDetails"); + assertResponseWrittenEquals("enterBookingDetails", context); + assertTrue(getRequiredFlowAttribute("booking") instanceof Booking); + + EasyMock.verify(bookingService); + } + + public void testEnterBookingDetails_Proceed() { + setCurrentState("enterBookingDetails"); + getFlowScope().put("booking", createTestBooking()); + + MockExternalContext context = new MockExternalContext(); + context.setEventId("proceed"); + resumeFlow(context); + + assertCurrentStateEquals("reviewBooking"); + assertResponseWrittenEquals("reviewBooking", context); + } + + public void testReviewBooking_Confirm() { + setCurrentState("reviewBooking"); + getFlowScope().put("booking", createTestBooking()); + MockExternalContext context = new MockExternalContext(); + context.setEventId("confirm"); + resumeFlow(context); + assertFlowExecutionEnded(); + assertFlowExecutionOutcomeEquals("bookingConfirmed"); + } + + private Booking createTestBooking() { + Hotel hotel = new Hotel(); + hotel.setId(1L); + hotel.setName("Jameson Inn"); + User user = new User("keith", "pass", "Keith Donald"); + Booking booking = new Booking(hotel, user); + return booking; + } + +} diff --git a/booking-faces/src/test/java/org/springframework/webflow/samples/booking/MainFlowExecutionTests.java b/booking-faces/src/test/java/org/springframework/webflow/samples/booking/MainFlowExecutionTests.java new file mode 100644 index 0000000..9feca43 --- /dev/null +++ b/booking-faces/src/test/java/org/springframework/webflow/samples/booking/MainFlowExecutionTests.java @@ -0,0 +1,119 @@ +package org.springframework.webflow.samples.booking; + +import java.util.ArrayList; +import java.util.List; + +import javax.faces.model.DataModel; + +import org.easymock.EasyMock; +import org.springframework.binding.mapping.Mapper; +import org.springframework.binding.mapping.MappingResults; +import org.springframework.faces.model.converter.FacesConversionService; +import org.springframework.webflow.config.FlowDefinitionResource; +import org.springframework.webflow.config.FlowDefinitionResourceFactory; +import org.springframework.webflow.core.collection.AttributeMap; +import org.springframework.webflow.engine.EndState; +import org.springframework.webflow.engine.Flow; +import org.springframework.webflow.test.MockExternalContext; +import org.springframework.webflow.test.MockFlowBuilderContext; +import org.springframework.webflow.test.execution.AbstractXmlFlowExecutionTests; + +public class MainFlowExecutionTests extends AbstractXmlFlowExecutionTests { + + private BookingService bookingService; + + protected void setUp() { + bookingService = EasyMock.createMock(BookingService.class); + } + + @Override + protected FlowDefinitionResource getResource(FlowDefinitionResourceFactory resourceFactory) { + return resourceFactory.createFileResource("src/main/webapp/WEB-INF/flows/main/main-flow.xml"); + } + + @Override + protected void configureFlowBuilderContext(MockFlowBuilderContext builderContext) { + builderContext.registerBean("bookingService", bookingService); + builderContext.getFlowBuilderServices().setConversionService(new FacesConversionService()); + } + + public void testStartMainFlow() { + List bookings = new ArrayList(); + bookings.add(new Booking(new Hotel(), new User("keith", "password", "Keith Donald"))); + EasyMock.expect(bookingService.findBookings("keith")).andReturn(bookings); + EasyMock.replay(bookingService); + + MockExternalContext context = new MockExternalContext(); + context.setCurrentUser("keith"); + startFlow(context); + assertCurrentStateEquals("enterSearchCriteria"); + assertResponseWrittenEquals("enterSearchCriteria", context); + assertTrue(getRequiredFlowAttribute("searchCriteria") instanceof SearchCriteria); + assertTrue(getRequiredViewAttribute("bookings") instanceof DataModel); + + EasyMock.verify(bookingService); + } + + public void testSearchHotels() { + setCurrentState("enterSearchCriteria"); + + SearchCriteria criteria = new SearchCriteria(); + criteria.setSearchString("Jameson"); + getFlowScope().put("searchCriteria", criteria); + + MockExternalContext context = new MockExternalContext(); + context.setEventId("search"); + resumeFlow(context); + + assertCurrentStateEquals("reviewHotels"); + assertResponseWrittenEquals("reviewHotels", context); + assertTrue(getRequiredViewAttribute("hotels") instanceof HotelLazyDataModel); + } + + public void testSelectHotel() { + setCurrentState("reviewHotels"); + + List hotels = new ArrayList(); + Hotel hotel = new Hotel(); + hotel.setId(1L); + hotel.setName("Jameson Inn"); + hotels.add(hotel); + HotelLazyDataModel dataModel = new HotelLazyDataModel(null, null); + dataModel.setSelected(hotel); + getViewScope().put("hotels", dataModel); + + MockExternalContext context = new MockExternalContext(); + context.setEventId("select"); + resumeFlow(context); + + assertCurrentStateEquals("reviewHotel"); + assertNull(getFlowAttribute("hotels")); + assertSame(hotel, getFlowAttribute("hotel")); + } + + public void testBookHotel() { + setCurrentState("reviewHotel"); + + Hotel hotel = new Hotel(); + hotel.setId(1L); + hotel.setName("Jameson Inn"); + getFlowScope().put("hotel", hotel); + + Flow mockBookingFlow = new Flow("booking"); + mockBookingFlow.setInputMapper(new Mapper() { + public MappingResults map(Object source, Object target) { + assertEquals(new Long(1), ((AttributeMap) source).get("hotelId")); + return null; + } + }); + new EndState(mockBookingFlow, "bookingConfirmed"); + getFlowDefinitionRegistry().registerFlowDefinition(mockBookingFlow); + + MockExternalContext context = new MockExternalContext(); + context.setEventId("book"); + resumeFlow(context); + + assertFlowExecutionEnded(); + assertFlowExecutionOutcomeEquals("finish"); + } +} diff --git a/booking-faces/src/test/resources/.gitignore b/booking-faces/src/test/resources/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/booking-mvc/build.xml b/booking-mvc/build.xml new file mode 100755 index 0000000..914de0d --- /dev/null +++ b/booking-mvc/build.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/booking-mvc/pom.xml b/booking-mvc/pom.xml new file mode 100644 index 0000000..5732145 --- /dev/null +++ b/booking-mvc/pom.xml @@ -0,0 +1,262 @@ + + + 4.0.0 + org.springframework.webflow.samples + booking-mvc + war + Hotel Booking : Spring MVC + Web Flow + JSP + 1.0.0.BUILD-SNAPSHOT + + + 3.1.1.RELEASE + 3.0.2.RELEASE + 2.3.1.RELEASE + 1.5.10 + + + + + spring-repository + Spring project snapshots, milestones, and releases + http://repo.springsource.org/snapshot + + + + + + + org.springframework + spring-webmvc + ${springframework-version} + + + + commons-logging + commons-logging + + + + + org.springframework + spring-jdbc + ${springframework-version} + + + org.springframework + spring-orm + ${springframework-version} + + + org.springframework.webflow + spring-webflow + ${webflow-version} + + + org.springframework.webflow + spring-js + ${webflow-version} + + + org.springframework.security + spring-security-web + ${springsecurity-version} + + + + commons-logging + commons-logging + + + + + org.springframework.security + spring-security-taglibs + ${springsecurity-version} + + + org.springframework.security + spring-security-config + ${springsecurity-version} + + + + commons-logging + commons-logging + + + + + + org.slf4j + slf4j-api + ${slf4j-version} + + + org.slf4j + jcl-over-slf4j + ${slf4j-version} + + + org.slf4j + slf4j-log4j12 + ${slf4j-version} + runtime + + + log4j + log4j + 1.2.15 + + + javax.mail + mail + + + javax.jms + jms + + + com.sun.jdmk + jmxtools + + + com.sun.jmx + jmxri + + + runtime + + + + org.hsqldb + hsqldb + 1.8.0.10 + runtime + + + org.hibernate + hibernate-entitymanager + 3.5.0-Final + + + + javax.servlet + servlet-api + 2.5 + provided + + + javax.servlet.jsp + jsp-api + 2.1 + provided + + + javax.servlet + jstl + 1.2 + + + + org.apache.tiles + tiles-jsp + 2.1.3 + + + + commons-logging + commons-logging-api + + + + + + org.hibernate + hibernate-validator + 4.1.0.Beta1 + + + + javax.xml.bind + jaxb-api + 2.1 + + + + joda-time + joda-time + 1.6 + + + joda-time + joda-time-jsptags + 1.0.2 + runtime + + + + org.easymock + easymock + 2.5.2 + test + + + junit + junit + 3.8.2 + test + + + org.springframework + spring-test + ${springframework-version} + test + + + + + booking-mvc + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.1.12 + + junit:junit + + **/*Tests.java + + + + + org.apache.tomcat.maven + tomcat7-maven-plugin + 2.0-SNAPSHOT + + + org.apache.maven.plugins + maven-eclipse-plugin + 2.8 + + true + false + 2.0 + + + + + diff --git a/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/Amenity.java b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/Amenity.java new file mode 100644 index 0000000..9b1c225 --- /dev/null +++ b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/Amenity.java @@ -0,0 +1,5 @@ +package org.springframework.webflow.samples.booking; + +public enum Amenity { + OCEAN_VIEW, LATE_CHECKOUT, MINIBAR; +} diff --git a/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/Booking.java b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/Booking.java new file mode 100755 index 0000000..b25931c --- /dev/null +++ b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/Booking.java @@ -0,0 +1,215 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Set; + +import javax.persistence.Basic; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; +import javax.validation.constraints.Future; +import javax.validation.constraints.NotNull; + +import org.hibernate.validator.constraints.NotEmpty; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * A Hotel Booking made by a User. + */ +@Entity +@BookingDateRange +public class Booking implements Serializable { + + private Long id; + + private User user; + + private Hotel hotel; + + @DateTimeFormat(pattern = "MM-dd-yyyy") + private Date checkinDate; + + @DateTimeFormat(pattern = "MM-dd-yyyy") + private Date checkoutDate; + + private String creditCard; + + private String creditCardName; + + private int creditCardExpiryMonth; + + private int creditCardExpiryYear; + + private boolean smoking; + + private int beds; + + private Set amenities; + + public Booking() { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_MONTH, 1); + setCheckinDate(calendar.getTime()); + calendar.add(Calendar.DAY_OF_MONTH, 1); + setCheckoutDate(calendar.getTime()); + } + + public Booking(Hotel hotel, User user) { + this(); + this.hotel = hotel; + this.user = user; + } + + @Transient + public BigDecimal getTotal() { + return hotel.getPrice().multiply(new BigDecimal(getNights())); + } + + @Transient + public int getNights() { + if (checkinDate == null || checkoutDate == null) { + return 0; + } else { + return (int) ((checkoutDate.getTime() - checkinDate.getTime()) / 1000 / 60 / 60 / 24); + } + } + + @Id + @GeneratedValue(strategy = GenerationType.TABLE) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @Basic + @Temporal(TemporalType.DATE) + @NotNull + @Future + public Date getCheckinDate() { + return checkinDate; + } + + public void setCheckinDate(Date datetime) { + this.checkinDate = datetime; + } + + @ManyToOne + public Hotel getHotel() { + return hotel; + } + + public void setHotel(Hotel hotel) { + this.hotel = hotel; + } + + @ManyToOne + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + @Basic + @Temporal(TemporalType.DATE) + @NotNull + @Future + public Date getCheckoutDate() { + return checkoutDate; + } + + public void setCheckoutDate(Date checkoutDate) { + this.checkoutDate = checkoutDate; + } + + @NotEmpty + public String getCreditCard() { + return creditCard; + } + + public void setCreditCard(String creditCard) { + this.creditCard = creditCard; + } + + @Transient + public String getDescription() { + DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM); + return hotel == null ? null : hotel.getName() + ", " + df.format(getCheckinDate()) + " to " + + df.format(getCheckoutDate()); + } + + public boolean isSmoking() { + return smoking; + } + + public void setSmoking(boolean smoking) { + this.smoking = smoking; + } + + public int getBeds() { + return beds; + } + + public void setBeds(int beds) { + this.beds = beds; + } + + @NotEmpty + public String getCreditCardName() { + return creditCardName; + } + + public void setCreditCardName(String creditCardName) { + this.creditCardName = creditCardName; + } + + public int getCreditCardExpiryMonth() { + return creditCardExpiryMonth; + } + + public void setCreditCardExpiryMonth(int creditCardExpiryMonth) { + this.creditCardExpiryMonth = creditCardExpiryMonth; + } + + public int getCreditCardExpiryYear() { + return creditCardExpiryYear; + } + + public void setCreditCardExpiryYear(int creditCardExpiryYear) { + this.creditCardExpiryYear = creditCardExpiryYear; + } + + @Transient + public Set getAmenities() { + return amenities; + } + + public void setAmenities(Set amenities) { + this.amenities = amenities; + } + + private Date today() { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_MONTH, -1); + return calendar.getTime(); + } + + @Override + public String toString() { + return "Booking(" + user + "," + hotel + ")"; + } + +} diff --git a/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingDateRange.java b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingDateRange.java new file mode 100644 index 0000000..a5cad18 --- /dev/null +++ b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingDateRange.java @@ -0,0 +1,22 @@ +package org.springframework.webflow.samples.booking; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import javax.validation.Constraint; +import javax.validation.Payload; + +@Constraint(validatedBy = BookingDateRangeValidator.class) +@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.PARAMETER }) +@Retention(RetentionPolicy.RUNTIME) +public @interface BookingDateRange { + + String message() default "Invalid check-in and check-out date range"; + + Class[] groups() default {}; + + Class[] payload() default {}; + +} diff --git a/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingDateRangeValidator.java b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingDateRangeValidator.java new file mode 100644 index 0000000..716a40b --- /dev/null +++ b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingDateRangeValidator.java @@ -0,0 +1,19 @@ +package org.springframework.webflow.samples.booking; + +import javax.validation.ConstraintValidator; +import javax.validation.ConstraintValidatorContext; + +public class BookingDateRangeValidator implements ConstraintValidator { + + public void initialize(BookingDateRange bookingDateRange) { + } + + public boolean isValid(Booking booking, ConstraintValidatorContext context) { + if ((booking.getCheckinDate() != null) && (booking.getCheckoutDate() != null) + && booking.getCheckoutDate().before(booking.getCheckinDate())) { + return false; + } + return true; + } + +} diff --git a/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingFlowHandler.java b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingFlowHandler.java new file mode 100644 index 0000000..726f2bd --- /dev/null +++ b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingFlowHandler.java @@ -0,0 +1,30 @@ +package org.springframework.webflow.samples.booking; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.webflow.core.FlowException; +import org.springframework.webflow.execution.FlowExecutionOutcome; +import org.springframework.webflow.execution.repository.NoSuchFlowExecutionException; +import org.springframework.webflow.mvc.servlet.AbstractFlowHandler; + +public class BookingFlowHandler extends AbstractFlowHandler { + + private static final String DEFAULT_URL = "/hotels/search"; + + @Override + public String handleExecutionOutcome(FlowExecutionOutcome outcome, HttpServletRequest request, + HttpServletResponse response) { + return DEFAULT_URL; + } + + @Override + public String handleException(FlowException e, HttpServletRequest request, HttpServletResponse response) { + if (e instanceof NoSuchFlowExecutionException) { + return DEFAULT_URL; + } else { + throw e; + } + } + +} diff --git a/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingService.java b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingService.java new file mode 100755 index 0000000..f6b6f9d --- /dev/null +++ b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingService.java @@ -0,0 +1,52 @@ +package org.springframework.webflow.samples.booking; + +import java.util.List; + +/** + * A service interface for retrieving hotels and bookings from a backing repository. Also supports the ability to cancel + * a booking. + */ +public interface BookingService { + + /** + * Find bookings made by the given user + * @param username the user's name + * @return their bookings + */ + public List findBookings(String username); + + /** + * Find hotels available for booking by some criteria. + * @param criteria the search criteria + * @return a list of hotels meeting the criteria + */ + public List findHotels(SearchCriteria criteria); + + /** + * Find hotels by their identifier. + * @param id the hotel id + * @return the hotel + */ + public Hotel findHotelById(Long id); + + /** + * Create a new, transient hotel booking instance for the given user. + * @param hotelId the hotelId + * @param userName the user name + * @return the new transient booking instance + */ + public Booking createBooking(Long hotelId, String userName); + + /** + * Persist the booking to the database + * @param booking the booking + */ + public void persistBooking(Booking booking); + + /** + * Cancel an existing booking. + * @param id the booking id + */ + public void cancelBooking(Long id); + +} diff --git a/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/Hotel.java b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/Hotel.java new file mode 100755 index 0000000..99719e5 --- /dev/null +++ b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/Hotel.java @@ -0,0 +1,107 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; + +/** + * A hotel where users may book stays. + */ +@Entity +public class Hotel implements Serializable { + private Long id; + + private String name; + + private String address; + + private String city; + + private String state; + + private String zip; + + private String country; + + private BigDecimal price; + + @Id + @GeneratedValue + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getZip() { + return zip; + } + + public void setZip(String zip) { + this.zip = zip; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + @Column(precision = 6, scale = 2) + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Booking createBooking(User user) { + return new Booking(this, user); + } + + @Override + public String toString() { + return "Hotel(" + name + "," + address + "," + city + "," + zip + ")"; + } +} diff --git a/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/HotelsController.java b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/HotelsController.java new file mode 100644 index 0000000..fb49728 --- /dev/null +++ b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/HotelsController.java @@ -0,0 +1,50 @@ +package org.springframework.webflow.samples.booking; + +import java.security.Principal; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +@Controller +public class HotelsController { + + private BookingService bookingService; + + @Autowired + public HotelsController(BookingService bookingService) { + this.bookingService = bookingService; + } + + @RequestMapping(value = "/hotels/search", method = RequestMethod.GET) + public void search(SearchCriteria searchCriteria, Principal currentUser, Model model) { + if (currentUser != null) { + List booking = bookingService.findBookings(currentUser.getName()); + model.addAttribute(booking); + } + } + + @RequestMapping(value = "/hotels", method = RequestMethod.GET) + public String list(SearchCriteria criteria, Model model) { + List hotels = bookingService.findHotels(criteria); + model.addAttribute(hotels); + return "hotels/list"; + } + + @RequestMapping(value = "/hotels/{id}", method = RequestMethod.GET) + public String show(@PathVariable Long id, Model model) { + model.addAttribute(bookingService.findHotelById(id)); + return "hotels/show"; + } + + @RequestMapping(value = "/bookings/{id}", method = RequestMethod.DELETE) + public String deleteBooking(@PathVariable Long id) { + bookingService.cancelBooking(id); + return "redirect:../hotels/search"; + } + +} diff --git a/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java new file mode 100755 index 0000000..e88436e --- /dev/null +++ b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java @@ -0,0 +1,94 @@ +package org.springframework.webflow.samples.booking; + +import java.util.List; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; + +import org.springframework.stereotype.Repository; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; + +/** + * A JPA-based implementation of the Booking Service. Delegates to a JPA entity manager to issue data access calls + * against the backing repository. The EntityManager reference is provided by the managing container (Spring) + * automatically. + */ +@Service("bookingService") +@Repository +public class JpaBookingService implements BookingService { + + private EntityManager em; + + @PersistenceContext + public void setEntityManager(EntityManager em) { + this.em = em; + } + + @Transactional(readOnly = true) + @SuppressWarnings("unchecked") + public List findBookings(String username) { + if (username != null) { + return em.createQuery("select b from Booking b where b.user.username = :username order by b.checkinDate") + .setParameter("username", username).getResultList(); + } else { + return null; + } + } + + @Transactional(readOnly = true) + @SuppressWarnings("unchecked") + public List findHotels(SearchCriteria criteria) { + String pattern = getSearchPattern(criteria); + int startIndex = criteria.getPage() * criteria.getPageSize(); + return em + .createQuery( + "select h from Hotel h where lower(h.name) like :pattern or lower(h.city) like :pattern " + + " or lower(h.zip) like :pattern or lower(h.address) like :pattern") + .setParameter("pattern", pattern).setFirstResult(startIndex).setMaxResults(criteria.getPageSize()) + .getResultList(); + } + + @Transactional(readOnly = true) + public Hotel findHotelById(Long id) { + return em.find(Hotel.class, id); + } + + @Transactional(readOnly = true) + public Booking createBooking(Long hotelId, String username) { + Hotel hotel = em.find(Hotel.class, hotelId); + User user = findUser(username); + Booking booking = new Booking(hotel, user); + return booking; + } + + @Transactional + public void persistBooking(Booking booking) { + em.persist(booking); + } + + @Transactional + public void cancelBooking(Long id) { + Booking booking = em.find(Booking.class, id); + if (booking != null) { + em.remove(booking); + } + } + + // helpers + + private String getSearchPattern(SearchCriteria criteria) { + if (StringUtils.hasText(criteria.getSearchString())) { + return "%" + criteria.getSearchString().toLowerCase().replace('*', '%') + "%"; + } else { + return "%"; + } + } + + private User findUser(String username) { + return (User) em.createQuery("select u from User u where u.username = :username") + .setParameter("username", username).getSingleResult(); + } + +} \ No newline at end of file diff --git a/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/SearchCriteria.java b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/SearchCriteria.java new file mode 100755 index 0000000..0db814b --- /dev/null +++ b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/SearchCriteria.java @@ -0,0 +1,56 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; + + +/** + * A backing bean for the main hotel search form. Encapsulates the criteria needed to perform a hotel search. + * + * It is expected a future milestone of Spring Web Flow 2.0 will allow flow-scoped beans like this one to hold + * references to transient services that are restored automatically when the flow is resumed on subsequent requests. + * This would allow this SearchCriteria object to delegate to the {@link BookingService} directly, for example, + * eliminating the need for the actions in {@link MainActions}. + */ +public class SearchCriteria implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * The user-provided search criteria for finding Hotels. + */ + private String searchString; + + /** + * The maximum page size of the Hotel result list + */ + private int pageSize; + + /** + * The current page of the Hotel result list. + */ + private int page; + + public String getSearchString() { + return searchString; + } + + public void setSearchString(String searchString) { + this.searchString = searchString; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getPage() { + return page; + } + + public void setPage(int page) { + this.page = page; + } +} \ No newline at end of file diff --git a/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/User.java b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/User.java new file mode 100755 index 0000000..55213ad --- /dev/null +++ b/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/User.java @@ -0,0 +1,59 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * A user who can book hotels. + */ +@Entity +@Table(name = "Customer") +public class User implements Serializable { + private String username; + + private String password; + + private String name; + + public User() { + } + + public User(String username, String password, String name) { + this.username = username; + this.password = password; + this.name = name; + } + + @Id + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return "User(" + username + ")"; + } +} diff --git a/booking-mvc/src/main/resources/META-INF/persistence.xml b/booking-mvc/src/main/resources/META-INF/persistence.xml new file mode 100755 index 0000000..f4e3d6a --- /dev/null +++ b/booking-mvc/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,18 @@ + + + + org.hibernate.ejb.HibernatePersistence + org.springframework.webflow.samples.booking.User + org.springframework.webflow.samples.booking.Booking + org.springframework.webflow.samples.booking.Hotel + + + + + + + + \ No newline at end of file diff --git a/booking-mvc/src/main/resources/import.sql b/booking-mvc/src/main/resources/import.sql new file mode 100755 index 0000000..e3211aa --- /dev/null +++ b/booking-mvc/src/main/resources/import.sql @@ -0,0 +1,27 @@ +insert into Customer (username, name) values ('keith', 'Keith') +insert into Customer (username, name) values ('erwin', 'Erwin') +insert into Customer (username, name) values ('jeremy', 'Jeremy') +insert into Customer (username, name) values ('scott', 'Scott') +insert into Hotel (id, price, name, address, city, state, zip, country) values (1, 199, 'Westin Diplomat', '3555 S. Ocean Drive', 'Hollywood', 'FL', '33019', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 60, 'Jameson Inn', '890 Palm Bay Rd NE', 'Palm Bay', 'FL', '32905', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 199, 'Chilworth Manor', 'The Cottage, Southampton Business Park', 'Southampton', 'Hants', 'SO16 7JF', 'UK') +insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 450, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (7, 450, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (8, 250, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (9, 300, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (10, 300, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (11, 80, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (12, 90, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (13, 160, 'Marriot Downtown', '55 Fourth Street', 'San Francisco', 'CA', '94103', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (14, 200, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona', 'Catalunya', '08019', 'Spain') +insert into Hotel (id, price, name, address, city, state, zip, country) values (15, 210, 'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '', '63405', 'Israel') +insert into Hotel (id, price, name, address, city, state, zip, country) values (16, 240, 'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo', '', '105', 'Japan') +insert into Hotel (id, price, name, address, city, state, zip, country) values (17, 130, 'Hotel Beaulac', ' Esplanade Léopold-Robert 2', 'Neuchatel', '', '2000', 'Switzerland') +insert into Hotel (id, price, name, address, city, state, zip, country) values (18, 140, 'Conrad Treasury Place', 'William & George Streets', 'Brisbane', 'QLD', '4001', 'Australia') +insert into Hotel (id, price, name, address, city, state, zip, country) values (19, 230, 'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal', 'Quebec', 'H3G1H6', 'Canada') +insert into Hotel (id, price, name, address, city, state, zip, country) values (20, 460, 'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA', '30326', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (21, 220, 'Swissotel', '68 Market Street', 'Sydney', 'NSW', '2000', 'Australia') +insert into Hotel (id, price, name, address, city, state, zip, country) values (22, 250, 'Meliá White House', 'Albany Street', 'Regents Park London', '', 'NW13UP', 'Great Britain') +insert into Hotel (id, price, name, address, city, state, zip, country) values (23, 210, 'Hotel Allegro', '171 West Randolph Street', 'Chicago', 'IL', '60601', 'USA') \ No newline at end of file diff --git a/booking-mvc/src/main/resources/log4j.xml b/booking-mvc/src/main/resources/log4j.xml new file mode 100644 index 0000000..b4e9ad1 --- /dev/null +++ b/booking-mvc/src/main/resources/log4j.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/META-INF/MANIFEST.MF b/booking-mvc/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 0000000..58630c0 --- /dev/null +++ b/booking-mvc/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/booking-mvc/src/main/webapp/WEB-INF/classes/log4j.properties b/booking-mvc/src/main/webapp/WEB-INF/classes/log4j.properties new file mode 100755 index 0000000..992d816 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/classes/log4j.properties @@ -0,0 +1,11 @@ +log4j.rootCategory=INFO, stdout + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n + +# Enable web flow logging +log4j.category.org.springframework.webflow=DEBUG +log4j.category.org.springframework.faces=DEBUG +log4j.category.org.springframework.binding=DEBUG +log4j.category.org.springframework.transaction=DEBUG \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/WEB-INF/config/data-access-config.xml b/booking-mvc/src/main/webapp/WEB-INF/config/data-access-config.xml new file mode 100644 index 0000000..94e2bae --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/config/data-access-config.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + hibernate.session_factory_name=mySessionFactory + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/WEB-INF/config/security-config.xml b/booking-mvc/src/main/webapp/WEB-INF/config/security-config.xml new file mode 100644 index 0000000..9a5df65 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/config/security-config.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/WEB-INF/config/web-application-config.xml b/booking-mvc/src/main/webapp/WEB-INF/config/web-application-config.xml new file mode 100644 index 0000000..5791b17 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/config/web-application-config.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/WEB-INF/config/webflow-config.xml b/booking-mvc/src/main/webapp/WEB-INF/config/webflow-config.xml new file mode 100644 index 0000000..7dcaeed --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/config/webflow-config.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/WEB-INF/config/webmvc-config.xml b/booking-mvc/src/main/webapp/WEB-INF/config/webmvc-config.xml new file mode 100644 index 0000000..56e56fd --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/config/webmvc-config.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /WEB-INF/**/views.xml + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/booking-flow.xml b/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/booking-flow.xml new file mode 100644 index 0000000..ff62d70 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/booking-flow.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/enterBookingDetails.jsp b/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/enterBookingDetails.jsp new file mode 100644 index 0000000..1f95919 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/enterBookingDetails.jsp @@ -0,0 +1,196 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> + +
+
+

${booking.hotel.name}

+ +
+ ${booking.hotel.address} +
+ ${booking.hotel.city}, ${booking.hotel.state}, ${booking.hotel.zip} +
+ ${booking.hotel.country} +
+

+ Nightly rate: ${status.value} +

+
+
+ +
+ + +
+
+
+
+
+ +
+ Book Hotel +
+
+ +
+
+

+ + +
+
+
+
+ +
+
+

+ +
+
+
+
+ +
+
+

+ + + + + +

+
+
+
+
+ Smoking Preference: +
+
+

+ + +

+ +
+
+
+
+ Amenities: +
+
+

+ +
+ +
+ +

+ +
+
+
+
+ +
+
+

+ +
+
+
+
+ +
+
+

+ +
+
+
+
+ +
+
+

+ + + + + + + + + + + + + + + + + + + + + +

+
+
+
+

+ + +

+ +
+
+
+
+
diff --git a/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/messages.jsp b/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/messages.jsp new file mode 100644 index 0000000..42054c9 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/messages.jsp @@ -0,0 +1,5 @@ +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> + +
+ +
\ No newline at end of file diff --git a/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/messages.properties b/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/messages.properties new file mode 100644 index 0000000..3d15709 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/messages.properties @@ -0,0 +1,16 @@ +booking.checkinDate.NotNull=The check in date is required +booking.checkinDate.Future=The check in date must be in the future +booking.checkinDate.beforeToday=The check in date must be a future date +booking.checkinDate.typeMismatch=The check in date must be in the format mm-dd-yyyy + +booking.checkoutDate.Future=The check out date must be in the future +booking.checkoutDate.NotNull=The check out date is required +booking.checkoutDate.typeMismatch=The check out date must be in the format mm-dd-yyyy +booking.BookingDateRange=The check out date must be later than the check in date + +booking.creditCard.NotEmpty=The credit card must be a valid 16 digit number +booking.creditCardName.NotEmpty=The name on the credit card is required + +NotEmpty=The {0} field is required +NotNull=The {0} field is required +Future=The {0} date must be in the future \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/reviewBooking.jsp b/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/reviewBooking.jsp new file mode 100644 index 0000000..9efe4fa --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/reviewBooking.jsp @@ -0,0 +1,65 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> + +
+
+

${booking.hotel.name}

+ +
+ ${booking.hotel.address} +
+ ${booking.hotel.city}, ${booking.hotel.state}, ${booking.hotel.zip} +
+ ${booking.hotel.country} +
+
+
+ +
+ Confirm Booking Details +
+
Check In:
+
+

${status.value}

+
+
+
+
Checkout:
+
+

${status.value}

+
+
+
+
Number of Nights:
+
+

${status.value}

+
+
+
+
Total Payment:
+
+

${status.value}

+
+
+
+
Credit Card #:
+
+

${booking.creditCard}

+
+
+
+

+ + + +

+ +
+
+
+
+ +
diff --git a/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/views.xml b/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/views.xml new file mode 100644 index 0000000..3e1ee8b --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/views.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/booking-mvc/src/main/webapp/WEB-INF/hotels/bookingsTable.jsp b/booking-mvc/src/main/webapp/WEB-INF/hotels/bookingsTable.jsp new file mode 100644 index 0000000..6d66283 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/hotels/bookingsTable.jsp @@ -0,0 +1,53 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %> +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> + +
+ +

Current Hotel Bookings

+ + + + No bookings found + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAddressCity, StateCheck in DateCheck out DateConfirmation NumberAction
${booking.hotel.name}${booking.hotel.address}${booking.hotel.city}, ${booking.hotel.state}${booking.checkinDate}${booking.checkoutDate}${booking.id} + + + + + + +
+
+
+ +
\ No newline at end of file diff --git a/booking-mvc/src/main/webapp/WEB-INF/hotels/list.jsp b/booking-mvc/src/main/webapp/WEB-INF/hotels/list.jsp new file mode 100644 index 0000000..fdd0880 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/hotels/list.jsp @@ -0,0 +1,74 @@ +<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> + +

Hotel Results

+

+ Change Search + +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAddressCity, StateZipAction
${hotel.name}${hotel.address}${hotel.city}, ${hotel.state}, ${hotel.country}${hotel.zip}View Hotel
No hotels found
+
+
+ + Previous Results + + +
+
+ + More Results + + +
+
+
+
+ diff --git a/booking-mvc/src/main/webapp/WEB-INF/hotels/search.jsp b/booking-mvc/src/main/webapp/WEB-INF/hotels/search.jsp new file mode 100644 index 0000000..50d79b9 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/hotels/search.jsp @@ -0,0 +1,5 @@ +<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %> + + + + diff --git a/booking-mvc/src/main/webapp/WEB-INF/hotels/searchForm.jsp b/booking-mvc/src/main/webapp/WEB-INF/hotels/searchForm.jsp new file mode 100644 index 0000000..0940b44 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/hotels/searchForm.jsp @@ -0,0 +1,36 @@ +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + +

Search Hotels

+ + + + + + +
+
+ + + +
+
+
+ + + + + + +
+
+
+ +
+
+
\ No newline at end of file diff --git a/booking-mvc/src/main/webapp/WEB-INF/hotels/show.jsp b/booking-mvc/src/main/webapp/WEB-INF/hotels/show.jsp new file mode 100644 index 0000000..82e2e70 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/hotels/show.jsp @@ -0,0 +1,22 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> + +

${hotel.name}

+
+ ${hotel.address} +
+ ${hotel.city}, ${hotel.state}, ${hotel.zip} +
+ ${hotel.country} +
+
+

+ Nightly Rate: + ${status.value} +

+ +
+ +
+
diff --git a/booking-mvc/src/main/webapp/WEB-INF/hotels/views.xml b/booking-mvc/src/main/webapp/WEB-INF/hotels/views.xml new file mode 100644 index 0000000..42e7bc0 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/hotels/views.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff --git a/booking-mvc/src/main/webapp/WEB-INF/intro.jsp b/booking-mvc/src/main/webapp/WEB-INF/intro.jsp new file mode 100755 index 0000000..4525d2f --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/intro.jsp @@ -0,0 +1,29 @@ +
+

Welcome to Spring Travel

+

+ This sample demonstrates how to use Spring MVC and Spring Web Flow together with JavaServerPages (JSP) and Tiles. +

+
+

+ The key features illustrated in this sample include: +

+
    +
  • A declarative navigation model enabling full browser button support and dynamic navigation rules
  • +
  • A fine-grained state management model, including support for ConversationScope and ViewScope
  • +
  • Modularization of web application functionality by domain use case, illustrating project structure best-practices
  • +
  • Spring Expression Language (SpEL) integration
  • +
  • Spring 3 formatting annotations @DateTimeFormat, @NumberFormat
  • +
  • Spring MVC custom namespace
  • +
  • Spring Security integration
  • +
  • Annotated POJO @Controllers for implementing RESTful user interactions.
  • +
  • Declarative page authoring with JSP, JSTL, and Spring MVC's form tag library
  • +
  • Page layout and composition with Apache Tiles
  • +
  • A JavaScript API for decorating HTML elements with behaviors such as Ajax, validation, and effects.
  • +
  • A grid layout with Blueprint CSS
  • +
  • Exception handling support across all layers of the application
  • +
  • SpringSource Tool Suite integration, with support for graphical flow modeling and visualization
  • +
+

+ Start your Spring Travel experience +

+
diff --git a/booking-mvc/src/main/webapp/WEB-INF/layouts/standard.jsp b/booking-mvc/src/main/webapp/WEB-INF/layouts/standard.jsp new file mode 100644 index 0000000..5e7bfbb --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/layouts/standard.jsp @@ -0,0 +1,69 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %> +<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %> + + + + + Spring Travel: Spring MVC and Web Flow Reference Application + " /> + " type="text/css" media="screen, projection" /> + " type="text/css" media="print" /> + + " type="text/css" media="screen" /> + + + + + +
+ + +
+ +
+ + \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/WEB-INF/layouts/views.xml b/booking-mvc/src/main/webapp/WEB-INF/layouts/views.xml new file mode 100644 index 0000000..0f94b92 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/layouts/views.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/booking-mvc/src/main/webapp/WEB-INF/login.jsp b/booking-mvc/src/main/webapp/WEB-INF/login.jsp new file mode 100755 index 0000000..04d9c59 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/login.jsp @@ -0,0 +1,66 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> + +<%@ page import="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter" %> +<%@ page import="org.springframework.security.core.AuthenticationException" %> + +
+

Valid username/passwords are:

+
    +
  • keith/melbourne
  • +
  • erwin/leuven
  • +
  • jeremy/atlanta
  • +
  • scott/rochester
  • +
+
+ +
+ +
+ Your login attempt was not successful, try again.

+ Reason: <%= ((AuthenticationException) session.getAttribute(UsernamePasswordAuthenticationFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %> +
+
+
" method="post"> +
+ Login Information +

+ +
+ value="<%= session.getAttribute(UsernamePasswordAuthenticationFilter.SPRING_SECURITY_LAST_USERNAME_KEY) %>" /> +

+ +

+ +
+ +

+ +

+ + +

+ +

+ + +

+
+
+
diff --git a/booking-mvc/src/main/webapp/WEB-INF/logoutSuccess.jsp b/booking-mvc/src/main/webapp/WEB-INF/logoutSuccess.jsp new file mode 100755 index 0000000..8f7418c --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/logoutSuccess.jsp @@ -0,0 +1,8 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + +
+

Logout

+

You have successfully logged out.

+
+

">Continue

+
diff --git a/booking-mvc/src/main/webapp/WEB-INF/views.xml b/booking-mvc/src/main/webapp/WEB-INF/views.xml new file mode 100644 index 0000000..96200a1 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/views.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/booking-mvc/src/main/webapp/WEB-INF/web.xml b/booking-mvc/src/main/webapp/WEB-INF/web.xml new file mode 100755 index 0000000..99c4593 --- /dev/null +++ b/booking-mvc/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,59 @@ + + + + + + contextConfigLocation + + /WEB-INF/config/web-application-config.xml + + + + + + org.springframework.web.context.ContextLoaderListener + + + + + httpMethodFilter + org.springframework.web.filter.HiddenHttpMethodFilter + + + + httpMethodFilter + Spring MVC Dispatcher Servlet + + + + + springSecurityFilterChain + org.springframework.web.filter.DelegatingFilterProxy + + + + springSecurityFilterChain + Spring MVC Dispatcher Servlet + + + + + Spring MVC Dispatcher Servlet + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + + + 1 + + + + + Spring MVC Dispatcher Servlet + / + + + \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/images/bg.gif b/booking-mvc/src/main/webapp/images/bg.gif new file mode 100644 index 0000000..ea9200d Binary files /dev/null and b/booking-mvc/src/main/webapp/images/bg.gif differ diff --git a/booking-mvc/src/main/webapp/images/btn.bg.gif b/booking-mvc/src/main/webapp/images/btn.bg.gif new file mode 100644 index 0000000..b77cc95 Binary files /dev/null and b/booking-mvc/src/main/webapp/images/btn.bg.gif differ diff --git a/booking-mvc/src/main/webapp/images/diplomat.jpg b/booking-mvc/src/main/webapp/images/diplomat.jpg new file mode 100644 index 0000000..e1d0c9c Binary files /dev/null and b/booking-mvc/src/main/webapp/images/diplomat.jpg differ diff --git a/booking-mvc/src/main/webapp/images/header.jpg b/booking-mvc/src/main/webapp/images/header.jpg new file mode 100644 index 0000000..6893bd8 Binary files /dev/null and b/booking-mvc/src/main/webapp/images/header.jpg differ diff --git a/booking-mvc/src/main/webapp/images/input.bg.gif b/booking-mvc/src/main/webapp/images/input.bg.gif new file mode 100644 index 0000000..8ebf87e Binary files /dev/null and b/booking-mvc/src/main/webapp/images/input.bg.gif differ diff --git a/booking-mvc/src/main/webapp/images/powered-by-spring.png b/booking-mvc/src/main/webapp/images/powered-by-spring.png new file mode 100644 index 0000000..e773b17 Binary files /dev/null and b/booking-mvc/src/main/webapp/images/powered-by-spring.png differ diff --git a/booking-mvc/src/main/webapp/images/spring-logo.jpg b/booking-mvc/src/main/webapp/images/spring-logo.jpg new file mode 100644 index 0000000..62be398 Binary files /dev/null and b/booking-mvc/src/main/webapp/images/spring-logo.jpg differ diff --git a/booking-mvc/src/main/webapp/images/springone2gx.jpeg b/booking-mvc/src/main/webapp/images/springone2gx.jpeg new file mode 100644 index 0000000..b43bcb2 Binary files /dev/null and b/booking-mvc/src/main/webapp/images/springone2gx.jpeg differ diff --git a/booking-mvc/src/main/webapp/images/th.bg.gif b/booking-mvc/src/main/webapp/images/th.bg.gif new file mode 100644 index 0000000..4663cf5 Binary files /dev/null and b/booking-mvc/src/main/webapp/images/th.bg.gif differ diff --git a/booking-mvc/src/main/webapp/images/tse.gif b/booking-mvc/src/main/webapp/images/tse.gif new file mode 100644 index 0000000..b1fa98c Binary files /dev/null and b/booking-mvc/src/main/webapp/images/tse.gif differ diff --git a/booking-mvc/src/main/webapp/images/webflow-logo.jpg b/booking-mvc/src/main/webapp/images/webflow-logo.jpg new file mode 100644 index 0000000..ed76bae Binary files /dev/null and b/booking-mvc/src/main/webapp/images/webflow-logo.jpg differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/icons/cross.png b/booking-mvc/src/main/webapp/styles/blueprint/icons/cross.png new file mode 100755 index 0000000..1514d51 Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/icons/cross.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/icons/key.png b/booking-mvc/src/main/webapp/styles/blueprint/icons/key.png new file mode 100755 index 0000000..a9d5e4f Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/icons/key.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/icons/tick.png b/booking-mvc/src/main/webapp/styles/blueprint/icons/tick.png new file mode 100755 index 0000000..a9925a0 Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/icons/tick.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/ie.css b/booking-mvc/src/main/webapp/styles/blueprint/ie.css new file mode 100755 index 0000000..bbc1e5c --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/ie.css @@ -0,0 +1,36 @@ +/* ----------------------------------------------------------------------- + + + Blueprint CSS Framework 0.9 + http://blueprintcss.org + + * Copyright (c) 2007-Present. See LICENSE for more info. + * See README for instructions on how to use Blueprint. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + +----------------------------------------------------------------------- */ + +/* ie.css */ +body {text-align:center;} +.container {text-align:left;} +* html .column, * html div.span-1, * html div.span-2, * html div.span-3, * html div.span-4, * html div.span-5, * html div.span-6, * html div.span-7, * html div.span-8, * html div.span-9, * html div.span-10, * html div.span-11, * html div.span-12, * html div.span-13, * html div.span-14, * html div.span-15, * html div.span-16, * html div.span-17, * html div.span-18, * html div.span-19, * html div.span-20, * html div.span-21, * html div.span-22, * html div.span-23, * html div.span-24 {display:inline;overflow-x:hidden;} +* html legend {margin:0px -8px 16px 0;padding:0;} +ol {margin-left:2em;} +sup {vertical-align:text-top;} +sub {vertical-align:text-bottom;} +html>body p code {*white-space:normal;} +hr {margin:-8px auto 11px;} +img {-ms-interpolation-mode:bicubic;} +.clearfix, .container {display:inline-block;} +* html .clearfix, * html .container {height:1%;} +fieldset {padding-top:0;} +textarea {overflow:auto;} +input.text, input.title, textarea {background-color:#fff;border:1px solid #bbb;} +input.text:focus, input.title:focus {border-color:#666;} +input.text, input.title, textarea, select {margin:0.5em 0;} +input.checkbox, input.radio {position:relative;top:.25em;} +form.inline div, form.inline p {vertical-align:middle;} +form.inline label {position:relative;top:-0.25em;} +form.inline input.checkbox, form.inline input.radio, form.inline input.button, form.inline button {margin:0.5em 0;} +button, input.button {position:relative;top:0.25em;} \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/icons/cross.png b/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/icons/cross.png new file mode 100755 index 0000000..1514d51 Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/icons/cross.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/icons/key.png b/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/icons/key.png new file mode 100755 index 0000000..a9d5e4f Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/icons/key.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/icons/tick.png b/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/icons/tick.png new file mode 100755 index 0000000..a9925a0 Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/icons/tick.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/readme.txt b/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/readme.txt new file mode 100755 index 0000000..a8c2b57 --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/readme.txt @@ -0,0 +1,32 @@ +Buttons + +* Gives you great looking CSS buttons, for both and + + + Change Password + + + + Cancel + diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/screen.css b/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/screen.css new file mode 100755 index 0000000..bb66b21 --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/plugins/buttons/screen.css @@ -0,0 +1,97 @@ +/* -------------------------------------------------------------- + + buttons.css + * Gives you some great CSS-only buttons. + + Created by Kevin Hale [particletree.com] + * particletree.com/features/rediscovering-the-button-element + + See Readme.txt in this folder for instructions. + +-------------------------------------------------------------- */ + +a.button, button { + display:block; + float:left; + margin: 0.7em 0.5em 0.7em 0; + padding:5px 10px 5px 7px; /* Links */ + + border:1px solid #dedede; + border-top:1px solid #eee; + border-left:1px solid #eee; + + background-color:#f5f5f5; + font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif; + font-size:100%; + line-height:130%; + text-decoration:none; + font-weight:bold; + color:#565656; + cursor:pointer; +} +button { + width:auto; + overflow:visible; + padding:4px 10px 3px 7px; /* IE6 */ +} +button[type] { + padding:4px 10px 4px 7px; /* Firefox */ + line-height:17px; /* Safari */ +} +*:first-child+html button[type] { + padding:4px 10px 3px 7px; /* IE7 */ +} +button img, a.button img{ + margin:0 3px -3px 0 !important; + padding:0; + border:none; + width:16px; + height:16px; + float:none; +} + + +/* Button colors +-------------------------------------------------------------- */ + +/* Standard */ +button:hover, a.button:hover{ + background-color:#dff4ff; + border:1px solid #c2e1ef; + color:#336699; +} +a.button:active{ + background-color:#6299c5; + border:1px solid #6299c5; + color:#fff; +} + +/* Positive */ +body .positive { + color:#529214; +} +a.positive:hover, button.positive:hover { + background-color:#E6EFC2; + border:1px solid #C6D880; + color:#529214; +} +a.positive:active { + background-color:#529214; + border:1px solid #529214; + color:#fff; +} + +/* Negative */ +body .negative { + color:#d12f19; +} +a.negative:hover, button.negative:hover { + background-color:#fbe3e4; + border:1px solid #fbc2c4; + color:#d12f19; +} +a.negative:active { + background-color:#d12f19; + border:1px solid #d12f19; + color:#fff; +} diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/fancy-type/readme.txt b/booking-mvc/src/main/webapp/styles/blueprint/plugins/fancy-type/readme.txt new file mode 100755 index 0000000..85f2491 --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/plugins/fancy-type/readme.txt @@ -0,0 +1,14 @@ +Fancy Type + +* Gives you classes to use if you'd like some + extra fancy typography. + +Credits and instructions are specified above each class +in the fancy-type.css file in this directory. + + +Usage +---------------------------------------------------------------- + +1) Add this plugin to lib/settings.yml. + See compress.rb for instructions. diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/fancy-type/screen.css b/booking-mvc/src/main/webapp/styles/blueprint/plugins/fancy-type/screen.css new file mode 100755 index 0000000..028e05b --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/plugins/fancy-type/screen.css @@ -0,0 +1,71 @@ +/* -------------------------------------------------------------- + + fancy-type.css + * Lots of pretty advanced classes for manipulating text. + + See the Readme file in this folder for additional instructions. + +-------------------------------------------------------------- */ + +/* Indentation instead of line shifts for sibling paragraphs. */ + p + p { text-indent:2em; margin-top:-1.5em; } + form p + p { text-indent: 0; } /* Don't want this in forms. */ + + +/* For great looking type, use this code instead of asdf: + asdf + Best used on prepositions and ampersands. */ + +.alt { + color: #666; + font-family: "Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua", Georgia, serif; + font-style: italic; + font-weight: normal; +} + + +/* For great looking quote marks in titles, replace "asdf" with: + asdf” + (That is, when the title starts with a quote mark). + (You may have to change this value depending on your font size). */ + +.dquo { margin-left: -.5em; } + + +/* Reduced size type with incremental leading + (http://www.markboulton.co.uk/journal/comments/incremental_leading/) + + This could be used for side notes. For smaller type, you don't necessarily want to + follow the 1.5x vertical rhythm -- the line-height is too much. + + Using this class, it reduces your font size and line-height so that for + every four lines of normal sized type, there is five lines of the sidenote. eg: + + New type size in em's: + 10px (wanted side note size) / 12px (existing base size) = 0.8333 (new type size in ems) + + New line-height value: + 12px x 1.5 = 18px (old line-height) + 18px x 4 = 72px + 72px / 5 = 14.4px (new line height) + 14.4px / 10px = 1.44 (new line height in em's) */ + +p.incr, .incr p { + font-size: 10px; + line-height: 1.44em; + margin-bottom: 1.5em; +} + + +/* Surround uppercase words and abbreviations with this class. + Based on work by Jørgen Arnor GĂĽrdsø Lom [http://twistedintellect.com/] */ + +.caps { + font-variant: small-caps; + letter-spacing: 1px; + text-transform: lowercase; + font-size:1.2em; + line-height:1%; + font-weight:bold; + padding:0 2px; +} diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/doc.png b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/doc.png new file mode 100755 index 0000000..834cdfa Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/doc.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/email.png b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/email.png new file mode 100755 index 0000000..7348aed Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/email.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/external.png b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/external.png new file mode 100755 index 0000000..cf1cfb4 Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/external.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/feed.png b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/feed.png new file mode 100755 index 0000000..315c4f4 Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/feed.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/im.png b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/im.png new file mode 100755 index 0000000..79f35cc Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/im.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/pdf.png b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/pdf.png new file mode 100755 index 0000000..8f8095e Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/pdf.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/visited.png b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/visited.png new file mode 100755 index 0000000..ebf206d Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/visited.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/xls.png b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/xls.png new file mode 100755 index 0000000..b977d7e Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/icons/xls.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/readme.txt b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/readme.txt new file mode 100755 index 0000000..3cb1b2c --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/readme.txt @@ -0,0 +1,18 @@ +Link Icons +* Icons for links based on protocol or file type. + +This is not supported in IE versions < 7. + + +Credits +---------------------------------------------------------------- + +* Marc Morgan +* Olav Bjorkoy [bjorkoy.com] + + +Usage +---------------------------------------------------------------- + +1) Add this line to your HTML: + \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/screen.css b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/screen.css new file mode 100755 index 0000000..6d3d47f --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/plugins/link-icons/screen.css @@ -0,0 +1,40 @@ +/* -------------------------------------------------------------- + + link-icons.css + * Icons for links based on protocol or file type. + + See the Readme file in this folder for additional instructions. + +-------------------------------------------------------------- */ + +/* Use this class if a link gets an icon when it shouldn't. */ +body a.noicon { + background:transparent none !important; + padding:0 !important; + margin:0 !important; +} + +/* Make sure the icons are not cut */ +a[href^="http:"], a[href^="mailto:"], a[href^="http:"]:visited, +a[href$=".pdf"], a[href$=".doc"], a[href$=".xls"], a[href$=".rss"], +a[href$=".rdf"], a[href^="aim:"] { + padding:2px 22px 2px 0; + margin:-2px 0; + background-repeat: no-repeat; + background-position: right center; +} + +/* External links */ +a[href^="http:"] { background-image: url(icons/external.png); } +a[href^="mailto:"] { background-image: url(icons/email.png); } +a[href^="http:"]:visited { background-image: url(icons/visited.png); } + +/* Files */ +a[href$=".pdf"] { background-image: url(icons/pdf.png); } +a[href$=".doc"] { background-image: url(icons/doc.png); } +a[href$=".xls"] { background-image: url(icons/xls.png); } + +/* Misc */ +a[href$=".rss"], +a[href$=".rdf"] { background-image: url(icons/feed.png); } +a[href^="aim:"] { background-image: url(icons/im.png); } \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/rtl/readme.txt b/booking-mvc/src/main/webapp/styles/blueprint/plugins/rtl/readme.txt new file mode 100755 index 0000000..4c46535 --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/plugins/rtl/readme.txt @@ -0,0 +1,10 @@ +RTL +* Mirrors Blueprint, so it can be used with Right-to-Left languages. + +By Ran Yaniv Hartstein, ranh.co.il + +Usage +---------------------------------------------------------------- + +1) Add this line to your HTML: + \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/styles/blueprint/plugins/rtl/screen.css b/booking-mvc/src/main/webapp/styles/blueprint/plugins/rtl/screen.css new file mode 100755 index 0000000..7e7ccdb --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/plugins/rtl/screen.css @@ -0,0 +1,110 @@ +/* -------------------------------------------------------------- + + rtl.css + * Mirrors Blueprint for left-to-right languages + + By Ran Yaniv Hartstein [ranh.co.il] + +-------------------------------------------------------------- */ + +body .container { direction: rtl; } +body .column, body div.span-1, body div.span-2, body div.span-3, body div.span-4, body div.span-5, body div.span-6, body div.span-7, body div.span-8, body div.span-9, body div.span-10, body div.span-11, body div.span-12, body div.span-13, body div.span-14, body div.span-15, body div.span-16, body div.span-17, body div.span-18, body div.span-19, body div.span-20, body div.span-21, body div.span-22, body div.span-23, body div.span-24 { + float: right; + margin-right: 0; + margin-left: 10px; + text-align:right; +} + +body div.last { margin-left: 0; } +body table .last { padding-left: 0; } + +body .append-1 { padding-right: 0; padding-left: 40px; } +body .append-2 { padding-right: 0; padding-left: 80px; } +body .append-3 { padding-right: 0; padding-left: 120px; } +body .append-4 { padding-right: 0; padding-left: 160px; } +body .append-5 { padding-right: 0; padding-left: 200px; } +body .append-6 { padding-right: 0; padding-left: 240px; } +body .append-7 { padding-right: 0; padding-left: 280px; } +body .append-8 { padding-right: 0; padding-left: 320px; } +body .append-9 { padding-right: 0; padding-left: 360px; } +body .append-10 { padding-right: 0; padding-left: 400px; } +body .append-11 { padding-right: 0; padding-left: 440px; } +body .append-12 { padding-right: 0; padding-left: 480px; } +body .append-13 { padding-right: 0; padding-left: 520px; } +body .append-14 { padding-right: 0; padding-left: 560px; } +body .append-15 { padding-right: 0; padding-left: 600px; } +body .append-16 { padding-right: 0; padding-left: 640px; } +body .append-17 { padding-right: 0; padding-left: 680px; } +body .append-18 { padding-right: 0; padding-left: 720px; } +body .append-19 { padding-right: 0; padding-left: 760px; } +body .append-20 { padding-right: 0; padding-left: 800px; } +body .append-21 { padding-right: 0; padding-left: 840px; } +body .append-22 { padding-right: 0; padding-left: 880px; } +body .append-23 { padding-right: 0; padding-left: 920px; } + +body .prepend-1 { padding-left: 0; padding-right: 40px; } +body .prepend-2 { padding-left: 0; padding-right: 80px; } +body .prepend-3 { padding-left: 0; padding-right: 120px; } +body .prepend-4 { padding-left: 0; padding-right: 160px; } +body .prepend-5 { padding-left: 0; padding-right: 200px; } +body .prepend-6 { padding-left: 0; padding-right: 240px; } +body .prepend-7 { padding-left: 0; padding-right: 280px; } +body .prepend-8 { padding-left: 0; padding-right: 320px; } +body .prepend-9 { padding-left: 0; padding-right: 360px; } +body .prepend-10 { padding-left: 0; padding-right: 400px; } +body .prepend-11 { padding-left: 0; padding-right: 440px; } +body .prepend-12 { padding-left: 0; padding-right: 480px; } +body .prepend-13 { padding-left: 0; padding-right: 520px; } +body .prepend-14 { padding-left: 0; padding-right: 560px; } +body .prepend-15 { padding-left: 0; padding-right: 600px; } +body .prepend-16 { padding-left: 0; padding-right: 640px; } +body .prepend-17 { padding-left: 0; padding-right: 680px; } +body .prepend-18 { padding-left: 0; padding-right: 720px; } +body .prepend-19 { padding-left: 0; padding-right: 760px; } +body .prepend-20 { padding-left: 0; padding-right: 800px; } +body .prepend-21 { padding-left: 0; padding-right: 840px; } +body .prepend-22 { padding-left: 0; padding-right: 880px; } +body .prepend-23 { padding-left: 0; padding-right: 920px; } + +body .border { + padding-right: 0; + padding-left: 4px; + margin-right: 0; + margin-left: 5px; + border-right: none; + border-left: 1px solid #eee; +} + +body .colborder { + padding-right: 0; + padding-left: 24px; + margin-right: 0; + margin-left: 25px; + border-right: none; + border-left: 1px solid #eee; +} + +body .pull-1 { margin-left: 0; margin-right: -40px; } +body .pull-2 { margin-left: 0; margin-right: -80px; } +body .pull-3 { margin-left: 0; margin-right: -120px; } +body .pull-4 { margin-left: 0; margin-right: -160px; } + +body .push-0 { margin: 0 18px 0 0; } +body .push-1 { margin: 0 18px 0 -40px; } +body .push-2 { margin: 0 18px 0 -80px; } +body .push-3 { margin: 0 18px 0 -120px; } +body .push-4 { margin: 0 18px 0 -160px; } +body .push-0, body .push-1, body .push-2, +body .push-3, body .push-4 { float: left; } + + +/* Typography with RTL support */ +body h1,body h2,body h3, +body h4,body h5,body h6 { font-family: Arial, sans-serif; } +html body { font-family: Arial, sans-serif; } +body pre,body code,body tt { font-family: monospace; } + +/* Mirror floats and margins on typographic elements */ +body p img { float: right; margin: 1.5em 0 1.5em 1.5em; } +body dd, body ul, body ol { margin-left: 0; margin-right: 1.5em;} +body td, body th { text-align:right; } \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/styles/blueprint/print.css b/booking-mvc/src/main/webapp/styles/blueprint/print.css new file mode 100755 index 0000000..fdb8220 --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/print.css @@ -0,0 +1,29 @@ +/* ----------------------------------------------------------------------- + + + Blueprint CSS Framework 0.9 + http://blueprintcss.org + + * Copyright (c) 2007-Present. See LICENSE for more info. + * See README for instructions on how to use Blueprint. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + +----------------------------------------------------------------------- */ + +/* print.css */ +body {line-height:1.5;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;color:#000;background:none;font-size:10pt;} +.container {background:none;} +hr {background:#ccc;color:#ccc;width:100%;height:2px;margin:2em 0;padding:0;border:none;} +hr.space {background:#fff;color:#fff;visibility:hidden;} +h1, h2, h3, h4, h5, h6 {font-family:"Helvetica Neue", Arial, "Lucida Grande", sans-serif;} +code {font:.9em "Courier New", Monaco, Courier, monospace;} +a img {border:none;} +p img.top {margin-top:0;} +blockquote {margin:1.5em;padding:1em;font-style:italic;font-size:.9em;} +.small {font-size:.9em;} +.large {font-size:1.1em;} +.quiet {color:#999;} +.hide {display:none;} +a:link, a:visited {background:transparent;font-weight:700;text-decoration:underline;} +a:link:after, a:visited:after {content:" (" attr(href) ")";font-size:90%;} \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/styles/blueprint/screen.css b/booking-mvc/src/main/webapp/styles/blueprint/screen.css new file mode 100755 index 0000000..c18b9a5 --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/screen.css @@ -0,0 +1,280 @@ +/* ----------------------------------------------------------------------- + + + Blueprint CSS Framework 0.9 + http://blueprintcss.org + + * Copyright (c) 2007-Present. See LICENSE for more info. + * See README for instructions on how to use Blueprint. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + +----------------------------------------------------------------------- */ + +/* reset.css */ +html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;} +body {line-height:1.5;} +table {border-collapse:separate;border-spacing:0;} +caption, th, td {text-align:left;font-weight:normal;} +table, td, th {vertical-align:middle;} +blockquote:before, blockquote:after, q:before, q:after {content:"";} +blockquote, q {quotes:"" "";} +a img {border:none;} + +/* typography.css */ +html {font-size:100.01%;} +body {font-size:75%;color:#222;background:#fff;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;} +h1, h2, h3, h4, h5, h6 {font-weight:normal;color:#111;} +h1 {font-size:3em;line-height:1;margin-bottom:0.5em;} +h2 {font-size:2em;margin-bottom:0.75em;} +h3 {font-size:1.5em;line-height:1;margin-bottom:1em;} +h4 {font-size:1.2em;line-height:1.25;margin-bottom:1.25em;} +h5 {font-size:1em;font-weight:bold;margin-bottom:1.5em;} +h6 {font-size:1em;font-weight:bold;} +h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;} +p {margin:0 0 1.5em;} +p img.left {float:left;margin:1.5em 1.5em 1.5em 0;padding:0;} +p img.right {float:right;margin:1.5em 0 1.5em 1.5em;} +a:focus, a:hover {color:#000;} +a {color:#009;text-decoration:underline;} +blockquote {margin:1.5em;color:#666;font-style:italic;} +strong {font-weight:bold;} +em, dfn {font-style:italic;} +dfn {font-weight:bold;} +sup, sub {line-height:0;} +abbr, acronym {border-bottom:1px dotted #666;} +address {margin:0 0 1.5em;font-style:italic;} +del {color:#666;} +pre {margin:1.5em 0;white-space:pre;} +pre, code, tt {font:1em 'andale mono', 'lucida console', monospace;line-height:1.5;} +li ul, li ol {margin:0 1.5em;} +ul, ol {margin:0 1.5em 1.5em 1.5em;} +ul {list-style-type:disc;} +ol {list-style-type:decimal;} +dl {margin:0 0 1.5em 0;} +dl dt {font-weight:bold;} +dd {margin-left:1.5em;} +table {margin-bottom:1.4em;width:100%;} +th {font-weight:bold;} +thead th {background:#c3d9ff;} +th, td, caption {padding:4px 10px 4px 5px;} +tr.even td {background:#e5ecf9;} +tfoot {font-style:italic;} +caption {background:#eee;} +.small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;} +.large {font-size:1.2em;line-height:2.5em;margin-bottom:1.25em;} +.hide {display:none;} +.quiet {color:#666;} +.loud {color:#000;} +.highlight {background:#ff0;} +.added {background:#060;color:#fff;} +.removed {background:#900;color:#fff;} +.first {margin-left:0;padding-left:0;} +.last {margin-right:0;padding-right:0;} +.top {margin-top:0;padding-top:0;} +.bottom {margin-bottom:0;padding-bottom:0;} + +/* forms.css */ +label {font-weight:bold;} +fieldset {padding:1.4em;margin:0 0 1.5em 0;border:1px solid #ccc;} +legend {font-weight:bold;font-size:1.2em;} +input[type=text], input[type=password], input.text, input.title, textarea, select {background-color:#fff;border:1px solid #bbb;} +input[type=text]:focus, input[type=password]:focus, input.text:focus, input.title:focus, textarea:focus, select:focus {border-color:#666;} +input[type=text], input[type=password], input.text, input.title, textarea, select {margin:0.5em 0;} +input.text, input.title {width:300px;padding:5px;} +input.title {font-size:1.5em;} +textarea {width:390px;height:250px;padding:5px;} +input[type=checkbox], input[type=radio], input.checkbox, input.radio {position:relative;top:.25em;} +form.inline {line-height:3;} +form.inline p {margin-bottom:0;} +.error, .notice, .success {padding:.8em;margin-bottom:1em;border:2px solid #ddd;} +.error {background:#FBE3E4;color:#8a1f11;border-color:#FBC2C4;} +.notice {background:#FFF6BF;color:#514721;border-color:#FFD324;} +.success {background:#E6EFC2;color:#264409;border-color:#C6D880;} +.error a {color:#8a1f11;} +.notice a {color:#514721;} +.success a {color:#264409;} + +/* grid.css */ +.container {width:950px;margin:0 auto;} +.showgrid {background:url(src/grid.png);} +.column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 {float:left;margin-right:10px;} +.last, div.last {margin-right:0;} +.span-1 {width:30px;} +.span-2 {width:70px;} +.span-3 {width:110px;} +.span-4 {width:150px;} +.span-5 {width:190px;} +.span-6 {width:230px;} +.span-7 {width:270px;} +.span-8 {width:310px;} +.span-9 {width:350px;} +.span-10 {width:390px;} +.span-11 {width:430px;} +.span-12 {width:470px;} +.span-13 {width:510px;} +.span-14 {width:550px;} +.span-15 {width:590px;} +.span-16 {width:630px;} +.span-17 {width:670px;} +.span-18 {width:710px;} +.span-19 {width:750px;} +.span-20 {width:790px;} +.span-21 {width:830px;} +.span-22 {width:870px;} +.span-23 {width:910px;} +.span-24, div.span-24 {width:950px;margin-right:0;} +input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 {border-left-width:1px!important;border-right-width:1px!important;padding-left:5px!important;padding-right:5px!important;} +input.span-1, textarea.span-1 {width:18px!important;} +input.span-2, textarea.span-2 {width:58px!important;} +input.span-3, textarea.span-3 {width:98px!important;} +input.span-4, textarea.span-4 {width:138px!important;} +input.span-5, textarea.span-5 {width:178px!important;} +input.span-6, textarea.span-6 {width:218px!important;} +input.span-7, textarea.span-7 {width:258px!important;} +input.span-8, textarea.span-8 {width:298px!important;} +input.span-9, textarea.span-9 {width:338px!important;} +input.span-10, textarea.span-10 {width:378px!important;} +input.span-11, textarea.span-11 {width:418px!important;} +input.span-12, textarea.span-12 {width:458px!important;} +input.span-13, textarea.span-13 {width:498px!important;} +input.span-14, textarea.span-14 {width:538px!important;} +input.span-15, textarea.span-15 {width:578px!important;} +input.span-16, textarea.span-16 {width:618px!important;} +input.span-17, textarea.span-17 {width:658px!important;} +input.span-18, textarea.span-18 {width:698px!important;} +input.span-19, textarea.span-19 {width:738px!important;} +input.span-20, textarea.span-20 {width:778px!important;} +input.span-21, textarea.span-21 {width:818px!important;} +input.span-22, textarea.span-22 {width:858px!important;} +input.span-23, textarea.span-23 {width:898px!important;} +input.span-24, textarea.span-24 {width:938px!important;} +.append-1 {padding-right:40px;} +.append-2 {padding-right:80px;} +.append-3 {padding-right:120px;} +.append-4 {padding-right:160px;} +.append-5 {padding-right:200px;} +.append-6 {padding-right:240px;} +.append-7 {padding-right:280px;} +.append-8 {padding-right:320px;} +.append-9 {padding-right:360px;} +.append-10 {padding-right:400px;} +.append-11 {padding-right:440px;} +.append-12 {padding-right:480px;} +.append-13 {padding-right:520px;} +.append-14 {padding-right:560px;} +.append-15 {padding-right:600px;} +.append-16 {padding-right:640px;} +.append-17 {padding-right:680px;} +.append-18 {padding-right:720px;} +.append-19 {padding-right:760px;} +.append-20 {padding-right:800px;} +.append-21 {padding-right:840px;} +.append-22 {padding-right:880px;} +.append-23 {padding-right:920px;} +.prepend-1 {padding-left:40px;} +.prepend-2 {padding-left:80px;} +.prepend-3 {padding-left:120px;} +.prepend-4 {padding-left:160px;} +.prepend-5 {padding-left:200px;} +.prepend-6 {padding-left:240px;} +.prepend-7 {padding-left:280px;} +.prepend-8 {padding-left:320px;} +.prepend-9 {padding-left:360px;} +.prepend-10 {padding-left:400px;} +.prepend-11 {padding-left:440px;} +.prepend-12 {padding-left:480px;} +.prepend-13 {padding-left:520px;} +.prepend-14 {padding-left:560px;} +.prepend-15 {padding-left:600px;} +.prepend-16 {padding-left:640px;} +.prepend-17 {padding-left:680px;} +.prepend-18 {padding-left:720px;} +.prepend-19 {padding-left:760px;} +.prepend-20 {padding-left:800px;} +.prepend-21 {padding-left:840px;} +.prepend-22 {padding-left:880px;} +.prepend-23 {padding-left:920px;} +div.border {padding-right:4px;margin-right:5px;border-right:1px solid #eee;} +div.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #eee;} +.pull-1 {margin-left:-40px;} +.pull-2 {margin-left:-80px;} +.pull-3 {margin-left:-120px;} +.pull-4 {margin-left:-160px;} +.pull-5 {margin-left:-200px;} +.pull-6 {margin-left:-240px;} +.pull-7 {margin-left:-280px;} +.pull-8 {margin-left:-320px;} +.pull-9 {margin-left:-360px;} +.pull-10 {margin-left:-400px;} +.pull-11 {margin-left:-440px;} +.pull-12 {margin-left:-480px;} +.pull-13 {margin-left:-520px;} +.pull-14 {margin-left:-560px;} +.pull-15 {margin-left:-600px;} +.pull-16 {margin-left:-640px;} +.pull-17 {margin-left:-680px;} +.pull-18 {margin-left:-720px;} +.pull-19 {margin-left:-760px;} +.pull-20 {margin-left:-800px;} +.pull-21 {margin-left:-840px;} +.pull-22 {margin-left:-880px;} +.pull-23 {margin-left:-920px;} +.pull-24 {margin-left:-960px;} +.pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18, .pull-19, .pull-20, .pull-21, .pull-22, .pull-23, .pull-24 {float:left;position:relative;} +.push-1 {margin:0 -40px 1.5em 40px;} +.push-2 {margin:0 -80px 1.5em 80px;} +.push-3 {margin:0 -120px 1.5em 120px;} +.push-4 {margin:0 -160px 1.5em 160px;} +.push-5 {margin:0 -200px 1.5em 200px;} +.push-6 {margin:0 -240px 1.5em 240px;} +.push-7 {margin:0 -280px 1.5em 280px;} +.push-8 {margin:0 -320px 1.5em 320px;} +.push-9 {margin:0 -360px 1.5em 360px;} +.push-10 {margin:0 -400px 1.5em 400px;} +.push-11 {margin:0 -440px 1.5em 440px;} +.push-12 {margin:0 -480px 1.5em 480px;} +.push-13 {margin:0 -520px 1.5em 520px;} +.push-14 {margin:0 -560px 1.5em 560px;} +.push-15 {margin:0 -600px 1.5em 600px;} +.push-16 {margin:0 -640px 1.5em 640px;} +.push-17 {margin:0 -680px 1.5em 680px;} +.push-18 {margin:0 -720px 1.5em 720px;} +.push-19 {margin:0 -760px 1.5em 760px;} +.push-20 {margin:0 -800px 1.5em 800px;} +.push-21 {margin:0 -840px 1.5em 840px;} +.push-22 {margin:0 -880px 1.5em 880px;} +.push-23 {margin:0 -920px 1.5em 920px;} +.push-24 {margin:0 -960px 1.5em 960px;} +.push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float:right;position:relative;} +.prepend-top {margin-top:1.5em;} +.append-bottom {margin-bottom:1.5em;} +.box {padding:1.5em;margin-bottom:1.5em;background:#E5ECF9;} +hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:.1em;margin:0 0 1.45em;border:none;} +hr.space {background:#fff;color:#fff;visibility:hidden;} +.clearfix:after, .container:after {content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflow:hidden;} +.clearfix, .container {display:block;} +.clear {clear:both;} + +/* fancy-type */ +p + p {text-indent:2em;margin-top:-1.5em;} +form p + p {text-indent:0;} +.alt {color:#666;font-family:"Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua", Georgia, serif;font-style:italic;font-weight:normal;} +.dquo {margin-left:-.5em;} +p.incr, .incr p {font-size:10px;line-height:1.44em;margin-bottom:1.5em;} +.caps {font-variant:small-caps;letter-spacing:1px;text-transform:lowercase;font-size:1.2em;line-height:1%;font-weight:bold;padding:0 2px;} + +/* buttons */ +a.button, button {display:block;float:left;margin:0.7em 0.5em 0.7em 0;padding:5px 10px 5px 7px;border:1px solid #dedede;border-top:1px solid #eee;border-left:1px solid #eee;background-color:#f5f5f5;font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;font-size:100%;line-height:130%;text-decoration:none;font-weight:bold;color:#565656;cursor:pointer;} +button {width:auto;overflow:visible;padding:4px 10px 3px 7px;} +button[type] {padding:4px 10px 4px 7px;line-height:17px;} +*:first-child+html button[type] {padding:4px 10px 3px 7px;} +button img, a.button img {margin:0 3px -3px 0 !important;padding:0;border:none;width:16px;height:16px;float:none;} +button:hover, a.button:hover {background-color:#dff4ff;border:1px solid #c2e1ef;color:#336699;} +a.button:active {background-color:#6299c5;border:1px solid #6299c5;color:#fff;} +body .positive {color:#529214;} +a.positive:hover, button.positive:hover {background-color:#E6EFC2;border:1px solid #C6D880;color:#529214;} +a.positive:active {background-color:#529214;border:1px solid #529214;color:#fff;} +body .negative {color:#d12f19;} +a.negative:hover, button.negative:hover {background-color:#fbe3e4;border:1px solid #fbc2c4;color:#d12f19;} +a.negative:active {background-color:#d12f19;border:1px solid #d12f19;color:#fff;} \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/styles/blueprint/src/forms.css b/booking-mvc/src/main/webapp/styles/blueprint/src/forms.css new file mode 100755 index 0000000..b491134 --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/src/forms.css @@ -0,0 +1,65 @@ +/* -------------------------------------------------------------- + + forms.css + * Sets up some default styling for forms + * Gives you classes to enhance your forms + + Usage: + * For text fields, use class .title or .text + * For inline forms, use .inline (even when using columns) + +-------------------------------------------------------------- */ + +label { font-weight: bold; } +fieldset { padding:1.4em; margin: 0 0 1.5em 0; border: 1px solid #ccc; } +legend { font-weight: bold; font-size:1.2em; } + + +/* Form fields +-------------------------------------------------------------- */ + +input[type=text], input[type=password], +input.text, input.title, +textarea, select { + background-color:#fff; + border:1px solid #bbb; +} +input[type=text]:focus, input[type=password]:focus, +input.text:focus, input.title:focus, +textarea:focus, select:focus { + border-color:#666; +} + +input[type=text], input[type=password], +input.text, input.title, +textarea, select { + margin:0.5em 0; +} + +input.text, +input.title { width: 300px; padding:5px; } +input.title { font-size:1.5em; } +textarea { width: 390px; height: 250px; padding:5px; } + +input[type=checkbox], input[type=radio], +input.checkbox, input.radio { + position:relative; top:.25em; +} + +form.inline { line-height:3; } +form.inline p { margin-bottom:0; } + + +/* Success, notice and error boxes +-------------------------------------------------------------- */ + +.error, +.notice, +.success { padding: .8em; margin-bottom: 1em; border: 2px solid #ddd; } + +.error { background: #FBE3E4; color: #8a1f11; border-color: #FBC2C4; } +.notice { background: #FFF6BF; color: #514721; border-color: #FFD324; } +.success { background: #E6EFC2; color: #264409; border-color: #C6D880; } +.error a { color: #8a1f11; } +.notice a { color: #514721; } +.success a { color: #264409; } diff --git a/booking-mvc/src/main/webapp/styles/blueprint/src/grid.css b/booking-mvc/src/main/webapp/styles/blueprint/src/grid.css new file mode 100755 index 0000000..352e0e2 --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/src/grid.css @@ -0,0 +1,281 @@ +/* -------------------------------------------------------------- + grid.css + * Sets up an easy-to-use grid of 24 columns. + + By default, the grid is 950px wide, with 24 columns + spanning 30px, and a 10px margin between columns. + + If you need fewer or more columns, namespaces or semantic + element names, use the compressor script (lib/compress.rb) + + Note: Changes made in this file will not be applied when + using the compressor: make changes in lib/blueprint/grid.css.rb +-------------------------------------------------------------- */ + +/* A container should group all your columns. */ +.container { + width: 950px; + margin: 0 auto; +} + +/* Use this class on any div.span / container to see the grid. */ +.showgrid { + background: url(src/grid.png); +} + + +/* Columns +-------------------------------------------------------------- */ + +/* Sets up basic grid floating and margin. */ +.column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 { + float: left; + margin-right: 10px; +} + +/* The last column in a row needs this class. */ +.last, div.last { margin-right: 0; } + +/* Use these classes to set the width of a column. */ +.span-1 {width: 30px;} + +.span-2 {width: 70px;} +.span-3 {width: 110px;} +.span-4 {width: 150px;} +.span-5 {width: 190px;} +.span-6 {width: 230px;} +.span-7 {width: 270px;} +.span-8 {width: 310px;} +.span-9 {width: 350px;} +.span-10 {width: 390px;} +.span-11 {width: 430px;} +.span-12 {width: 470px;} +.span-13 {width: 510px;} +.span-14 {width: 550px;} +.span-15 {width: 590px;} +.span-16 {width: 630px;} +.span-17 {width: 670px;} +.span-18 {width: 710px;} +.span-19 {width: 750px;} +.span-20 {width: 790px;} +.span-21 {width: 830px;} +.span-22 {width: 870px;} +.span-23 {width: 910px;} +.span-24, div.span-24 { width:950px; margin-right:0; } + +/* Use these classes to set the width of an input. */ +input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 { + border-left-width: 1px!important; + border-right-width: 1px!important; + padding-left: 5px!important; + padding-right: 5px!important; +} + +input.span-1, textarea.span-1 { width: 18px!important; } +input.span-2, textarea.span-2 { width: 58px!important; } +input.span-3, textarea.span-3 { width: 98px!important; } +input.span-4, textarea.span-4 { width: 138px!important; } +input.span-5, textarea.span-5 { width: 178px!important; } +input.span-6, textarea.span-6 { width: 218px!important; } +input.span-7, textarea.span-7 { width: 258px!important; } +input.span-8, textarea.span-8 { width: 298px!important; } +input.span-9, textarea.span-9 { width: 338px!important; } +input.span-10, textarea.span-10 { width: 378px!important; } +input.span-11, textarea.span-11 { width: 418px!important; } +input.span-12, textarea.span-12 { width: 458px!important; } +input.span-13, textarea.span-13 { width: 498px!important; } +input.span-14, textarea.span-14 { width: 538px!important; } +input.span-15, textarea.span-15 { width: 578px!important; } +input.span-16, textarea.span-16 { width: 618px!important; } +input.span-17, textarea.span-17 { width: 658px!important; } +input.span-18, textarea.span-18 { width: 698px!important; } +input.span-19, textarea.span-19 { width: 738px!important; } +input.span-20, textarea.span-20 { width: 778px!important; } +input.span-21, textarea.span-21 { width: 818px!important; } +input.span-22, textarea.span-22 { width: 858px!important; } +input.span-23, textarea.span-23 { width: 898px!important; } +input.span-24, textarea.span-24 { width: 938px!important; } + +/* Add these to a column to append empty cols. */ + +.append-1 { padding-right: 40px;} +.append-2 { padding-right: 80px;} +.append-3 { padding-right: 120px;} +.append-4 { padding-right: 160px;} +.append-5 { padding-right: 200px;} +.append-6 { padding-right: 240px;} +.append-7 { padding-right: 280px;} +.append-8 { padding-right: 320px;} +.append-9 { padding-right: 360px;} +.append-10 { padding-right: 400px;} +.append-11 { padding-right: 440px;} +.append-12 { padding-right: 480px;} +.append-13 { padding-right: 520px;} +.append-14 { padding-right: 560px;} +.append-15 { padding-right: 600px;} +.append-16 { padding-right: 640px;} +.append-17 { padding-right: 680px;} +.append-18 { padding-right: 720px;} +.append-19 { padding-right: 760px;} +.append-20 { padding-right: 800px;} +.append-21 { padding-right: 840px;} +.append-22 { padding-right: 880px;} +.append-23 { padding-right: 920px;} + +/* Add these to a column to prepend empty cols. */ + +.prepend-1 { padding-left: 40px;} +.prepend-2 { padding-left: 80px;} +.prepend-3 { padding-left: 120px;} +.prepend-4 { padding-left: 160px;} +.prepend-5 { padding-left: 200px;} +.prepend-6 { padding-left: 240px;} +.prepend-7 { padding-left: 280px;} +.prepend-8 { padding-left: 320px;} +.prepend-9 { padding-left: 360px;} +.prepend-10 { padding-left: 400px;} +.prepend-11 { padding-left: 440px;} +.prepend-12 { padding-left: 480px;} +.prepend-13 { padding-left: 520px;} +.prepend-14 { padding-left: 560px;} +.prepend-15 { padding-left: 600px;} +.prepend-16 { padding-left: 640px;} +.prepend-17 { padding-left: 680px;} +.prepend-18 { padding-left: 720px;} +.prepend-19 { padding-left: 760px;} +.prepend-20 { padding-left: 800px;} +.prepend-21 { padding-left: 840px;} +.prepend-22 { padding-left: 880px;} +.prepend-23 { padding-left: 920px;} + + +/* Border on right hand side of a column. */ +div.border { + padding-right: 4px; + margin-right: 5px; + border-right: 1px solid #eee; +} + +/* Border with more whitespace, spans one column. */ +div.colborder { + padding-right: 24px; + margin-right: 25px; + border-right: 1px solid #eee; +} + + +/* Use these classes on an element to push it into the +next column, or to pull it into the previous column. */ + + +.pull-1 { margin-left: -40px; } +.pull-2 { margin-left: -80px; } +.pull-3 { margin-left: -120px; } +.pull-4 { margin-left: -160px; } +.pull-5 { margin-left: -200px; } +.pull-6 { margin-left: -240px; } +.pull-7 { margin-left: -280px; } +.pull-8 { margin-left: -320px; } +.pull-9 { margin-left: -360px; } +.pull-10 { margin-left: -400px; } +.pull-11 { margin-left: -440px; } +.pull-12 { margin-left: -480px; } +.pull-13 { margin-left: -520px; } +.pull-14 { margin-left: -560px; } +.pull-15 { margin-left: -600px; } +.pull-16 { margin-left: -640px; } +.pull-17 { margin-left: -680px; } +.pull-18 { margin-left: -720px; } +.pull-19 { margin-left: -760px; } +.pull-20 { margin-left: -800px; } +.pull-21 { margin-left: -840px; } +.pull-22 { margin-left: -880px; } +.pull-23 { margin-left: -920px; } +.pull-24 { margin-left: -960px; } + +.pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18, .pull-19, .pull-20, .pull-21, .pull-22, .pull-23, .pull-24 {float: left; position:relative;} + + +.push-1 { margin: 0 -40px 1.5em 40px; } +.push-2 { margin: 0 -80px 1.5em 80px; } +.push-3 { margin: 0 -120px 1.5em 120px; } +.push-4 { margin: 0 -160px 1.5em 160px; } +.push-5 { margin: 0 -200px 1.5em 200px; } +.push-6 { margin: 0 -240px 1.5em 240px; } +.push-7 { margin: 0 -280px 1.5em 280px; } +.push-8 { margin: 0 -320px 1.5em 320px; } +.push-9 { margin: 0 -360px 1.5em 360px; } +.push-10 { margin: 0 -400px 1.5em 400px; } +.push-11 { margin: 0 -440px 1.5em 440px; } +.push-12 { margin: 0 -480px 1.5em 480px; } +.push-13 { margin: 0 -520px 1.5em 520px; } +.push-14 { margin: 0 -560px 1.5em 560px; } +.push-15 { margin: 0 -600px 1.5em 600px; } +.push-16 { margin: 0 -640px 1.5em 640px; } +.push-17 { margin: 0 -680px 1.5em 680px; } +.push-18 { margin: 0 -720px 1.5em 720px; } +.push-19 { margin: 0 -760px 1.5em 760px; } +.push-20 { margin: 0 -800px 1.5em 800px; } +.push-21 { margin: 0 -840px 1.5em 840px; } +.push-22 { margin: 0 -880px 1.5em 880px; } +.push-23 { margin: 0 -920px 1.5em 920px; } +.push-24 { margin: 0 -960px 1.5em 960px; } + +.push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float: right; position:relative;} + + +/* Misc classes and elements +-------------------------------------------------------------- */ + +/* In case you need to add a gutter above/below an element */ +.prepend-top { + margin-top:1.5em; +} +.append-bottom { + margin-bottom:1.5em; +} + +/* Use a .box to create a padded box inside a column. */ +.box { + padding: 1.5em; + margin-bottom: 1.5em; + background: #E5ECF9; +} + +/* Use this to create a horizontal ruler across a column. */ +hr { + background: #ddd; + color: #ddd; + clear: both; + float: none; + width: 100%; + height: .1em; + margin: 0 0 1.45em; + border: none; +} + +hr.space { + background: #fff; + color: #fff; + visibility: hidden; +} + + +/* Clearing floats without extra markup + Based on How To Clear Floats Without Structural Markup by PiE + [http://www.positioniseverything.net/easyclearing.html] */ + +.clearfix:after, .container:after { + content: "\0020"; + display: block; + height: 0; + clear: both; + visibility: hidden; + overflow:hidden; +} +.clearfix, .container {display: block;} + +/* Regular clearing + apply to column that should drop below previous ones. */ + +.clear { clear:both; } diff --git a/booking-mvc/src/main/webapp/styles/blueprint/src/grid.png b/booking-mvc/src/main/webapp/styles/blueprint/src/grid.png new file mode 100755 index 0000000..b7539f6 Binary files /dev/null and b/booking-mvc/src/main/webapp/styles/blueprint/src/grid.png differ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/src/ie.css b/booking-mvc/src/main/webapp/styles/blueprint/src/ie.css new file mode 100755 index 0000000..214b879 --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/src/ie.css @@ -0,0 +1,76 @@ +/* -------------------------------------------------------------- + + ie.css + + Contains every hack for Internet Explorer, + so that our core files stay sweet and nimble. + +-------------------------------------------------------------- */ + +/* Make sure the layout is centered in IE5 */ +body { text-align: center; } +.container { text-align: left; } + +/* Fixes IE margin bugs */ +* html .column, * html div.span-1, * html div.span-2, +* html div.span-3, * html div.span-4, * html div.span-5, +* html div.span-6, * html div.span-7, * html div.span-8, +* html div.span-9, * html div.span-10, * html div.span-11, +* html div.span-12, * html div.span-13, * html div.span-14, +* html div.span-15, * html div.span-16, * html div.span-17, +* html div.span-18, * html div.span-19, * html div.span-20, +* html div.span-21, * html div.span-22, * html div.span-23, +* html div.span-24 { display:inline; overflow-x: hidden; } + + +/* Elements +-------------------------------------------------------------- */ + +/* Fixes incorrect styling of legend in IE6. */ +* html legend { margin:0px -8px 16px 0; padding:0; } + +/* Fixes wrong line-height on sup/sub in IE. */ +sup { vertical-align:text-top; } +sub { vertical-align:text-bottom; } + +/* Fixes IE7 missing wrapping of code elements. */ +html>body p code { *white-space: normal; } + +/* IE 6&7 has problems with setting proper
margins. */ +hr { margin:-8px auto 11px; } + +/* Explicitly set interpolation, allowing dynamically resized images to not look horrible */ +img { -ms-interpolation-mode:bicubic; } + +/* Clearing +-------------------------------------------------------------- */ + +/* Makes clearfix actually work in IE */ +.clearfix, .container { display:inline-block; } +* html .clearfix, +* html .container { height:1%; } + + +/* Forms +-------------------------------------------------------------- */ + +/* Fixes padding on fieldset */ +fieldset { padding-top:0; } + +/* Makes classic textareas in IE 6 resemble other browsers */ +textarea { overflow:auto; } + +/* Fixes rule that IE 6 ignores */ +input.text, input.title, textarea { background-color:#fff; border:1px solid #bbb; } +input.text:focus, input.title:focus { border-color:#666; } +input.text, input.title, textarea, select { margin:0.5em 0; } +input.checkbox, input.radio { position:relative; top:.25em; } + +/* Fixes alignment of inline form elements */ +form.inline div, form.inline p { vertical-align:middle; } +form.inline label { position:relative;top:-0.25em; } +form.inline input.checkbox, form.inline input.radio, +form.inline input.button, form.inline button { + margin:0.5em 0; +} +button, input.button { position:relative;top:0.25em; } \ No newline at end of file diff --git a/booking-mvc/src/main/webapp/styles/blueprint/src/print.css b/booking-mvc/src/main/webapp/styles/blueprint/src/print.css new file mode 100755 index 0000000..d303029 --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/src/print.css @@ -0,0 +1,85 @@ +/* -------------------------------------------------------------- + + print.css + * Gives you some sensible styles for printing pages. + * See Readme file in this directory for further instructions. + + Some additions you'll want to make, customized to your markup: + #header, #footer, #navigation { display:none; } + +-------------------------------------------------------------- */ + +body { + line-height: 1.5; + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + color:#000; + background: none; + font-size: 10pt; +} + + +/* Layout +-------------------------------------------------------------- */ + +.container { + background: none; +} + +hr { + background:#ccc; + color:#ccc; + width:100%; + height:2px; + margin:2em 0; + padding:0; + border:none; +} +hr.space { + background: #fff; + color: #fff; + visibility: hidden; +} + + +/* Text +-------------------------------------------------------------- */ + +h1,h2,h3,h4,h5,h6 { font-family: "Helvetica Neue", Arial, "Lucida Grande", sans-serif; } +code { font:.9em "Courier New", Monaco, Courier, monospace; } + +a img { border:none; } +p img.top { margin-top: 0; } + +blockquote { + margin:1.5em; + padding:1em; + font-style:italic; + font-size:.9em; +} + +.small { font-size: .9em; } +.large { font-size: 1.1em; } +.quiet { color: #999; } +.hide { display:none; } + + +/* Links +-------------------------------------------------------------- */ + +a:link, a:visited { + background: transparent; + font-weight:700; + text-decoration: underline; +} + +a:link:after, a:visited:after { + content: " (" attr(href) ")"; + font-size: 90%; +} + +/* If you're having trouble printing relative links, uncomment and customize this: + (note: This is valid CSS3, but it still won't go through the W3C CSS Validator) */ + +/* a[href^="/"]:after { + content: " (http://www.yourdomain.com" attr(href) ") "; +} */ diff --git a/booking-mvc/src/main/webapp/styles/blueprint/src/reset.css b/booking-mvc/src/main/webapp/styles/blueprint/src/reset.css new file mode 100755 index 0000000..fc0788c --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/src/reset.css @@ -0,0 +1,38 @@ +/* -------------------------------------------------------------- + + reset.css + * Resets default browser CSS. + +-------------------------------------------------------------- */ + +html, body, div, span, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, code, +del, dfn, em, img, q, dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +body { + line-height: 1.5; +} + +/* Tables still need 'cellspacing="0"' in the markup. */ +table { border-collapse: separate; border-spacing: 0; } +caption, th, td { text-align: left; font-weight: normal; } +table, td, th { vertical-align: middle; } + +/* Remove possible quote marks (") from ,
. */ +blockquote:before, blockquote:after, q:before, q:after { content: ""; } +blockquote, q { quotes: "" ""; } + +/* Remove annoying border on linked images. */ +a img { border: none; } diff --git a/booking-mvc/src/main/webapp/styles/blueprint/src/typography.css b/booking-mvc/src/main/webapp/styles/blueprint/src/typography.css new file mode 100755 index 0000000..6cc099c --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/blueprint/src/typography.css @@ -0,0 +1,106 @@ +/* -------------------------------------------------------------- + + typography.css + * Sets up some sensible default typography. + +-------------------------------------------------------------- */ + +/* Default font settings. + The font-size percentage is of 16px. (0.75 * 16px = 12px) */ +html { font-size:100.01%; } +body { + font-size: 75%; + color: #222; + background: #fff; + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; +} + + +/* Headings +-------------------------------------------------------------- */ + +h1,h2,h3,h4,h5,h6 { font-weight: normal; color: #111; } + +h1 { font-size: 3em; line-height: 1; margin-bottom: 0.5em; } +h2 { font-size: 2em; margin-bottom: 0.75em; } +h3 { font-size: 1.5em; line-height: 1; margin-bottom: 1em; } +h4 { font-size: 1.2em; line-height: 1.25; margin-bottom: 1.25em; } +h5 { font-size: 1em; font-weight: bold; margin-bottom: 1.5em; } +h6 { font-size: 1em; font-weight: bold; } + +h1 img, h2 img, h3 img, +h4 img, h5 img, h6 img { + margin: 0; +} + + +/* Text elements +-------------------------------------------------------------- */ + +p { margin: 0 0 1.5em; } +p img.left { float: left; margin: 1.5em 1.5em 1.5em 0; padding: 0; } +p img.right { float: right; margin: 1.5em 0 1.5em 1.5em; } + +a:focus, +a:hover { color: #000; } +a { color: #009; text-decoration: underline; } + +blockquote { margin: 1.5em; color: #666; font-style: italic; } +strong { font-weight: bold; } +em,dfn { font-style: italic; } +dfn { font-weight: bold; } +sup, sub { line-height: 0; } + +abbr, +acronym { border-bottom: 1px dotted #666; } +address { margin: 0 0 1.5em; font-style: italic; } +del { color:#666; } + +pre { margin: 1.5em 0; white-space: pre; } +pre,code,tt { font: 1em 'andale mono', 'lucida console', monospace; line-height: 1.5; } + + +/* Lists +-------------------------------------------------------------- */ + +li ul, +li ol { margin: 0; } +ul, ol { margin: 0 1.5em 1.5em 0; padding-left: 3.333em; } + +ul { list-style-type: disc; } +ol { list-style-type: decimal; } + +dl { margin: 0 0 1.5em 0; } +dl dt { font-weight: bold; } +dd { margin-left: 1.5em;} + + +/* Tables +-------------------------------------------------------------- */ + +table { margin-bottom: 1.4em; width:100%; } +th { font-weight: bold; } +thead th { background: #c3d9ff; } +th,td,caption { padding: 4px 10px 4px 5px; } +tr.even td { background: #e5ecf9; } +tfoot { font-style: italic; } +caption { background: #eee; } + + +/* Misc classes +-------------------------------------------------------------- */ + +.small { font-size: .8em; margin-bottom: 1.875em; line-height: 1.875em; } +.large { font-size: 1.2em; line-height: 2.5em; margin-bottom: 1.25em; } +.hide { display: none; } + +.quiet { color: #666; } +.loud { color: #000; } +.highlight { background:#ff0; } +.added { background:#060; color: #fff; } +.removed { background:#900; color: #fff; } + +.first { margin-left:0; padding-left:0; } +.last { margin-right:0; padding-right:0; } +.top { margin-top:0; padding-top:0; } +.bottom { margin-bottom:0; padding-bottom:0; } diff --git a/booking-mvc/src/main/webapp/styles/booking.css b/booking-mvc/src/main/webapp/styles/booking.css new file mode 100644 index 0000000..b8d17e4 --- /dev/null +++ b/booking-mvc/src/main/webapp/styles/booking.css @@ -0,0 +1,53 @@ + +a,a:visited,a:link,a:active { + color: #59924B; + background-color: transparent; + text-decoration: none; + font-weight: bold; +} + +a:hover { + color: white; + background-color: #65a242; + text-decoration: none; + font-weight: bold; +} + +button { + color: #fff; + background: #fff url(../images/btn.bg.gif) 0 0 repeat-x; + border-style: none; +} + +button:hover { + color: yellow; + background: #fff url(../images/btn.bg.gif) 0 0 repeat-x; + border-style: none; +} + +.summary { + width: 100%; + border: 1px solid #414f23; + border-collapse: collapse; +} + +.summary thead th { + border-left: 1px solid #414f23; + background: #fff url(../images/th.bg.gif) 0 100% repeat-x; + border-bottom: 1px solid #414f23; + padding: 6px; + text-align: left; + font-size: small; +} + +.summary tbody td { + border-left: 1px solid #9cac7c; + padding: 4px; + border-bottom: 1px solid #9cac7c; + font-size: 8pt; +} + +.label { + font-weight: bold; +} + diff --git a/booking-mvc/src/test/java/org/springframework/webflow/samples/booking/BookingFlowExecutionTests.java b/booking-mvc/src/test/java/org/springframework/webflow/samples/booking/BookingFlowExecutionTests.java new file mode 100644 index 0000000..63d78e9 --- /dev/null +++ b/booking-mvc/src/test/java/org/springframework/webflow/samples/booking/BookingFlowExecutionTests.java @@ -0,0 +1,81 @@ +package org.springframework.webflow.samples.booking; + +import org.easymock.EasyMock; +import org.springframework.webflow.config.FlowDefinitionResource; +import org.springframework.webflow.config.FlowDefinitionResourceFactory; +import org.springframework.webflow.core.collection.LocalAttributeMap; +import org.springframework.webflow.core.collection.MutableAttributeMap; +import org.springframework.webflow.test.MockExternalContext; +import org.springframework.webflow.test.MockFlowBuilderContext; +import org.springframework.webflow.test.execution.AbstractXmlFlowExecutionTests; + +public class BookingFlowExecutionTests extends AbstractXmlFlowExecutionTests { + + private BookingService bookingService; + + protected void setUp() { + bookingService = EasyMock.createMock(BookingService.class); + } + + @Override + protected FlowDefinitionResource getResource(FlowDefinitionResourceFactory resourceFactory) { + return resourceFactory.createFileResource("src/main/webapp/WEB-INF/hotels/booking/booking-flow.xml"); + } + + @Override + protected void configureFlowBuilderContext(MockFlowBuilderContext builderContext) { + builderContext.registerBean("bookingService", bookingService); + } + + public void testStartBookingFlow() { + Booking booking = createTestBooking(); + + EasyMock.expect(bookingService.createBooking(1L, "keith")).andReturn(booking); + + EasyMock.replay(bookingService); + + MutableAttributeMap input = new LocalAttributeMap(); + input.put("hotelId", "1"); + MockExternalContext context = new MockExternalContext(); + context.setCurrentUser("keith"); + startFlow(input, context); + + assertCurrentStateEquals("enterBookingDetails"); + assertResponseWrittenEquals("enterBookingDetails", context); + assertTrue(getRequiredFlowAttribute("booking") instanceof Booking); + + EasyMock.verify(bookingService); + } + + public void testEnterBookingDetails_Proceed() { + setCurrentState("enterBookingDetails"); + getFlowScope().put("booking", createTestBooking()); + + MockExternalContext context = new MockExternalContext(); + context.setEventId("proceed"); + resumeFlow(context); + + assertCurrentStateEquals("reviewBooking"); + assertResponseWrittenEquals("reviewBooking", context); + } + + public void testReviewBooking_Confirm() { + setCurrentState("reviewBooking"); + getFlowScope().put("booking", createTestBooking()); + MockExternalContext context = new MockExternalContext(); + context.setEventId("confirm"); + resumeFlow(context); + assertFlowExecutionEnded(); + assertFlowExecutionOutcomeEquals("bookingConfirmed"); + } + + private Booking createTestBooking() { + Hotel hotel = new Hotel(); + hotel.setId(1L); + hotel.setName("Jameson Inn"); + User user = new User("keith", "pass", "Keith Donald"); + Booking booking = new Booking(hotel, user); + return booking; + } + +} diff --git a/booking-mvc/src/test/resources/.gitignore b/booking-mvc/src/test/resources/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/booking-portlet-faces/.metadata/src/main/webapp/WEB-INF/faces-config.pageflow b/booking-portlet-faces/.metadata/src/main/webapp/WEB-INF/faces-config.pageflow new file mode 100644 index 0000000..60c2b79 --- /dev/null +++ b/booking-portlet-faces/.metadata/src/main/webapp/WEB-INF/faces-config.pageflow @@ -0,0 +1,2 @@ + + diff --git a/booking-portlet-faces/build.xml b/booking-portlet-faces/build.xml new file mode 100644 index 0000000..e27197c --- /dev/null +++ b/booking-portlet-faces/build.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/booking-portlet-faces/pom.xml b/booking-portlet-faces/pom.xml new file mode 100644 index 0000000..86d3fc4 --- /dev/null +++ b/booking-portlet-faces/pom.xml @@ -0,0 +1,219 @@ + + + 4.0.0 + org.springframework.webflow.samples + booking-portlet-faces + war + Hotel Booking : Spring Portlet MVC + Web Flow + JSF + 1.0.0.BUILD-SNAPSHOT + + + 3.1.1.RELEASE + 2.3.1.RELEASE + 1.5.10 + 1.2.9 + + + + + spring-repository + Spring project snapshots, milestones, and releases + http://repo.springsource.org/snapshot + + + + + + + org.springframework + spring-context + ${springframework-version} + + + + commons-logging + commons-logging + + + + + org.springframework + spring-jdbc + ${springframework-version} + + + org.springframework + spring-orm + ${springframework-version} + + + org.springframework + spring-webmvc + ${springframework-version} + + + org.springframework + spring-webmvc-portlet + ${springframework-version} + + + org.springframework.webflow + spring-faces + ${webflow-version} + + + + org.hsqldb + hsqldb + 1.8.0.10 + runtime + + + org.hibernate + hibernate-entitymanager + 3.5.0-Final + + + + org.apache.myfaces.core + myfaces-api + ${myfaces-version} + + + org.apache.myfaces.core + myfaces-impl + ${myfaces-version} + + + com.sun.facelets + jsf-facelets + 1.1.14 + + + + org.slf4j + slf4j-api + ${slf4j-version} + + + org.slf4j + jcl-over-slf4j + ${slf4j-version} + + + org.slf4j + slf4j-log4j12 + ${slf4j-version} + runtime + + + log4j + log4j + 1.2.15 + + + javax.mail + mail + + + javax.jms + jms + + + com.sun.jdmk + jmxtools + + + com.sun.jmx + jmxri + + + runtime + + + + javax.servlet + servlet-api + 2.5 + provided + + + javax.portlet + portlet-api + 2.0 + provided + + + + org.hibernate + hibernate-validator + 4.0.2.GA + + + + javax.xml.bind + jaxb-api + 2.1 + + + + org.easymock + easymock + 2.5.2 + test + + + junit + junit + 3.8.2 + test + + + org.springframework + spring-test + ${springframework-version} + test + + + + + booking-portlet-faces + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.1.12 + + junit:junit + + **/*Tests.java + + + + + org.apache.maven.plugins + maven-eclipse-plugin + 2.8 + + true + false + 2.0 + + + + + diff --git a/booking-portlet-faces/readme.txt b/booking-portlet-faces/readme.txt new file mode 100644 index 0000000..323a081 --- /dev/null +++ b/booking-portlet-faces/readme.txt @@ -0,0 +1,8 @@ + +Starting with version 2.2, Spring Web Flow provides support for JSF Portlets using its own internal +Portlet integration rather than a Portlet Bridge for JSF. + +This sample demonstrates that support. It has been tested on Apache Pluto 2.0.1 with Portlet +API 2.0 and JSF 1.2 (both Mojarra and MyFaces). + +See the reference documentation for more information. diff --git a/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/Booking.java b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/Booking.java new file mode 100644 index 0000000..07db3df --- /dev/null +++ b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/Booking.java @@ -0,0 +1,198 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.util.Calendar; +import java.util.Date; + +import javax.persistence.Basic; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; + +import org.springframework.binding.message.MessageBuilder; +import org.springframework.binding.message.MessageContext; + +/** + * A Hotel Booking made by a User. + */ +@Entity +public class Booking implements Serializable { + + private static final long serialVersionUID = 1171567558348174963L; + + private Long id; + + private User user; + + private Hotel hotel; + + private Date checkinDate; + + private Date checkoutDate; + + private String creditCard; + + private String creditCardName; + + private int creditCardExpiryMonth; + + private int creditCardExpiryYear; + + private boolean smoking; + + private int beds; + + public Booking() { + } + + public Booking(Hotel hotel, User user) { + this.hotel = hotel; + this.user = user; + Calendar calendar = Calendar.getInstance(); + setCheckinDate(calendar.getTime()); + calendar.add(Calendar.DAY_OF_MONTH, 1); + setCheckoutDate(calendar.getTime()); + } + + @Transient + public BigDecimal getTotal() { + return hotel.getPrice().multiply(new BigDecimal(getNights())); + } + + @Transient + public int getNights() { + return (int) (checkoutDate.getTime() - checkinDate.getTime()) / 1000 / 60 / 60 / 24; + } + + @Id + @GeneratedValue(strategy = GenerationType.TABLE) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @Basic + @Temporal(TemporalType.DATE) + public Date getCheckinDate() { + return checkinDate; + } + + public void setCheckinDate(Date datetime) { + this.checkinDate = datetime; + } + + @ManyToOne + public Hotel getHotel() { + return hotel; + } + + public void setHotel(Hotel hotel) { + this.hotel = hotel; + } + + @ManyToOne + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + @Basic + @Temporal(TemporalType.DATE) + public Date getCheckoutDate() { + return checkoutDate; + } + + public void setCheckoutDate(Date checkoutDate) { + this.checkoutDate = checkoutDate; + } + + public String getCreditCard() { + return creditCard; + } + + public void setCreditCard(String creditCard) { + this.creditCard = creditCard; + } + + @Transient + public String getDescription() { + DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM); + return hotel == null ? null : hotel.getName() + ", " + df.format(getCheckinDate()) + " to " + + df.format(getCheckoutDate()); + } + + public boolean isSmoking() { + return smoking; + } + + public void setSmoking(boolean smoking) { + this.smoking = smoking; + } + + public int getBeds() { + return beds; + } + + public void setBeds(int beds) { + this.beds = beds; + } + + public String getCreditCardName() { + return creditCardName; + } + + public void setCreditCardName(String creditCardName) { + this.creditCardName = creditCardName; + } + + public int getCreditCardExpiryMonth() { + return creditCardExpiryMonth; + } + + public void setCreditCardExpiryMonth(int creditCardExpiryMonth) { + this.creditCardExpiryMonth = creditCardExpiryMonth; + } + + public int getCreditCardExpiryYear() { + return creditCardExpiryYear; + } + + public void setCreditCardExpiryYear(int creditCardExpiryYear) { + this.creditCardExpiryYear = creditCardExpiryYear; + } + + public boolean validate(MessageContext context) { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_MONTH, -1); + boolean valid = true; + if (checkinDate.before(calendar.getTime())) { + context.addMessage(new MessageBuilder().error().source("checkinDate").defaultText( + "Check in date must be a future date").build()); + valid = false; + } else if (!checkinDate.before(checkoutDate)) { + context.addMessage(new MessageBuilder().error().source("checkoutDate").defaultText( + "Check out date must be later than check in date").build()); + valid = false; + } + return valid; + } + + @Override + public String toString() { + return "Booking(" + user + "," + hotel + ")"; + } + +} diff --git a/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/BookingService.java b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/BookingService.java new file mode 100644 index 0000000..59a333f --- /dev/null +++ b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/BookingService.java @@ -0,0 +1,59 @@ +package org.springframework.webflow.samples.booking; + +import java.util.List; + +/** + * A service interface for retrieving hotels and bookings from a backing repository. Also supports the ability to cancel + * a booking. + */ +public interface BookingService { + + /** + * Find bookings made by the given user + * @param username the user's name + * @return their bookings + */ + public List findBookings(String username); + + /** + * Find hotels available for booking by some criteria. + * @param criteria the search criteria + * @return a list of hotels meeting the criteria + */ + public List findHotels(SearchCriteria criteria); + + /** + * Find hotels by their identifier. + * @param id the hotel id + * @return the hotel + */ + public Hotel findHotelById(Long id); + + /** + * Find user by their username. + * @param username the user's username + * @return the user + */ + public User findUser(String username); + + /** + * Create a new, transient hotel booking instance for the given user. + * @param hotelId the hotelId + * @param userName the user name + * @return the new transient booking instance + */ + public Booking createBooking(Long hotelId, String userName); + + /** + * Persist the booking to the database + * @param booking the booking + */ + public void persistBooking(Booking booking); + + /** + * Cancel an existing booking. + * @param id the booking id + */ + public void cancelBooking(Booking booking); + +} diff --git a/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/Hotel.java b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/Hotel.java new file mode 100644 index 0000000..3715a98 --- /dev/null +++ b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/Hotel.java @@ -0,0 +1,110 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; + +/** + * A hotel where users may book stays. + */ +@Entity +public class Hotel implements Serializable { + + private static final long serialVersionUID = 4011346719502656269L; + + private Long id; + + private String name; + + private String address; + + private String city; + + private String state; + + private String zip; + + private String country; + + private BigDecimal price; + + @Id + @GeneratedValue + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getZip() { + return zip; + } + + public void setZip(String zip) { + this.zip = zip; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + @Column(precision = 6, scale = 2) + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Booking createBooking(User user) { + return new Booking(this, user); + } + + @Override + public String toString() { + return "Hotel(" + name + "," + address + "," + city + "," + zip + ")"; + } +} diff --git a/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java new file mode 100644 index 0000000..b530411 --- /dev/null +++ b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java @@ -0,0 +1,93 @@ +package org.springframework.webflow.samples.booking; + +import java.util.List; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; + +import org.springframework.stereotype.Repository; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; + +/** + * A JPA-based implementation of the Booking Service. Delegates to a JPA entity manager to issue data access calls + * against the backing repository. The EntityManager reference is provided by the managing container (Spring) + * automatically. + */ +@Service("bookingService") +@Repository +public class JpaBookingService implements BookingService { + + private EntityManager em; + + @PersistenceContext + public void setEntityManager(EntityManager em) { + this.em = em; + } + + @Transactional(readOnly = true) + @SuppressWarnings("unchecked") + public List findBookings(String username) { + if (username != null) { + return em.createQuery("select b from Booking b where b.user.username = :username order by b.checkinDate") + .setParameter("username", username).getResultList(); + } else { + return null; + } + } + + @Transactional(readOnly = true) + @SuppressWarnings("unchecked") + public List findHotels(SearchCriteria criteria) { + String pattern = getSearchPattern(criteria); + return em + .createQuery( + "select h from Hotel h where lower(h.name) like :pattern or lower(h.city) like :pattern " + + " or lower(h.zip) like :pattern or lower(h.address) like :pattern") + .setParameter("pattern", pattern).setMaxResults(criteria.getPageSize()) + .setFirstResult(criteria.getPage() * criteria.getPageSize()).getResultList(); + } + + @Transactional(readOnly = true) + public Hotel findHotelById(Long id) { + return em.find(Hotel.class, id); + } + + @Transactional(readOnly = true) + public User findUser(String username) { + return (User) em.createQuery("select u from User u where u.username = :username") + .setParameter("username", username).getSingleResult(); + } + + @Transactional(readOnly = true) + public Booking createBooking(Long hotelId, String username) { + Hotel hotel = em.find(Hotel.class, hotelId); + User user = findUser(username); + return new Booking(hotel, user); + } + + @Transactional + public void persistBooking(Booking booking) { + em.persist(booking); + } + + @Transactional + public void cancelBooking(Booking booking) { + booking = em.find(Booking.class, booking.getId()); + if (booking != null) { + em.remove(booking); + } + } + + // helpers + + private String getSearchPattern(SearchCriteria criteria) { + if (StringUtils.hasText(criteria.getSearchString())) { + return "%" + criteria.getSearchString().toLowerCase().replace('*', '%') + "%"; + } else { + return "%"; + } + } + +} \ No newline at end of file diff --git a/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/ReferenceData.java b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/ReferenceData.java new file mode 100644 index 0000000..4c499aa --- /dev/null +++ b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/ReferenceData.java @@ -0,0 +1,83 @@ +package org.springframework.webflow.samples.booking; + +import java.util.ArrayList; +import java.util.List; + +import javax.faces.model.SelectItem; + +import org.springframework.stereotype.Service; + +@Service +public class ReferenceData { + + private List bedOptions; + + private List smokingOptions; + + private List creditCardExpMonths; + + private List creditCardExpYears; + + private List pageSizeOptions; + + public List getBedOptions() { + if (bedOptions == null) { + bedOptions = new ArrayList(); + bedOptions.add(new SelectItem(new Integer(1), "One king-size bed")); + bedOptions.add(new SelectItem(new Integer(2), "Two double beds")); + bedOptions.add(new SelectItem(new Integer(3), "Three beds")); + } + return bedOptions; + } + + public List getSmokingOptions() { + if (smokingOptions == null) { + smokingOptions = new ArrayList(); + smokingOptions.add(new SelectItem(Boolean.TRUE, "Smoking")); + smokingOptions.add(new SelectItem(Boolean.FALSE, "Non-Smoking")); + } + return smokingOptions; + } + + public List getCreditCardExpMonths() { + if (creditCardExpMonths == null) { + creditCardExpMonths = new ArrayList(); + creditCardExpMonths.add(new SelectItem(new Integer(1), "Jan")); + creditCardExpMonths.add(new SelectItem(new Integer(2), "Feb")); + creditCardExpMonths.add(new SelectItem(new Integer(3), "Mar")); + creditCardExpMonths.add(new SelectItem(new Integer(4), "Apr")); + creditCardExpMonths.add(new SelectItem(new Integer(5), "May")); + creditCardExpMonths.add(new SelectItem(new Integer(6), "Jun")); + creditCardExpMonths.add(new SelectItem(new Integer(7), "Jul")); + creditCardExpMonths.add(new SelectItem(new Integer(8), "Aug")); + creditCardExpMonths.add(new SelectItem(new Integer(9), "Sep")); + creditCardExpMonths.add(new SelectItem(new Integer(10), "Oct")); + creditCardExpMonths.add(new SelectItem(new Integer(11), "Nov")); + creditCardExpMonths.add(new SelectItem(new Integer(12), "Dec")); + } + return creditCardExpMonths; + } + + public List getCreditCardExpYears() { + if (creditCardExpYears == null) { + creditCardExpYears = new ArrayList(); + creditCardExpYears.add(new SelectItem(new Integer(2008), "2008")); + creditCardExpYears.add(new SelectItem(new Integer(2009), "2009")); + creditCardExpYears.add(new SelectItem(new Integer(2010), "2010")); + creditCardExpYears.add(new SelectItem(new Integer(2010), "2011")); + creditCardExpYears.add(new SelectItem(new Integer(2010), "2012")); + } + return creditCardExpYears; + } + + public List getPageSizeOptions() { + if (pageSizeOptions == null) { + pageSizeOptions = new ArrayList(); + pageSizeOptions.add(new SelectItem(new Integer(5), "5")); + pageSizeOptions.add(new SelectItem(new Integer(10), "10")); + pageSizeOptions.add(new SelectItem(new Integer(20), "20")); + } + return pageSizeOptions; + } + +} diff --git a/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/SearchCriteria.java b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/SearchCriteria.java new file mode 100644 index 0000000..0a1b92d --- /dev/null +++ b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/SearchCriteria.java @@ -0,0 +1,66 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; + +/** + * A backing bean for the main hotel search form. Encapsulates the criteria needed to perform a hotel search. + */ +public class SearchCriteria implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * The user-provided search criteria for finding Hotels. + */ + private String searchString = ""; + + /** + * The maximum page size of the Hotel result list + */ + private int pageSize = 5; + + /** + * The current page of the Hotel result list. + */ + private int page; + + public String getSearchString() { + return searchString; + } + + public void setSearchString(String searchString) { + this.searchString = searchString; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getPage() { + return page; + } + + public void setPage(int page) { + this.page = page; + } + + public void nextPage() { + page++; + } + + public void previousPage() { + page--; + } + + public void resetPage() { + page = 0; + } + + public String toString() { + return "[Search Criteria searchString = '" + searchString + "'"; + } +} \ No newline at end of file diff --git a/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/User.java b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/User.java new file mode 100644 index 0000000..2a5d0a5 --- /dev/null +++ b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/User.java @@ -0,0 +1,62 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * A user who can book hotels. + */ +@Entity +@Table(name = "Customer") +public class User implements Serializable { + + private static final long serialVersionUID = -3652559447682574722L; + + private String username; + + private String password; + + private String name; + + public User() { + } + + public User(String username, String password, String name) { + this.username = username; + this.password = password; + this.name = name; + } + + @Id + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return "User(" + username + ")"; + } +} diff --git a/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/ViewFlowHandler.java b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/ViewFlowHandler.java new file mode 100644 index 0000000..27a4280 --- /dev/null +++ b/booking-portlet-faces/src/main/java/org/springframework/webflow/samples/booking/ViewFlowHandler.java @@ -0,0 +1,11 @@ +package org.springframework.webflow.samples.booking; + +import org.springframework.webflow.mvc.portlet.AbstractFlowHandler; + +public class ViewFlowHandler extends AbstractFlowHandler { + + public String getFlowId() { + return "view"; + } + +} diff --git a/booking-portlet-faces/src/main/resources/META-INF/persistence.xml b/booking-portlet-faces/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..f4e3d6a --- /dev/null +++ b/booking-portlet-faces/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,18 @@ + + + + org.hibernate.ejb.HibernatePersistence + org.springframework.webflow.samples.booking.User + org.springframework.webflow.samples.booking.Booking + org.springframework.webflow.samples.booking.Hotel + + + + + + + + \ No newline at end of file diff --git a/booking-portlet-faces/src/main/resources/import.sql b/booking-portlet-faces/src/main/resources/import.sql new file mode 100644 index 0000000..9c156ed --- /dev/null +++ b/booking-portlet-faces/src/main/resources/import.sql @@ -0,0 +1,28 @@ +insert into Customer (username, name) values ('keith', 'Keith') +insert into Customer (username, name) values ('erwin', 'Erwin') +insert into Customer (username, name) values ('jeremy', 'Jeremy') +insert into Customer (username, name) values ('scott', 'Scott') +insert into Customer (username, name) values ('pluto', 'Pluto') +insert into Hotel (id, price, name, address, city, state, zip, country) values (1, 199, 'Westin Diplomat', '3555 S. Ocean Drive', 'Hollywood', 'FL', '33019', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 60, 'Jameson Inn', '890 Palm Bay Rd NE', 'Palm Bay', 'FL', '32905', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 199, 'Chilworth Manor', 'The Cottage, Southampton Business Park', 'Southampton', 'Hants', 'SO16 7JF', 'UK') +insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 450, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (7, 450, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (8, 250, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (9, 300, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (10, 300, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (11, 80, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (12, 90, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (13, 160, 'Marriot Downtown', '55 Fourth Street', 'San Francisco', 'CA', '94103', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (14, 200, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona', 'Catalunya', '08019', 'Spain') +insert into Hotel (id, price, name, address, city, state, zip, country) values (15, 210, 'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '', '63405', 'Israel') +insert into Hotel (id, price, name, address, city, state, zip, country) values (16, 240, 'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo', '', '105', 'Japan') +insert into Hotel (id, price, name, address, city, state, zip, country) values (17, 130, 'Hotel Beaulac', ' Esplanade Léopold-Robert 2', 'Neuchatel', '', '2000', 'Switzerland') +insert into Hotel (id, price, name, address, city, state, zip, country) values (18, 140, 'Conrad Treasury Place', 'William & George Streets', 'Brisbane', 'QLD', '4001', 'Australia') +insert into Hotel (id, price, name, address, city, state, zip, country) values (19, 230, 'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal', 'Quebec', 'H3G1H6', 'Canada') +insert into Hotel (id, price, name, address, city, state, zip, country) values (20, 460, 'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA', '30326', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (21, 220, 'Swissotel', '68 Market Street', 'Sydney', 'NSW', '2000', 'Australia') +insert into Hotel (id, price, name, address, city, state, zip, country) values (22, 250, 'Meliá White House', 'Albany Street', 'Regents Park London', '', 'NW13UP', 'Great Britain') +insert into Hotel (id, price, name, address, city, state, zip, country) values (23, 210, 'Hotel Allegro', '171 West Randolph Street', 'Chicago', 'IL', '60601', 'USA') \ No newline at end of file diff --git a/booking-portlet-faces/src/main/resources/log4j.xml b/booking-portlet-faces/src/main/resources/log4j.xml new file mode 100644 index 0000000..4c3ff1c --- /dev/null +++ b/booking-portlet-faces/src/main/resources/log4j.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/classes/log4j.properties b/booking-portlet-faces/src/main/webapp/WEB-INF/classes/log4j.properties new file mode 100644 index 0000000..992d816 --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/classes/log4j.properties @@ -0,0 +1,11 @@ +log4j.rootCategory=INFO, stdout + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n + +# Enable web flow logging +log4j.category.org.springframework.webflow=DEBUG +log4j.category.org.springframework.faces=DEBUG +log4j.category.org.springframework.binding=DEBUG +log4j.category.org.springframework.transaction=DEBUG \ No newline at end of file diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/config/application-config.xml b/booking-portlet-faces/src/main/webapp/WEB-INF/config/application-config.xml new file mode 100644 index 0000000..295df2e --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/config/application-config.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/config/hotelbooking-portlet-config.xml b/booking-portlet-faces/src/main/webapp/WEB-INF/config/hotelbooking-portlet-config.xml new file mode 100644 index 0000000..6526dc0 --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/config/hotelbooking-portlet-config.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/faces-config.xml b/booking-portlet-faces/src/main/webapp/WEB-INF/faces-config.xml new file mode 100644 index 0000000..67a0dac --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/faces-config.xml @@ -0,0 +1,10 @@ + + + + + + org.springframework.faces.webflow.application.portlet.PortletFaceletViewHandler + + diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/flows/booking/booking.xml b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/booking/booking.xml new file mode 100644 index 0000000..a3abd47 --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/booking/booking.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml new file mode 100644 index 0000000..982cda9 --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml @@ -0,0 +1,122 @@ + + + + + +

Book Hotel

+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:#{booking.hotel.name}
Address:#{booking.hotel.address}
City, State:#{booking.hotel.city}, #{booking.hotel.state}
Zip:#{booking.hotel.zip}
Country:#{booking.hotel.country}
Nightly rate: + + + +
+ Check In Date: + + + + +
+ Check Out Date: + + + + +
+ Room Preference: + + + + +
+ Smoking Preference: + + + + +
+ Credit Card #: + + +
+ Credit Card Name: + + +
+ Expiration Date: + + + + + + + +
+   + +
+
+
+ +
+
\ No newline at end of file diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml new file mode 100644 index 0000000..57c610b --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml @@ -0,0 +1,74 @@ + + + + + +

Confirm Hotel Booking

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:#{booking.hotel.name}
Address:#{booking.hotel.address}
City, State:#{booking.hotel.city}, #{booking.hotel.state}
Zip:#{booking.hotel.zip}
Country:#{booking.hotel.country}
Total payment: + + + +
Check In Date: + + + +
Check Out Date: + + + +
Credit Card #:#{booking.creditCard}
+   +   + +
+
+
+ +
+
\ No newline at end of file diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml new file mode 100644 index 0000000..9b559b5 --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml @@ -0,0 +1,77 @@ + + + + + +
+

Search Hotels

+ + + + +
+
+
+ Search String: + +
+
+ Maximum results: + + + +
+
+ +
+
+
+
+
+ +
+ +

Current Hotel Bookings

+ + + + Name + #{booking.hotel.name} + + + Address + #{booking.hotel.address} + + + City, State + #{booking.hotel.city}, #{booking.hotel.state} + + + Check in date + + + + + + Check out date + + + + + + Confirmation number + #{booking.id} + + + Action + + + +
+
+ +
+
\ No newline at end of file diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/flows/main/main.xml b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/main/main.xml new file mode 100644 index 0000000..2c79820 --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/main/main.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml new file mode 100644 index 0000000..9517b4a --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml @@ -0,0 +1,52 @@ + + + + + +

View Hotel

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:#{hotel.name}
Address:#{hotel.address}
City:#{hotel.city}
State:#{hotel.state}
Zip:#{hotel.zip}
Country:#{hotel.country}
Nightly rate: + + + +
+ + + +   + + + +
+
\ No newline at end of file diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml new file mode 100644 index 0000000..ad9d944 --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml @@ -0,0 +1,48 @@ + + + + + + +

Hotel Results

+

+ +

+
+ + + + Name + #{hotel.name} + + + Address + #{hotel.address} + + + City, State + #{hotel.city}, #{hotel.state}, #{hotel.country} + + + Zip + #{hotel.zip} + + + Action + + + + + +
+
+ +
+
\ No newline at end of file diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/flows/view/intro.xhtml b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/view/intro.xhtml new file mode 100644 index 0000000..b9b064e --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/view/intro.xhtml @@ -0,0 +1,35 @@ + + + + + +

Welcome to Spring Travel

+

+ This reference application illustrates Spring Faces, + a software library that integrates Spring and JavaServerFaces technology in a portlet environment. +

+

+ The key features illustrated in this sample include: +

+
    +
  • A declarative navigation model enabling full browser button support and dynamic navigation rules
  • +
  • A fine-grained state management model, including support for ConversationScope and ViewScope
  • +
  • Modularization of web application functionality by domain use case, illustrating project structure best-practices
  • +
  • Managed persistence contexts with the Java Persistence API (JPA)
  • +
  • Unified Expression Language (EL) integration
  • +
  • Declarative page authoring with Facelets, including applying reusable page layouts
  • +
  • Exception handling support across all layers of the application
  • +
  • Spring IDE tooling integration, with support for graphical flow modeling and visualization
  • +
+

+ + Start your Spring Travel experience + +

+ +
+
\ No newline at end of file diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/flows/view/view.xml b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/view/view.xml new file mode 100644 index 0000000..71d0044 --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/flows/view/view.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/portlet.xml b/booking-portlet-faces/src/main/webapp/WEB-INF/portlet.xml new file mode 100644 index 0000000..2294d94 --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/portlet.xml @@ -0,0 +1,40 @@ + + + + + swf-booking-faces + Spring Webflow Booking Faces + + + org.springframework.web.portlet.DispatcherPortlet + + + + contextConfigLocation + + /WEB-INF/config/hotelbooking-portlet-config.xml + + + + + viewRendererUrl + /WEB-INF/servlet/view + + + 0 + + + text/html + view + + + + Spring Webflow Booking Faces + + + + + \ No newline at end of file diff --git a/booking-portlet-faces/src/main/webapp/WEB-INF/web.xml b/booking-portlet-faces/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..1ad5682 --- /dev/null +++ b/booking-portlet-faces/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,65 @@ + + + + + contextConfigLocation + + /WEB-INF/config/application-config.xml + + + + + + javax.faces.DEFAULT_SUFFIX + .xhtml + + + + + facelets.DEVELOPMENT + true + + + + + facelets.REFRESH_PERIOD + 1 + + + + org.springframework.web.context.ContextLoaderListener + + + + + swf-booking-faces + org.apache.pluto.container.driver.PortletServlet + + portlet-name + swf-booking-faces + + 1 + + + + swf-booking-faces + /PlutoInvoker/swf-booking-faces + + + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + + + Faces Servlet + *.faces + + + \ No newline at end of file diff --git a/booking-portlet-faces/src/test/java/.gitignore b/booking-portlet-faces/src/test/java/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/booking-portlet-faces/src/test/resources/.gitignore b/booking-portlet-faces/src/test/resources/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/booking-portlet-mvc/build.xml b/booking-portlet-mvc/build.xml new file mode 100644 index 0000000..e28d39c --- /dev/null +++ b/booking-portlet-mvc/build.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/booking-portlet-mvc/pom.xml b/booking-portlet-mvc/pom.xml new file mode 100644 index 0000000..3ca2aa8 --- /dev/null +++ b/booking-portlet-mvc/pom.xml @@ -0,0 +1,224 @@ + + + 4.0.0 + org.springframework.webflow.samples + booking-portlet-mvc + war + Hotel Booking : Spring Portlet MVC + Web Flow + JSP + 1.0.0.BUILD-SNAPSHOT + + + 3.1.1.RELEASE + 2.3.1.RELEASE + 1.5.10 + + + + + spring-repository + Spring project snapshots, milestones, and releases + http://repo.springsource.org/snapshot + + + + + + + org.springframework + spring-context + ${springframework-version} + + + + commons-logging + commons-logging + + + + + org.springframework + spring-jdbc + ${springframework-version} + + + org.springframework + spring-orm + ${springframework-version} + + + org.springframework + spring-webmvc + ${springframework-version} + + + org.springframework + spring-webmvc-portlet + ${springframework-version} + + + org.springframework.webflow + spring-webflow + ${webflow-version} + + + org.springframework.webflow + spring-js + ${webflow-version} + + + + org.slf4j + slf4j-api + ${slf4j-version} + + + org.slf4j + jcl-over-slf4j + ${slf4j-version} + + + org.slf4j + slf4j-log4j12 + ${slf4j-version} + runtime + + + log4j + log4j + 1.2.15 + + + javax.mail + mail + + + javax.jms + jms + + + com.sun.jdmk + jmxtools + + + com.sun.jmx + jmxri + + + runtime + + + + org.hsqldb + hsqldb + 1.8.0.10 + runtime + + + org.hibernate + hibernate-entitymanager + 3.5.0-Final + + + + javax.servlet + servlet-api + 2.5 + provided + + + javax.portlet + portlet-api + 2.0 + provided + + + javax.servlet + jstl + 1.2 + + + + org.hibernate + hibernate-validator + 4.1.0.Beta1 + + + + javax.xml.bind + jaxb-api + 2.1 + + + + joda-time + joda-time + 1.6 + + + joda-time + joda-time-jsptags + 1.0.2 + runtime + + + + org.easymock + easymock + 2.5.2 + test + + + junit + junit + 3.8.2 + test + + + org.springframework + spring-test + ${springframework-version} + test + + + + + booking-portlet-mvc + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.1.12 + + junit:junit + + **/*Tests.java + + + + + org.apache.maven.plugins + maven-eclipse-plugin + 2.8 + + true + false + 2.0 + + + + + diff --git a/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/Booking.java b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/Booking.java new file mode 100644 index 0000000..2cf8b8c --- /dev/null +++ b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/Booking.java @@ -0,0 +1,192 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.util.Calendar; +import java.util.Date; + +import javax.persistence.Basic; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; +import javax.validation.constraints.Future; +import javax.validation.constraints.NotNull; + +import org.hibernate.validator.constraints.NotEmpty; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * A Hotel Booking made by a User. + */ +@Entity +@BookingDateRange +public class Booking implements Serializable { + private Long id; + + private User user; + + private Hotel hotel; + + @DateTimeFormat(pattern = "MM-dd-yyyy") + private Date checkinDate; + + @DateTimeFormat(pattern = "MM-dd-yyyy") + private Date checkoutDate; + + private String creditCard; + + private String creditCardName; + + private int creditCardExpiryMonth; + + private int creditCardExpiryYear; + + private boolean smoking; + + private int beds; + + public Booking() { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_MONTH, 1); + setCheckinDate(calendar.getTime()); + calendar.add(Calendar.DAY_OF_MONTH, 1); + setCheckoutDate(calendar.getTime()); + } + + public Booking(Hotel hotel, User user) { + this(); + this.hotel = hotel; + this.user = user; + } + + @Transient + public BigDecimal getTotal() { + return hotel.getPrice().multiply(new BigDecimal(getNights())); + } + + @Transient + public int getNights() { + return (int) (checkoutDate.getTime() - checkinDate.getTime()) / 1000 / 60 / 60 / 24; + } + + @Id + @GeneratedValue(strategy = GenerationType.TABLE) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @Basic + @Temporal(TemporalType.DATE) + @NotNull + @Future + public Date getCheckinDate() { + return checkinDate; + } + + public void setCheckinDate(Date datetime) { + this.checkinDate = datetime; + } + + @ManyToOne + public Hotel getHotel() { + return hotel; + } + + public void setHotel(Hotel hotel) { + this.hotel = hotel; + } + + @ManyToOne + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + @Basic + @Temporal(TemporalType.DATE) + @NotNull + @Future + public Date getCheckoutDate() { + return checkoutDate; + } + + public void setCheckoutDate(Date checkoutDate) { + this.checkoutDate = checkoutDate; + } + + @NotEmpty + public String getCreditCard() { + return creditCard; + } + + public void setCreditCard(String creditCard) { + this.creditCard = creditCard; + } + + @Transient + public String getDescription() { + DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM); + return hotel == null ? null : hotel.getName() + ", " + df.format(getCheckinDate()) + " to " + + df.format(getCheckoutDate()); + } + + public boolean isSmoking() { + return smoking; + } + + public void setSmoking(boolean smoking) { + this.smoking = smoking; + } + + public int getBeds() { + return beds; + } + + public void setBeds(int beds) { + this.beds = beds; + } + + @NotEmpty + public String getCreditCardName() { + return creditCardName; + } + + public void setCreditCardName(String creditCardName) { + this.creditCardName = creditCardName; + } + + public int getCreditCardExpiryMonth() { + return creditCardExpiryMonth; + } + + public void setCreditCardExpiryMonth(int creditCardExpiryMonth) { + this.creditCardExpiryMonth = creditCardExpiryMonth; + } + + public int getCreditCardExpiryYear() { + return creditCardExpiryYear; + } + + public void setCreditCardExpiryYear(int creditCardExpiryYear) { + this.creditCardExpiryYear = creditCardExpiryYear; + } + + @Override + public String toString() { + return "Booking(" + user + "," + hotel + ")"; + } + +} diff --git a/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingDateRange.java b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingDateRange.java new file mode 100644 index 0000000..a5cad18 --- /dev/null +++ b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingDateRange.java @@ -0,0 +1,22 @@ +package org.springframework.webflow.samples.booking; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import javax.validation.Constraint; +import javax.validation.Payload; + +@Constraint(validatedBy = BookingDateRangeValidator.class) +@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.PARAMETER }) +@Retention(RetentionPolicy.RUNTIME) +public @interface BookingDateRange { + + String message() default "Invalid check-in and check-out date range"; + + Class[] groups() default {}; + + Class[] payload() default {}; + +} diff --git a/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingDateRangeValidator.java b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingDateRangeValidator.java new file mode 100644 index 0000000..716a40b --- /dev/null +++ b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingDateRangeValidator.java @@ -0,0 +1,19 @@ +package org.springframework.webflow.samples.booking; + +import javax.validation.ConstraintValidator; +import javax.validation.ConstraintValidatorContext; + +public class BookingDateRangeValidator implements ConstraintValidator { + + public void initialize(BookingDateRange bookingDateRange) { + } + + public boolean isValid(Booking booking, ConstraintValidatorContext context) { + if ((booking.getCheckinDate() != null) && (booking.getCheckoutDate() != null) + && booking.getCheckoutDate().before(booking.getCheckinDate())) { + return false; + } + return true; + } + +} diff --git a/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingService.java b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingService.java new file mode 100644 index 0000000..5a1978f --- /dev/null +++ b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingService.java @@ -0,0 +1,59 @@ +package org.springframework.webflow.samples.booking; + +import java.util.List; + +/** + * A service interface for retrieving hotels and bookings from a backing repository. Also supports the ability to cancel + * a booking. + */ +public interface BookingService { + + /** + * Find user by their username. + * @param username the user's username + * @return the user + */ + public User findUser(String username); + + /** + * Find bookings made by the given user + * @param username the user's name + * @return their bookings + */ + public List findBookings(String username); + + /** + * Find hotels available for booking by some criteria. + * @param criteria the search criteria + * @return a list of hotels meeting the criteria + */ + public List findHotels(SearchCriteria criteria); + + /** + * Find hotels by their identifier. + * @param id the hotel id + * @return the hotel + */ + public Hotel findHotelById(Long id); + + /** + * Create a new, transient hotel booking instance for the given user. + * @param hotelId the hotelId + * @param userName the user name + * @return the new transient booking instance + */ + public Booking createBooking(Long hotelId, String userName); + + /** + * Persist the booking to the database + * @param booking the booking + */ + public void persistBooking(Booking booking); + + /** + * Cancel an existing booking. + * @param id the booking id + */ + public void cancelBooking(Long id); + +} diff --git a/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingValidator.java b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingValidator.java new file mode 100644 index 0000000..f0977e1 --- /dev/null +++ b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/BookingValidator.java @@ -0,0 +1,31 @@ +package org.springframework.webflow.samples.booking; + +import java.util.Calendar; + +import org.springframework.validation.Errors; +import org.springframework.validation.Validator; + +public class BookingValidator implements Validator { + + public boolean supports(Class clazz) { + return Booking.class.equals(clazz); + } + + public void validate(Object obj, Errors errors) { + Booking booking = (Booking) obj; + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_MONTH, -1); + if (booking.getCreditCard() == null || "".equals(booking.getCreditCard())) { + errors.rejectValue("creditCard", null, "Credit card number must be provided"); + } + if (booking.getCreditCardName() == null || "".equals(booking.getCreditCardName())) { + errors.rejectValue("creditCardName", null, "Credit card name must be provided"); + } + if (booking.getCheckinDate() == null || booking.getCheckinDate().before(calendar.getTime())) { + errors.rejectValue("checkinDate", null, "Check in date must be a future date"); + } else if (booking.getCheckoutDate() == null || !booking.getCheckinDate().before(booking.getCheckoutDate())) { + errors.rejectValue("checkoutDate", null, "Check out date must be later than check in date"); + } + } + +} diff --git a/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/Hotel.java b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/Hotel.java new file mode 100644 index 0000000..99719e5 --- /dev/null +++ b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/Hotel.java @@ -0,0 +1,107 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; + +/** + * A hotel where users may book stays. + */ +@Entity +public class Hotel implements Serializable { + private Long id; + + private String name; + + private String address; + + private String city; + + private String state; + + private String zip; + + private String country; + + private BigDecimal price; + + @Id + @GeneratedValue + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getZip() { + return zip; + } + + public void setZip(String zip) { + this.zip = zip; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + @Column(precision = 6, scale = 2) + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Booking createBooking(User user) { + return new Booking(this, user); + } + + @Override + public String toString() { + return "Hotel(" + name + "," + address + "," + city + "," + zip + ")"; + } +} diff --git a/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java new file mode 100644 index 0000000..6a36525 --- /dev/null +++ b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java @@ -0,0 +1,93 @@ +package org.springframework.webflow.samples.booking; + +import java.util.List; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; + +import org.springframework.stereotype.Repository; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; + +/** + * A JPA-based implementation of the Booking Service. Delegates to a JPA entity manager to issue data access calls + * against the backing repository. The EntityManager reference is provided by the managing container (Spring) + * automatically. + */ +@Service("bookingService") +@Repository +public class JpaBookingService implements BookingService { + + private EntityManager em; + + @PersistenceContext + public void setEntityManager(EntityManager em) { + this.em = em; + } + + @Transactional(readOnly = true) + public User findUser(String username) { + return (User) em.createQuery("select u from User u where u.username = :username") + .setParameter("username", username).getSingleResult(); + } + + @Transactional(readOnly = true) + @SuppressWarnings("unchecked") + public List findBookings(String username) { + if (username != null) { + return em.createQuery("select b from Booking b where b.user.username = :username order by b.checkinDate") + .setParameter("username", username).getResultList(); + } else { + return null; + } + } + + @Transactional(readOnly = true) + @SuppressWarnings("unchecked") + public List findHotels(SearchCriteria criteria) { + String pattern = getSearchPattern(criteria); + return em + .createQuery( + "select h from Hotel h where lower(h.name) like :pattern or lower(h.city) like :pattern " + + " or lower(h.zip) like :pattern or lower(h.address) like :pattern") + .setParameter("pattern", pattern).setMaxResults(criteria.getPageSize()) + .setFirstResult(criteria.getPage() * criteria.getPageSize()).getResultList(); + } + + @Transactional(readOnly = true) + public Hotel findHotelById(Long id) { + return em.find(Hotel.class, id); + } + + @Transactional(readOnly = true) + public Booking createBooking(Long hotelId, String username) { + Hotel hotel = em.find(Hotel.class, hotelId); + User user = findUser(username); + return new Booking(hotel, user); + } + + @Transactional + public void persistBooking(Booking booking) { + em.persist(booking); + } + + @Transactional + public void cancelBooking(Long id) { + Booking booking = em.find(Booking.class, id); + if (booking != null) { + em.remove(booking); + } + } + + // helpers + + private String getSearchPattern(SearchCriteria criteria) { + if (StringUtils.hasText(criteria.getSearchString())) { + return "%" + criteria.getSearchString().toLowerCase().replace('*', '%') + "%"; + } else { + return "%"; + } + } + +} \ No newline at end of file diff --git a/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/SearchCriteria.java b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/SearchCriteria.java new file mode 100644 index 0000000..ba0b2f0 --- /dev/null +++ b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/SearchCriteria.java @@ -0,0 +1,68 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; + +/** + * A backing bean for the main hotel search form. Encapsulates the criteria needed to perform a hotel search. + * + * It is expected a future milestone of Spring Web Flow 2.0 will allow flow-scoped beans like this one to hold + * references to transient services that are restored automatically when the flow is resumed on subsequent requests. + * This would allow this SearchCriteria object to delegate to the {@link BookingService} directly, for example, + * eliminating the need for the actions in {@link MainActions}. + */ +public class SearchCriteria implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * The user-provided search criteria for finding Hotels. + */ + private String searchString; + + /** + * The maximum page size of the Hotel result list + */ + private int pageSize; + + /** + * The current page of the Hotel result list. + */ + private int page; + + public String getSearchString() { + return searchString; + } + + public void setSearchString(String searchString) { + this.searchString = searchString; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getPage() { + return page; + } + + public void setPage(int page) { + this.page = page; + } + + public void nextPage() { + page++; + } + + public void previousPage() { + page--; + } + + public void resetPage() { + page = 0; + } + +} \ No newline at end of file diff --git a/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/User.java b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/User.java new file mode 100644 index 0000000..55213ad --- /dev/null +++ b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/User.java @@ -0,0 +1,59 @@ +package org.springframework.webflow.samples.booking; + +import java.io.Serializable; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * A user who can book hotels. + */ +@Entity +@Table(name = "Customer") +public class User implements Serializable { + private String username; + + private String password; + + private String name; + + public User() { + } + + public User(String username, String password, String name) { + this.username = username; + this.password = password; + this.name = name; + } + + @Id + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return "User(" + username + ")"; + } +} diff --git a/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/ViewFlowHandler.java b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/ViewFlowHandler.java new file mode 100644 index 0000000..27a4280 --- /dev/null +++ b/booking-portlet-mvc/src/main/java/org/springframework/webflow/samples/booking/ViewFlowHandler.java @@ -0,0 +1,11 @@ +package org.springframework.webflow.samples.booking; + +import org.springframework.webflow.mvc.portlet.AbstractFlowHandler; + +public class ViewFlowHandler extends AbstractFlowHandler { + + public String getFlowId() { + return "view"; + } + +} diff --git a/booking-portlet-mvc/src/main/resources/META-INF/persistence.xml b/booking-portlet-mvc/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..f4e3d6a --- /dev/null +++ b/booking-portlet-mvc/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,18 @@ + + + + org.hibernate.ejb.HibernatePersistence + org.springframework.webflow.samples.booking.User + org.springframework.webflow.samples.booking.Booking + org.springframework.webflow.samples.booking.Hotel + + + + + + + + \ No newline at end of file diff --git a/booking-portlet-mvc/src/main/resources/import.sql b/booking-portlet-mvc/src/main/resources/import.sql new file mode 100644 index 0000000..9c156ed --- /dev/null +++ b/booking-portlet-mvc/src/main/resources/import.sql @@ -0,0 +1,28 @@ +insert into Customer (username, name) values ('keith', 'Keith') +insert into Customer (username, name) values ('erwin', 'Erwin') +insert into Customer (username, name) values ('jeremy', 'Jeremy') +insert into Customer (username, name) values ('scott', 'Scott') +insert into Customer (username, name) values ('pluto', 'Pluto') +insert into Hotel (id, price, name, address, city, state, zip, country) values (1, 199, 'Westin Diplomat', '3555 S. Ocean Drive', 'Hollywood', 'FL', '33019', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 60, 'Jameson Inn', '890 Palm Bay Rd NE', 'Palm Bay', 'FL', '32905', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 199, 'Chilworth Manor', 'The Cottage, Southampton Business Park', 'Southampton', 'Hants', 'SO16 7JF', 'UK') +insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 450, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (7, 450, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (8, 250, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (9, 300, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (10, 300, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (11, 80, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (12, 90, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (13, 160, 'Marriot Downtown', '55 Fourth Street', 'San Francisco', 'CA', '94103', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (14, 200, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona', 'Catalunya', '08019', 'Spain') +insert into Hotel (id, price, name, address, city, state, zip, country) values (15, 210, 'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '', '63405', 'Israel') +insert into Hotel (id, price, name, address, city, state, zip, country) values (16, 240, 'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo', '', '105', 'Japan') +insert into Hotel (id, price, name, address, city, state, zip, country) values (17, 130, 'Hotel Beaulac', ' Esplanade Léopold-Robert 2', 'Neuchatel', '', '2000', 'Switzerland') +insert into Hotel (id, price, name, address, city, state, zip, country) values (18, 140, 'Conrad Treasury Place', 'William & George Streets', 'Brisbane', 'QLD', '4001', 'Australia') +insert into Hotel (id, price, name, address, city, state, zip, country) values (19, 230, 'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal', 'Quebec', 'H3G1H6', 'Canada') +insert into Hotel (id, price, name, address, city, state, zip, country) values (20, 460, 'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA', '30326', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (21, 220, 'Swissotel', '68 Market Street', 'Sydney', 'NSW', '2000', 'Australia') +insert into Hotel (id, price, name, address, city, state, zip, country) values (22, 250, 'Meliá White House', 'Albany Street', 'Regents Park London', '', 'NW13UP', 'Great Britain') +insert into Hotel (id, price, name, address, city, state, zip, country) values (23, 210, 'Hotel Allegro', '171 West Randolph Street', 'Chicago', 'IL', '60601', 'USA') \ No newline at end of file diff --git a/booking-portlet-mvc/src/main/resources/log4j.xml b/booking-portlet-mvc/src/main/resources/log4j.xml new file mode 100644 index 0000000..b4e9ad1 --- /dev/null +++ b/booking-portlet-mvc/src/main/resources/log4j.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-portlet-mvc/src/main/webapp/META-INF/MANIFEST.MF b/booking-portlet-mvc/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 0000000..58630c0 --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/classes/log4j.properties b/booking-portlet-mvc/src/main/webapp/WEB-INF/classes/log4j.properties new file mode 100644 index 0000000..0b9061f --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/classes/log4j.properties @@ -0,0 +1,11 @@ +log4j.rootCategory=INFO, stdout + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n + +# Enable web flow logging +log4j.category.org.springframework.webflow=DEBUG +log4j.category.org.springframework.js=DEBUG +log4j.category.org.springframework.binding=DEBUG +log4j.category.org.springframework.transaction=DEBUG \ No newline at end of file diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/config/application-config.xml b/booking-portlet-mvc/src/main/webapp/WEB-INF/config/application-config.xml new file mode 100644 index 0000000..02faf83 --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/config/application-config.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/config/hotelbooking-portlet-config.xml b/booking-portlet-mvc/src/main/webapp/WEB-INF/config/hotelbooking-portlet-config.xml new file mode 100644 index 0000000..f3cc03a --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/config/hotelbooking-portlet-config.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/booking/booking.xml b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/booking/booking.xml new file mode 100644 index 0000000..f7cd26f --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/booking/booking.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.jsp b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.jsp new file mode 100644 index 0000000..51508a9 --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.jsp @@ -0,0 +1,142 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%> +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> + +

Book Hotel

+ + + + + + +
+ + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:${booking.hotel.name}
Address:${booking.hotel.address}
City, State:${booking.hotel.city}, ${booking.hotel.state}
Zip:${booking.hotel.zip}
Country:${booking.hotel.country}
Nightly rate: + ${status.value} +
+ + + + +
+ + + + +
+ + + + + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+   +   +
+
+
diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/booking/messages.properties b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/booking/messages.properties new file mode 100644 index 0000000..3d15709 --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/booking/messages.properties @@ -0,0 +1,16 @@ +booking.checkinDate.NotNull=The check in date is required +booking.checkinDate.Future=The check in date must be in the future +booking.checkinDate.beforeToday=The check in date must be a future date +booking.checkinDate.typeMismatch=The check in date must be in the format mm-dd-yyyy + +booking.checkoutDate.Future=The check out date must be in the future +booking.checkoutDate.NotNull=The check out date is required +booking.checkoutDate.typeMismatch=The check out date must be in the format mm-dd-yyyy +booking.BookingDateRange=The check out date must be later than the check in date + +booking.creditCard.NotEmpty=The credit card must be a valid 16 digit number +booking.creditCardName.NotEmpty=The name on the credit card is required + +NotEmpty=The {0} field is required +NotNull=The {0} field is required +Future=The {0} date must be in the future \ No newline at end of file diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/booking/reviewBooking.jsp b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/booking/reviewBooking.jsp new file mode 100644 index 0000000..d95fbaa --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/booking/reviewBooking.jsp @@ -0,0 +1,65 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%> +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> + +

Confirm Hotel Booking

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:${booking.hotel.name}
Address:${booking.hotel.address}
City, State:${booking.hotel.city}, ${booking.hotel.state}
Zip:${booking.hotel.zip}
Country:${booking.hotel.country}
Total payment: + ${status.value} +
Check In Date: + ${status.value} +
Check Out Date: + ${status.value} +
Credit Card #:${booking.creditCard}
+   +   +   +
+
+
diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.jsp b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.jsp new file mode 100644 index 0000000..84bc87a --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.jsp @@ -0,0 +1,64 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> + + + + + +

Search Hotels

+ + + +
+ + + + + + + + + +
+
+ +

Current Hotel Bookings

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAddressCity, StateCheck in DateCheck out DateConfirmation NumberAction
${booking.hotel.name}${booking.hotel.address}${booking.hotel.city}, ${booking.hotel.state}${booking.checkinDate}${booking.checkoutDate}${booking.id} + + + + + + Cancel +
No booking history
diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/main/main.xml b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/main/main.xml new file mode 100644 index 0000000..fbd0607 --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/main/main.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/main/reviewHotel.jsp b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/main/reviewHotel.jsp new file mode 100644 index 0000000..a617049 --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/main/reviewHotel.jsp @@ -0,0 +1,53 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%> +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> + +

View Hotel

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:${hotel.name}
Address:${hotel.address}
City:${hotel.city}
State:${hotel.state}
Zip:${hotel.zip}
Country:${hotel.country}
Nightly rate: + ${status.value} +
+   +   +
+
+
diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/main/reviewHotels.jsp b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/main/reviewHotels.jsp new file mode 100644 index 0000000..b760e99 --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/main/reviewHotels.jsp @@ -0,0 +1,63 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> + +

Hotel Results

+ + + + + +Change Search + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAddressCity, StateZipAction
${hotel.name}${hotel.address}${hotel.city}, ${hotel.state}, ${hotel.country}${hotel.zip} + + + + + + View Hotel +
No hotels found
+ + + + + + + Previous Results + + + + + + + More Results + + diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/view/intro.jsp b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/view/intro.jsp new file mode 100644 index 0000000..1fe0053 --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/view/intro.jsp @@ -0,0 +1,28 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%> + +

Welcome to Spring Travel

+

+ This reference application shows how to use Spring MVC and Web Flow together with JavaServerPages (JSP) in a portlet. +

+

+ The key features illustrated in this sample include: +

+
    +
  • A declarative navigation model enabling full browser button support and dynamic navigation rules
  • +
  • A fine-grained state management model, including support for ConversationScope and ViewScope
  • +
  • Managed persistence contexts with the Java Persistence API (JPA)
  • +
  • Unified Expression Language (EL) integration
  • +
  • Declarative page authoring with JSP, JSTL, and Spring MVC's form tag library +
  • Exception handling support across all layers of the application
  • +
  • Spring IDE tooling integration, with support for graphical flow modeling and visualization
  • +
+

+ + + + + + Start your Spring Travel experience + +

diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/view/view.xml b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/view/view.xml new file mode 100644 index 0000000..71d0044 --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/flows/view/view.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/portlet.xml b/booking-portlet-mvc/src/main/webapp/WEB-INF/portlet.xml new file mode 100644 index 0000000..c3fcc9f --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/portlet.xml @@ -0,0 +1,40 @@ + + + + + swf-booking-mvc + Spring Webflow Booking MVC + + + org.springframework.web.portlet.DispatcherPortlet + + + + contextConfigLocation + + /WEB-INF/config/hotelbooking-portlet-config.xml + + + + + viewRendererUrl + /WEB-INF/servlet/view + + + 0 + + + text/html + view + + + + Spring Webflow Booking MVC + + + + + \ No newline at end of file diff --git a/booking-portlet-mvc/src/main/webapp/WEB-INF/web.xml b/booking-portlet-mvc/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..2c90854 --- /dev/null +++ b/booking-portlet-mvc/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,54 @@ + + + + + + contextConfigLocation + + /WEB-INF/config/application-config.xml + + + + + + org.springframework.web.context.ContextLoaderListener + + + + + ViewRendererServlet + org.springframework.web.servlet.ViewRendererServlet + + + + ViewRendererServlet + /WEB-INF/servlet/view + + + + + swf-booking-mvc + org.apache.pluto.container.driver.PortletServlet + + portlet-name + swf-booking-mvc + + 1 + + + + swf-booking-mvc + /PlutoInvoker/swf-booking-mvc + + + \ No newline at end of file diff --git a/booking-portlet-mvc/src/test/java/.gitignore b/booking-portlet-mvc/src/test/java/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/booking-portlet-mvc/src/test/resources/log4j.properties b/booking-portlet-mvc/src/test/resources/log4j.properties new file mode 100644 index 0000000..5ba9222 --- /dev/null +++ b/booking-portlet-mvc/src/test/resources/log4j.properties @@ -0,0 +1,9 @@ +log4j.rootCategory=WARN, stdout + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n + +# Enable web flow logging +log4j.category.org.springframework.webflow=DEBUG +log4j.category.org.springframework.binding=DEBUG \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..6efbe04 --- /dev/null +++ b/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + org.springframework.webflow + spring-webflow-samples + pom + Spring Web Flow Samples + 1.0.0.BUILD-SNAPSHOT + + booking-mvc + booking-faces + booking-portlet-mvc + booking-portlet-faces + jsf-booking + +