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 Details

  • Constructor Details

  • 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

      @FrameworkGetMapping("/{id}") @Policy(permissionRoots="PRODUCT") public Product readProductById(javax.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String productId)
    • 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

      @FrameworkPostMapping(consumes="application/json") @Policy(permissionRoots="PRODUCT") public Product createProduct(javax.servlet.http.HttpServletRequest request, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody Product req)
    • 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

      protected CategoryRef createCategoryRefFromCategory(Category category)
    • 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

      protected ProductService<Product> getProductSvc()
    • getCloneProductSvc

      protected CloneProductService<Product,CloneProductRequest> getCloneProductSvc()
    • getSkuGenerationSvc

      protected SkuGenerationService<Variant> getSkuGenerationSvc()
    • getPromotionalProductSvc

      protected PromotionalProductService<PromotionalProduct> getPromotionalProductSvc()
    • getCategoryService

      protected CategoryService<Category> getCategoryService()
    • getTranslationEntityService

      protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> getTranslationEntityService()
    • getCategoryProductService

      protected CategoryProductService<CategoryProduct> 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

      protected ProductConsolidationService getProductConsolidationService()
    • getProductHydrationService

      protected ProductHydrationService getProductHydrationService()
    • getOptionGenerationService

      protected OptionGenerationService<Product> getOptionGenerationService()