public class DefaultMerchCatalogService extends java.lang.Object implements MerchCatalogService
MerchCatalogService, used
to make catalog requests for Merch v2 support.| Modifier and Type | Field and Description |
|---|---|
protected BaseSiteService |
baseSiteService |
protected AbstractUrlResolver<CategoryModel> |
categoryUrlResolver |
| Constructor and Description |
|---|
DefaultMerchCatalogService() |
| Modifier and Type | Method and Description |
|---|---|
protected BaseSiteService |
getBaseSiteService()
Gets the configured
BaseSiteService, used to set the current site for the request. |
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).
|
AbstractUrlResolver<CategoryModel> |
getCategoryUrlResolver()
Retrieves the configured URL resolver for
CategoryModel. |
protected java.lang.String |
getUrl(CategoryModel category,
java.lang.String baseCategoryUrl)
getUrl resolves the URL for a provided
CategoryModel. |
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.
|
void |
setBaseSiteService(BaseSiteService baseSiteService)
Sets the configured
BaseSiteService, used to set the current site for the request. |
void |
setCategoryUrlResolver(AbstractUrlResolver<CategoryModel> categoryUrlResolver)
Sets the configured URL resolver for
CategoryModel. |
protected BaseSiteService baseSiteService
protected AbstractUrlResolver<CategoryModel> categoryUrlResolver
public java.util.List<CategoryHierarchy> getCategories(java.lang.String baseSite, java.lang.String catalogId, java.lang.String catalogVersionId, java.lang.String baseCategoryUrl)
getCategories in interface MerchCatalogServicebaseSite - 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.CategoryHierarchy representing the categories.protected void processSubCategories(CategoryHierarchy toPopulate, CategoryModel category, boolean root, java.lang.String categoryUrl)
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.protected java.lang.String getUrl(CategoryModel category, java.lang.String baseCategoryUrl)
CategoryModel.category - the category model to retrieve the URL for.protected BaseSiteService getBaseSiteService()
BaseSiteService, used to set the current site for the request.public void setBaseSiteService(BaseSiteService baseSiteService)
BaseSiteService, used to set the current site for the request.baseSiteService - the injected base site service to use.public AbstractUrlResolver<CategoryModel> getCategoryUrlResolver()
CategoryModel.public void setCategoryUrlResolver(AbstractUrlResolver<CategoryModel> categoryUrlResolver)
CategoryModel.categoryUrlResolver - the resolver to return.Copyright © 2018 SAP SE. All Rights Reserved.