public class WishListMgr extends BaseMgr implements WishListMgrIf
Modifier and Type | Class and Description |
---|---|
class |
WishListMgr.WishListAndCriteria
Used internally to return data from a method
|
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log
the log
|
templateBaseDir
Constructor and Description |
---|
WishListMgr(KKEngIf eng)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
addToWishList(java.lang.String sessionId,
WishListItemIf wishListItem)
Add a WishListItem object to the wish list referenced by wishListId.
|
int |
addToWishListWithOptions(java.lang.String sessionId,
WishListItemIf wishListItem,
AddToWishListOptionsIf options)
Add a WishListItem object to the wish list referenced by wishListId.
|
protected void |
checkWishListItemOptions(WishListItem wli)
We may have the case where the wish list item object has an array of options that only have
the id and value id set.
|
protected FetchProductOptionsIf |
createFetchProductOptions(AddToWishListOptionsIf options)
Creates a FetchProductOptions object from an AddToWishListOptions
|
int |
createWishList(java.lang.String sessionId,
WishListIf wishList)
Create a wish list from a WishList object.
|
int |
createWishListWithOptions(java.lang.String sessionId,
WishListIf wishList,
AddToWishListOptionsIf options)
Create a wish list from a WishList object.
|
void |
deleteWishList(java.lang.String sessionId,
int wishListId)
The wish list referenced by wishListId and all of the items contained by the wish list, will
be deleted.
|
void |
deleteWishListWithOptions(java.lang.String sessionId,
int wishListId,
AddToWishListOptionsIf options)
The wish list referenced by wishListId and all of the items contained by the wish list, will
be deleted.
|
void |
editWishList(java.lang.String sessionId,
WishListIf wishList)
Edit an existing wish list object.
|
void |
editWishListWithOptions(java.lang.String sessionId,
WishListIf wishList,
AddToWishListOptionsIf options)
Edit an existing wish list object.
|
protected int |
getCount(KKCriteria c)
This method is mainly used for paging.
|
protected int |
getCustomerId(java.lang.String sessionId,
int customerId)
If the sessionId is null, we check the customerId to ensure that it is negative.
|
WishList |
getWishList(int wishListId)
Get a wish list object for its id.
|
WishList |
getWishList(java.lang.String sessionId,
int wishListId)
Get a wish list object for its id.
|
protected WishListItem |
getWishListItem(int wishListItemId)
Get a wish list item object for its id.
|
protected WishListItem |
getWishListItemPerEncodedProductAndWishList(int wishListId,
java.lang.String encodedProduct)
This is used to see if a product that we are adding to the wish list already exists in it
|
WishListItems |
getWishListItems(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int wishListId,
int languageId)
Returns a WishListItems object containing an array of items and the number of items returned.
|
WishListItems |
getWishListItemsWithOptions(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int wishListId,
int languageId,
AddToWishListOptionsIf options)
Returns a WishListItems object containing an array of items and the number of items returned.
|
WishList |
getWishListWithItems(java.lang.String sessionId,
int wishListId,
int languageId)
Returns a fully populated WishList object that may contain an array of WishListItem objects.
|
WishList |
getWishListWithItemsWithOptions(java.lang.String sessionId,
int wishListId,
int languageId,
AddToWishListOptionsIf options)
Returns a fully populated WishList object that may contain an array of WishListItem objects.
|
protected WishListMgr.WishListAndCriteria |
getWishListWithItemsWithOptionsPrivate(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int wishListId,
int languageId,
AddToWishListOptionsIf options)
Protected method to get wish list items for all cases
|
WishList |
getWishListWithOptions(java.lang.String sessionId,
int wishListId,
AddToWishListOptionsIf options)
Get a wish list object for its id.
|
protected boolean |
isEnhancedVariantHandlingModeEnabled()
Check in the configuration if enhanced variant handling mode is enabled.
|
protected void |
manageDataDescriptor(DataDescriptorIf dataDesc,
KKCriteria c)
Provides common code to deal with the management of the DataDescriptor
|
void |
mergeWishListsWithOptions(java.lang.String sessionId,
int customerFromId,
int languageId,
AddToWishListOptionsIf wishListOptions)
Add all items from the wish list of customerFrom to the wish list of customerTo which is
retrieved from the sessionId.
|
protected void |
populateOptsForWishListItem(WishListItem item,
int priceId,
int languageId,
AddToWishListOptionsIf a2wOptions)
The kk_wishlist_item table contains a products_id field which is encoded like this :
1{4}3{3}6 which means product of id==1 with product_options of id==4 and
product_options_values of id==3 followed by product_options of id==3 and
product_options_values of id==6.
|
protected void |
populateWishListWithCustomerInfo(WishListIf wishList)
Populates the wish list object with information about the customer so that a customer can
select a public wish list for a particular person.
|
void |
removeFromWishList(java.lang.String sessionId,
int wishListItemId)
Remove the WishListItem object referenced by wishListItemId.
|
void |
removeFromWishListWithOptions(java.lang.String sessionId,
int wishListItemId,
AddToWishListOptionsIf options)
Remove the WishListItem object referenced by wishListItemId.
|
WishLists |
searchForWishLists(java.lang.String sessionId,
DataDescriptorIf dataDescriptor,
CustomerSearchIf customerSearch)
All wish lists matching the search criteria will be returned.
|
protected void |
setWishListCriteriaWithStandardAttributes(KKCriteria c)
Common code to avoid duplication
|
protected void |
setWishListItemCriteriaWithStandardAttributes(KKCriteria c)
Common code to avoid duplication
|
void |
updateWishListItemQuantityBought(int wishListItemId,
int quantityBought)
Updates the wishListItem quantity received attribute by adding quantityBought to the actual
value.
|
acquireLock, addInsertAttr, addInsertAttr, addStringRuleConstraint, addStringRuleConstraint, checkRequired, escapeHTML, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, getAdminEngMgr, getBasketMgr, getBillingMgr, getBookableProductMgr, getCacheMgr, getCatMgr, getConfigMgr, getCookieMgr, getCurrMgr, getCustMgr, getCustomerIdFromSession, getCustomerStatsMgr, getCustomerTagMgr, getEmailMgr, getEng, getEventMgr, getExportMgr, getHTMLEscaper, getKonaKartConfig, getKonaKartConfig, getKonaKartConfig, getLangMgr, getManuMgr, getMiscItemMgr, getMiscPriceMgr, getMode, getModeString, getMqMgr, getMultiStoreMgr, getNewCriteria, getNewCriteria, getOrderIntegrationMgr, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getProductsToCategoresCriteria, getPromMgr, getPunchOutMgr, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getStoreMgr, getStoreTime, getSuggestionMgr, getTaxMgr, getTemplate, getTemplateRoot, getVelocityContextMgr, getWishListMgr, init, insertKKEvent, insertKKEvent, isBusiness, isBusinessOrEnterprise, isClassPresent, isCommunity, isDeadlockException, isEnterprise, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareCustomersOrProducts, isMultiStoreSharedDb, isMultiStoreShareProducts, isMultiVendor, isUnix, manageThrowable, releaseLock, updateStaticVariablesNow
public WishListMgr(KKEngIf eng) throws java.lang.Exception
eng
- the engjava.lang.Exception
- an unexpected exceptionpublic int createWishList(java.lang.String sessionId, WishListIf wishList) throws java.lang.Exception
getWishListWithItems()
can be called to add wish list items to the wish list.
The compulsory attributes for the WishListItem are:
createWishList
in interface WishListMgrIf
sessionId
- the sessionIdwishList
- the wishListjava.lang.Exception
- an unexpected exceptionpublic int createWishListWithOptions(java.lang.String sessionId, WishListIf wishList, AddToWishListOptionsIf options) throws java.lang.Exception
getWishListWithItems()
can be called to add wish list items to the wish list.
This method may be called even when a customer isn't logged in. In this case the
customerId
attribute of the options object must be set to the id of the
temporary customer which is negative. The compulsory attributes for the WishListItem are:
createWishListWithOptions
in interface WishListMgrIf
sessionId
- the sessionIdwishList
- the wishListoptions
- the optionsjava.lang.Exception
- an unexpected exceptionpublic void editWishList(java.lang.String sessionId, WishListIf wishList) throws java.lang.Exception
editWishList
in interface WishListMgrIf
sessionId
- the sessionIdwishList
- the wishListjava.lang.Exception
- an unexpected exceptionpublic void editWishListWithOptions(java.lang.String sessionId, WishListIf wishList, AddToWishListOptionsIf options) throws java.lang.Exception
editWishListWithOptions
in interface WishListMgrIf
sessionId
- The session id of the logged in userwishList
- The wish list to be editedoptions
- the optionsjava.lang.Exception
- an unexpected exceptionpublic int addToWishList(java.lang.String sessionId, WishListItemIf wishListItem) throws java.lang.Exception
addToWishList
in interface WishListMgrIf
sessionId
- the sessionIdwishListItem
- the wishListItemjava.lang.Exception
- an unexpected exceptionpublic int addToWishListWithOptions(java.lang.String sessionId, WishListItemIf wishListItem, AddToWishListOptionsIf options) throws java.lang.Exception
addToWishListWithOptions
in interface WishListMgrIf
sessionId
- the sessionIdwishListItem
- the wishListItemoptions
- the optionsjava.lang.Exception
- an unexpected exceptionpublic void removeFromWishList(java.lang.String sessionId, int wishListItemId) throws java.lang.Exception
removeFromWishList
in interface WishListMgrIf
sessionId
- the sessionIdwishListItemId
- the wishListItemIdjava.lang.Exception
- an unexpected exceptionpublic void removeFromWishListWithOptions(java.lang.String sessionId, int wishListItemId, AddToWishListOptionsIf options) throws java.lang.Exception
removeFromWishListWithOptions
in interface WishListMgrIf
sessionId
- the sessionIdwishListItemId
- the wishListItemIdoptions
- the optionsjava.lang.Exception
- an unexpected exceptionpublic void deleteWishList(java.lang.String sessionId, int wishListId) throws java.lang.Exception
deleteWishList
in interface WishListMgrIf
sessionId
- the sessionIdwishListId
- the wishListIdjava.lang.Exception
- an unexpected exceptionpublic void deleteWishListWithOptions(java.lang.String sessionId, int wishListId, AddToWishListOptionsIf options) throws java.lang.Exception
deleteWishListWithOptions
in interface WishListMgrIf
sessionId
- the sessionIdwishListId
- the wishListIdoptions
- the optionsjava.lang.Exception
- an unexpected exceptionpublic void mergeWishListsWithOptions(java.lang.String sessionId, int customerFromId, int languageId, AddToWishListOptionsIf wishListOptions) throws java.lang.Exception
The currently logged in customer may have more than one wish list. The one used is the first one found of listType == 0.
mergeWishListsWithOptions
in interface WishListMgrIf
sessionId
- the sessionIdcustomerFromId
- the customerFromIdlanguageId
- the languageIdwishListOptions
- the wishListOptionsjava.lang.Exception
- an unexpected exceptionpublic WishLists searchForWishLists(java.lang.String sessionId, DataDescriptorIf dataDescriptor, CustomerSearchIf customerSearch) throws java.lang.Exception
getWishListWithItems()
method, passing it the id of the wish list. This will
also populate the final price attributes of the wish list.searchForWishLists
in interface WishListMgrIf
sessionId
- The session id of the logged in user. It may be null if the user isn't logged in.dataDescriptor
- the dataDescriptorcustomerSearch
- the customerSearchjava.lang.Exception
- an unexpected exceptionprotected int getCount(KKCriteria c) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
c
- the corg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)public WishList getWishListWithItems(java.lang.String sessionId, int wishListId, int languageId) throws java.lang.Exception
product
attribute and populated
opts
attribute if the WishListItem contains options. The items will be ordered
by priority with the highest priority first.getWishListWithItems
in interface WishListMgrIf
sessionId
- The session id of the logged in user. It may be null if the user isn't logged in.wishListId
- the wishListIdlanguageId
- the languageIdjava.lang.Exception
- an unexpected exceptionpublic WishList getWishListWithItemsWithOptions(java.lang.String sessionId, int wishListId, int languageId, AddToWishListOptionsIf options) throws java.lang.Exception
product
attribute and populated
opts
attribute if the WishListItem contains options. The items will be ordered
by priority with the highest priority first.
If options is set to null, this method is identical to getWishListWithItems(). Otherwise the
functionality differs depending on the combination of options set.getWishListWithItemsWithOptions
in interface WishListMgrIf
sessionId
- The session id of the logged in user. It may be null if the user isn't logged in.wishListId
- the wishListIdlanguageId
- the languageIdoptions
- the optionsjava.lang.Exception
- an unexpected exceptionpublic WishListItems getWishListItemsWithOptions(java.lang.String sessionId, DataDescriptorIf dataDesc, int wishListId, int languageId, AddToWishListOptionsIf options) throws java.lang.Exception
dataDesc
, the following functionality may
be controlled :
onlyShowAvailable
attribute of the options object is set, then the wish
list items that have quantity received equal to quantity desired, are not returned.getWishListItemsWithOptions
in interface WishListMgrIf
sessionId
- The session id of the logged in user. It may be null if the user isn't logged in.dataDesc
- the dataDescwishListId
- the wishListIdlanguageId
- the languageIdoptions
- the optionsjava.lang.Exception
- an unexpected exceptionpublic WishListItems getWishListItems(java.lang.String sessionId, DataDescriptorIf dataDesc, int wishListId, int languageId) throws java.lang.Exception
dataDesc
, the following functionality may
be controlled :
getWishListItems
in interface WishListMgrIf
sessionId
- The session id of the logged in user. It may be null if the user isn't logged in.dataDesc
- the dataDescwishListId
- the wishListIdlanguageId
- the languageIdjava.lang.Exception
- an unexpected exceptionprotected WishListMgr.WishListAndCriteria getWishListWithItemsWithOptionsPrivate(java.lang.String sessionId, DataDescriptorIf dataDesc, int wishListId, int languageId, AddToWishListOptionsIf options) throws java.lang.Exception
sessionId
- the sessionIddataDesc
- the dataDescwishListId
- the wishListIdlanguageId
- the languageIdoptions
- the optionsjava.lang.Exception
- an unexpected exceptionprotected void checkWishListItemOptions(WishListItem wli) throws java.lang.Exception
wli
- the wlijava.lang.Exception
- an unexpected exceptionprotected WishListItem getWishListItemPerEncodedProductAndWishList(int wishListId, java.lang.String encodedProduct) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
wishListId
- the wishListIdencodedProduct
- the encodedProductorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)public WishList getWishList(java.lang.String sessionId, int wishListId) throws java.lang.Exception
getWishList
in interface WishListMgrIf
sessionId
- the sessionIdwishListId
- the wishListIdjava.lang.Exception
- an unexpected exceptionpublic WishList getWishListWithOptions(java.lang.String sessionId, int wishListId, AddToWishListOptionsIf options) throws java.lang.Exception
getWishListWithOptions
in interface WishListMgrIf
sessionId
- the sessionIdwishListId
- the wishListIdoptions
- the optionsjava.lang.Exception
- an unexpected exceptionpublic WishList getWishList(int wishListId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
getWishList
in interface WishListMgrIf
wishListId
- the wishListIdorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)protected void populateWishListWithCustomerInfo(WishListIf wishList) throws java.lang.Exception
wishList
- the wishListjava.lang.Exception
- an unexpected exceptionprotected WishListItem getWishListItem(int wishListItemId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
wishListItemId
- the wishListItemIdorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)protected void setWishListCriteriaWithStandardAttributes(KKCriteria c)
c
- the cprotected void setWishListItemCriteriaWithStandardAttributes(KKCriteria c)
c
- the cprotected void populateOptsForWishListItem(WishListItem item, int priceId, int languageId, AddToWishListOptionsIf a2wOptions) throws java.lang.Exception
item
- the itempriceId
- the priceIdlanguageId
- the languageIda2wOptions
- the a2wOptionsjava.lang.Exception
- an unexpected exceptionprotected FetchProductOptionsIf createFetchProductOptions(AddToWishListOptionsIf options)
options
- the optionspublic void updateWishListItemQuantityBought(int wishListItemId, int quantityBought) throws java.lang.Exception
updateWishListItemQuantityBought
in interface WishListMgrIf
wishListItemId
- the wishListItemIdquantityBought
- the quantityBoughtjava.lang.Exception
- an unexpected exceptionprotected void manageDataDescriptor(DataDescriptorIf dataDesc, KKCriteria c)
dataDesc
- the dataDescc
- the cprotected int getCustomerId(java.lang.String sessionId, int customerId) throws java.lang.Exception
sessionId
- the sessionIdcustomerId
- the customerIdjava.lang.Exception
- an unexpected exceptionprotected boolean isEnhancedVariantHandlingModeEnabled() throws java.lang.Exception
java.lang.Exception
- an unexpected exceptionCopyright © 2018 DS Data Systems UK Ltd.