com.konakartadmin.bl
Class AdminBookableProductMgr

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
      extended by com.konakartadmin.bl.AdminBookableProductMgr
All Implemented Interfaces:
AdminBookableProductMgrIf

public class AdminBookableProductMgr
extends AdminBaseMgr
implements AdminBookableProductMgrIf

The AdminBookableProductMgr - for Managing bookable products


Nested Class Summary
 
Nested classes/interfaces inherited from class com.konakartadmin.bl.AdminBaseMgr
AdminBaseMgr.StaticData
 
Field Summary
protected static org.apache.commons.logging.Log log
          the log
 
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
 
Constructor Summary
AdminBookableProductMgr(KKAdminIf eng)
          Constructor
 
Method Summary
protected  void addBookingOrderBy(com.konakart.bl.KKCriteria c, AdminBookingSearch search)
          Add the order by constraints
protected  int addBookingSearchCriteria(com.konakart.bl.KKCriteria c, AdminBookingSearch search, AdminBookableProductOptions options)
          Add the search criteria
 void deleteBookableProduct(int productId)
          Delete the bookable Product
 void deleteBooking(int bookingId, AdminBookableProductOptions options)
          Delete the booking
 AdminBookableProduct getBookableProduct(int productId)
          Gets a Bookable Product object for a product id
 AdminBooking getBooking(int bookingId, AdminBookableProductOptions options)
          Return a booking by Id
protected  int getBookingCount(AdminBookingSearch search, AdminBookableProductOptions options)
          Get the number of bookings
 int getBookingQty(int bookingId, AdminBookableProductOptions options)
          Return a booking by Id
 AdminBookingSearchResult getBookings(AdminBookingSearch search, int offset, int size, AdminBookableProductOptions options)
          Method used to search for bookings.
 void insertBookableProduct(AdminBookableProduct bProd)
          Inserts a BookableProduct object into the database.
 void insertBookableProduct(AdminBookableProduct bProd, java.sql.Connection con, com.konakart.bl.KKCriteria insertC)
          Inserts a BookableProduct object into the database.
 int insertBooking(AdminBooking booking, AdminBookableProductOptions options)
          Inserts a Booking object into the database.
protected  void setBookableProductCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
          Set the standard attributes
protected  void setBookingCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
          Set the standard attributes
protected  void setBookingInsertCriteriaWithStandardAttributes(AdminBookableProduct bProd, com.konakart.bl.KKCriteria insertC)
          Method that avoids duplication of code
protected  void setBookingUpdateCriteriaWithStandardAttributes(AdminBookableProduct bProd, com.konakart.bl.KKCriteria selectC, com.konakart.bl.KKCriteria updateC)
          Method that avoids duplication of code
 void updateBookableProduct(AdminBookableProduct bProd)
          This method is use to edit an existing bookable product.
 void updateBookableProduct(AdminBookableProduct bProd, java.sql.Connection con, com.konakart.bl.KKCriteria selectC, com.konakart.bl.KKCriteria updateC)
          This method is use to edit an existing bookable product.
 void updateBooking(AdminBooking booking, AdminBookableProductOptions options)
          This method is used to edit an existing booking.
protected  void updateBookingCount(int productId, AdminBookableProductOptions options)
          Update the number of bookings present
protected  void validateBookableProduct(AdminBookableProduct bProd, boolean checkProd)
          Validate the bookable product
protected  void validateBooking(AdminBooking booking, int bookingQtyChange, AdminBookableProductOptions options)
          Validate the booking
 
Methods inherited from class com.konakartadmin.bl.AdminBaseMgr
addInsertAttr, addInsertAttr, checkIntIsSet, checkRequired, getAdminAddressMgr, getAdminAuditMgr, getAdminBillingMgr, getAdminBookableProductMgr, getAdminCatMgr, getAdminConfigMgr, getAdminCurrMgr, getAdminCustMgr, getAdminCustTagMgr, getAdminEmailMgr, getAdminEng, getAdminHtmlMgr, getAdminLanguageMgr, getAdminManuMgr, getAdminMessageMgr, getAdminMiscItemMgr, getAdminModulesMgr, getAdminMultiStoreMgr, getAdminOrderMgr, getAdminPdfMgr, getAdminProdAttrMgr, getAdminProdMgr, getAdminPromMgr, getAdminPublishProdMgr, getAdminReviewMgr, getAdminSearchRuleMgr, getAdminSecMgr, getAdminSolrMgr, getAdminStoreMgr, getAdminTagMgr, getAdminTaxMgr, getAdminValidationMgr, getAdminVelocityContextMgr, getAdminWishListMgr, getBooleanFromString, getExportXMLData, getIntFromString, getKkConfig, getKkInstanceId, getMode, getModeString, getMqMgr, getNewCriteria, getNewCriteria, getPostSearchText, getPreSearchText, getPropertyValue, getRecordCount, getRewardPointMgr, getSingleIntResult, getStoreId, getTemplate, getTemplateBase, getXml_io, init, isConfigSet, isEnterprise, isMultiStoreLanguagesShared, isMultiStoreMode, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareProducts, isMultiStoreSingleDBCSMode, isMultiStoreSingleDBMode, isMultiStoreSingleDBNonCSMode, manageException, refreshConfigs, removeCData, setAdminEng, setupWildCardRules, setWildCardAfter, setWildCardBefore, shutdownGracefully, shutdownGracefully, timestampStr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log

