Interface BundleTemplateService
- All Known Implementing Classes:
DefaultBundleTemplateService
public interface BundleTemplateService
Bundle template service that exposes methods to deal with bundle template operations.
- Spring Bean ID:
- bundleTemplateService
-
Method Summary
Modifier and TypeMethodDescriptioncreateBundleTree(BundleTemplateModel bundleTemplate, AbstractOrderModel order) Creates entry group tree reflecting the structure of a bundle template and add the tree to the given order.getAllApprovedRootBundleTemplates(CatalogVersionModel catalogVersion) This methods returns all approved root bundle templates.This methods returns all root bundle templates.ReturnsEntryGroupof typeGroupType.CONFIGURABLEBUNDLEthe given entry belongs to.getBundleEntryGroup(AbstractOrderModel order, Set<Integer> entryGroupNumbers) For given Set of entry group numbers find the one which id is of typeCONFIGURABLEBUNDLEin given order.getBundleTemplateForCode(String bundleId) This method returns the bundle template by bundle idbundleIdgetBundleTemplateForCode(String bundleId, String version) This method returns the bundle template by bundle idbundleIdgetBundleTemplateName(BundleTemplateModel bundleTemplate) Get well-formatted string with the name of the given component.Get all components (child bundle templates) where the current device is included in the products listgetLeafComponents(BundleTemplateModel anyComponent) Collect all leaf components of bundle.intgetPositionInParent(BundleTemplateModel bundleTemplate) Returns the givenbundleTemplate's absolute position in the list of child templates that are assigned to the parent templategetPreviousBundleTemplate(BundleTemplateModel bundleTemplate) Returns the previous child bundle template.getRelativeBundleTemplate(BundleTemplateModel bundleTemplate, int relativePosition) Returns a relative child bundle template.getRootBundleTemplate(BundleTemplateModel bundleTemplateModel) This method returns the root bundleTemplateBundleTemplateModelof the givenbundleTemplateModel.getSubsequentBundleTemplate(BundleTemplateModel bundleTemplate) Returns the next child bundle template.booleanisAutoPickComponent(BundleTemplateModel bundleTemplate) Checks ifBundleTemplateModelhas a selection criteria of auto pick type.booleanisBundleTemplateUsed(BundleTemplateModel bundleTemplate) Deprecated, for removal: This API element is subject to removal in a future version.since 1905 - used only in cockpits which is deprecated
-
Method Details
-
getRootBundleTemplate
@Nonnull BundleTemplateModel getRootBundleTemplate(@Nonnull BundleTemplateModel bundleTemplateModel) This method returns the root bundleTemplateBundleTemplateModelof the givenbundleTemplateModel. In case the givenbundleTemplateModelis the root template the givenbundleTemplateModelis returned as root template.- Parameters:
bundleTemplateModel- Bundle Template Model- Returns:
BundleTemplateModel
-
getBundleTemplateForCode
This method returns the bundle template by bundle idbundleId- Parameters:
bundleId- Bundle Id- Returns:
- BundleTemplateModel
BundleTemplateModel
-
getBundleTemplatesByProduct
Get all components (child bundle templates) where the current device is included in the products list- Parameters:
model- Product Model- Returns:
- List -
BundleTemplateModel
-
getSubsequentBundleTemplate
@Nullable BundleTemplateModel getSubsequentBundleTemplate(@Nonnull BundleTemplateModel bundleTemplate) Returns the next child bundle template. The logic retrieves the parent of the givenbundleTemplateand selects the parents next child template, e.g. SMAR_Handset (givenbundleTemplate) -> SMAR (parent template) -> SMAR_Plan (next child template of parent), SMAR_Plan is returned.- Parameters:
bundleTemplate- Bundle Template Model- Returns:
BundleTemplateModel
-
getPreviousBundleTemplate
@Nullable BundleTemplateModel getPreviousBundleTemplate(@Nonnull BundleTemplateModel bundleTemplate) Returns the previous child bundle template. The logic retrieves the parent of the givenbundleTemplateand selects the parents next child template, e.g. SMAR_Plan (givenbundleTemplate) -> SMAR (parent template) -> SMAR_Handset (previous child template of parent), SMAR_Handset is returned.- Parameters:
bundleTemplate- Bundle Template Model- Returns:
BundleTemplateModel
-
getRelativeBundleTemplate
@Nullable BundleTemplateModel getRelativeBundleTemplate(@Nonnull BundleTemplateModel bundleTemplate, int relativePosition) Returns a relative child bundle template. The logic retrieves the parent of the givenbundleTemplateand selects the parents relative child template- Parameters:
bundleTemplate- Bundle Template ModelrelativePosition- the relative position of the child template to be returned- Returns:
BundleTemplateModel
-
getLeafComponents
Collect all leaf components of bundle.- Parameters:
anyComponent- any component in bundle hierarchy- Returns:
- list of leaf components in correct order
-
getBundleTemplateForCode
@Nonnull BundleTemplateModel getBundleTemplateForCode(@Nonnull String bundleId, @Nonnull String version) This method returns the bundle template by bundle idbundleId- Parameters:
bundleId- Bundle Idversion- bundle version- Returns:
- BundleTemplateModel
BundleTemplateModel
-
isAutoPickComponent
Checks ifBundleTemplateModelhas a selection criteria of auto pick type.- Parameters:
bundleTemplate- Bundle Template Model- Returns:
trueif selection criteria has auto pick type, otherwisefalse
-
getAllRootBundleTemplates
This methods returns all root bundle templates.- Parameters:
catVer- catalog version where bundle templates will be searched in- Returns:
ListofBundleTemplateModels
-
getPositionInParent
Returns the givenbundleTemplate's absolute position in the list of child templates that are assigned to the parent template- Parameters:
bundleTemplate- the child template whose position shall be returned- Returns:
- absolute position as int
-
getAllApprovedRootBundleTemplates
@Nonnull List<BundleTemplateModel> getAllApprovedRootBundleTemplates(CatalogVersionModel catalogVersion) This methods returns all approved root bundle templates.- Parameters:
catalogVersion- catalog version where bundle templates will be searched in- Returns:
ListofBundleTemplateModels
-
isBundleTemplateUsed
@Deprecated(since="1905", forRemoval=true) boolean isBundleTemplateUsed(@Nonnull BundleTemplateModel bundleTemplate) Deprecated, for removal: This API element is subject to removal in a future version.since 1905 - used only in cockpits which is deprecatedChecks if the givenBundleTemplateModelwas used in any cart or order entry- Parameters:
bundleTemplate- Bundle Template Model- Returns:
- true if given bundleTemplate is used in any cart/order entry, otherwise false
-
getBundleTemplateName
Get well-formatted string with the name of the given component.- Parameters:
bundleTemplate- a bundle component- Returns:
- the name of the component of component id (if the name is null)
-
getBundleEntryGroup
ReturnsEntryGroupof typeGroupType.CONFIGURABLEBUNDLEthe given entry belongs to.- Parameters:
entry- entry to get group for- Returns:
- entry group or null if the entry does not belong to any bundle groups
-
getBundleEntryGroup
For given Set of entry group numbers find the one which id is of typeCONFIGURABLEBUNDLEin given order.- Parameters:
order- Order to get bundle group forentryGroupNumbers- List of Integers representing numbers of EntryGroups- Returns:
- EntryGroup of type CONFIGURABLEBUNDLE in given order, referenced in entryGroupNumbers
- Throws:
IllegalArgumentException- when there is more than one group of the given type found
-
createBundleTree
@Nonnull EntryGroup createBundleTree(@Nonnull BundleTemplateModel bundleTemplate, @Nonnull AbstractOrderModel order) Creates entry group tree reflecting the structure of a bundle template and add the tree to the given order.- Parameters:
bundleTemplate- any component of a bundle templateorder- order to add the bundle to- Returns:
- root
EntryGroupof the structure created
-