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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A custom DTO that is intended for the specific purpose of supporting PATCH forProductAsset
. -
Constructor Summary
ConstructorDescriptionProductAssetEndpoint
(ProductAssetService<ProductAsset> productAssetService, ProductService<Product> productService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService) -
Method Summary
Modifier and TypeMethodDescriptioncreate
(String productId, ProductAsset toCreate, OptionalSortPositionRequest givenSortRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) void
delete
(String productId, String productAssetId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected ProductAssetService<ProductAsset>
protected ProductService<Product>
protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation>
org.springframework.data.domain.Page<ProductAsset>
readAll
(String productId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, Boolean isSorted, String searchString) readSingle
(String productId, String productAssetId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) reorderProductAsset
(String productId, String productAssetId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.data.tracking.core.sort.SortPositionRequest sortPositionRequest) com.broadleafcommerce.translation.service.dto.TranslationsPayload
replaceAllProductAssetTranslations
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId, String assetId, Locale locale, com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest) update
(String productId, String productAssetId, ProductAssetEndpoint.ProductAssetUpdate assetUpdate, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
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
-
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
-
getProductService
-
getTranslationEntityService
protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> getTranslationEntityService()
-