Class DefaultOptionTemplatePreloader
java.lang.Object
com.broadleafcommerce.dataexchange.service.catalog.product.DefaultOptionTemplatePreloader
- All Implemented Interfaces:
BatchExtensionProcessor,org.springframework.core.Ordered
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
FieldsFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultOptionTemplatePreloader(CatalogProvider<ComprehensiveProduct, Variant> catalogProvider, ProductBatchItemHandlerHelper<ComprehensiveProduct> helper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionbooleanMethod to determine if this handler should execute.protected voidfetchOptionTemplates(DefaultOptionTemplatePreloader.OptionTemplateFilterValues templateFilterValues, BatchContext<ComprehensiveProduct> batchContext) protected CatalogProvider<ComprehensiveProduct,Variant> protected com.broadleafcommerce.common.extension.TypeFactoryprotected voidhandleCustomGenerateOptionType(ComprehensiveProduct product, GenerateProductOption option, DefaultOptionTemplatePreloader.OptionTemplateFilterValues templateFilterValues, BatchContext<ComprehensiveProduct> batchContext) protected voidhandleMissingName(ComprehensiveProduct product, GenerateProductOption option, DefaultOptionTemplatePreloader.OptionTemplateFilterValues templateFilterValues, BatchContext<ComprehensiveProduct> batchContext) protected booleanprotected voidpopulateTemplateNames(DefaultOptionTemplatePreloader.OptionTemplateFilterValues templateFilterValues, List<ComprehensiveProduct> products, BatchContext<ComprehensiveProduct> batchContext) voidpreProcess(BatchContext<?> batch) This method will be executed to allow customers to fetch, for example, data that is required for future processing.protected voidvalidateOptionTemplates(List<ComprehensiveProduct> products, BatchContext<ComprehensiveProduct> batchContext) Validate the option templates from the request for each product to check that they exist.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.dataexchange.service.BatchExtensionProcessor
getOrder, postProcess
-
Field Details
-
OPTION_TEMPLATES
- See Also:
-
OPTION_TEMPLATE_GROUPS
- See Also:
-
-
Constructor Details
-
DefaultOptionTemplatePreloader
public DefaultOptionTemplatePreloader(CatalogProvider<ComprehensiveProduct, Variant> catalogProvider, ProductBatchItemHandlerHelper<ComprehensiveProduct> helper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
canHandle
Description copied from interface:BatchExtensionProcessorMethod to determine if this handler should execute.- Specified by:
canHandlein interfaceBatchExtensionProcessor- Returns:
-
preProcess
Description copied from interface:BatchExtensionProcessorThis method will be executed to allow customers to fetch, for example, data that is required for future processing. This is good in situations where you want to pre-fetch or batch fetch and pre-cache data for use within this batch context. Generally, implementors should save any results that they want to save and use later inBatchContext#getAdditionalProperties(). This method is called only ifBatchExtensionProcessor.canHandle(Class)returns true. It is executed inAbstractDataExchangeService.saveAll(List, ContextInfo)afterAbstractDataExchangeService.split(List, BatchContext)and beforeAbstractDataExchangeService.aggregate(BatchContext).- Specified by:
preProcessin interfaceBatchExtensionProcessor
-
validateOptionTemplates
protected void validateOptionTemplates(List<ComprehensiveProduct> products, BatchContext<ComprehensiveProduct> batchContext) Validate the option templates from the request for each product to check that they exist.- Parameters:
batchContext- the batch context
-
fetchOptionTemplates
protected void fetchOptionTemplates(DefaultOptionTemplatePreloader.OptionTemplateFilterValues templateFilterValues, BatchContext<ComprehensiveProduct> batchContext) -
populateTemplateNames
protected void populateTemplateNames(DefaultOptionTemplatePreloader.OptionTemplateFilterValues templateFilterValues, List<ComprehensiveProduct> products, BatchContext<ComprehensiveProduct> batchContext) -
handleMissingName
protected void handleMissingName(ComprehensiveProduct product, GenerateProductOption option, DefaultOptionTemplatePreloader.OptionTemplateFilterValues templateFilterValues, BatchContext<ComprehensiveProduct> batchContext) -
handleCustomGenerateOptionType
protected void handleCustomGenerateOptionType(ComprehensiveProduct product, GenerateProductOption option, DefaultOptionTemplatePreloader.OptionTemplateFilterValues templateFilterValues, BatchContext<ComprehensiveProduct> batchContext) -
isMissingTemplateName
-
getCatalogProvider
-
getHelper
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-