Class ProductAssetEndpoint

java.lang.Object
com.broadleafcommerce.catalog.web.endpoint.ProductAssetEndpoint

@FrameworkRestController @FrameworkMapping("/products/{productId}/assets") @DataRouteByExample(ProductAsset.class) public class ProductAssetEndpoint extends Object
Endpoints for CRUD on ProductAsset. These operations are done purely in the context of a Product.
Author:
Samarth Dhruva (samarthd)
See Also:
  • Constructor Details

    • ProductAssetEndpoint

      public ProductAssetEndpoint(ProductAssetService<ProductAsset> productAssetService, ProductService<Product> productService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService)
  • Method Details

    • readAll

      @FrameworkGetMapping @Policy(permissionRoots="PRODUCT") public org.springframework.data.domain.Page<ProductAsset> readAll(@PathVariable("productId") String productId, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @RequestParam(value="isSorted",required=false) Boolean isSorted, @RequestParam(value="q",required=false) String searchString)
    • readSingle

      @FrameworkGetMapping("/{productAssetId}") @Policy(permissionRoots="PRODUCT") public ProductAsset readSingle(@PathVariable("productId") String productId, @PathVariable("productAssetId") String productAssetId, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • create

      @FrameworkPostMapping(consumes="application/json") @Policy(permissionRoots="PRODUCT") public ProductAsset create(@PathVariable("productId") String productId, @RequestBody ProductAsset toCreate, OptionalSortPositionRequest givenSortRequest, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • update

      @FrameworkPatchMapping(value="/{productAssetId}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public ProductAsset update(@PathVariable("productId") String productId, @PathVariable("productAssetId") String productAssetId, @RequestBody ProductAssetEndpoint.ProductAssetUpdate assetUpdate, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • reorderProductAsset

      @FrameworkPatchMapping("/{productAssetId}/sort") @Policy(permissionRoots="PRODUCT") public ProductAsset reorderProductAsset(@PathVariable("productId") String productId, @PathVariable("productAssetId") String productAssetId, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @UpdateSortOperation("productAssetId") com.broadleafcommerce.data.tracking.core.sort.SortPositionRequest sortPositionRequest)
    • delete

      @FrameworkDeleteMapping("/{productAssetId}") @Policy(permissionRoots="PRODUCT") public void delete(@PathVariable("productId") String productId, @PathVariable("productAssetId") String productAssetId, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • replaceAllProductAssetTranslations

      @FrameworkPutMapping(value="/{productAssetId}/translations/{locale}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public com.broadleafcommerce.translation.service.dto.TranslationsPayload replaceAllProductAssetTranslations(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("productId") String productId, @PathVariable("productAssetId") String assetId, @PathVariable("locale") Locale locale, @RequestBody com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest)
    • getProductAssetService

      @NonNull protected ProductAssetService<ProductAsset> getProductAssetService()
    • getProductService

      @NonNull protected ProductService<Product> getProductService()
    • getTranslationEntityService

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