Constructor Detail

AdminBookableProductMgr

public AdminBookableProductMgr(KKAdminIf eng)
                        throws java.lang.Exception
Constructor

Parameters:
eng -
Throws:
java.lang.Exception
Method Detail

insertBookableProduct

public void insertBookableProduct(AdminBookableProduct bProd)
                           throws java.lang.Exception
Inserts a BookableProduct object into the database. The object must have a start date and end date and it must be associated with an existing product through the product id attribute.

Specified by:
insertBookableProduct in interface AdminBookableProductMgrIf
Parameters:
bProd - A bookable product object
Throws:
java.lang.Exception

insertBookableProduct

public void insertBookableProduct(AdminBookableProduct bProd,
                                  java.sql.Connection con,
                                  com.konakart.bl.KKCriteria insertC)
                           throws java.lang.Exception
Inserts a BookableProduct object into the database. The object must have a start date and end date and it must be associated with an existing product through the product id attribute. Parameters are passed so that it may be used within a transaction.

Specified by:
insertBookableProduct in interface AdminBookableProductMgrIf
Parameters:
bProd - A bookable product object
con - Database connection
insertC - Criteria object
Throws:
java.lang.Exception

setBookingInsertCriteriaWithStandardAttributes

protected void setBookingInsertCriteriaWithStandardAttributes(AdminBookableProduct bProd,
                                                              com.konakart.bl.KKCriteria insertC)
Method that avoids duplication of code

Parameters:
bProd -
insertC -

updateBookableProduct

public void updateBookableProduct(AdminBookableProduct bProd)
                           throws java.lang.Exception
This method is use to edit an existing bookable product. Attributes will null values will not be modified. The productId attribute of the bookable product must refer to an existing product. If the BookableProduct object doesn't exist, it is inserted.

Specified by:
updateBookableProduct in interface AdminBookableProductMgrIf
Parameters:
bProd - A bookable product object
Throws:
java.lang.Exception

updateBookableProduct

public void updateBookableProduct(AdminBookableProduct bProd,
                                  java.sql.Connection con,
                                  com.konakart.bl.KKCriteria selectC,
                                  com.konakart.bl.KKCriteria updateC)
                           throws java.lang.Exception
This method is use to edit an existing bookable product. Attributes will null values will not be modified. The productId attribute of the bookable product must refer to an existing product. If the BookableProduct object doesn't exist, it is inserted. Parameters are passed so that it may be used within a transaction.

Specified by:
updateBookableProduct in interface AdminBookableProductMgrIf
Parameters:
bProd - A bookable product object
con - Database connection
selectC - Criteria object
updateC - Criteria object
Throws:
java.lang.Exception

setBookingUpdateCriteriaWithStandardAttributes

protected void setBookingUpdateCriteriaWithStandardAttributes(AdminBookableProduct bProd,
                                                              com.konakart.bl.KKCriteria selectC,
                                                              com.konakart.bl.KKCriteria updateC)
Method that avoids duplication of code

Parameters:
bProd -
selectC -
updateC -

getBookableProduct

public AdminBookableProduct getBookableProduct(int productId)
                                        throws com.workingdogs.village.DataSetException,
                                               org.apache.torque.TorqueException,
                                               KKAdminException
Gets a Bookable Product object for a product id

Specified by:
getBookableProduct in interface AdminBookableProductMgrIf
Parameters:
productId -
Returns:
Returns a Bookable Product object
Throws:
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException

setBookableProductCriteriaWithStandardAttributes

protected void setBookableProductCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
Set the standard attributes

Parameters:
c -

validateBookableProduct

protected void validateBookableProduct(AdminBookableProduct bProd,
                                       boolean checkProd)
                                throws java.lang.Exception
Validate the bookable product

Parameters:
bProd -
checkProd - Check to see whether product exists
Throws:
java.lang.Exception

insertBooking

