Interface BundleTemplateService
-
- All Known Implementing Classes:
DefaultBundleTemplateService
public interface BundleTemplateServiceBundle template service that exposes methods to deal with bundle template operations.- Spring Bean ID:
- bundleTemplateService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description EntryGroupcreateBundleTree(BundleTemplateModel bundleTemplate, AbstractOrderModel order)Creates entry group tree reflecting the structure of a bundle template and add the tree to the given order.java.util.List<BundleTemplateModel>getAllApprovedRootBundleTemplates(CatalogVersionModel catalogVersion)This methods returns all approved root bundle templates.java.util.List<BundleTemplateModel>getAllRootBundleTemplates(CatalogVersionModel catVer)This methods returns all root bundle templates.EntryGroupgetBundleEntryGroup(AbstractOrderEntryModel entry)ReturnsEntryGroupof typeGroupType.CONFIGURABLEBUNDLEthe given entry belongs to.EntryGroupgetBundleEntryGroup(AbstractOrderModel order, java.util.Set<java.lang.Integer> entryGroupNumbers)For given Set of entry group numbers find the one which id is of typeCONFIGURABLEBUNDLEin given order.BundleTemplateModelgetBundleTemplateForCode(java.lang.String bundleId)This method returns the bundle template by bundle idbundleIdBundleTemplateModelgetBundleTemplateForCode(java.lang.String bundleId, java.lang.String version)This method returns the bundle template by bundle idbundleIdjava.lang.StringgetBundleTemplateName(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 listjava.util.List<BundleTemplateModel>getLeafComponents(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 templateBundleTemplateModelgetPreviousBundleTemplate(BundleTemplateModel bundleTemplate)Returns the previous child bundle template.BundleTemplateModelgetRelativeBundleTemplate(BundleTemplateModel bundleTemplate, int relativePosition)Returns a relative child bundle template.BundleTemplateModelgetRootBundleTemplate(BundleTemplateModel bundleTemplateModel)This method returns the root bundleTemplateBundleTemplateModelof the givenbundleTemplateModel.BundleTemplateModelgetSubsequentBundleTemplate(BundleTemplateModel bundleTemplate)Returns the next child bundle template.booleanisAutoPickComponent(BundleTemplateModel bundleTemplate)Deprecated, for removal: This API element is subject to removal in a future version.since 1811 - auto pick component is a part of subscriptionbundlesbooleanisBundleTemplateUsed(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 Detail
-
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
@Nonnull BundleTemplateModel getBundleTemplateForCode(@Nonnull java.lang.String bundleId)
This method returns the bundle template by bundle idbundleId- Parameters:
bundleId- Bundle Id- Returns:
- BundleTemplateModel
BundleTemplateModel
-
getBundleTemplatesByProduct
@Nonnull java.util.List<BundleTemplateModel> getBundleTemplatesByProduct(@Nonnull ProductModel model)
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
@Nonnull java.util.List<BundleTemplateModel> getLeafComponents(@Nonnull BundleTemplateModel anyComponent)
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 java.lang.String bundleId, @Nonnull java.lang.String version)
This method returns the bundle template by bundle idbundleId- Parameters:
bundleId- Bundle Idversion- bundle version- Returns:
- BundleTemplateModel
BundleTemplateModel
-
isAutoPickComponent
@Deprecated(since="1811", forRemoval=true) boolean isAutoPickComponent(@Nullable BundleTemplateModel bundleTemplate)Deprecated, for removal: This API element is subject to removal in a future version.since 1811 - auto pick component is a part of subscriptionbundlesChecks ifBundleTemplateModelhas a selection criteria of auto pick type.- Parameters:
bundleTemplate- Bundle Template Model- Returns:
trueif selection criteria has auto pick type, otherwisefalse
-
getAllRootBundleTemplates
@Nonnull java.util.List<BundleTemplateModel> getAllRootBundleTemplates(CatalogVersionModel catVer)
This methods returns all root bundle templates.- Parameters:
catVer- catalog version where bundle templates will be searched in- Returns:
ListofBundleTemplateModels
-
getPositionInParent
int getPositionInParent(@Nonnull BundleTemplateModel bundleTemplate)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 java.util.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
@Nonnull java.lang.String getBundleTemplateName(BundleTemplateModel bundleTemplate)
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
EntryGroup getBundleEntryGroup(@Nonnull AbstractOrderEntryModel entry)
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
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 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:
java.lang.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
-
-