Class DefaultMerchCatalogService

    • Constructor Detail

      • DefaultMerchCatalogService

        public DefaultMerchCatalogService()
    • Method Detail

      • getCategories

        public java.util.List<CategoryHierarchy> getCategories​(java.lang.String baseSite,
                                                               java.lang.String catalogId,
                                                               java.lang.String catalogVersionId,
                                                               java.lang.String baseCategoryUrl)
        getCategories is a method for retrieving the category hierarchy (including subcategories).
        Specified by:
        getCategories in interface MerchCatalogService
        Parameters:
        baseSite - the base site we wish to retrieve the category hierarchy for.
        catalogId - the catalog we wish to retrieve the category hierarchy from.
        catalogVersionId - the catalog version we wish to retrieve the category hierarchy for.
        baseCategoryUrl - the URL we wish to use to access the category from.
        Returns:
        a List of CategoryHierarchy representing the categories.
      • processSubCategories

        protected void processSubCategories​(CategoryHierarchy toPopulate,
                                            CategoryModel category,
                                            boolean root,
                                            java.lang.String categoryUrl)
        processSubCategories is a method for taking a category model and recursively processing its sub categories.
        Parameters:
        toPopulate - the CategoryHierarchy we wish to populate.
        category - the CategoryModel representing the hierarchy.
        root - whether the category is a root category or not.
        categoryUrl - the URL to prefix the category with.
      • getUrl

        protected java.lang.String getUrl​(CategoryModel category,
                                          java.lang.String baseCategoryUrl)
        getUrl resolves the URL for a provided CategoryModel.
        Parameters:
        category - the category model to retrieve the URL for.
        Returns:
        a String containing the URL.
      • getBaseSiteService

        protected BaseSiteService getBaseSiteService()
        Gets the configured BaseSiteService, used to set the current site for the request.
        Returns:
        the injected base site service to use.
      • setBaseSiteService

        public void setBaseSiteService​(BaseSiteService baseSiteService)
        Sets the configured BaseSiteService, used to set the current site for the request.
        Parameters:
        baseSiteService - the injected base site service to use.
      • setCategoryUrlResolver

        public void setCategoryUrlResolver​(AbstractUrlResolver<CategoryModel> categoryUrlResolver)
        Sets the configured URL resolver for CategoryModel.
        Parameters:
        categoryUrlResolver - the resolver to return.