public int insertBooking(AdminBooking booking,
                         AdminBookableProductOptions options)
                  throws KKAdminException,
                         org.apache.torque.TorqueException,
                         com.workingdogs.village.DataSetException
Inserts a Booking object into the database. The object must be associated with an existing product through the product id attribute.

Specified by:
insertBooking in interface AdminBookableProductMgrIf
Parameters:
booking - A booking object
options - AdminBookableProduct options
Returns:
Returns the id of the inserted object
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

updateBookingCount

protected void updateBookingCount(int productId,
                                  AdminBookableProductOptions options)
                           throws KKAdminException,
                                  org.apache.torque.TorqueException,
                                  com.workingdogs.village.DataSetException
Update the number of bookings present

Parameters:
productId -
options -
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

updateBooking

public void updateBooking(AdminBooking booking,
                          AdminBookableProductOptions options)
                   throws java.lang.Exception
This method is used to edit an existing booking. Attributes will null values will not be modified. The ProductId attribute of the booking must refer to an existing product.

Specified by:
updateBooking in interface AdminBookableProductMgrIf
Parameters:
booking - A booking object
options - AdminBookableProduct options
Throws:
java.lang.Exception

validateBooking

protected void validateBooking(AdminBooking booking,
                               int bookingQtyChange,
                               AdminBookableProductOptions options)
                        throws KKAdminException,
                               org.apache.torque.TorqueException,
                               com.workingdogs.village.DataSetException
Validate the booking

Parameters:
booking -
bookingQtyChange - an integer that holds the change to the booking qty on the bookable product prior to the insert, update or delete of the specified booking. For inserts this number will be greater than or equal to 0, for updates it could be any value, and deletes it will be less than or equal to zero
options - AdminBookableProduct options
Throws:
KKAdminException
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException

deleteBooking

public void deleteBooking(int bookingId,
                          AdminBookableProductOptions options)
                   throws java.lang.Exception
Delete the booking

Specified by:
deleteBooking in interface AdminBookableProductMgrIf
Parameters:
bookingId -
options - AdminBookableProduct options
Throws:
java.lang.Exception

deleteBookableProduct

public void deleteBookableProduct(int productId)
                           throws org.apache.torque.TorqueException,
                                  KKAdminException
Delete the bookable Product

Specified by:
deleteBookableProduct in interface AdminBookableProductMgrIf
Parameters:
productId -
Throws:
org.apache.torque.TorqueException
KKAdminException

getBooking

public AdminBooking getBooking(int bookingId,
                               AdminBookableProductOptions options)
                        throws org.apache.torque.TorqueException,
                               com.workingdogs.village.DataSetException,
                               KKAdminException
Return a booking by Id

Specified by:
getBooking in interface AdminBookableProductMgrIf
Parameters:
bookingId -
options - AdminBookableProduct options
Returns:
Returns a booking
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getBookingQty

public int getBookingQty(int bookingId,
                         AdminBookableProductOptions options)
                  throws org.apache.torque.TorqueException,
                         com.workingdogs.village.DataSetException,
                         KKAdminException
Return a booking by Id

Parameters:
bookingId - the booking Id
options - AdminBookableProductOptions
Returns:
Returns the Quantity attribute for the specified booking
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getBookings

public AdminBookingSearchResult getBookings(AdminBookingSearch search,
                                            int offset,
                                            int size,
                                            AdminBookableProductOptions options)
                                     throws org.apache.torque.TorqueException,
                                            com.workingdogs.village.DataSetException,
                                            KKAdminException
Method used to search for bookings.

Specified by:
getBookings in interface AdminBookableProductMgrIf
Parameters:
search -
offset -
size -
options - AdminBookableProduct options
Returns:
Returns an array of bookings
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getBookingCount

protected int getBookingCount(AdminBookingSearch search,
                              AdminBookableProductOptions options)
                       throws org.apache.torque.TorqueException,
                              com.workingdogs.village.DataSetException,
                              KKAdminException
Get the number of bookings

Parameters:
search -
options -
Returns:
the number of bookings with the specified search criteria
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

setBookingCriteriaWithStandardAttributes

protected void setBookingCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
Set the standard attributes

Parameters:
c -

addBookingSearchCriteria

protected int addBookingSearchCriteria(com.konakart.bl.KKCriteria c,
                                       AdminBookingSearch search,
                                       AdminBookableProductOptions options)
Add the search criteria

Parameters:
c -
search -
options -
Returns:
the number of constraints added

addBookingOrderBy

protected void addBookingOrderBy(com.konakart.bl.KKCriteria c,
                                 AdminBookingSearch search)
Add the order by constraints

Parameters:
c -
search -


Copyright © 2011 DS Data Systems UK Ltd.