Class CatalogBrowseEndpoint
java.lang.Object
com.broadleafcommerce.catalogbrowse.web.endpoint.CatalogBrowseEndpoint
@FrameworkRestController
@FrameworkMapping
@DataRouteByKey("catalogbrowse")
public class CatalogBrowseEndpoint
extends Object
- Author:
- Nathan Moore (nathandmoore)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCatalogBrowseEndpoint(CatalogProvider browseCatalogProvider, BrowseEntityResolver browseEntityResolver, CatalogSearchProvider<Product> browseCatalogSearchProvider, OfferProvider browseOfferProvider, MarketingMessageUtils marketingMessageUtils, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtilsprotected booleangetBooleanParameter(@NonNull org.springframework.util.MultiValueMap<String, String> parameters, @NonNull String paramName) Gets a parameter from the parameters and converts to a boolean.protected CatalogProviderprotected CatalogSearchProvider<Product>protected ContentProviderprotected BrowseEntityResolverprotected OfferProviderprotected PricingProvidergetCatalogSearchResults(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, org.springframework.util.MultiValueMap<String, String> parameters) TODO: The/search/catalogmapping should be removed in the future as we will want to deprecate it in favor of/browse/search/catalog.getCatalogSuggestions(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, org.springframework.util.MultiValueMap<String, String> parameters) TODO: The/search/catalog/suggestmapping should be removed in the future as we will want to deprecate it in favor of/browse/search/catalog/suggest.getMarketingMessages(MarketingMessageRequest request, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) TODO: The/marketing-messagesmapping should be removed in the future as we will want to deprecate it in favor of/browse/marketing-messages.protected MarketingMessageUtilsList<com.broadleafcommerce.pricing.client.domain.PriceInfo>getPricingForTargets(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, PriceableTargetsRequest priceableTargetsRequest) getProductIdsToBuildLineItems(@NonNull MarketingMessageRequest request) Gets a set of product ids to build theLineItemDTOs from.protected ProductListgetProductList(@NonNull Set<String> productIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated, for removal: This API element is subject to removal in a future version.protected ProductListgetProductList(@NonNull Set<String> productIds, @Nullable com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.common.extension.TypeFactoryprotected booleanreadAllCategoryDetails(jakarta.servlet.http.HttpServletRequest servletRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, org.springframework.util.MultiValueMap<String, String> parameters, BulkCategoryDetailsRequest request) readBrowseEntityDetails(jakarta.servlet.http.HttpServletRequest servletRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, org.springframework.util.MultiValueMap<String, String> parameters) readBrowseEntityDetails(jakarta.servlet.http.HttpServletRequest servletRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, org.springframework.util.MultiValueMap<String, String> parameters, @Nullable ContentContext contentContext) readBulkContentItems(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, ContentContext contentContext, org.springframework.util.MultiValueMap<String, String> parameters, BulkContentResolverRequest bulkRequest) readCartFieldMappings(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) TODO: The/products/cart-field-mappingsmapping should be removed in the future as we will want to deprecate it in favor of/browse/products/cart-field-mappings.readCategoryDetails(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, org.springframework.util.MultiValueMap<String, String> parameters) TODO: The/categories/detailsmapping should be removed in the future as we will want to deprecate it in favor of/browse/categories.readContentItems(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, ContentContext contentContext, org.springframework.util.MultiValueMap<String, String> parameters) readDataDrivenEnumDetails(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, DataDrivenEnumDetailsRequest detailsRequest) TODO: The/data-driven-enums/detailsmapping should be removed in the future as we will want to deprecate it in favor of/browse/data-driven-enums.readProductDetails(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, org.springframework.util.MultiValueMap<String, String> parameters) TODO: The/products/detailsmapping should be removed in the future as we will want to deprecate it in favor of/browse/products.readProductDetailsWithSkipPricing(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, boolean skipPricing, boolean skipInventory, org.springframework.util.MultiValueMap<String, String> parameters) TODO: The/products/detailsmapping should be removed in the future as we will want to deprecate it in favor of/browse/products.protected MarketingMessageRequestremoveDuplicateProductIdsFromRequest(@NonNull MarketingMessageRequest request) voidsetAuthenticationUtils(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils) voidsetBrowseContentProvider(ContentProvider browseContentProvider) voidsetBrowsePricingProvider(PricingProvider browsePricingProvider) voidsetSubscriptionEnabled(boolean subscriptionEnabled)
-
Field Details
-
HYDRATE_CATEGORY_PRODUCTS_FROM_SEARCH
- See Also:
-
HYDRATE_CATEGORY_PRODUCTS
- See Also:
-
HYDRATE_PRODUCT_ASSETS
- See Also:
-
HYDRATE_CATEGORY_PRODUCTS_ONTO_CONTENT_ITEMS
- See Also:
-
-
Constructor Details
-
CatalogBrowseEndpoint
public CatalogBrowseEndpoint(CatalogProvider browseCatalogProvider, BrowseEntityResolver browseEntityResolver, CatalogSearchProvider<Product> browseCatalogSearchProvider, OfferProvider browseOfferProvider, MarketingMessageUtils marketingMessageUtils, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
readProductDetails
@FrameworkGetMapping({"/products/details","/browse/products"}) public ProductList readProductDetails(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @RequestHeader(value="X-Price-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @RequestHeader(value="X-Price-Info-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, @RequestParam org.springframework.util.MultiValueMap<String, String> parameters) TODO: The/products/detailsmapping should be removed in the future as we will want to deprecate it in favor of/browse/products. This mapping was originally slated to be removed in v2.0.0-GA.- Since:
- 2.0.0
-
readProductDetailsWithSkipPricing
@FrameworkGetMapping(value={"/products/details","/browse/products"}, params="skipPricing") public ProductList readProductDetailsWithSkipPricing(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @RequestHeader(value="X-Price-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @RequestHeader(value="X-Price-Info-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, @RequestParam boolean skipPricing, @RequestParam(required=false,defaultValue="false") boolean skipInventory, @RequestParam org.springframework.util.MultiValueMap<String, String> parameters) TODO: The/products/detailsmapping should be removed in the future as we will want to deprecate it in favor of/browse/products. This mapping was originally slated to be removed in v2.0.0-GA.- Since:
- 1.8.8, 2.0.1
-
readCategoryDetails
@FrameworkGetMapping({"/categories/details","/browse/categories"}) public Category readCategoryDetails(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @RequestHeader(value="X-Price-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @RequestHeader(value="X-Price-Info-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, @RequestParam org.springframework.util.MultiValueMap<String, String> parameters) TODO: The/categories/detailsmapping should be removed in the future as we will want to deprecate it in favor of/browse/categories. This mapping was originally slated to be removed in v2.0.0-GA.- Since:
- 2.0.0
-
readAllCategoryDetails
@FrameworkPostMapping(value="/browse/categories", consumes="application/json") public CategoryList readAllCategoryDetails(jakarta.servlet.http.HttpServletRequest servletRequest, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @RequestHeader(value="X-Price-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @RequestHeader(value="X-Price-Info-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, @RequestParam org.springframework.util.MultiValueMap<String, String> parameters, @RequestBody BulkCategoryDetailsRequest request) -
readContentItems
@FrameworkGetMapping("/browse/content-items") public ContentResolverResponse readContentItems(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestHeader(value="X-Content-Context",required=false) ContentContext contentContext, @RequestParam org.springframework.util.MultiValueMap<String, String> parameters) -
readBulkContentItems
@FrameworkPostMapping(value="/browse/content-items/bulk", consumes="application/json") public BulkContentResolverResponse readBulkContentItems(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestHeader(value="X-Content-Context",required=false) ContentContext contentContext, @RequestParam org.springframework.util.MultiValueMap<String, String> parameters, @RequestBody BulkContentResolverRequest bulkRequest) -
readBrowseEntityDetails
@FrameworkGetMapping("/browse/details") public BrowseEntityDetails readBrowseEntityDetails(jakarta.servlet.http.HttpServletRequest servletRequest, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @RequestHeader(value="X-Price-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @RequestHeader(value="X-Price-Info-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, @RequestParam org.springframework.util.MultiValueMap<String, String> parameters) -
readBrowseEntityDetails
@FrameworkGetMapping(value="/browse/details", headers="X-Content-Context") public BrowseEntityDetails readBrowseEntityDetails(jakarta.servlet.http.HttpServletRequest servletRequest, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @RequestHeader(value="X-Price-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @RequestHeader(value="X-Price-Info-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, @RequestParam org.springframework.util.MultiValueMap<String, String> parameters, @RequestHeader(value="X-Content-Context",required=false) @Nullable @Nullable ContentContext contentContext) -
readDataDrivenEnumDetails
@FrameworkGetMapping({"/data-driven-enums/details","/browse/data-driven-enums"}) public DataDrivenEnumList readDataDrivenEnumDetails(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, DataDrivenEnumDetailsRequest detailsRequest) TODO: The/data-driven-enums/detailsmapping should be removed in the future as we will want to deprecate it in favor of/browse/data-driven-enums. This mapping was originally slated to be removed in v2.0.0-GA.- Since:
- 2.0.0
-
readCartFieldMappings
@FrameworkGetMapping({"/products/cart-field-mappings","/browse/products/cart-field-mappings"}) public List<CartFieldMapping> readCartFieldMappings(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) TODO: The/products/cart-field-mappingsmapping should be removed in the future as we will want to deprecate it in favor of/browse/products/cart-field-mappings. This mapping was originally slated to be removed in v2.0.0-GA.- Since:
- 2.0.0
-
getCatalogSearchResults
@FrameworkGetMapping({"/search/catalog","/browse/search/catalog"}) public SearchResponse<Product> getCatalogSearchResults(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @RequestHeader(value="X-Price-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @RequestHeader(value="X-Price-Info-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, @RequestParam org.springframework.util.MultiValueMap<String, String> parameters) TODO: The/search/catalogmapping should be removed in the future as we will want to deprecate it in favor of/browse/search/catalog. This mapping was originally slated to be removed in v2.0.0-GA.- Since:
- 2.0.0
-
getPricingForTargets
@FrameworkPostMapping(value="/browse/price-targets", consumes="application/json") public List<com.broadleafcommerce.pricing.client.domain.PriceInfo> getPricingForTargets(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @RequestHeader(value="X-Price-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @RequestHeader(value="X-Price-Info-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, @RequestBody PriceableTargetsRequest priceableTargetsRequest) -
getCatalogSuggestions
@FrameworkGetMapping({"/search/catalog/suggest","/browse/search/catalog/suggest"}) public TypeAheadResponse getCatalogSuggestions(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @RequestHeader(value="X-Price-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @RequestHeader(value="X-Price-Info-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceInfoContext priceInfoContext, @RequestParam org.springframework.util.MultiValueMap<String, String> parameters) TODO: The/search/catalog/suggestmapping should be removed in the future as we will want to deprecate it in favor of/browse/search/catalog/suggest. This mapping was originally slated to be removed in v2.0.0-GA.- Since:
- 2.0.0
-
getMarketingMessages
@FrameworkPostMapping({"/marketing-messages","/browse/marketing-messages"}) public MarketingMessageResponse getMarketingMessages(@RequestBody MarketingMessageRequest request, @RequestHeader(value="X-Price-Context",required=false) com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) TODO: The/marketing-messagesmapping should be removed in the future as we will want to deprecate it in favor of/browse/marketing-messages. This mapping was originally slated to be removed in v2.0.0-GA.- Since:
- 2.0.0
-
getProductIdsToBuildLineItems
protected Set<String> getProductIdsToBuildLineItems(@NonNull @NonNull MarketingMessageRequest request) Gets a set of product ids to build theLineItemDTOs from.By default, this method will return the union of the product ids and cart product ids, and any product ids that are already in the line items are removed.
- Parameters:
request- theMarketingMessageRequestto get the product ids from- Returns:
- a set of product ids to build the
LineItemDTOs from - Since:
- Catalog Browse Service 2.2.0, Release Train 2.3.0
-
getProductList
@Deprecated(since="Catalog Browse Service 2.2.0, Release Train 2.3.0", forRemoval=true) protected ProductList getProductList(@NonNull @NonNull Set<String> productIds, @Nullable @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated, for removal: This API element is subject to removal in a future version.in favor ofgetProductList(Set, PriceContext, ContextInfo) -
getProductList
protected ProductList getProductList(@NonNull @NonNull Set<String> productIds, @Nullable @Nullable com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @Nullable @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
removeDuplicateProductIdsFromRequest
protected MarketingMessageRequest removeDuplicateProductIdsFromRequest(@NonNull @NonNull MarketingMessageRequest request) -
getBooleanParameter
protected boolean getBooleanParameter(@NonNull @NonNull org.springframework.util.MultiValueMap<String, String> parameters, @NonNull @NonNull String paramName) Gets a parameter from the parameters and converts to a boolean.- Parameters:
parameters- Map of request parameters received.paramName- Name of the parameter to get.- Returns:
- The value of parameter.
- Since:
- Catalog Browse Service 2.1.0, Release Train 2.2.0
-
isSubscriptionEnabled
protected boolean isSubscriptionEnabled() -
setSubscriptionEnabled
@Autowired public void setSubscriptionEnabled(@Value("${broadleaf.subscription.enabled:false}") boolean subscriptionEnabled) -
getBrowseCatalogProvider
-
getBrowseEntityResolver
-
getBrowseCatalogSearchProvider
-
getBrowseOfferProvider
-
getMarketingMessageUtils
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
setBrowseContentProvider
-
getBrowseContentProvider
-
setBrowsePricingProvider
-
getBrowsePricingProvider
-
setAuthenticationUtils
@Autowired public void setAuthenticationUtils(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils) -
getAuthenticationUtils
protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils getAuthenticationUtils()
-
getProductList(Set, PriceContext, ContextInfo)