Class AdminCustomerSegmentImportEndpoint

java.lang.Object
com.broadleafcommerce.customersegment.admin.web.api.endpoint.AdminCustomerSegmentImportEndpoint

@ConditionalOnImport @ConditionalOnAdmin @FrameworkRestController @FrameworkMapping(path="/api/import") public class AdminCustomerSegmentImportEndpoint extends Object
Created by Brandon Hines on 2/23/17.
  • Field Details

    • siteService

      @Autowired protected org.broadleafcommerce.common.site.service.SiteService siteService
    • importService

      protected com.broadleafcommerce.dataimport.service.ImportService importService
    • customerSegmentService

      protected CustomerSegmentService customerSegmentService
  • Constructor Details

    • AdminCustomerSegmentImportEndpoint

      public AdminCustomerSegmentImportEndpoint()
  • Method Details

    • importCustomerSegments

      @FrameworkMapping(path="/customer-segment", method=POST) public void importCustomerSegments(@RequestParam(value="importType",defaultValue="CSV") String importType, @RequestParam(value="catalog",required=false) Long catalogId, @RequestParam(value="site",required=false) Long siteId, InputStream body) throws Exception
      Throws:
      Exception
    • importGroupCustomerSegments

      @FrameworkMapping(path="/customer-segment/id/{id}", method=POST) public void importGroupCustomerSegments(@PathVariable(name="id") Long id, @RequestParam(value="importType",defaultValue="CSV") String importType, @RequestParam(value="catalog",required=false) Long catalogId, @RequestParam(value="site",required=false) Long siteId, InputStream body) throws Exception
      Throws:
      Exception
    • importGroupCustomerSegmentsByName

      @FrameworkMapping(path="/customer-segment/name/{name}", method=POST) public void importGroupCustomerSegmentsByName(@PathVariable(name="name") String name, @RequestParam(value="importType",defaultValue="CSV") String importType, @RequestParam(value="catalog",required=false) Long catalogId, @RequestParam(value="site",required=false) Long siteId, InputStream body) throws Exception
      Throws:
      Exception
    • scheduleImportForCustomerSegment

      protected void scheduleImportForCustomerSegment(String importType, Long siteId, Long catalogId, Long customerSegmentId, InputStream inputStream) throws Exception
      Throws:
      Exception
    • resolveSiteId

      protected org.broadleafcommerce.common.site.domain.Site resolveSiteId(Long overrideSiteId)
    • resolveCatalogId

      protected org.broadleafcommerce.common.site.domain.Catalog resolveCatalogId(Long overrideCatalogId)
    • handleException

      @ExceptionHandler(CustomerSegmentNotFoundException.class) @ResponseStatus(NOT_FOUND) @ResponseBody public Map<String,String> handleException(AdminCustomerSegmentImportEndpoint.CustomerSegmentNotFoundException e)