public class DefaultBundleCommerceCartService extends DefaultSubscriptionCommerceCartService implements BundleCommerceCartService
BundleCommerceCartService| Modifier and Type | Field and Description |
|---|---|
static int |
NEW_BUNDLE |
static int |
NO_BUNDLE |
| Constructor and Description |
|---|
DefaultBundleCommerceCartService() |
| Modifier and Type | Method and Description |
|---|---|
protected List<CommerceCartModification> |
addAutoPickProductsToCart(CartModel masterCartModel,
int bundleNo,
BundleTemplateModel bundleTemplate,
UnitModel unit)
Add auto-pick products to the bundle in the cart.
|
protected CommerceCartModification |
addProductToCart(CartModel masterCartModel,
ProductModel productModel,
long quantityToAdd,
UnitModel unit,
boolean forceNewEntry,
int bundleNo,
BundleTemplateModel bundleTemplateModel,
String xmlProduct,
boolean ignoreEmptyBundle)
Adds a product to the cart, either as standalone product or as part of a bundle.
|
protected void |
addToBundle(AbstractOrderEntryModel entry,
BundleTemplateModel bundleTemplate,
int bundleNoRequested)
Assign the new cart entry to an existing bundle or create a new bundle for it
|
CommerceCartModification |
addToCart(CartModel masterCartModel,
ProductModel productModel,
long quantityToAdd,
UnitModel unit,
boolean forceNewEntry) |
List<CommerceCartModification> |
addToCart(CartModel masterCartModel,
ProductModel productModel,
long quantityToAdd,
UnitModel unit,
boolean forceNewEntry,
int bundleNo,
BundleTemplateModel bundleTemplateModel,
boolean removeCurrentProducts)
Deprecated.
|
List<CommerceCartModification> |
addToCart(CartModel masterCartModel,
ProductModel productModel,
long quantityToAdd,
UnitModel unit,
boolean forceNewEntry,
int bundleNo,
BundleTemplateModel bundleTemplateModel,
boolean removeCurrentProducts,
String xmlProduct) |
CommerceCartModification |
addToCart(CartModel masterCartModel,
ProductModel productModel,
long quantityToAdd,
UnitModel unit,
boolean forceNewEntry,
String xmlProduct) |
List<CommerceCartModification> |
addToCart(CartModel masterCartModel,
UnitModel unit,
int bundleNo,
ProductModel productModel1,
BundleTemplateModel bundleTemplateModel1,
ProductModel productModel2,
BundleTemplateModel bundleTemplateModel2)
Deprecated.
|
List<CommerceCartModification> |
addToCart(CartModel masterCartModel,
UnitModel unit,
int bundleNo,
ProductModel productModel1,
BundleTemplateModel bundleTemplateModel1,
ProductModel productModel2,
BundleTemplateModel bundleTemplateModel2,
String xmlProduct1,
String xmlProduct2)
Adds the (existing)
ProductModels productModel1 and productModel2 in the given
UnitModel and with quantity=1 to the (existing) multi-cart CartModel as new cart entries. |
boolean |
calculateCart(CartModel cartModel)
Overrides the super class' method to make sure that in a multi-cart system the master cart and the child carts are
calculated.
|
String |
checkAndGetReasonForDisabledProductInComponent(CartModel masterCart,
ProductModel product,
BundleTemplateModel bundleTemplate,
int bundleNo,
boolean ignoreCurrentProducts)
Checks if the given
product which is not yet added to the cart/bundle needs to be disabled within a
component. |
String |
checkAndGetReasonForNotRemovableEntry(CartEntryModel cartEntry)
Checks whether the given
CartEntryModel could be removed from the bundle/cart (only a check, the cart is
not modified!) and returns the reason if the removal is not allowed. |
protected void |
checkAndRemoveDependentComponents(CartModel masterCartModel,
int bundleNo,
BundleTemplateModel bundleTemplate)
If the last item of the given
bundleTemplate is deleted all items that belong to components which are
dependent on the given bundleTemplate are also removed from the cart. |
protected void |
checkAutoPickAddToCart(BundleTemplateModel bundleTemplate,
ProductModel product)
Checks whether the given
cartEntry is an auto-pick item and throws an
CommerceCartModificationException in that case |
protected void |
checkAutoPickRemoval(CartEntryModel cartEntry)
Checks whether the given
cartEntry is an auto-pick item and throws an
CommerceCartModificationException in that case |
protected void |
checkBundleParameters(int bundleNo,
BundleTemplateModel bundleTemplateModel)
Checks if given
bundleNo is valid and if the combination of the given bundleNo and the
given bundleTemplateModel is correct |
protected void |
checkCanBeAddedToComponent(CartModel masterCart,
BundleTemplateModel bundleTemplate,
int bundleNo) |
protected void |
checkIsBundleConsistent(int bundleNo,
BundleTemplateModel bundleTemplateModel,
CartModel masterCartModel,
ProductModel productModel)
Checks if the combination of the given
bundleNo and bundleTemplateModel is correct in
the context of the given master cart |
protected void |
checkIsComponentDependencyMetAfterRemoval(CartModel masterCart,
BundleTemplateModel bundleTemplate,
int bundleNo)
Checks if an item can be removed from the given
bundleTemplate (component). |
boolean |
checkIsComponentEditable(CartModel masterCart,
BundleTemplateModel bundleTemplate,
int bundleNo)
Checks if the given component
bundleTemplate in given bundle bundleNo and
masterCart can be edited. |
boolean |
checkIsComponentSelectionCriteriaMet(CartModel masterCart,
BundleTemplateModel bundleTemplate,
int bundleNo)
Checks if the selection criteria of the given component
bundleTemplate in given bundle
bundleNo and masterCart is met. |
boolean |
checkIsEntryRemovable(CartEntryModel cartEntry)
Checks whether the given
CartEntryModel could be removed from the bundle/cart (only a check, the cart is
not modified!). |
boolean |
checkIsEntryUpdateable(CartEntryModel cartEntry)
Checks whether the given
cartEntry can be updated. |
protected void |
checkIsProductAlreadyInComponent(CartModel masterCart,
int bundleNo,
BundleTemplateModel bundleTemplate,
ProductModel product)
Checks whether the given
product is already added to the given bundleNo and
bundleTemplate. |
protected void |
checkIsProductDisabledByRules(CartModel masterCart,
ProductModel product,
BundleTemplateModel bundleTemplate,
int bundleNo) |
protected void |
checkIsProductInComponentProductList(int bundleNo,
BundleTemplateModel bundleTemplateModel,
ProductModel productModel)
Checks whether the given
productModel is in the products list of the given
bundleTemplateModel. |
protected void |
checkIsSelectionCriteriaNotExceeded(CartModel masterCart,
BundleTemplateModel bundleTemplate,
int bundleNo)
Checks that not too many products are added to the given
bundleNo within the given
bundleTemplate (component) in the given masterCart. |
protected void |
checkIsSoldIndividually(ProductModel productModel,
int bundleNo) |
protected void |
checkSelectionCriteriaNotUnderThreshold(CartEntryModel cartEntry) |
protected String |
createMessageForDisableRule(DisableProductBundleRuleModel disableRule,
ProductModel product) |
protected CommerceCartModification |
createStandaloneEntry(boolean forceNewEntry,
CartModel masterCartModel,
ProductModel productModel,
UnitModel unit,
long quantityToAdd,
String xmlProduct) |
protected BundleTemplateModel |
findAnyRequiredTemplate(CartModel masterCart,
BundleTemplateModel bundleTemplate,
int bundleNo) |
protected OrderEntryDao |
getBundleCartEntryDao() |
protected AbstractBundleComponentEditableChecker<CartModel> |
getBundleComponentEditableChecker() |
protected BundleRuleService |
getBundleRuleService() |
protected BundleTemplateModel |
getBundleTemplateForBundleNoFromCart(CartModel masterCartModel,
int bundleNo)
Find any BundleTemplate within the multi-cart for the given bundleNo.
|
protected BundleTemplateService |
getBundleTemplateService() |
List<CartEntryModel> |
getCartEntriesForBundle(CartModel masterCart,
int bundleNo)
Gets the list of for bundleNo.
|
List<CartEntryModel> |
getCartEntriesForComponentInBundle(CartModel masterCart,
BundleTemplateModel component,
int bundleNo)
Gets the list of
CartEntryModel for component and bundleNo. |
List<CartEntryModel> |
getCartEntriesForProductInBundle(CartModel masterCart,
ProductModel product,
int bundleNo)
Gets the list of
CartEntryModel for Products and bundleNo. |
protected CartEntryModel |
getCartEntryForUpdate(CartModel masterCartModel,
ProductModel productModel,
UnitModel unit)
Search in the masterCart if there is already an entry whose quantity could be updated.
|
protected String |
getDisablingReason(CartModel masterCart,
ProductModel product,
BundleTemplateModel bundleTemplate,
int bundleNo,
boolean ignoreCurrentProducts) |
BundleTemplateModel |
getFirstInvalidComponentInCart(CartModel masterCart)
Checks the given
masterCart if there are invalid components in it. |
protected L10NService |
getL10NService() |
BillingTimeModel |
getMasterBillingTime()
Get the master
BillingTimeModel |
protected <any> |
getOrderEntryModifiableChecker() |
protected RemoveableChecker<CartEntryModel> |
getRemovableChecker() |
protected String |
getSelectionCriterionMessage(CartModel masterCart,
BundleTemplateModel bundleTemplate,
int bundleNo) |
SessionService |
getSessionService() |
void |
removeAllEntries(CartModel masterCartModel,
int bundleNo)
Removes a bundle from the given
CartModel and its child carts. |
protected void |
removeCartEntry(CartModel masterCartModel,
CartEntryModel cartEntry)
Removes a cart entry without performing any validation checks.
|
protected void |
removeEntriesWithChildren(List<CartEntryModel> cartEntries,
CartModel masterCartModel) |
void |
setBundleCartEntryDao(OrderEntryDao cartEntryDao) |
void |
setBundleComponentEditableChecker(AbstractBundleComponentEditableChecker<CartModel> bundleComponentEditableChecker) |
void |
setBundleRuleService(BundleRuleService bundleRuleService) |
void |
setBundleTemplateService(BundleTemplateService bundleTemplateService) |
protected void |
setCartEntriesInSameBundleToNotCalculated(AbstractOrderEntryModel sourceEntry)
Sets all other cart entries that belong to the same bundle to "not calculated".
|
void |
setL10NService(L10NService l10NService) |
void |
setOrderEntryModifiableChecker(<any> orderEntryModifiableChecker) |
void |
setRemovableChecker(RemoveableChecker<CartEntryModel> removableChecker) |
protected void |
updateLastModifiedEntriesList(CartModel masterCart,
List<CommerceCartModification> modifications) |
CommerceCartModification |
updateQuantityForCartEntry(CartModel masterCartModel,
long entryNumber,
long newQuantity)
Update quantity for the cart entry with given
entryNumber with the given newQuantity. |
CommerceCartModification |
updateQuantityForCartEntry(CommerceCartParameter parameter) |
addToCart, checkMasterCart, checkQuantityToAdd, createChildCartForBillingTime, getAvailableStockLevel, getBaseStoreService, getBillingFrequenciesForMasterEntry, getBillingTimeForCode, getBillingTimeService, getCartEntryToBeUpdated, getChildCartForBillingTime, getCommercePriceService, getCommerceStockService, getMasterCartBillingTimeCode, getMasterCartForCartEntry, getSubscriptionCommerceCartStrategy, getSubscriptionProductService, getSubscriptionProductStockQuantity, isMasterCart, recalculateCart, recalculateCart, removeAllEntries, removeEmptyChildCarts, setBaseStoreService, setBillingTimeService, setCommercePriceService, setCommerceStockService, setMasterCartBillingTimeCode, setSubscriptionCommerceCartStrategy, setSubscriptionProductService, setSubscriptionProductStockQuantityclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddToCart, getChildCartForBillingTime, getMasterCartBillingTimeCode, getMasterCartForCartEntrypublic static final int NEW_BUNDLE
public static final int NO_BUNDLE
@Deprecated public List<CommerceCartModification> addToCart(CartModel masterCartModel, ProductModel productModel, long quantityToAdd, UnitModel unit, boolean forceNewEntry, int bundleNo, BundleTemplateModel bundleTemplateModel, boolean removeCurrentProducts) throws CommerceCartModificationException
BundleCommerceCartServiceProductModel in the given UnitModel and with the given quantity
to the (existing) CartModel. If an entry with the given product and given unit exists in the cart already,
then the given quantity is added to the quantity of this cart entry unless forceNewEntry
is set to true or a subscription product or a product, that is part of a bundle, is added. Dependent on the
parameter bundleNo the product is added to an existing or new bundle or treated as a standalone
product. In case a new bundle is created the method also adds auto-pick products to the cart if there are any
setup for the bundle template. After this the multi-cart is calculated.addToCart in interface BundleCommerceCartServicemasterCartModel - the cart model. It must exist and it must be a master cart.productModel - the product model that will be added to the cartquantityToAdd - the quantity of the productunit - if null ProductService#getOrderableUnit(ProductModel) is used to determine the unitforceNewEntry - the force new entry if set to true, new cart entry will be created in any case. In case of subscription
products and products that are part of a bundle there will be always a new cart entrybundleNo - indicates to which bundle the product model shall be added (-1=create new bundle; 0=standalone
product/no bundle; >0=number of existing bundle)bundleTemplateModel - current version of the bundleTemplate model based on which the product is added to the cart. It will be
stored on the cart entry. If null the product will be treated as a standalone product and
the bundleNo must be 0 accordingly.removeCurrentProducts - whether to remove current productsCommerceCartModification that includes a statusCode and the
actual quantity of the products added to the cartCommerceCartModificationException - if the product is a base product OR the quantity is less than 1 or no usable unit was
found (only when given unit is also null) or any other reason the cart could
not be modified.public List<CommerceCartModification> addToCart(CartModel masterCartModel, ProductModel productModel, long quantityToAdd, UnitModel unit, boolean forceNewEntry, int bundleNo, BundleTemplateModel bundleTemplateModel, boolean removeCurrentProducts, String xmlProduct) throws CommerceCartModificationException
addToCart in interface BundleCommerceCartServiceCommerceCartModification that includes a statusCode and the
actual quantity of the products added to the cartCommerceCartModificationExceptionBundleCommerceCartService.addToCart(CartModel, ProductModel, long, UnitModel, boolean, int,
BundleTemplateModel, boolean)protected CommerceCartModification addProductToCart(CartModel masterCartModel, ProductModel productModel, long quantityToAdd, UnitModel unit, boolean forceNewEntry, int bundleNo, BundleTemplateModel bundleTemplateModel, String xmlProduct, boolean ignoreEmptyBundle) throws CommerceCartModificationException
CommerceCartModificationExceptionprotected CommerceCartModification createStandaloneEntry(boolean forceNewEntry, CartModel masterCartModel, ProductModel productModel, UnitModel unit, long quantityToAdd, String xmlProduct) throws CommerceCartModificationException
CommerceCartModificationException@Deprecated public List<CommerceCartModification> addToCart(CartModel masterCartModel, UnitModel unit, int bundleNo, ProductModel productModel1, BundleTemplateModel bundleTemplateModel1, ProductModel productModel2, BundleTemplateModel bundleTemplateModel2) throws CommerceCartModificationException
addToCart in interface BundleCommerceCartServiceList of CommerceCartModificationsCommerceCartModificationExceptionBundleCommerceCartService.addToCart(CartModel, UnitModel, int, ProductModel, BundleTemplateModel,
ProductModel, BundleTemplateModel, String, String)public List<CommerceCartModification> addToCart(CartModel masterCartModel, UnitModel unit, int bundleNo, ProductModel productModel1, BundleTemplateModel bundleTemplateModel1, ProductModel productModel2, BundleTemplateModel bundleTemplateModel2, String xmlProduct1, String xmlProduct2) throws CommerceCartModificationException
BundleCommerceCartServiceProductModels productModel1 and productModel2 in the given
UnitModel and with quantity=1 to the (existing) multi-cart CartModel as new cart entries. As this
method works for bundles only, both products must have a bundle template and must be part of an existing bundle or
a new bundle that is created during the addToCart. In case a new bundle is created the method also adds auto-pick
products to the cart if there are any setup for the bundle template. After this the multi-cart is calculated.addToCart in interface BundleCommerceCartServicemasterCartModel - the cart model. It must exist and it must be a master cart.unit - if null ProductService#getOrderableUnit(ProductModel) is used to determine the unitbundleNo - indicates to which bundle the product model shall be added (-1=create new bundle; >0=number of existing
bundle; 0=standalone product/no bundle is not allowed here)productModel1 - the first product model that will be added to the cartbundleTemplateModel1 - current version of the bundleTemplate model based on which the first product is added to the cart. It
will be stored on the cart entry. The parameter cannot be null.productModel2 - the second product model that will be added to the cartbundleTemplateModel2 - current version of the bundleTemplate model based on which the second product is added to the cart. It
will be stored on the cart entry. The parameter cannot be null.xmlProduct1 - first product in xml formatxmlProduct2 - second product in xml formatCommerceCartModification that includes a statusCode and the
actual quantity of the products added to the cartCommerceCartModificationException - if the product is a base product OR the quantity is less than 1 or no usable unit was
found (only when given unit is also null) or the bundle parameters were
empty/wrong or any other reason the cart could not be modified.public CommerceCartModification addToCart(CartModel masterCartModel, ProductModel productModel, long quantityToAdd, UnitModel unit, boolean forceNewEntry) throws CommerceCartModificationException
addToCart in class DefaultSubscriptionCommerceCartServiceCommerceCartModificationExceptionpublic CommerceCartModification addToCart(CartModel masterCartModel, ProductModel productModel, long quantityToAdd, UnitModel unit, boolean forceNewEntry, String xmlProduct) throws CommerceCartModificationException
addToCart in interface SubscriptionCommerceCartServiceaddToCart in class DefaultSubscriptionCommerceCartServiceCommerceCartModificationExceptionpublic CommerceCartModification updateQuantityForCartEntry(CommerceCartParameter parameter) throws CommerceCartModificationException
updateQuantityForCartEntry in class DefaultSubscriptionCommerceCartServiceCommerceCartModificationExceptionpublic CommerceCartModification updateQuantityForCartEntry(CartModel masterCartModel, long entryNumber, long newQuantity) throws CommerceCartModificationException
SubscriptionCommerceCartServiceentryNumber with the given newQuantity.
Then cart is calculated.updateQuantityForCartEntry in interface SubscriptionCommerceCartServiceupdateQuantityForCartEntry in class DefaultSubscriptionCommerceCartServicemasterCartModel - the CartModel that we will perform update onentryNumber - the entry number that will be updatednewQuantity - the new quantity that will be set for specified cart entryCommerceCartModificationException - if the product is a base product OR the quantity is less than 1 or no usable unit was
found (only when given unit is also null) or any other reason the cart could
not be modified.protected void addToBundle(AbstractOrderEntryModel entry, BundleTemplateModel bundleTemplate, int bundleNoRequested) throws CommerceCartModificationException
CommerceCartModificationExceptionprotected void setCartEntriesInSameBundleToNotCalculated(AbstractOrderEntryModel sourceEntry)
protected void checkBundleParameters(int bundleNo,
BundleTemplateModel bundleTemplateModel)
throws CommerceCartModificationException
bundleNo is valid and if the combination of the given bundleNo and the
given bundleTemplateModel is correctCommerceCartModificationExceptionprotected void checkIsBundleConsistent(int bundleNo,
BundleTemplateModel bundleTemplateModel,
CartModel masterCartModel,
ProductModel productModel)
throws CommerceCartModificationException
bundleNo and bundleTemplateModel is correct in
the context of the given master cartCommerceCartModificationExceptionprotected void checkIsProductInComponentProductList(int bundleNo,
BundleTemplateModel bundleTemplateModel,
ProductModel productModel)
throws CommerceCartModificationException
productModel is in the products list of the given
bundleTemplateModel. This is only checked for products to be added to a bundleCommerceCartModificationExceptionprotected void checkIsProductAlreadyInComponent(CartModel masterCart, int bundleNo, BundleTemplateModel bundleTemplate, ProductModel product) throws CommerceCartModificationException
product is already added to the given bundleNo and
bundleTemplate. As it is not allowed to add the same product more than once to the same component an
CommerceCartModificationException is thrown in case the product is already in the component.CommerceCartModificationExceptionprotected void checkIsSelectionCriteriaNotExceeded(CartModel masterCart, BundleTemplateModel bundleTemplate, int bundleNo) throws CommerceCartModificationException
bundleNo within the given
bundleTemplate (component) in the given masterCart. The check is based on the
selectionCriteria of the given bundleTemplate which limit the max. possible product selections.CommerceCartModificationExceptionpublic boolean checkIsEntryRemovable(CartEntryModel cartEntry)
BundleCommerceCartServiceCartEntryModel could be removed from the bundle/cart (only a check, the cart is
not modified!). The check is based on the selectionCritera of the given cartEntry's component (bundle
template). If with the removal of the given cartEntry the lower limit of required product selections
would not be met any more, the check returns false, otherwise true.checkIsEntryRemovable in interface BundleCommerceCartServicecartEntry - cart entry that is checked whether it can be removed from the cart/bundletrue if the given cartEntry can be removed from the cart, otherwise
falsepublic String checkAndGetReasonForNotRemovableEntry(CartEntryModel cartEntry)
BundleCommerceCartServiceCartEntryModel could be removed from the bundle/cart (only a check, the cart is
not modified!) and returns the reason if the removal is not allowed. The check is based on the selectionCritera of
the given cartEntry's component (bundle template). If with the removal of the given
cartEntry the lower limit of required product selections would not be met any more, the check returns
the reason as String, otherwise null.checkAndGetReasonForNotRemovableEntry in interface BundleCommerceCartServicecartEntry - cart entry that is checked whether it can be removed from the cart/bundleString why the given cartEntry cannot be removed, otherwise
nullprotected void checkSelectionCriteriaNotUnderThreshold(CartEntryModel cartEntry) throws CommerceCartModificationException
CommerceCartModificationExceptionprotected void checkAutoPickRemoval(CartEntryModel cartEntry) throws CommerceCartModificationException
cartEntry is an auto-pick item and throws an
CommerceCartModificationException in that caseCommerceCartModificationExceptionprotected void checkAutoPickAddToCart(BundleTemplateModel bundleTemplate, ProductModel product) throws CommerceCartModificationException
cartEntry is an auto-pick item and throws an
CommerceCartModificationException in that caseCommerceCartModificationExceptionprotected List<CommerceCartModification> addAutoPickProductsToCart(CartModel masterCartModel, int bundleNo, BundleTemplateModel bundleTemplate, UnitModel unit) throws CommerceCartModificationException
CommerceCartModificationExceptionprotected BundleTemplateModel getBundleTemplateForBundleNoFromCart(CartModel masterCartModel, int bundleNo)
public void removeAllEntries(CartModel masterCartModel, int bundleNo) throws CommerceCartModificationException
BundleCommerceCartServiceCartModel and its child carts. The given CartModel must be a
master cart. All entries within the multi-cart (master + child carts) that belong to the same bundle identified by
the given bundleNo are removed from the multi cart.removeAllEntries in interface BundleCommerceCartServicemasterCartModel - the CartModel. It must exist and it must be a master cart.bundleNo - the number of the bundleCommerceCartModificationException - if the given CartModel is not a master cartprotected void checkAndRemoveDependentComponents(CartModel masterCartModel, int bundleNo, BundleTemplateModel bundleTemplate)
bundleTemplate is deleted all items that belong to components which are
dependent on the given bundleTemplate are also removed from the cart. Only components that have a
direct dependency on the given bundleTemplate are deleted. Components that have an indirect
dependency (via a 3rd component) are not removed (this method has to be overridden to implement this feature).protected void removeEntriesWithChildren(List<CartEntryModel> cartEntries, CartModel masterCartModel)
protected void removeCartEntry(CartModel masterCartModel, CartEntryModel cartEntry)
protected void checkIsSoldIndividually(ProductModel productModel, int bundleNo) throws CommerceCartModificationException
CommerceCartModificationExceptionprotected CartEntryModel getCartEntryForUpdate(CartModel masterCartModel, ProductModel productModel, UnitModel unit)
public boolean calculateCart(CartModel cartModel)
public boolean checkIsEntryUpdateable(CartEntryModel cartEntry)
BundleCommerceCartServicecartEntry can be updated. Any cart entry CartEntryModel belonging to
a bundle BundleTemplateModel cannot be updated.checkIsEntryUpdateable in interface BundleCommerceCartServicecartEntry - cart Entry that is checkedtrue if given cartEntry can be update, otherwise falsepublic boolean checkIsComponentEditable(CartModel masterCart, BundleTemplateModel bundleTemplate, int bundleNo)
BundleCommerceCartServicebundleTemplate in given bundle bundleNo and
masterCart can be edited. The check is based on the selection dependencies of the given
bundleTemplate. In case the given bundleTemplate's selection criteria is of type
AutoPickBundleSelectionCriteriaModel, it is never editable.checkIsComponentEditable in interface BundleCommerceCartServicemasterCart - the master cart the bundle is inbundleTemplate - the component that is checked whether it can be editedbundleNo - the number of the bundle the given bundleTemplate belongs totrue if the selection dependencies are fulfilled and the component can be edited, otherwise
falsepublic boolean checkIsComponentSelectionCriteriaMet(CartModel masterCart, BundleTemplateModel bundleTemplate, int bundleNo)
BundleCommerceCartServicebundleTemplate in given bundle
bundleNo and masterCart is met.checkIsComponentSelectionCriteriaMet in interface BundleCommerceCartServicemasterCart - the master cart the bundle is inbundleTemplate - the component that is checked whether its selection criteria is metbundleNo - the number of the bundle the given bundleTemplate belongs totrue if given bundleTemplate's's selection criteria is met, otherwise
falseprotected void checkCanBeAddedToComponent(CartModel masterCart, BundleTemplateModel bundleTemplate, int bundleNo) throws CommerceCartModificationException
CommerceCartModificationExceptionprotected void checkIsComponentDependencyMetAfterRemoval(CartModel masterCart, BundleTemplateModel bundleTemplate, int bundleNo) throws CommerceCartModificationException
bundleTemplate (component). If the given
bundleTemplate becomes invalid or would be removed completely (if last item is deleted), other
components in the same bundle would also become invalid if they have a dependency on the given component. In that
case an exception is thrownCommerceCartModificationExceptionprotected BundleTemplateModel findAnyRequiredTemplate(CartModel masterCart, BundleTemplateModel bundleTemplate, int bundleNo)
protected void checkIsProductDisabledByRules(CartModel masterCart, ProductModel product, BundleTemplateModel bundleTemplate, int bundleNo) throws CommerceCartModificationException
CommerceCartModificationExceptionpublic String checkAndGetReasonForDisabledProductInComponent(CartModel masterCart, ProductModel product, BundleTemplateModel bundleTemplate, int bundleNo, boolean ignoreCurrentProducts)
BundleCommerceCartServiceproduct which is not yet added to the cart/bundle needs to be disabled within a
component. A product needs to be disabled if a disable rule is applicable (see description of method
isProductDisabledInBundle() above) and/or the selection criteria of the component is exceeded. If the given
product needs to be disabled the reason is returned as String. If ignoreCurrentProducts
is enabled, then all product of the current component will be ignored when finding disable rules.checkAndGetReasonForDisabledProductInComponent in interface BundleCommerceCartServicemasterCart - the master cart the bundle is inproduct - the product which is to be added to the given bundleNobundleTemplate - the component to which the given product is linkedbundleNo - the number of the bundle the given bundleTemplate and product belong to or
will be addedignoreCurrentProducts - if current products should be ignoredString why the given product needs to be disabled, otherwise
nullprotected String getSelectionCriterionMessage(CartModel masterCart, BundleTemplateModel bundleTemplate, int bundleNo)
protected String getDisablingReason(CartModel masterCart, ProductModel product, BundleTemplateModel bundleTemplate, int bundleNo, boolean ignoreCurrentProducts)
protected String createMessageForDisableRule(DisableProductBundleRuleModel disableRule, ProductModel product)
public List<CartEntryModel> getCartEntriesForProductInBundle(CartModel masterCart, ProductModel product, int bundleNo)
BundleCommerceCartServiceCartEntryModel for Products and bundleNo.getCartEntriesForProductInBundle in interface BundleCommerceCartServicemasterCart - the master cart the bundle is inproduct - the product for which the cartentries should be foundbundleNo - the bundleNo for which the cartentries should be foundpublic List<CartEntryModel> getCartEntriesForComponentInBundle(CartModel masterCart, BundleTemplateModel component, int bundleNo)
BundleCommerceCartServiceCartEntryModel for component and bundleNo.getCartEntriesForComponentInBundle in interface BundleCommerceCartServicemasterCart - the master cart the bundle is incomponent - the component for which the cartentries should be foundbundleNo - the bundleNo for which the cartentries should be foundpublic List<CartEntryModel> getCartEntriesForBundle(CartModel masterCart, int bundleNo)
BundleCommerceCartServicegetCartEntriesForBundle in interface BundleCommerceCartServicemasterCart - the master cart the bundle is inbundleNo - the bundleNo for which the cartEntries should be foundCartEntryModel with specific bundle numberpublic BundleTemplateModel getFirstInvalidComponentInCart(CartModel masterCart)
BundleCommerceCartServicemasterCart if there are invalid components in it.getFirstInvalidComponentInCart in interface BundleCommerceCartServiceBundleTemplateModel if there is one, otherwise nullprotected void updateLastModifiedEntriesList(CartModel masterCart, List<CommerceCartModification> modifications)
public void setBundleTemplateService(BundleTemplateService bundleTemplateService)
protected BundleTemplateService getBundleTemplateService()
public void setBundleCartEntryDao(OrderEntryDao cartEntryDao)
protected OrderEntryDao getBundleCartEntryDao()
protected RemoveableChecker<CartEntryModel> getRemovableChecker()
public void setRemovableChecker(RemoveableChecker<CartEntryModel> removableChecker)
public void setOrderEntryModifiableChecker(<any> orderEntryModifiableChecker)
protected <any> getOrderEntryModifiableChecker()
public void setBundleComponentEditableChecker(AbstractBundleComponentEditableChecker<CartModel> bundleComponentEditableChecker)
protected AbstractBundleComponentEditableChecker<CartModel> getBundleComponentEditableChecker()
public void setBundleRuleService(BundleRuleService bundleRuleService)
protected BundleRuleService getBundleRuleService()
public BillingTimeModel getMasterBillingTime()
BundleCommerceCartServiceBillingTimeModelgetMasterBillingTime in interface BundleCommerceCartServiceBillingTimeModelpublic void setL10NService(L10NService l10NService)
protected L10NService getL10NService()
public SessionService getSessionService()
Copyright © 2017 SAP SE. All Rights Reserved.