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 Detail

      • getRootBundleTemplate

        @Nonnull
        BundleTemplateModel getRootBundleTemplate​(@Nonnull
                                                  BundleTemplateModel bundleTemplateModel)
        This method returns the root bundleTemplate BundleTemplateModel of the given bundleTemplateModel. In case the given bundleTemplateModel is the root template the given bundleTemplateModel is 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 id bundleId
        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 given bundleTemplate 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.
        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 given bundleTemplate 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.
        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 given bundleTemplate and selects the parents relative child template
        Parameters:
        bundleTemplate - Bundle Template Model
        relativePosition - 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 id bundleId
        Parameters:
        bundleId - Bundle Id
        version - 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 subscriptionbundles
        Checks if BundleTemplateModel has a selection criteria of auto pick type.
        Parameters:
        bundleTemplate - Bundle Template Model
        Returns:
        true if selection criteria has auto pick type, otherwise false
      • 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:
        List of BundleTemplateModels
      • getPositionInParent

        int getPositionInParent​(@Nonnull
                                BundleTemplateModel bundleTemplate)
        Returns the given bundleTemplate'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:
        List of BundleTemplateModels
      • 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 deprecated
        Checks if the given BundleTemplateModel was 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​(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.
        Parameters:
        order - Order to get bundle group for
        entryGroupNumbers - 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 template
        order - order to add the bundle to
        Returns:
        root EntryGroup of the structure created