Class ProductEndpoint
java.lang.Object
com.broadleafcommerce.catalog.web.endpoint.ProductEndpoint
@FrameworkRestController
@FrameworkMapping("/products")
@DataRouteByExample(Product.class)
public class ProductEndpoint
extends Object
Operations that are performed for a
Product
and PromotionalProducts
- Author:
- Phillip Verheyden (phillipuniverse), Samarth Dhruva (samarthd)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionProductEndpoint
(ProductService<Product> productSvc, CloneProductService<Product, CloneProductRequest> cloneProductSvc, SkuGenerationService<Variant> skuGenerationSvc, PromotionalProductService<PromotionalProduct> promotionalProductSvc, CategoryService<Category> categoryService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService, CategoryProductService<CategoryProduct> categoryProductService, com.broadleafcommerce.bulk.service.BulkUpdateManager bulkUpdateManager, com.broadleafcommerce.bulk.service.BulkUpdateService<com.broadleafcommerce.bulk.domain.BulkUpdate> bulkUpdateService, com.broadleafcommerce.common.extension.TypeFactory catalogFactory, ProductConsolidationService productConsolidationService, ProductHydrationService productHydrationService, OptionGenerationService<Product> optionGenerationService, com.broadleafcommerce.data.tracking.core.filtering.fetch.rsql.web.RsqlFilterHandlerMethodArgumentResolver rsqlResolver) -
Method Summary
Modifier and TypeMethodDescriptionaddPromotionalProduct
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String productId, PromotionalProduct promotionalProduct, OptionalSortPositionRequest givenSortRequest) void
bulkUpdateProducts
(String filterString, com.broadleafcommerce.bulk.domain.BulkUpdateRequest bulkUpdateRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) cloneProduct
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId, CloneProductRequest cloneProductRequest) protected CategoryRef
createCategoryRefFromCategory
(Category category) createProduct
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, Product req) void
deleteProduct
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id) void
deletePromotionalProduct
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String productId, String promotionalProductId) generateOptionsFromTemplates
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, OptionGenerationRequest optionGenerationRequest) generateSkus
(String productId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, SkuGenerationParameters generationParameters) protected com.broadleafcommerce.bulk.service.BulkUpdateManager
protected com.broadleafcommerce.bulk.service.BulkUpdateService<com.broadleafcommerce.bulk.domain.BulkUpdate>
protected com.broadleafcommerce.common.extension.TypeFactory
protected CategoryProductService<CategoryProduct>
protected CategoryService<Category>
protected CloneProductService<Product,
CloneProductRequest> protected OptionGenerationService<Product>
org.springframework.data.domain.Page<com.broadleafcommerce.bulk.domain.BulkUpdate>
getProductBulkUpdates
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, org.springframework.data.domain.Pageable pageable) protected ProductConsolidationService
protected ProductHydrationService
protected ProductService<Product>
protected PromotionalProductService<PromotionalProduct>
protected SkuGenerationService<Variant>
protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation>
readAllProductIdsIgnoreNarrowing
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters, int page) org.springframework.data.domain.Page<Product>
readAllProducts
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String query, boolean hydratePrimaryAssets, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page) readAllProductsIgnoreNarrowingHydrated
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters) org.springframework.data.domain.Page<SKUContainer>
readAllSKUs
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, String id, String query) org.springframework.data.domain.Page<CategoryProduct>
readCategories
(String productId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, cz.jirutka.rsql.parser.ast.Node filters) readProductById
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId) org.springframework.data.domain.Page<PromotionalProduct>
readPromotionalProducts
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String productId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page) reorderPromotionalProduct
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String productId, String promotionalProductId, com.broadleafcommerce.data.tracking.core.sort.SortPositionRequest sortPositionRequest) com.broadleafcommerce.translation.service.dto.TranslationsPayload
replaceAllProductTranslations
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, Locale locale, com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest) com.broadleafcommerce.translation.service.dto.TranslationsPayload
replaceAllPromotionalProductTranslations
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId, String promotionalProductId, Locale locale, com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest) replaceProduct
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, Product req) replacePromotionalProduct
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String productId, String promotionalProductId, PromotionalProduct givenPromotionalProduct) updateProduct
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, Product req) updatePromotionalProduct
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String productId, String promotionalProductId, PromotionalProduct promotionalProduct)
-
Field Details
-
BASE_URI
- See Also:
-
-
Constructor Details
-
ProductEndpoint
public ProductEndpoint(ProductService<Product> productSvc, CloneProductService<Product, CloneProductRequest> cloneProductSvc, SkuGenerationService<Variant> skuGenerationSvc, PromotionalProductService<PromotionalProduct> promotionalProductSvc, CategoryService<Category> categoryService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService, CategoryProductService<CategoryProduct> categoryProductService, com.broadleafcommerce.bulk.service.BulkUpdateManager bulkUpdateManager, com.broadleafcommerce.bulk.service.BulkUpdateService<com.broadleafcommerce.bulk.domain.BulkUpdate> bulkUpdateService, com.broadleafcommerce.common.extension.TypeFactory catalogFactory, ProductConsolidationService productConsolidationService, ProductHydrationService productHydrationService, OptionGenerationService<Product> optionGenerationService, com.broadleafcommerce.data.tracking.core.filtering.fetch.rsql.web.RsqlFilterHandlerMethodArgumentResolver rsqlResolver)
-
-
Method Details
-
readAllProducts
@FrameworkGetMapping @Policy(permissionRoots="PRODUCT") public org.springframework.data.domain.Page<Product> readAllProducts(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestParam(value="q",required=false) String query, @RequestParam(value="hydratePrimaryAssets",defaultValue="true") boolean hydratePrimaryAssets, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50) org.springframework.data.domain.Pageable page) -
readProductById
-
updateProduct
@FrameworkPatchMapping(value="/{id}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public Product updateProduct(javax.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody Product req) -
replaceProduct
@FrameworkPutMapping(value="/{id}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public Product replaceProduct(javax.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody Product req) -
cloneProduct
@FrameworkPostMapping("/{id}/clone") @Policy(permissionRoots="PRODUCT") public Product cloneProduct(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String productId, @RequestBody CloneProductRequest cloneProductRequest) -
bulkUpdateProducts
@FrameworkPostMapping(value="/bulk-updates", consumes="application/json") @Policy(permissionRoots="PRODUCT") public void bulkUpdateProducts(@RequestParam(value="cq",defaultValue="") String filterString, @RequestBody com.broadleafcommerce.bulk.domain.BulkUpdateRequest bulkUpdateRequest, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context) -
getProductBulkUpdates
@FrameworkGetMapping("/bulk-updates") @Policy(permissionRoots="PRODUCT") public org.springframework.data.domain.Page<com.broadleafcommerce.bulk.domain.BulkUpdate> getProductBulkUpdates(@ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PageableDefault(size=50) org.springframework.data.domain.Pageable pageable) -
replaceAllProductTranslations
@FrameworkPutMapping(value="/{id}/translations/{locale}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public com.broadleafcommerce.translation.service.dto.TranslationsPayload replaceAllProductTranslations(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @PathVariable("locale") Locale locale, @RequestBody com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest) -
createProduct
-
deleteProduct
@FrameworkDeleteMapping("/{id}") @Policy(permissionRoots="PRODUCT") public void deleteProduct(javax.servlet.http.HttpServletRequest request, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id) -
generateOptionsFromTemplates
@FrameworkPostMapping(value="/{id}/generate-options", consumes="application/json") @Policy(permissionRoots="PRODUCT") public Product generateOptionsFromTemplates(javax.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody OptionGenerationRequest optionGenerationRequest) -
readAllSKUs
@FrameworkGetMapping("/{id}/skus") @Policy(permissionRoots="PRODUCT") public org.springframework.data.domain.Page<SKUContainer> readAllSKUs(javax.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @PathVariable("id") String id, @RequestParam(value="q",required=false,defaultValue="") String query) -
generateSkus
@FrameworkPostMapping(value="/{id}/generate-skus", consumes="application/json") @Policy(permissionRoots="PRODUCT") public Map<String,List<Variant>> generateSkus(@PathVariable("id") String productId, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody SkuGenerationParameters generationParameters) -
readPromotionalProducts
@FrameworkGetMapping("/{id}/promotional-products") @Policy(permissionRoots="PRODUCT") public org.springframework.data.domain.Page<PromotionalProduct> readPromotionalProducts(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PathVariable("id") String productId, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50) org.springframework.data.domain.Pageable page) -
addPromotionalProduct
@FrameworkPostMapping(value="/{id}/promotional-products", consumes="application/json") @Policy(permissionRoots="PRODUCT") public PromotionalProduct addPromotionalProduct(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PathVariable("id") String productId, @RequestBody PromotionalProduct promotionalProduct, OptionalSortPositionRequest givenSortRequest) throws InvalidRelatedProductException - Throws:
InvalidRelatedProductException
-
updatePromotionalProduct
@FrameworkPatchMapping(value="/{id}/promotional-products/{promotionalProductId}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public PromotionalProduct updatePromotionalProduct(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PathVariable("id") String productId, @PathVariable("promotionalProductId") String promotionalProductId, @RequestBody PromotionalProduct promotionalProduct) throws InvalidRelatedProductException - Throws:
InvalidRelatedProductException
-
reorderPromotionalProduct
@FrameworkPatchMapping("/{id}/promotional-products/{promotionalProductId}/sort") @Policy(permissionRoots="PRODUCT") public PromotionalProduct reorderPromotionalProduct(javax.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PathVariable("id") String productId, @PathVariable("promotionalProductId") String promotionalProductId, @UpdateSortOperation("promotionalProductId") com.broadleafcommerce.data.tracking.core.sort.SortPositionRequest sortPositionRequest) -
replaceAllPromotionalProductTranslations
@FrameworkPutMapping(value="/{id}/promotional-products/{promotionalProductId}/translations/{locale}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public com.broadleafcommerce.translation.service.dto.TranslationsPayload replaceAllPromotionalProductTranslations(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String productId, @PathVariable("promotionalProductId") String promotionalProductId, @PathVariable("locale") Locale locale, @RequestBody com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest) -
replacePromotionalProduct
@FrameworkPutMapping(value="/{id}/promotional-products/{promotionalProductId}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public PromotionalProduct replacePromotionalProduct(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PathVariable("id") String productId, @PathVariable("promotionalProductId") String promotionalProductId, @RequestBody PromotionalProduct givenPromotionalProduct) throws InvalidRelatedProductException - Throws:
InvalidRelatedProductException
-
deletePromotionalProduct
@FrameworkDeleteMapping("/{id}/promotional-products/{promotionalProductId}") @Policy(permissionRoots="PRODUCT") public void deletePromotionalProduct(@ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PathVariable("id") String productId, @PathVariable("promotionalProductId") String promotionalProductId) -
readCategories
@FrameworkGetMapping("/{id}/categories") @Policy(permissionRoots="PRODUCT") public org.springframework.data.domain.Page<CategoryProduct> readCategories(@PathVariable("id") String productId, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, cz.jirutka.rsql.parser.ast.Node filters) -
createCategoryRefFromCategory
-
readAllProductIdsIgnoreNarrowing
@FrameworkGetMapping("/ignore-narrowing/ids") @Policy(permissionRoots="PRODUCT_IGNORE_NARROWING") public List<String> readAllProductIdsIgnoreNarrowing(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters, @RequestParam("size") int page) -
readAllProductsIgnoreNarrowingHydrated
@FrameworkGetMapping("/ignore-narrowing/hydrated") @Policy(permissionRoots="PRODUCT_IGNORE_NARROWING") public List<ConsolidatedProduct> readAllProductsIgnoreNarrowingHydrated(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters) -
getProductSvc
-
getCloneProductSvc
-
getSkuGenerationSvc
-
getPromotionalProductSvc
-
getCategoryService
-
getTranslationEntityService
protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> getTranslationEntityService() -
getCategoryProductService
-
getBulkUpdateManager
protected com.broadleafcommerce.bulk.service.BulkUpdateManager getBulkUpdateManager() -
getBulkUpdateService
protected com.broadleafcommerce.bulk.service.BulkUpdateService<com.broadleafcommerce.bulk.domain.BulkUpdate> getBulkUpdateService() -
getCatalogFactory
protected com.broadleafcommerce.common.extension.TypeFactory getCatalogFactory() -
getProductConsolidationService
-
getProductHydrationService
-
getOptionGenerationService
-