Class CategoryAssetEndpoint
java.lang.Object
com.broadleafcommerce.catalog.web.endpoint.CategoryAssetEndpoint
@FrameworkRestController
@FrameworkMapping("/categories/{categoryId}/assets")
@DataRouteByExample(CategoryAsset.class)
public class CategoryAssetEndpoint
extends Object
Endpoints for CRUD on
CategoryAsset
. These operations are done purely in the context of a
Category
.- Author:
- Samarth Dhruva (samarthd)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A custom DTO that is intended for the specific purpose of supporting PATCH forCategoryAsset
. -
Constructor Summary
ConstructorDescriptionCategoryAssetEndpoint
(CategoryAssetService<CategoryAsset> categoryAssetService, CategoryService<Category> categoryService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService) -
Method Summary
Modifier and TypeMethodDescriptioncreate
(String categoryId, CategoryAsset toCreate, OptionalSortPositionRequest givenSortRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) void
delete
(String categoryId, String categoryAssetId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected CategoryAssetService<CategoryAsset>
protected CategoryService<Category>
protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation>
org.springframework.data.domain.Page<CategoryAsset>
readAll
(String categoryId, 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 categoryId, String categoryAssetId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) reorderCategoryAsset
(String categoryId, String categoryAssetId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.data.tracking.core.sort.SortPositionRequest sortPositionRequest) com.broadleafcommerce.translation.service.dto.TranslationsPayload
replaceAllVariantTranslations
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String categoryId, String assetId, Locale locale, com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest) update
(String categoryId, String categoryAssetId, CategoryAssetEndpoint.CategoryAssetUpdate assetUpdate, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
Constructor Details
-
CategoryAssetEndpoint
public CategoryAssetEndpoint(CategoryAssetService<CategoryAsset> categoryAssetService, CategoryService<Category> categoryService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService)
-
-
Method Details
-
readAll
@FrameworkGetMapping @Policy(permissionRoots="CATEGORY") public org.springframework.data.domain.Page<CategoryAsset> readAll(@PathVariable("categoryId") String categoryId, 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("/{categoryAssetId}") @Policy(permissionRoots="CATEGORY") public CategoryAsset readSingle(@PathVariable("categoryId") String categoryId, @PathVariable("categoryAssetId") String categoryAssetId, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
create
@FrameworkPostMapping(consumes="application/json") @Policy(permissionRoots="CATEGORY") public CategoryAsset create(@PathVariable("categoryId") String categoryId, @RequestBody CategoryAsset toCreate, OptionalSortPositionRequest givenSortRequest, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
update
@FrameworkPatchMapping(value="/{categoryAssetId}", consumes="application/json") @Policy(permissionRoots="CATEGORY") public CategoryAsset update(@PathVariable("categoryId") String categoryId, @PathVariable("categoryAssetId") String categoryAssetId, @RequestBody CategoryAssetEndpoint.CategoryAssetUpdate assetUpdate, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
reorderCategoryAsset
@FrameworkPatchMapping("/{categoryAssetId}/sort") @Policy(permissionRoots="CATEGORY") public CategoryAsset reorderCategoryAsset(@PathVariable("categoryId") String categoryId, @PathVariable("categoryAssetId") String categoryAssetId, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @UpdateSortOperation("categoryAssetId") com.broadleafcommerce.data.tracking.core.sort.SortPositionRequest sortPositionRequest) -
delete
@FrameworkDeleteMapping("/{categoryAssetId}") @Policy(permissionRoots="CATEGORY") public void delete(@PathVariable("categoryId") String categoryId, @PathVariable("categoryAssetId") String categoryAssetId, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
replaceAllVariantTranslations
@FrameworkPutMapping(value="/{categoryAssetId}/translations/{locale}", consumes="application/json") @Policy(permissionRoots="CATEGORY") public com.broadleafcommerce.translation.service.dto.TranslationsPayload replaceAllVariantTranslations(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("categoryId") String categoryId, @PathVariable("categoryAssetId") String assetId, @PathVariable("locale") Locale locale, @RequestBody com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest) -
getCategoryAssetService
-
getCategoryService
-
getTranslationEntityService
protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> getTranslationEntityService()
-