public class DefaultBundleTemplateService extends java.lang.Object implements BundleTemplateService
BundleTemplateService| Constructor and Description |
|---|
DefaultBundleTemplateService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addGroupNumbers(java.util.List<EntryGroup> bundleEntryGroups,
AbstractOrderModel order) |
protected void |
addTreeToOrder(AbstractOrderModel order,
EntryGroup rootGroup) |
boolean |
containsComponenentProductsOfType(BundleTemplateModel bundleTemplate,
java.lang.Class<? extends ProductModel>... clazzes)
Checks whether the products on the list of assigned products of the given
bundleTemplate are of the
the given clazzes. |
EntryGroup |
createBundleTree(BundleTemplateModel bundleTemplate,
AbstractOrderModel order)
Creates entry group tree reflecting the structure of a bundle template and add the tree to the given order.
|
protected java.util.List<EntryGroup> |
createEntryGroupTree(BundleTemplateModel currentBundleTemplate,
EntryGroup parentEntryGroup) |
java.util.List<BundleTemplateModel> |
getAllApprovedRootBundleTemplates(CatalogVersionModel catalogVersion)
This methods returns all approved root bundle templates.
|
java.util.List<BundleTemplateModel> |
getAllComponentsOfType(BundleTemplateModel bundleTemplate,
java.lang.Class<? extends ProductModel>... clazzes)
Returns all child bundle templates (components) with products of the type
clazz. |
java.util.List<BundleTemplateModel> |
getAllRootBundleTemplates(CatalogVersionModel catalogVersion)
This methods returns all root bundle templates.
|
protected AbstractBundleComponentEditableChecker<CartModel> |
getBundleComponentEditableChecker() |
EntryGroup |
getBundleEntryGroup(AbstractOrderEntryModel entry)
Returns
EntryGroup of type GroupType.CONFIGURABLEBUNDLE the given
entry belongs to. |
EntryGroup |
getBundleEntryGroup(AbstractOrderModel order,
java.util.Set<java.lang.Integer> entryGroupNumbers)
For given Set of entry group numbers find the one which id is of type
CONFIGURABLEBUNDLE in given order. |
protected BundleTemplateDao |
getBundleTemplateDao() |
BundleTemplateModel |
getBundleTemplateForCode(java.lang.String bundleId)
This method returns the bundle template by bundle id
bundleId |
BundleTemplateModel |
getBundleTemplateForCode(java.lang.String bundleId,
java.lang.String version)
This method returns the bundle template by bundle id
bundleId |
java.lang.String |
getBundleTemplateName(BundleTemplateModel bundleTemplate)
Get well-formatted string with the name of the given component.
|
java.util.List<BundleTemplateModel> |
getBundleTemplatesByProduct(ProductModel model)
Get all components (child bundle templates) where the current device is included in the products list
|
protected EntryGroupService |
getEntryGroupService() |
java.util.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.
|
java.util.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 auto pick type. |
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 |
setEntryGroupService(EntryGroupService entryGroupService) |
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(java.lang.String bundleId)
BundleTemplateServicebundleIdgetBundleTemplateForCode in interface BundleTemplateServicebundleId - Bundle IdBundleTemplateModelpublic java.util.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 java.util.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 java.util.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, java.lang.Class<? extends ProductModel>... clazzes)
BundleTemplateServicebundleTemplate are of the
the given clazzes.
The method is deprecated and should be replaced with own one on client side.
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 auto pick type.isAutoPickComponent in interface BundleTemplateServicetrue if selection criteria has auto pick type, otherwise
falsepublic java.util.List<BundleTemplateModel> getAllComponentsOfType(BundleTemplateModel bundleTemplate, java.lang.Class<? extends ProductModel>... clazzes)
BundleTemplateServiceclazz.
The method is deprecated and should be replaced with own one on client side.
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(java.lang.String bundleId, java.lang.String version)
BundleTemplateServicebundleIdgetBundleTemplateForCode in interface BundleTemplateServicebundleId - Bundle IdBundleTemplateModelpublic boolean isBundleTemplateUsed(BundleTemplateModel bundleTemplate)
BundleTemplateServiceBundleTemplateModel was used in any cart or order entryisBundleTemplateUsed in interface BundleTemplateServicepublic java.lang.String getBundleTemplateName(BundleTemplateModel bundleTemplate)
BundleTemplateServicegetBundleTemplateName in interface BundleTemplateServicebundleTemplate - a bundle componentpublic EntryGroup getBundleEntryGroup(AbstractOrderEntryModel entry)
BundleTemplateServiceEntryGroup of type GroupType.CONFIGURABLEBUNDLE the given
entry belongs to.getBundleEntryGroup in interface BundleTemplateServiceentry - entry to get group forpublic EntryGroup getBundleEntryGroup(AbstractOrderModel order, java.util.Set<java.lang.Integer> entryGroupNumbers)
BundleTemplateServiceCONFIGURABLEBUNDLE in given order.getBundleEntryGroup in interface BundleTemplateServiceorder - Order to get bundle group forentryGroupNumbers - List of Integers representing numbers of EntryGroupspublic EntryGroup createBundleTree(BundleTemplateModel bundleTemplate, AbstractOrderModel order)
BundleTemplateServicecreateBundleTree in interface BundleTemplateServicebundleTemplate - any component of a bundle templateorder - order to add the bundle toEntryGroup of the structure createdprotected java.util.List<EntryGroup> createEntryGroupTree(BundleTemplateModel currentBundleTemplate, EntryGroup parentEntryGroup)
protected void addGroupNumbers(java.util.List<EntryGroup> bundleEntryGroups, AbstractOrderModel order)
protected void addTreeToOrder(AbstractOrderModel order, EntryGroup rootGroup)
protected BundleTemplateDao getBundleTemplateDao()
public void setBundleTemplateDao(BundleTemplateDao bundleTemplateDao)
protected AbstractBundleComponentEditableChecker<CartModel> getBundleComponentEditableChecker()
public void setBundleComponentEditableChecker(AbstractBundleComponentEditableChecker<CartModel> bundleComponentEditableChecker)
public java.util.List<BundleTemplateModel> getAllRootBundleTemplates(CatalogVersionModel catalogVersion)
BundleTemplateServicegetAllRootBundleTemplates in interface BundleTemplateServicecatalogVersion - catalog version where bundle templates will be searched inList of BundleTemplateModelspublic java.util.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)
protected EntryGroupService getEntryGroupService()
public void setEntryGroupService(EntryGroupService entryGroupService)
Copyright © 2018 SAP SE. All Rights Reserved.