Class SyncCharacteristicDefaultValuesBulkUpdateProcessor
java.lang.Object
com.broadleafcommerce.catalog.service.bulkoperation.processor.SyncCharacteristicDefaultValuesBulkUpdateProcessor
- All Implemented Interfaces:
BulkUpdateProcessor
public class SyncCharacteristicDefaultValuesBulkUpdateProcessor
extends Object
implements BulkUpdateProcessor
A
BulkUpdateProcessor
component that allows explicit synchronization of a
Characteristic
and any
default CharacteristicValue
to existing products that were initialized from a
BusinessType
with
BusinessTypeCharacteristic
s.
This allows selection of a sandbox and general sandboxable workflows to be engaged for the
selected products chosen for this bulk update. This is useful for when users may augment or add
additional characteristics and default values to a business type and a need a way to easily sync
those new characteristics to already existing products.- Author:
- Elbert Bautista (elbertbautista)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSyncCharacteristicDefaultValuesBulkUpdateProcessor
(ProductBulkUpdateProcessorUtil processorUtil, ProductService<Product> productService, ProductHydrationService productHydrationService, BulkUpdateProcessorHelper<BulkOperationItem> bulkUpdateProcessorHelper) -
Method Summary
Modifier and TypeMethodDescriptionprotected BulkUpdateProcessorHelper<BulkOperationItem>
getHydratedCharacteristicsProductUpdates
(BulkOperation bulkOperation, org.springframework.data.domain.Page<BulkOperationItem> bulkOperationItems, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) The operation type that this processor supports.protected ProductBulkUpdateProcessorUtil
protected ProductHydrationService
protected ProductService<Product>
void
process
(BulkOperation bulkOperation) Processes the provided bulk operation.protected org.springframework.data.domain.Page<BulkOperationItem>
processPageOfItems
(BulkOperation bulkOperation, org.springframework.data.domain.Page<BulkOperationItem> bulkOperationItems) For a page of bulk operation items, identifies the products to sync with business type from the bulk operation data.protected void
validateUpdates
(List<com.broadleafcommerce.data.tracking.core.service.Update<Product>> productUpdates, org.springframework.data.domain.Page<BulkOperationItem> bulkOperationItems) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.catalog.service.bulkoperation.processor.BulkUpdateProcessor
canHandle
-
Field Details
-
OPERATION_TYPE
- See Also:
-
-
Constructor Details
-
SyncCharacteristicDefaultValuesBulkUpdateProcessor
public SyncCharacteristicDefaultValuesBulkUpdateProcessor(ProductBulkUpdateProcessorUtil processorUtil, ProductService<Product> productService, ProductHydrationService productHydrationService, BulkUpdateProcessorHelper<BulkOperationItem> bulkUpdateProcessorHelper)
-
-
Method Details
-
process
Description copied from interface:BulkUpdateProcessor
Processes the provided bulk operation.- Specified by:
process
in interfaceBulkUpdateProcessor
- Parameters:
bulkOperation
- the bulk operation to be processed
-
getOperationType
Description copied from interface:BulkUpdateProcessor
The operation type that this processor supports.- Specified by:
getOperationType
in interfaceBulkUpdateProcessor
- Returns:
- the operation type that this processor supports
-
processPageOfItems
protected org.springframework.data.domain.Page<BulkOperationItem> processPageOfItems(BulkOperation bulkOperation, org.springframework.data.domain.Page<BulkOperationItem> bulkOperationItems) For a page of bulk operation items, identifies the products to sync with business type from the bulk operation data. Attempts to synchronize any default Characteristic Values (based on the associated Product Business Type characteristic) that have not yet been added as Product Characteristic Values and updates the bulk operation items to success or failure.- Parameters:
bulkOperation
- the bulk operation occurringbulkOperationItems
- the bulk operation items currently being processed- Returns:
- the page of updated bulk operation items
-
validateUpdates
protected void validateUpdates(List<com.broadleafcommerce.data.tracking.core.service.Update<Product>> productUpdates, org.springframework.data.domain.Page<BulkOperationItem> bulkOperationItems) -
getHydratedCharacteristicsProductUpdates
protected List<com.broadleafcommerce.data.tracking.core.service.Update<Product>> getHydratedCharacteristicsProductUpdates(BulkOperation bulkOperation, org.springframework.data.domain.Page<BulkOperationItem> bulkOperationItems, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getProcessorUtil
-
getProductService
-
getProductHydrationService
-
getBulkUpdateProcessorHelper
-