Class ExternalCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
java.lang.Object
com.broadleafcommerce.dataexchange.service.provider.external.AbstractRestApiExternalProvider
com.broadleafcommerce.dataexchange.service.provider.external.ExternalCatalogProvider<T1,T2> 
- All Implemented Interfaces:
 NodeBuilder,CatalogProvider<T1,T2> 
public class ExternalCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
extends AbstractRestApiExternalProvider
implements CatalogProvider<T1,T2> 
- Author:
 - Kelly Tisdell (ktisdell)
 
- 
Constructor Summary
ConstructorsConstructorDescriptionExternalCatalogProvider(com.fasterxml.jackson.databind.ObjectMapper mapper, org.springframework.web.reactive.function.client.WebClient dataExchangeWebClient, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalCatalogProviderProperties properties)  - 
Method Summary
Modifier and TypeMethodDescriptionprotected cz.jirutka.rsql.parser.ast.NodeaddExternalIdRsql(cz.jirutka.rsql.parser.ast.Node node, Set<String> externalIds) protected cz.jirutka.rsql.parser.ast.NodeaddProductIdsRsql(cz.jirutka.rsql.parser.ast.Node node, Set<String> productIds) protected cz.jirutka.rsql.parser.ast.NodeaddSkuRsql(cz.jirutka.rsql.parser.ast.Node node, Set<String> skus) protected cz.jirutka.rsql.parser.ast.NodebuildDataDrivenEnumFilter(DataDrivenEnumRequestFilters filters, BatchContext<?> batchContext) buildFindProductsRequestParams(String rsqlQuery) protected cz.jirutka.rsql.parser.ast.NodebuildNameInNode(Collection<String> names) createExistingProductRsqlQuery(List<T1> products, BatchContext<?> batchContext) When we want to query for existing products, we normally do so by querying by contextId, externalId, or sku.createProduct(T1 product, BatchContext<?> batchContext) createVariant(T1 product, T2 variant, BatchContext<?> batchContext) voiddeleteVariant(String productId, String variantId, BatchContext<?> context) protected ProductList<T1>generateOptions(GenerateProductOption generateProductOption, BatchContext<?> batchContext) getFilterParamsWithPaging(cz.jirutka.rsql.parser.ast.Node node) getProductPathVars(T1 product) getProductTranslationsPathVars(T1 product, Locale locale) protected ExternalCatalogProviderPropertiesgetReadAllDataDriveEnumParams(DataDrivenEnumRequestFilters filters, BatchContext<?> batchContext) protected Stringprotected Class<TranslationsPayload>protected voidpopulateExistingProductIdentifiers(List<T1> products, Set<String> productIds, Set<String> externalIds, Set<String> skus) readDataDrivenEnums(DataDrivenEnumRequestFilters filters, BatchContext<?> batchContext) Fetches a list of DataDrivenEnums based on the provided filters.readOptionTemplateGroups(cz.jirutka.rsql.parser.ast.Node node, BatchContext<?> batchContext) readOptionTemplateGroupsByNameIn(Collection<String> names, BatchContext<?> batchContext) readOptionTemplates(cz.jirutka.rsql.parser.ast.Node node, BatchContext<?> batchContext) readOptionTemplatesByNameIn(Collection<String> names, BatchContext<?> batchContext) readProductById(String productId, BatchContext<?> batchContext) readProducts(List<T1> requestedProducts, BatchContext<?> batchContext) Fetches a list of Products based on externalId, SKU, or URI.readProducts(org.springframework.util.MultiValueMap<String, String> params, BatchContext<?> batchContext) readVariant(String productId, String variantId, BatchContext<?> context) readVariantById(String productId, String variantId, BatchContext<?> batchContext) readVariants(List<T1> products, BatchContext<?> batchContext) readVariantsForProduct(T1 product, BatchContext<?> batchContext) protected T1saveProduct(T1 product, org.springframework.web.reactive.function.client.WebClient.RequestBodySpec request) saveProductTranslations(T1 product, Locale locale, List<Translation> translations, BatchContext<?> batchContext) Saves translations, specifically for a Product.saveVariantTranslations(T1 product, T2 variant, Locale locale, List<Translation> translations, BatchContext<?> batchContext) updateProduct(T1 product, BatchContext<?> batchContext) updateVariant(T1 product, T2 variant, BatchContext<?> batchContext) Methods inherited from class com.broadleafcommerce.dataexchange.service.provider.external.AbstractRestApiExternalProvider
addNarrowedPageableParams, deleteRequest, deleteRequest, getFilterParams, getFilterParams, getHeaders, getMapper, getMostDerivedType, getRequest, getRequest, getTypeFactory, getWebClient, narrowedPageParams, patchRequest, patchRequest, postRequest, postRequest, putRequest, putRequest, setCorrelationIdsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.dataexchange.service.NodeBuilder
buildAndNode, buildAndNode, buildEqualsNode, buildInNode, buildInNode, buildOrNode, buildOrNode, emptyNode, escapeSpecialCharacters, filterEmptyNodes, filterEmptyNodes, isEmptyNodeOrNull 
- 
Constructor Details
- 
ExternalCatalogProvider
public ExternalCatalogProvider(com.fasterxml.jackson.databind.ObjectMapper mapper, org.springframework.web.reactive.function.client.WebClient dataExchangeWebClient, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalCatalogProviderProperties properties)  
 - 
 - 
