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 BusinessTypeCharacteristics. 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 Details

  • Constructor Details

  • Method Details

    • process

      public void process(BulkOperation bulkOperation)
      Description copied from interface: BulkUpdateProcessor
      Processes the provided bulk operation.
      Specified by:
      process in interface BulkUpdateProcessor
      Parameters:
      bulkOperation - the bulk operation to be processed
    • getOperationType

      public String getOperationType()
      Description copied from interface: BulkUpdateProcessor
      The operation type that this processor supports.
      Specified by:
      getOperationType in interface BulkUpdateProcessor
      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 occurring
      bulkOperationItems - 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

      protected ProductBulkUpdateProcessorUtil getProcessorUtil()
    • getProductService

      protected ProductService<Product> getProductService()
    • getProductHydrationService

      protected ProductHydrationService getProductHydrationService()
    • getBulkUpdateProcessorHelper

      protected BulkUpdateProcessorHelper<BulkOperationItem> getBulkUpdateProcessorHelper()