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)
  • 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

      @NonNull protected CategoryAssetService<CategoryAsset> getCategoryAssetService()
    • getCategoryService

      @NonNull protected CategoryService<Category> getCategoryService()
    • getTranslationEntityService

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