public class DefaultBundleTemplateService extends Object implements BundleTemplateService
BundleTemplateService| Constructor and Description |
|---|
DefaultBundleTemplateService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsComponenentProductsOfType(BundleTemplateModel bundleTemplate,
Class<? extends ProductModel>... clazzes) |
List<BundleTemplateModel> |
getAllApprovedRootBundleTemplates(CatalogVersionModel catalogVersion)
This methods returns all approved root bundle templates.
|
List<BundleTemplateModel> |
getAllComponentsOfType(BundleTemplateModel bundleTemplate,
Class<? extends ProductModel>... clazzes) |
List<BundleTemplateModel> |
getAllRootBundleTemplates(CatalogVersionModel catalogVersion)
This methods returns all root bundle templates.
|
protected AbstractBundleComponentEditableChecker<CartModel> |
getBundleComponentEditableChecker() |
protected BundleTemplateDao |
getBundleTemplateDao() |
BundleTemplateModel |
getBundleTemplateForCode(String bundleId)
This method returns the bundle template by bundle id
bundleId |
BundleTemplateModel |
getBundleTemplateForCode(String bundleId,
String version)
This method returns the bundle template by bundle id
bundleId |
List<BundleTemplateModel> |
getBundleTemplatesByProduct(ProductModel model)
Get all components (child bundle templates) where the current device is included in the products list
|
List<BundleTemplateModel> |
getLeafComponents(BundleTemplateModel anyComponent)
Collect all leaf components of bundle.
|
protected ModelService |
getModelService() |
int |
getPositionInParent(BundleTemplateModel bundleTemplate)
Returns the given
bundleTemplate's absolute position in the list of child templates that are assigned
to the parent template |
BundleTemplateModel |
getPreviousBundleTemplate(BundleTemplateModel bundleTemplate)
Returns the previous child bundle template.
|
BundleTemplateModel |
getRelativeBundleTemplate(BundleTemplateModel bundleTemplate,
int relativePosition)
Returns a relative child bundle template.
|
BundleTemplateModel |
getRootBundleTemplate(BundleTemplateModel bundleTemplateModel)
This method returns the root bundleTemplate
BundleTemplateModel of the given
bundleTemplateModel. |
BundleTemplateModel |
getSubsequentBundleTemplate(BundleTemplateModel bundleTemplate)
Returns the next child bundle template.
|
List<BundleTemplateModel> |
getTemplatesForMasterOrderAndBundleNo(AbstractOrderModel masterAbstractOrder,
int bundleNo)
Returns the distinct
BundleTemplateModels from the order entries that match the given filter criteria |
boolean |
isAutoPickComponent(BundleTemplateModel bundleTemplate)
Checks if
BundleTemplateModel has a selection criteria of AutoPickBundleSelectionCriteriaModel |
boolean |
isBundleTemplateUsed(BundleTemplateModel bundleTemplate)
Checks if the given
BundleTemplateModel was used in any cart or order entry |
void |
setBundleComponentEditableChecker(AbstractBundleComponentEditableChecker<CartModel> bundleComponentEditableChecker) |
void |
setBundleTemplateDao(BundleTemplateDao bundleTemplateDao) |
void |
setModelService(ModelService modelService) |
public BundleTemplateModel getRootBundleTemplate(BundleTemplateModel bundleTemplateModel)
BundleTemplateServiceBundleTemplateModel of the given
bundleTemplateModel. In case the given bundleTemplateModel is the root template the
given bundleTemplateModel is returned as root template.getRootBundleTemplate in interface BundleTemplateServiceBundleTemplateModelpublic BundleTemplateModel getBundleTemplateForCode(String bundleId)
BundleTemplateServicebundleIdgetBundleTemplateForCode in interface BundleTemplateServicebundleId - Bundle IdBundleTemplateModelpublic List<BundleTemplateModel> getBundleTemplatesByProduct(ProductModel model)
BundleTemplateServicegetBundleTemplatesByProduct in interface BundleTemplateServiceBundleTemplateModelpublic BundleTemplateModel getSubsequentBundleTemplate(BundleTemplateModel bundleTemplate)
BundleTemplateServicebundleTemplate
and selects the parents next child template, e.g. SMAR_Handset (given bundleTemplate) -> SMAR (parent
template) -> SMAR_Plan (next child template of parent), SMAR_Plan is returned.getSubsequentBundleTemplate in interface BundleTemplateServiceBundleTemplateModelpublic BundleTemplateModel getPreviousBundleTemplate(BundleTemplateModel bundleTemplate)
BundleTemplateServicebundleTemplate and selects the parents next child template, e.g. SMAR_Plan (given
bundleTemplate) -> SMAR (parent template) -> SMAR_Handset (previous child template of parent),
SMAR_Handset is returned.getPreviousBundleTemplate in interface BundleTemplateServiceBundleTemplateModelpublic BundleTemplateModel getRelativeBundleTemplate(BundleTemplateModel bundleTemplate, int relativePosition)
BundleTemplateServicebundleTemplate
and selects the parents relative child templategetRelativeBundleTemplate in interface BundleTemplateServicerelativePosition - the relative position of the child template to be returnedBundleTemplateModelpublic List<BundleTemplateModel> getLeafComponents(BundleTemplateModel anyComponent)
BundleTemplateServicegetLeafComponents in interface BundleTemplateServiceanyComponent - any component in bundle hierarchypublic int getPositionInParent(BundleTemplateModel bundleTemplate)
BundleTemplateServicebundleTemplate's absolute position in the list of child templates that are assigned
to the parent templategetPositionInParent in interface BundleTemplateServicebundleTemplate - the child template whose position shall be returnedpublic List<BundleTemplateModel> getTemplatesForMasterOrderAndBundleNo(AbstractOrderModel masterAbstractOrder, int bundleNo)
BundleTemplateServiceBundleTemplateModels from the order entries that match the given filter criteriagetTemplatesForMasterOrderAndBundleNo in interface BundleTemplateServicemasterAbstractOrder - the master cart/order the bundle is inbundleNo - the number of the bundle to which the bundle templates belongList of BundleTemplateModels or empty List.public boolean containsComponenentProductsOfType(BundleTemplateModel bundleTemplate, Class<? extends ProductModel>... clazzes)
containsComponenentProductsOfType in interface BundleTemplateServicebundleTemplate - the component to be checked for add-on productsclazzes - class of the products instances that are on the list of assigned products of the given
bundleTemplate (e.g. ServiceAddOnModel.class)true if the given bundleTemplate contains add-on products, otherwise
falsepublic boolean isAutoPickComponent(BundleTemplateModel bundleTemplate)
BundleTemplateServiceBundleTemplateModel has a selection criteria of AutoPickBundleSelectionCriteriaModelisAutoPickComponent in interface BundleTemplateServicetrue if selection criteria is AutoPickBundleSelectionCriteriaModel, otherwise
falsepublic List<BundleTemplateModel> getAllComponentsOfType(BundleTemplateModel bundleTemplate, Class<? extends ProductModel>... clazzes)
getAllComponentsOfType in interface BundleTemplateServicebundleTemplate - the bundleTemplate for which the child components are searchedclazzes - class of the products instances that are on the list of assigned products of the searched
bundleTemplate (e.g. ServicePlanModel.class)public BundleTemplateModel getBundleTemplateForCode(String bundleId, String version)
BundleTemplateServicebundleIdgetBundleTemplateForCode in interface BundleTemplateServicebundleId - Bundle IdBundleTemplateModelpublic boolean isBundleTemplateUsed(BundleTemplateModel bundleTemplate)
BundleTemplateServiceBundleTemplateModel was used in any cart or order entryisBundleTemplateUsed in interface BundleTemplateServiceprotected BundleTemplateDao getBundleTemplateDao()
public void setBundleTemplateDao(BundleTemplateDao bundleTemplateDao)
protected AbstractBundleComponentEditableChecker<CartModel> getBundleComponentEditableChecker()
public void setBundleComponentEditableChecker(AbstractBundleComponentEditableChecker<CartModel> bundleComponentEditableChecker)
public List<BundleTemplateModel> getAllRootBundleTemplates(CatalogVersionModel catalogVersion)
BundleTemplateServicegetAllRootBundleTemplates in interface BundleTemplateServicecatalogVersion - catalog version where bundle templates will be searched inList of BundleTemplateModelspublic List<BundleTemplateModel> getAllApprovedRootBundleTemplates(CatalogVersionModel catalogVersion)
BundleTemplateServicegetAllApprovedRootBundleTemplates in interface BundleTemplateServicecatalogVersion - catalog version where bundle templates will be searched inList of BundleTemplateModelsprotected ModelService getModelService()
public void setModelService(ModelService modelService)
Copyright © 2017 SAP SE. All Rights Reserved.