[jboss-cvs] JBossAS SVN: r97892 - in projects/snowdrop/examples/trunk/sportsclub/sportsclub-reservations-web: src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Dec 16 08:24:07 EST 2009
Author: lvlcek at redhat.com
Date: 2009-12-16 08:24:07 -0500 (Wed, 16 Dec 2009)
New Revision: 97892
Added:
projects/snowdrop/examples/trunk/sportsclub/sportsclub-reservations-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/ReservationCreate.java
Modified:
projects/snowdrop/examples/trunk/sportsclub/sportsclub-reservations-web/pom.xml
projects/snowdrop/examples/trunk/sportsclub/sportsclub-reservations-web/src/main/webapp/WEB-INF/spring-beans.xml
Log:
fixed missing javax.persistence.* dependency
Modified: projects/snowdrop/examples/trunk/sportsclub/sportsclub-reservations-web/pom.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-reservations-web/pom.xml 2009-12-16 13:00:03 UTC (rev 97891)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-reservations-web/pom.xml 2009-12-16 13:24:07 UTC (rev 97892)
@@ -48,6 +48,12 @@
<artifactId>spring</artifactId>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>ejb3-persistence</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>javax.faces</groupId>
Added: projects/snowdrop/examples/trunk/sportsclub/sportsclub-reservations-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/ReservationCreate.java
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-reservations-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/ReservationCreate.java (rev 0)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-reservations-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/ReservationCreate.java 2009-12-16 13:24:07 UTC (rev 97892)
@@ -0,0 +1,65 @@
+package org.jboss.snowdrop.samples.sportsclub.jsf.beans;
+
+import org.jboss.snowdrop.samples.sportsclub.service.ReservationService;
+import org.jboss.snowdrop.samples.sportsclub.domain.entity.Reservation;
+import org.jboss.snowdrop.samples.sportsclub.domain.entity.Account;
+import org.jboss.snowdrop.samples.sportsclub.domain.entity.Equipment;
+
+import java.util.Date;
+import java.util.Calendar;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:lvlcek at redhat.com">Lukas Vlcek</a>
+ */
+public class ReservationCreate
+{
+ private ReservationService reservationService;
+
+ private Reservation reservation;
+
+ public void init()
+ {
+ Date from;
+ Date to;
+
+ Calendar cal = Calendar.getInstance(Locale.US);
+ cal.clear();
+ from = cal.getTime();
+
+ cal.set(Calendar.MONTH, cal.get(Calendar.MONTH) + 1);
+ to = cal.getTime();
+
+ reservation = new Reservation();
+ reservation.setAccount(new Account());
+ reservation.setEquipment(new Equipment());
+ reservation.setFrom(from);
+ reservation.setTo(to);
+ }
+
+ public String create()
+ {
+ reservationService.create();
+ return "success";
+ }
+
+ public ReservationService getReservationService()
+ {
+ return reservationService;
+ }
+
+ public void setReservationService(ReservationService reservationService)
+ {
+ this.reservationService = reservationService;
+ }
+
+ public Reservation getReservation()
+ {
+ return reservation;
+ }
+
+ public void setReservation(Reservation reservation)
+ {
+ this.reservation = reservation;
+ }
+}
Modified: projects/snowdrop/examples/trunk/sportsclub/sportsclub-reservations-web/src/main/webapp/WEB-INF/spring-beans.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-reservations-web/src/main/webapp/WEB-INF/spring-beans.xml 2009-12-16 13:00:03 UTC (rev 97891)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-reservations-web/src/main/webapp/WEB-INF/spring-beans.xml 2009-12-16 13:24:07 UTC (rev 97892)
@@ -17,9 +17,9 @@
<property name="reservationSearchOptions" ref="reservationSearchOptions"/>
</bean>
- <!--<bean id="reservationCreate" class="org.jboss.snowdrop.samples.sportsclub.jsf.beans.ReservationCreate" scope="request" init-method="init">-->
- <!--<property name="reservationService" ref="reservationService"/>-->
- <!--</bean>-->
+ <bean id="reservationCreate" class="org.jboss.snowdrop.samples.sportsclub.jsf.beans.ReservationCreate" scope="request" init-method="init">
+ <property name="reservationService" ref="reservationService"/>
+ </bean>
<!-- Keeps search table state in the session -->
<bean id="reservationSearchTableState" class="org.jboss.snowdrop.samples.sportsclub.jsf.beans.ReservationTableState" scope="session"/>
More information about the jboss-cvs-commits
mailing list