public abstract class DefaultAbstractBundleComponentEditableChecker<O extends AbstractOrderModel,E extends AbstractOrderEntryModel> extends java.lang.Object implements AbstractBundleComponentEditableChecker<O>
AbstractBundleComponentEditableChecker| Constructor and Description |
|---|
DefaultAbstractBundleComponentEditableChecker() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Set<java.lang.Integer> |
bundleTemplatesToGroupNumbers(EntryGroup rootGroup,
java.util.Collection<BundleTemplateModel> components) |
boolean |
canEdit(O masterAbstractOrder,
BundleTemplateModel bundleTemplate,
int bundleNo)
Checks if the given component
bundleTemplate in given bundle bundleNo and
masterAbstractOrder can be edited. |
protected void |
checkComponentIsLeaf(BundleTemplateModel bundleTemplate) |
void |
checkIsComponentDependencyMet(O masterAbstractOrder,
BundleTemplateModel bundleTemplate,
int bundleNo)
Checks if the selection dependency of the given component
bundleTemplate in given bundle
bundleNo and masterAbstractOrder is fulfilled. |
void |
checkIsComponentSelectionCriteriaMet(O masterAbstractOrder,
BundleTemplateModel bundleTemplate,
int bundleNo)
Checks if the given
bundleTemplate's selection criteria are fulfilled, neither exceeded nor under
threshold. |
protected EntryGroupService |
getEntryGroupService() |
protected OrderEntryDao |
getOrderEntryDao() |
protected java.util.Set<java.lang.Integer> |
getPopulatedGroupNumbers(AbstractOrderModel order) |
boolean |
isAutoPickComponent(BundleTemplateModel bundleTemplate)
Checks if
BundleTemplateModel has a selection criteria of auto pick type. |
boolean |
isComponentDependencyMet(O masterAbstractOrder,
BundleTemplateModel bundleTemplate,
int bundleNo)
Checks if the selection dependency of the given component
bundleTemplate in given bundle
bundleNo and masterAbstractOrder is fulfilled. |
boolean |
isComponentSelectionCriteriaMet(O masterAbstractOrder,
BundleTemplateModel bundleTemplate,
int bundleNo)
Checks if the given
bundleTemplate's selection criteria are fulfilled, neither exceeded nor under
threshold. |
boolean |
isRequiredDependencyMet(O order,
BundleTemplateModel bundleTemplate,
java.lang.Integer entryGroupNumber)
Checks if the selection dependency of the given component
bundleTemplate in given bundle
bundleTemplate and order is fulfilled. |
void |
setEntryGroupService(EntryGroupService entryGroupService) |
void |
setOrderEntryDao(OrderEntryDao orderEntryDao) |
public DefaultAbstractBundleComponentEditableChecker()
public boolean canEdit(O masterAbstractOrder, BundleTemplateModel bundleTemplate, int bundleNo)
AbstractBundleComponentEditableCheckerbundleTemplate in given bundle bundleNo and
masterAbstractOrder can be edited. In case the given bundleTemplate's selection criteria
is of auto pick type, it is never editable. The check is based on the selection
dependencies of the given bundleTemplate. Only if all requirements of those components, the given
component is dependent on, are met, the given component should be open for modifications.canEdit in interface AbstractBundleComponentEditableChecker<O extends AbstractOrderModel>masterAbstractOrder - the master order/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 void checkIsComponentDependencyMet(O masterAbstractOrder, BundleTemplateModel bundleTemplate, int bundleNo) throws CommerceCartModificationException
AbstractBundleComponentEditableCheckerbundleTemplate in given bundle
bundleNo and masterAbstractOrder is fulfilled.checkIsComponentDependencyMet in interface AbstractBundleComponentEditableChecker<O extends AbstractOrderModel>masterAbstractOrder - the master order/cart the bundle is inbundleTemplate - the component whose selection dependency is checkedbundleNo - the number of the bundle the given bundleTemplate belongs toCommerceCartModificationException - if the given bundleTemplate's selection dependency is not metpublic boolean isAutoPickComponent(BundleTemplateModel bundleTemplate)
AbstractBundleComponentEditableCheckerBundleTemplateModel has a selection criteria of auto pick type.isAutoPickComponent in interface AbstractBundleComponentEditableChecker<O extends AbstractOrderModel>true if selection criteria has auto pick type, otherwise
falsepublic boolean isComponentSelectionCriteriaMet(O masterAbstractOrder, BundleTemplateModel bundleTemplate, int bundleNo)
AbstractBundleComponentEditableCheckerbundleTemplate's selection criteria are fulfilled, neither exceeded nor under
threshold.isComponentSelectionCriteriaMet in interface AbstractBundleComponentEditableChecker<O extends AbstractOrderModel>masterAbstractOrder - the master cart/orderbundleTemplate - the bundle template/component whose selection criteria are checkedbundleNo - the number of the bundle the given bundleTemplate is intrue if selection criteria is met, otherwise falsepublic void checkIsComponentSelectionCriteriaMet(O masterAbstractOrder, BundleTemplateModel bundleTemplate, int bundleNo) throws CommerceCartModificationException
AbstractBundleComponentEditableCheckerbundleTemplate's selection criteria are fulfilled, neither exceeded nor under
threshold. Throws an exception of selection criteria is not met.checkIsComponentSelectionCriteriaMet in interface AbstractBundleComponentEditableChecker<O extends AbstractOrderModel>masterAbstractOrder - the master cart/orderbundleTemplate - the bundle template/component whose selection criteria are checkedbundleNo - the number of the bundle the given bundleTemplate is inCommerceCartModificationException - if selection criteria is not fulfilledpublic boolean isComponentDependencyMet(O masterAbstractOrder, BundleTemplateModel bundleTemplate, int bundleNo)
AbstractBundleComponentEditableCheckerbundleTemplate in given bundle
bundleNo and masterAbstractOrder is fulfilled.isComponentDependencyMet in interface AbstractBundleComponentEditableChecker<O extends AbstractOrderModel>masterAbstractOrder - the master order/cart the bundle is inbundleTemplate - the component whose selection dependency is checkedbundleNo - the number of the bundle the given bundleTemplate belongs totrue if selection dependency is met, otherwise falsepublic boolean isRequiredDependencyMet(O order, BundleTemplateModel bundleTemplate, java.lang.Integer entryGroupNumber)
AbstractBundleComponentEditableCheckerbundleTemplate in given bundle
bundleTemplate and order is fulfilled. Returns the result of that check instead
of throwing an exception.isRequiredDependencyMet in interface AbstractBundleComponentEditableChecker<O extends AbstractOrderModel>order - the order specified bundle is a part ofbundleTemplate - the component to check selection dependency forentryGroupNumber - number of the entry group created from bundle templateprotected java.util.Set<java.lang.Integer> bundleTemplatesToGroupNumbers(EntryGroup rootGroup, java.util.Collection<BundleTemplateModel> components)
protected java.util.Set<java.lang.Integer> getPopulatedGroupNumbers(AbstractOrderModel order)
protected void checkComponentIsLeaf(BundleTemplateModel bundleTemplate) throws CommerceCartModificationException
public void setOrderEntryDao(OrderEntryDao orderEntryDao)
protected OrderEntryDao getOrderEntryDao()
protected EntryGroupService getEntryGroupService()
public void setEntryGroupService(EntryGroupService entryGroupService)
Copyright © 2018 SAP SE. All Rights Reserved.