Broadleaf Microservices
  • v1.0.0-latest-prod

Catalog Browse Catalog Provider

Overview

Provider for interfacing with Catalog entities. This is used to retrieve the basic information for products and categories. It additionally will interact with the PricingProvider to enhance the pricing information on products.

Default Implementation Details

The default implementation, ExternalCatalogProvider, is designed to interact with the Broadleaf Catalog Services, which handles building out the product and category hierarchies. This ensures that the fewest number of HTTP requests are made as possible so that the caller does not need to handle as much of the complexity related to the Product domain hierarchy.

Configuration

ExternalCatalogProvider defines the following configuration properties:

  • broadleaf.catalogbrowse.catalogprovider.url: The base url for an external catalog service.

  • broadleaf.catalogbrowse.catalogprovider.productsUri: The context path for reading product information. This is appended to the url property.

  • broadleaf.catalogbrowse.catalogprovider.productAssetsUri: The URI path for retrieving product assets. This is appended to productsUri.

    • Note that this is only necessary if assets are requested separately from product details such as for hydrating search results. Otherwise, they are already hydrated on the results of fetchProductsWithDetails and fetchCategoryWithDetails.

  • broadleaf.catalogbrowse.catalogprovider.categoriesUri: The context path for reading category information. This is appended to the url property.

  • broadleaf.catalogbrowse.catalogprovider.browseEntitiesUri: The URI path for retrieving browse entities when the type is not known by the caller. This is appended to the url property.

    • This could be the case when the caller has a browser URL but does not know if it belongs to a Catalog or a Product.

  • broadleaf.catalogbrowse.catalogprovider.dataDrivenEnumsUri: The context path for reading data driven enum information. This is appended to the url property.

  • broadleaf.catalogbrowse.catalogprovider.cartFieldMappingsUri: The URI path for retrieving cart field mappings. This is appended to the url property.

  • broadleaf.catalogbrowse.catalogprovider.productTagsUri: The URI path for retrieving product tags. This is appended to productsUri.

    • Note that this is only necessary if tags are requested separately from product details such as for hydrating search results. Otherwise, they are already hydrated on the results of fetchProductsWithDetails and fetchCategoryWithDetails.

  • broadleaf.catalogbrowse.catalogprovider.liteVariantsUri: The URI path for retrieving LiteVariants for a product. This is appended to the url property.

    • Since version 2.2.0

  • broadleaf.catalogbrowse.catalogprovider.loopbackOptimizationEnabled: Where available, whether optimizing microservice interlink requests should be optimized with a direct method call when the targeted service is colocated in the same flexpackage

    • Since version 2.1.0

  • broadleaf.catalogbrowse.catalogprovider.assetMinificationEnabled: Whether to reduce the overall payload size of response by trimming typically unnecessary information from Assets

    • Since version 2.1.0

Example of building request from properties
UriComponentsBuilder.fromHttpUrl(getUrl())
        .path(getProductsUri())
        .queryParam("productUris", productUris)
        .toUriString();