Class CustomerSegmentEndpoint

java.lang.Object
com.broadleafcommerce.customer.web.endpoint.CustomerSegmentEndpoint

@FrameworkRestController @FrameworkMapping("/segments") @DataRouteByExample(CustomerSegment.class) public class CustomerSegmentEndpoint extends Object
Endpoint for managing customer segments. Includes standard CRUD operations as well as adding/removing customers from segments.
  • Field Details

  • Constructor Details

  • Method Details

    • readCustomerSegmentById

      @Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkGetMapping("/{segmentId}") public CustomerSegment readCustomerSegmentById(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("segmentId") String segmentId)
    • readAllCustomerSegments

      @Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkGetMapping(params="unpaged=true") public List<CustomerSegment> readAllCustomerSegments(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters, @SortDefault("priority") org.springframework.data.domain.Sort sort)
    • readAllCustomerSegments

      @Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkGetMapping public org.springframework.data.domain.Page<CustomerSegment> readAllCustomerSegments(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Sort sort, org.springframework.data.domain.Pageable page)
    • createCustomerSegment

      @Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkPostMapping(consumes="application/json") public CustomerSegment createCustomerSegment(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody CustomerSegment customerSegment)
    • replaceCustomerSegment

      @Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkPutMapping(value="/{segmentId}", consumes="application/json") public CustomerSegment replaceCustomerSegment(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("segmentId") String segmentId, @RequestBody CustomerSegment updatedSegment)
    • deleteCustomerSegment

      @Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkDeleteMapping("/{segmentId}") public void deleteCustomerSegment(@ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("segmentId") String segmentId)
    • readCustomersInSegment

      @Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkGetMapping("/{segmentId}/customers") public org.springframework.data.domain.Page<SegmentMember> readCustomersInSegment(@ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("segmentId") String segmentId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page)
    • addCustomerToSegment

      @Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkPostMapping("/{segmentId}/customers") public SegmentMember addCustomerToSegment(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody SegmentMember segmentMember, @PathVariable("segmentId") String segmentId)
    • removeCustomerFromSegment

      @Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkDeleteMapping("/{segmentId}/customers/{customerId}") public void removeCustomerFromSegment(@ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("segmentId") String segmentId, @PathVariable("customerId") String customerId)
    • processRuleBasedSegment

      @Policy(permissionRoots="CUSTOMER_SEGMENT_PROCESS_HISTORY") @FrameworkPostMapping("/{segmentId}/process") public SegmentProcessHistory processRuleBasedSegment(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("segmentId") String segmentId)
    • readAllSegmentBulkProcess

      @Policy(permissionRoots="CUSTOMER_SEGMENT_PROCESS_HISTORY") @FrameworkGetMapping("/{segmentId}/process") public org.springframework.data.domain.Page<SegmentProcessHistory> readAllSegmentBulkProcess(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PageableDefault(sort="created",direction=DESC) org.springframework.data.domain.Pageable pageable, @PathVariable("segmentId") String segmentId) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • readSegmentBulkProcess

      @Policy(permissionRoots="CUSTOMER_SEGMENT_PROCESS_HISTORY") @FrameworkGetMapping("/{segmentId}/process/{id}") public com.broadleafcommerce.bulk.domain.BulkUpdate readSegmentBulkProcess(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String bulkUpdateId) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • hydrateCustomers

      protected void hydrateCustomers(org.springframework.data.domain.Page<SegmentMember> segmentMemberPage, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • getCustomerSegmentService

      protected CustomerSegmentService<CustomerSegment> getCustomerSegmentService()
    • getSegmentMemberService

      protected SegmentMemberService<SegmentMember,CustomerSegment> getSegmentMemberService()
    • getCustomerService

      protected CustomerService<Customer> getCustomerService()
    • getSegmentProcessingService

      protected SegmentProcessingService getSegmentProcessingService()
    • getSegmentProcessHistoryService

      protected SegmentProcessHistoryService<SegmentProcessHistory> getSegmentProcessHistoryService()
    • getTypeFactory

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