Class DefaultConsolidatedProductPostProcessor
java.lang.Object
com.broadleafcommerce.catalog.service.product.consolidation.DefaultConsolidatedProductPostProcessor
- All Implemented Interfaces:
ConsolidatedProductPostProcessor
public class DefaultConsolidatedProductPostProcessor
extends Object
implements ConsolidatedProductPostProcessor
Default implementation of
ConsolidatedProductPostProcessor. Focuses on adding data for
ConsolidatedProduct.getCatalogOverrides(),
ConsolidatedProduct.getSandboxOverrides(), and
ConsolidatedProduct.getCatalogOmissions().- Author:
- Jeff Fischer
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultConsolidatedProductPostProcessor(List<ConsolidatedProduct> products, ProductService<Product> productService, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, Map<String, Set<String>> marketplaceApplicationsForCatalogs, Map<String, Set<String>> pendingMarketplaceApplicationsForCatalogs) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddFromInheritanceLines(ConsolidatedProduct product, String productCatalog, Map<String, Set<String>> applicationsForCatalogs, Set<String> applicationsToAdd) protected StringCreate the sandbox override value to store as part ofConsolidatedProduct.getSandboxOverrides().protected static booleanprotected booleanisInheriting(String reference, String candidate) Determine if the candidate catalog id represents a catalog that inherits from a catalog represented by the reference catalog id.protected booleanisSameSandboxContext(ConsolidatedProduct reference, ConsolidatedProduct candidate) protected booleanisSandboxOverride(ConsolidatedProduct reference, ConsolidatedProduct candidate) Determine if the candidate product is a more close sandbox version than the reference.voidprocess(ConsolidatedProduct product, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
Constructor Details
-
DefaultConsolidatedProductPostProcessor
public DefaultConsolidatedProductPostProcessor(List<ConsolidatedProduct> products, ProductService<Product> productService, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, Map<String, Set<String>> marketplaceApplicationsForCatalogs, Map<String, Set<String>> pendingMarketplaceApplicationsForCatalogs)
-
-
Method Details
-
process
public void process(ConsolidatedProduct product, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
processin interfaceConsolidatedProductPostProcessor
-
addFromInheritanceLines
-
isSandboxOverride
Determine if the candidate product is a more close sandbox version than the reference.- Parameters:
reference- The production or sandbox version to use as a base referencecandidate- The candidate sandbox version to compare against the reference for closeness- Returns:
- Whether or not the candidate is a closer sandbox version
-
createSandboxOverrideValue
Create the sandbox override value to store as part ofConsolidatedProduct.getSandboxOverrides(). Usually a combination of sandbox id and sandbox owner.- Parameters:
override- The sandbox overriding product- Returns:
- The representative string for the override
-
isInheriting
Determine if the candidate catalog id represents a catalog that inherits from a catalog represented by the reference catalog id.- Parameters:
reference- The id of the reference catalogcandidate- The id of the candidate catalog- Returns:
- Whether or not the candidate inherits from the reference
-
isActiveSandboxMember
-
isSameSandboxContext
protected boolean isSameSandboxContext(ConsolidatedProduct reference, ConsolidatedProduct candidate)
-