Class CustomerSegmentationController


@RestController public class CustomerSegmentationController extends PersonalizationAbstractController
  • Constructor Details

    • CustomerSegmentationController

      @Autowired public CustomerSegmentationController(CustomerSegmentationFacade cxCustomerSegmentationFacade, org.springframework.validation.Validator segmentationIdValidator)
  • Method Details

    • getCustomerSegmentations

      @GetMapping("/v1/customersegmentations") public CustomerSegmentationListWsDTO getCustomerSegmentations(@RequestParam(required=false) String customerId, @RequestParam(required=false) String segmentId, @RequestParam(required=false) String baseSite, @RequestParam(required=false) Map<String,String> requestParams)
      Method for searching customersegmentation objects based on given parameters
      Returns:
      list of found relations or object with empty list
    • createListDTO

      protected CustomerSegmentationListWsDTO createListDTO(SearchPageData<CustomerSegmentationData> segmentations)
    • create

      @PostMapping(value="/v1/customersegmentations", consumes={"application/json","application/xml"}) @ResponseStatus(CREATED) public org.springframework.http.ResponseEntity<CustomerSegmentationData> create(@RequestBody CustomerSegmentationData customerSegmentation, org.springframework.web.util.UriComponentsBuilder builder)
      Creates relation between customer and segment
      Parameters:
      customerSegmentation - Request body parameter (DTO in xml or json format) which contains customer and segment identifiers.
      Throws:
      AlreadyExistsException - When relation between customer and segment already exists
      WebserviceValidationException - When customer or segment identifier is invalid (empty or object not exists)
      NotFoundException - When customer or segment with given identifier doesn't exist
    • getCustomerSegmentation

      @GetMapping("/v1/customersegmentations/{segmentationId}") public CustomerSegmentationData getCustomerSegmentation(@PathVariable String segmentationId)
      Returns relation between customer and segment
      Returns:
      information about relation between customer and segment
      Throws:
      NotFoundException - When there is no relation with given identifier
      WebserviceValidationException - When identifier is invalid (have not supported format)
    • update

      @PutMapping(value="/v1/customersegmentations/{segmentationId}", consumes={"application/json","application/xml"}) public CustomerSegmentationData update(@PathVariable String segmentationId, @RequestBody CustomerSegmentationData data)
      Updates relation between customer and segment
      Returns:
      Updated relation
      Throws:
      WebserviceValidationException - When customer or segment identifier is invalid (empty or object not exists)
      NotFoundException - When there is no relation with given identifier
    • delete

      @DeleteMapping("/v1/customersegmentations/{segmentationId}") @ResponseStatus(NO_CONTENT) public void delete(@PathVariable String segmentationId)
      Removes relation between customer and segment
      Throws:
      NotFoundException - When there is no relation with given identifier