Class CartNoteOperationEndpoint

java.lang.Object
com.broadleafcommerce.cartoperation.web.endpoint.CartNoteOperationEndpoint

@FrameworkRestController @FrameworkMapping("/cart-notes/{cartId}") public class CartNoteOperationEndpoint extends Object
Endpoint for CartNote management.
Author:
Sunny Yu
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CartNoteOperationEndpoint(CartResolverService cartResolverService, CartNoteOperationService<com.broadleafcommerce.cart.client.domain.CartNote> cartNoteOperationService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
     
    com.broadleafcommerce.cart.client.domain.CartNote
    createCartItemLevelNote(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, String cartId, String cartItemId, com.broadleafcommerce.cart.client.domain.CartNote cartNote)
     
    com.broadleafcommerce.cart.client.domain.CartNote
    createCartLevelNote(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, String cartId, com.broadleafcommerce.cart.client.domain.CartNote cartNote)
     
    void
    deleteNote(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, String cartId, String noteId)
     
    protected CartNoteOperationService<com.broadleafcommerce.cart.client.domain.CartNote>
     
     
    protected com.broadleafcommerce.common.extension.TypeFactory
     
    org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.CartNote>
    readByCartId(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, String cartId, boolean cartLevelOnly, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable)
     
    org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.CartNote>
    readByCartItemId(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, String cartId, String cartItemId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable)
     
    com.broadleafcommerce.cart.client.domain.CartNote
    replace(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, String cartId, String noteId, com.broadleafcommerce.cart.client.domain.CartNote cartNote)
     
    protected com.broadleafcommerce.cart.client.domain.Cart
    resolveCart(@NonNull String cartId, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Resolves Cart by the given cart id.
    void
    setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
     

    Methods inherited from class java.lang.Object

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

  • Constructor Details

  • Method Details

    • createCartLevelNote

      @FrameworkPostMapping public com.broadleafcommerce.cart.client.domain.CartNote createCartLevelNote(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @PathVariable String cartId, @RequestBody com.broadleafcommerce.cart.client.domain.CartNote cartNote)
    • createCartItemLevelNote

      @FrameworkPostMapping("/items/{cartItemId}") public com.broadleafcommerce.cart.client.domain.CartNote createCartItemLevelNote(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @PathVariable String cartId, @PathVariable String cartItemId, @RequestBody com.broadleafcommerce.cart.client.domain.CartNote cartNote)
    • readByCartId

      @FrameworkGetMapping public org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.CartNote> readByCartId(@ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @PathVariable String cartId, @RequestParam(required=false,defaultValue="false") boolean cartLevelOnly, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50,sort="dateCreated",direction=DESC) org.springframework.data.domain.Pageable pageable)
    • readByCartItemId

      @FrameworkGetMapping("/items/{cartItemId}") public org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.CartNote> readByCartItemId(@ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @PathVariable String cartId, @PathVariable String cartItemId, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50,sort="dateCreated",direction=DESC) org.springframework.data.domain.Pageable pageable)
    • replace

      @FrameworkPutMapping("/notes/{noteId}") public com.broadleafcommerce.cart.client.domain.CartNote replace(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @PathVariable String cartId, @PathVariable String noteId, @RequestBody com.broadleafcommerce.cart.client.domain.CartNote cartNote)
    • deleteNote

      @FrameworkDeleteMapping("/notes/{noteId}") public void deleteNote(@ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @PathVariable String cartId, @PathVariable String noteId)
    • resolveCart

      protected com.broadleafcommerce.cart.client.domain.Cart resolveCart(@NonNull @NonNull String cartId, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Resolves Cart by the given cart id.

      This is used to ensure that the Cart that the CartNote is being added for is owned by the given CustomerRef.

    • cartNotFoundMessage

      protected String cartNotFoundMessage(String cartId)
    • getCartResolverService

      protected CartResolverService getCartResolverService()
    • getCartNoteOperationService

      protected CartNoteOperationService<com.broadleafcommerce.cart.client.domain.CartNote> getCartNoteOperationService()
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
    • setTypeFactory

      @Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)