Method Details
- 
readProducts
Description copied from interface:CatalogProviderFetches a list of Products based on externalId, SKU, or URI. This is to find existing products for update.- Specified by:
 readProductsin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> - Returns:
 
 - 
readProducts
public ProductList<T1> readProducts(@Nullable org.springframework.util.MultiValueMap<String, String> params, BatchContext<?> batchContext) - Specified by:
 readProductsin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
readProductById
- Specified by:
 readProductByIdin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
readVariantById
- Specified by:
 readVariantByIdin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
createProduct
- Specified by:
 createProductin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
updateProduct
- Specified by:
 updateProductin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
generateOptions
public T1 generateOptions(GenerateProductOption generateProductOption, BatchContext<?> batchContext) - Specified by:
 generateOptionsin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
saveProductTranslations
public List<Translation> saveProductTranslations(T1 product, Locale locale, List<Translation> translations, BatchContext<?> batchContext) Description copied from interface:CatalogProviderSaves translations, specifically for a Product.- Specified by:
 saveProductTranslationsin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> - Parameters:
 product- the product for which to save translationslocale- the locale for the translations - must be the same for alltranslations- the list of translationsbatchContext- the batch context including theContextInfo- Returns:
 - the list of translations
 
 - 
readVariants
- Specified by:
 readVariantsin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
readVariantsForProduct
- Specified by:
 readVariantsForProductin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
createVariant
- Specified by:
 createVariantin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
updateVariant
- Specified by:
 updateVariantin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
saveVariantTranslations
public List<Translation> saveVariantTranslations(T1 product, T2 variant, Locale locale, List<Translation> translations, BatchContext<?> batchContext) - Specified by:
 saveVariantTranslationsin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
readDataDrivenEnums
public DataDrivenEnumResponse readDataDrivenEnums(DataDrivenEnumRequestFilters filters, BatchContext<?> batchContext) Description copied from interface:CatalogProviderFetches a list of DataDrivenEnums based on the provided filters.- Specified by:
 readDataDrivenEnumsin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> - Parameters:
 filters- the filters to applybatchContext- the batch context- Returns:
 - the list of DataDrivenEnums
 
 - 
readOptionTemplateGroups
public List<OptionTemplateGroup> readOptionTemplateGroups(cz.jirutka.rsql.parser.ast.Node node, BatchContext<?> batchContext) - Specified by:
 readOptionTemplateGroupsin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
readOptionTemplates
public List<OptionTemplate> readOptionTemplates(cz.jirutka.rsql.parser.ast.Node node, BatchContext<?> batchContext) - Specified by:
 readOptionTemplatesin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
readOptionTemplateGroupsByNameIn
public List<OptionTemplateGroup> readOptionTemplateGroupsByNameIn(Collection<String> names, BatchContext<?> batchContext) - Specified by:
 readOptionTemplateGroupsByNameInin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
readOptionTemplatesByNameIn
public List<OptionTemplate> readOptionTemplatesByNameIn(Collection<String> names, BatchContext<?> batchContext) - Specified by:
 readOptionTemplatesByNameInin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
readVariant
- Specified by:
 readVariantin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
deleteVariant
- Specified by:
 deleteVariantin interfaceCatalogProvider<T1 extends ComprehensiveProduct,T2 extends Variant> 
 - 
saveProduct
 - 
getProductTranslationsPathVars
 - 
getProductPathVars
 - 
emptyProductList
 - 
createExistingProductRsqlQuery
protected Optional<String> createExistingProductRsqlQuery(List<T1> products, BatchContext<?> batchContext) When we want to query for existing products, we normally do so by querying by contextId, externalId, or sku. These are known, unique identifiers. In this case, we're trying to find products that may exist, but that may not be known by or referenced by their contextIds by the client. In this case, we useEntityExchangeObject.getId()andComprehensiveProduct.getExternalId()andComprehensiveProduct.getSku()as unique references and query for existing products so that we have original product references, including their IDs.- Parameters:
 products- the product list for which we plan to execute create or update operationsbatchContext- the batch context including theContextRequest- Returns:
 - an 
Optionalvalue which may contain an RSQL string 
 - 
addProductIdsRsql
 - 
addSkuRsql
 - 
addExternalIdRsql
 - 
populateExistingProductIdentifiers
 - 
buildFindProductsRequestParams
 - 
getProductType
 - 
getVariantType
 - 
getTranslationsPayloadType
 - 
buildDataDrivenEnumFilter
protected cz.jirutka.rsql.parser.ast.Node buildDataDrivenEnumFilter(DataDrivenEnumRequestFilters filters, BatchContext<?> batchContext)  - 
getReadAllDataDriveEnumParams
protected org.springframework.util.MultiValueMap<String,String> getReadAllDataDriveEnumParams(DataDrivenEnumRequestFilters filters, BatchContext<?> batchContext)  - 
getFilterParamsWithPaging
 - 
buildNameInNode
 - 
getServiceClient
- Specified by:
 getServiceClientin classAbstractRestApiExternalProvider- Returns:
 - Returns the service client name to be used for the request.
 
 - 
getProperties
 
 -