Class ProductExportRowProducer
java.lang.Object
com.broadleafcommerce.catalog.dataexport.ProductExportRowProducer
- All Implemented Interfaces:
ExportRowProducer<Product>
ExportRowProducer
implementation for Product
.- Author:
- Samarth Dhruva (samarthd)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
These are headers that the row producer itself will add by default.static final class
These are the different line types that the row producer will assign for the different exported rows. -
Constructor Summary
ConstructorDescriptionProductExportRowProducer
(ProductExportRowConverter productExportRowConverter, VariantExportRowConverter variantExportRowConverter, IncludedProductExportRowConverter includedProductExportRowConverter, ProductOptionExportRowConverter productOptionExportRowConverter, CategoryProductExportRowConverter categoryProductExportRowConverter, ProductAssetExportRowConverter productAssetExportRowConverter, AttributeChoiceValueExportRowConverter attributeChoiceValueExportRowConverter, SpecificItemChoiceExportRowConverter specificItemChoiceExportRowConverter, ProductTagExportRowConverter productTagExportRowConverter, VariantService<Variant> variantService, CategoryProductService<CategoryProduct> categoryProductService, ProductAssetService<ProductAsset> productAssetService, ProductTagService<ProductTag> productTagService) -
Method Summary
Modifier and TypeMethodDescriptioncom.broadleafcommerce.common.dataexport.service.RowGenerationResponse
generateRows
(List<Product> batch, com.broadleafcommerce.common.dataexport.domain.Export export, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Given a list of base domain objects, will produce all of the rows that are needed to represent them and any desired related/embedded domain objects.protected AttributeChoiceValueExportRowConverter
protected CategoryProductExportRowConverter
protected CategoryProductService<CategoryProduct>
Returns the exhaustive set of headers that this row producer may output values for.protected IncludedProductExportRowConverter
protected ProductAssetExportRowConverter
protected ProductAssetService<ProductAsset>
protected ProductExportRowConverter
protected ProductOptionExportRowConverter
protected ProductTagExportRowConverter
protected ProductTagService<ProductTag>
protected SpecificItemChoiceExportRowConverter
protected VariantExportRowConverter
protected VariantService<Variant>
protected Map<String,
List<CategoryProduct>> readCategoryProductsByProductIdIn
(Set<String> productIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected Map<String,
List<ProductAsset>> readProductAssetsByProductIdIn
(Set<String> productIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected Map<String,
List<ProductTag>> readProductTagsByProductIdIn
(Set<String> productIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) readVariantsByProductIdIn
(Set<String> productIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
Constructor Details
-
ProductExportRowProducer
public ProductExportRowProducer(ProductExportRowConverter productExportRowConverter, VariantExportRowConverter variantExportRowConverter, IncludedProductExportRowConverter includedProductExportRowConverter, ProductOptionExportRowConverter productOptionExportRowConverter, CategoryProductExportRowConverter categoryProductExportRowConverter, ProductAssetExportRowConverter productAssetExportRowConverter, AttributeChoiceValueExportRowConverter attributeChoiceValueExportRowConverter, SpecificItemChoiceExportRowConverter specificItemChoiceExportRowConverter, ProductTagExportRowConverter productTagExportRowConverter, VariantService<Variant> variantService, CategoryProductService<CategoryProduct> categoryProductService, ProductAssetService<ProductAsset> productAssetService, ProductTagService<ProductTag> productTagService)
-
-
Method Details
-
getHeaders
Description copied from interface:ExportRowProducer
Returns the exhaustive set of headers that this row producer may output values for. These correspond to keys in theRowGenerationResponse.rows
produced by#generateRows(List)
.This method is called by the
ExportProcessor
when it needs to report all of the headers it may possibly output.- Specified by:
getHeaders
in interfaceExportRowProducer<Product>
- Returns:
- the exhaustive set of headers that this row producer may output values for
-
generateRows
public com.broadleafcommerce.common.dataexport.service.RowGenerationResponse generateRows(List<Product> batch, com.broadleafcommerce.common.dataexport.domain.Export export, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:ExportRowProducer
Given a list of base domain objects, will produce all of the rows that are needed to represent them and any desired related/embedded domain objects.For this reason, the returned list may contain more than one element for each element in the input list.
If any queries need to be performed to retrieve any of the related domains, they are performed by this method.
- Specified by:
generateRows
in interfaceExportRowProducer<Product>
- Parameters:
batch
- a list of base domain objects to produce rows forexport
- the export that is being processedcontextInfo
- context information surrounding sandboxing and multitenant state. This should be used to narrow results of any queries that need to be performed to generate the output.- Returns:
- a response containing a list of row representations of the base domain objects (and any related domain objects). Details about success/failure are also included.
-
readVariantsByProductIdIn
-
readCategoryProductsByProductIdIn
-
readProductAssetsByProductIdIn
-
readProductTagsByProductIdIn
-
getProductExportRowConverter
-
getVariantExportRowConverter
-
getIncludedProductExportRowConverter
-
getProductOptionExportRowConverter
-
getCategoryProductExportRowConverter
-
getProductAssetExportRowConverter
-
getAttributeChoiceValueExportRowConverter
-
getSpecificItemChoiceExportRowConverter
-
getProductTagExportRowConverter
-
getVariantService
-
getCategoryProductService
-
getProductAssetService
-
getProductTagService
-