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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CustomerSegmentServiceprotected com.broadleafcommerce.dataimport.service.ImportServiceprotected org.broadleafcommerce.common.site.service.SiteService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidimportCustomerSegments(String importType, Long catalogId, Long siteId, InputStream body) voidimportGroupCustomerSegments(Long id, String importType, Long catalogId, Long siteId, InputStream body) voidimportGroupCustomerSegmentsByName(String name, String importType, Long catalogId, Long siteId, InputStream body) protected org.broadleafcommerce.common.site.domain.CatalogresolveCatalogId(Long overrideCatalogId) protected org.broadleafcommerce.common.site.domain.SiteresolveSiteId(Long overrideSiteId) protected voidscheduleImportForCustomerSegment(String importType, Long siteId, Long catalogId, Long customerSegmentId, InputStream inputStream)
-
Field Details
-
siteService
@Autowired protected org.broadleafcommerce.common.site.service.SiteService siteService -
importService
protected com.broadleafcommerce.dataimport.service.ImportService importService -
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
-
resolveCatalogId
-
handleException
@ExceptionHandler(CustomerSegmentNotFoundException.class) @ResponseStatus(NOT_FOUND) @ResponseBody public Map<String,String> handleException(AdminCustomerSegmentImportEndpoint.CustomerSegmentNotFoundException e)
-