|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.konakart.bl.BaseMgr
com.konakart.bl.BookableProductMgr
public class BookableProductMgr
The manager for bookable products
| Nested Class Summary | |
|---|---|
protected class |
BookableProductMgr.TimeSlot
protected class used to store a start and end time |
| Field Summary | |
|---|---|
protected static int |
LIMIT
|
protected static org.apache.commons.logging.Log |
log
the log |
| Fields inherited from class com.konakart.bl.BaseMgr |
|---|
templateBaseDir |
| Constructor Summary | |
|---|---|
BookableProductMgr(KKEngIf eng)
Constructor |
|
| Method Summary | |
|---|---|
protected boolean |
doTimeSlotsOverlap(BookableProductMgr.TimeSlot ts1,
BookableProductMgr.TimeSlot ts2)
Returns true if the two time slots overlap |
BookableProductIf |
getBookableProduct(int productId,
BookableProductOptionsIf options)
Gets a Bookable Product object for a product id |
Product[] |
getBookableProductConflict(java.lang.String sessionId,
ProductIf bookableProd,
BookableProductOptionsIf options)
This method checks to see whether the bookable product passed in as a parameter conflicts with any bookable products that the customer identified by the sessionId has already signed up for. If no conflicts are found, null is returned. |
protected Bookings |
getBookingsPerCustomer(int customerId,
DataDescriptorIf dataDesc)
Get an array of bookings for a logged in customer. |
Bookings |
getBookingsPerCustomer(java.lang.String sessionId,
DataDescriptorIf dataDesc,
BookableProductOptionsIf options)
Get an array of bookings for a logged in customer. |
Bookings |
getBookingsPerProduct(DataDescriptorIf dataDesc,
int productId,
BookableProductOptionsIf options)
Get an array of bookings for a product. |
protected int |
getCount(org.apache.torque.util.Criteria c)
This method is mainly used for paging. |
protected int |
getTimeInMins(java.lang.String timeStr)
Calculates a time in minutes from a time representation in the format 00:13 or 12:45 etc. |
protected java.util.ArrayList<BookableProductMgr.TimeSlot> |
getTimeSlots(java.lang.String times)
Returns an array of times slots from times encoded in a string in the format 10:45;11:30 15:00;16:00 where the delimiter between start and end is ";" and between times is a space |
protected java.util.ArrayList<BookableProductMgr.TimeSlot>[] |
getWeeklySchedule(ProductIf bookableProd)
Returns an array 7 elements long where each element is for a day of the week. |
int |
insertBooking(BookingIf booking,
BookableProductOptionsIf options)
Inserts a Booking object into the database. |
int |
insertBooking(java.lang.String sessionId,
BookingIf booking,
BookableProductOptionsIf options)
Inserts a Booking object into the database. |
protected void |
manageDataDescriptor(DataDescriptorIf dataDesc,
org.apache.torque.util.Criteria c)
Add constraints and order by criteria |
protected void |
setBookableProductCriteriaWithStandardAttributes(KKCriteria c)
Set the standard attributes |
protected void |
setBookingCriteriaWithStandardAttributes(KKCriteria c)
Set the standard attributes |
protected void |
validateBooking(BookingIf booking,
BookableProductOptionsIf options)
Validate the booking |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.commons.logging.Log log
protected static final int LIMIT
| Constructor Detail |
|---|
public BookableProductMgr(KKEngIf eng)
throws java.lang.Exception
eng -
java.lang.Exception| Method Detail |
|---|
public Bookings getBookingsPerProduct(DataDescriptorIf dataDesc,
int productId,
BookableProductOptionsIf options)
throws com.workingdogs.village.DataSetException,
org.apache.torque.TorqueException,
KKException
getBookingsPerProduct in interface BookableProductMgrIfdataDesc - productId - options - Not used at the moment. May be left null.
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKException
public Bookings getBookingsPerCustomer(java.lang.String sessionId,
DataDescriptorIf dataDesc,
BookableProductOptionsIf options)
throws java.lang.Exception
getBookingsPerCustomer in interface BookableProductMgrIfdataDesc - sessionId - options - Not used at the moment. May be left null.
java.lang.Exception
protected Bookings getBookingsPerCustomer(int customerId,
DataDescriptorIf dataDesc)
throws java.lang.Exception
dataDesc - customerId -
java.lang.Exceptionprotected void setBookingCriteriaWithStandardAttributes(KKCriteria c)
c -
protected void manageDataDescriptor(DataDescriptorIf dataDesc,
org.apache.torque.util.Criteria c)
dataDesc - c -
protected int getCount(org.apache.torque.util.Criteria c)
throws org.apache.torque.TorqueException,
com.workingdogs.village.DataSetException
c -
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
public int insertBooking(BookingIf booking,
BookableProductOptionsIf options)
throws java.lang.Exception
insertBooking in interface BookableProductMgrIfbooking - A booking objectoptions - Options allowing an exception to be thrown for exceeding the maximum number of
bookings
java.lang.Exception
public int insertBooking(java.lang.String sessionId,
BookingIf booking,
BookableProductOptionsIf options)
throws java.lang.Exception
insertBooking in interface BookableProductMgrIfsessionId - booking - A booking objectoptions - Options allowing an exception to be thrown for exceeding the maximum number of
bookings
java.lang.Exception
protected void validateBooking(BookingIf booking,
BookableProductOptionsIf options)
throws java.lang.Exception
booking - options -
java.lang.Exception
public BookableProductIf getBookableProduct(int productId,
BookableProductOptionsIf options)
throws com.workingdogs.village.DataSetException,
org.apache.torque.TorqueException,
KKException
getBookableProduct in interface BookableProductMgrIfproductId - options - Not used at the moment. May be left null.
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKExceptionprotected void setBookableProductCriteriaWithStandardAttributes(KKCriteria c)
c -
public Product[] getBookableProductConflict(java.lang.String sessionId,
ProductIf bookableProd,
BookableProductOptionsIf options)
throws java.lang.Exception
getBookableProductConflict in interface BookableProductMgrIfsessionId - bookableProd - options - Not used at the moment. May be left null.
java.lang.Exception
protected boolean doTimeSlotsOverlap(BookableProductMgr.TimeSlot ts1,
BookableProductMgr.TimeSlot ts2)
ts1 - ts2 -
protected java.util.ArrayList<BookableProductMgr.TimeSlot>[] getWeeklySchedule(ProductIf bookableProd)
throws KKException
bookableProd -
KKException
protected java.util.ArrayList<BookableProductMgr.TimeSlot> getTimeSlots(java.lang.String times)
throws KKException
times -
KKException
protected int getTimeInMins(java.lang.String timeStr)
throws KKException
timeStr -
KKException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||