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
ConstructorDescriptionDefaultConsolidatedProductPostProcessor
(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) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Create the sandbox override value to store as part ofConsolidatedProduct.getSandboxOverrides()
.protected static boolean
protected boolean
isInheriting
(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 boolean
isSameSandboxContext
(ConsolidatedProduct reference, ConsolidatedProduct candidate) protected boolean
isSandboxOverride
(ConsolidatedProduct reference, ConsolidatedProduct candidate) Determine if the candidate product is a more close sandbox version than the reference.void
process
(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)
-
-
Method Details
-
process
public void process(ConsolidatedProduct product, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
process
in interfaceConsolidatedProductPostProcessor
-
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)
-