Class VariantEndpoint

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

@FrameworkRestController @FrameworkMapping("/products/{productId}/variants") @DataRouteByExample(Variant.class) public class VariantEndpoint extends Object
Endpoints that only deal with Variants. Most of the time, Variant operations are done solely within the context of a Product
Author:
Phillip Verheyden (phillipuniverse)
  • Constructor Summary

    Constructors
    Constructor
    Description
    VariantEndpoint(VariantService<Variant> variantSvc, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    createVariant(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId, Variant req)
     
    void
    deleteVariant(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId, String variantId)
     
    org.springframework.data.domain.Page<Variant>
    getAllProductVariants(String productId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation>
     
     
    readVariantById(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String variantId)
     
    com.broadleafcommerce.translation.service.dto.TranslationsPayload
    replaceAllVariantTranslations(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId, String variantId, Locale locale, com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest)
     
    replaceVariant(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId, String variantId, Variant req)
     
    updateVariant(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId, String variantId, Variant req)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VariantEndpoint

      public VariantEndpoint(VariantService<Variant> variantSvc, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService)
  • Method Details

    • getAllProductVariants

      @FrameworkGetMapping @Policy(permissionRoots="PRODUCT") public org.springframework.data.domain.Page<Variant> getAllProductVariants(@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 context)
    • readVariantById

      @FrameworkGetMapping("/{variantId}") @Policy(permissionRoots="PRODUCT") public Variant readVariantById(javax.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("variantId") String variantId)
    • replaceVariant

      @FrameworkPutMapping(value="/{variantId}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public Variant replaceVariant(javax.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("productId") String productId, @PathVariable("variantId") String variantId, @RequestBody Variant req)
    • replaceAllVariantTranslations

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

      @FrameworkPatchMapping(value="/{variantId}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public Variant updateVariant(javax.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("productId") String productId, @PathVariable("variantId") String variantId, @RequestBody Variant req)
    • createVariant

      @FrameworkPostMapping(consumes="application/json") @Policy(permissionRoots="PRODUCT") public Variant createVariant(javax.servlet.http.HttpServletRequest request, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("productId") String productId, @RequestBody Variant req)
    • deleteVariant

      @FrameworkDeleteMapping("/{variantId}") @Policy(permissionRoots="PRODUCT") public void deleteVariant(javax.servlet.http.HttpServletRequest request, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("productId") String productId, @PathVariable("variantId") String variantId)
    • getVariantSvc

      protected VariantService<Variant> getVariantSvc()
    • getTranslationEntityService

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