Class DefaultProductConsolidationService
java.lang.Object
com.broadleafcommerce.catalog.service.product.consolidation.DefaultProductConsolidationService
- All Implemented Interfaces:
ProductConsolidationService
public class DefaultProductConsolidationService
extends Object
implements ProductConsolidationService
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultProductConsolidationService
(List<ProductConsolidationContributor> productConsolidationContributors, ProductService<Product> productSvc, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.data.tracking.core.tenant.service.CommonCatalogService<com.broadleafcommerce.data.tracking.core.tenant.domain.Catalog> catalogService, com.broadleafcommerce.data.tracking.core.marketplace.service.CommonMarketplaceApplicationCatalogService<com.broadleafcommerce.data.tracking.core.tenant.domain.MarketplaceApplicationCatalog> marketplaceApplicationCatalogService, cz.jirutka.rsql.parser.RSQLParser rsqlParser) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<ConsolidatedProduct>
consolidateProducts
(List<Product> products, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, Map<String, com.broadleafcommerce.data.tracking.core.tenant.domain.Catalog> catalogsById, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Consolidate products with their related domain and translations.protected ConsolidatedProductPostProcessor
createPostProcessor
(List<ConsolidatedProduct> products, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, Map<String, Set<String>> marketplaceApplicationsForCatalogs) getBaseCatalogIds
(List<Product> products) protected com.broadleafcommerce.data.tracking.core.tenant.service.CommonCatalogService<com.broadleafcommerce.data.tracking.core.tenant.domain.Catalog>
protected com.broadleafcommerce.data.tracking.core.marketplace.service.CommonMarketplaceApplicationCatalogService<com.broadleafcommerce.data.tracking.core.tenant.domain.MarketplaceApplicationCatalog>
getOverrideCatalogIds
(List<Product> products) protected List<ProductConsolidationContributor>
protected ProductService<Product>
protected cz.jirutka.rsql.parser.RSQLParser
protected com.broadleafcommerce.common.extension.TypeFactory
protected void
processSandboxOwner
(ConsolidatedProduct product) Populate the sandbox owner of the product, if in a user sandbox context.protected void
processVendorRef
(ConsolidatedProduct consolidatedProduct, Map<String, com.broadleafcommerce.data.tracking.core.tenant.domain.Catalog> catalogsById) Populate the vendor ref from the Product's catalog.readAllConsolidatedProducts
(cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Read and consolidate products with their related domain.readMarketplaceApplicationsForCatalogs
(Set<String> catalogs, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
-
Field Details
-
ARCHIVED_FILTER
- See Also:
-
-
Constructor Details
-
DefaultProductConsolidationService
public DefaultProductConsolidationService(List<ProductConsolidationContributor> productConsolidationContributors, ProductService<Product> productSvc, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.data.tracking.core.tenant.service.CommonCatalogService<com.broadleafcommerce.data.tracking.core.tenant.domain.Catalog> catalogService, @Nullable com.broadleafcommerce.data.tracking.core.marketplace.service.CommonMarketplaceApplicationCatalogService<com.broadleafcommerce.data.tracking.core.tenant.domain.MarketplaceApplicationCatalog> marketplaceApplicationCatalogService, cz.jirutka.rsql.parser.RSQLParser rsqlParser)
-
-
Method Details
-
readAllConsolidatedProducts
public List<ConsolidatedProduct> readAllConsolidatedProducts(@NonNull cz.jirutka.rsql.parser.ast.Node filters, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:ProductConsolidationService
Read and consolidate products with their related domain.- Specified by:
readAllConsolidatedProducts
in interfaceProductConsolidationService
- Parameters:
filters
- the RSQLNode
used to restrict results, must not be nullcontext
- context information around sandboxing and multitenant state- Returns:
- list of products consolidated with relations
-
getBaseCatalogIds
-
getOverrideCatalogIds
-
consolidateProducts
protected List<ConsolidatedProduct> consolidateProducts(List<Product> products, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, Map<String, com.broadleafcommerce.data.tracking.core.tenant.domain.Catalog> catalogsById, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Consolidate products with their related domain and translations. This includes both hydratingProduct
fields and combining external references likeCategoryProduct
. Any catalog or sandbox overrides made to external references for non-overridden products will generate new placeholder products to store those overrides.- Parameters:
products
- the products in all explicit context statesinheritanceLines
- the catalog inheritance lines top-down from all of the productscontext
- context information surrounding sandboxing/multitenant state- Returns:
- A list of products combined with all relations including every overridden state
-
processSandboxOwner
Populate the sandbox owner of the product, if in a user sandbox context.- Parameters:
product
- the ConsolidatedProduct on which to populate the sandbox owner
-
processVendorRef
protected void processVendorRef(ConsolidatedProduct consolidatedProduct, Map<String, com.broadleafcommerce.data.tracking.core.tenant.domain.Catalog> catalogsById) Populate the vendor ref from the Product's catalog.- Parameters:
consolidatedProduct
- the ConsolidatedProduct on which to populate the vendor refcatalogsById
- the map of the catalogs with the catalog id as a key
-
readMarketplaceApplicationsForCatalogs
-
createPostProcessor
protected ConsolidatedProductPostProcessor createPostProcessor(List<ConsolidatedProduct> products, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, Map<String, Set<String>> marketplaceApplicationsForCatalogs) -
getProductConsolidationContributors
-
getProductSvc
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getCatalogService
protected com.broadleafcommerce.data.tracking.core.tenant.service.CommonCatalogService<com.broadleafcommerce.data.tracking.core.tenant.domain.Catalog> getCatalogService() -
getMarketplaceApplicationCatalogService
@Nullable protected com.broadleafcommerce.data.tracking.core.marketplace.service.CommonMarketplaceApplicationCatalogService<com.broadleafcommerce.data.tracking.core.tenant.domain.MarketplaceApplicationCatalog> getMarketplaceApplicationCatalogService() -
getRsqlParser
protected cz.jirutka.rsql.parser.RSQLParser getRsqlParser()
-