Class OfferCodeExportEndpoint
java.lang.Object
com.broadleafcommerce.promotion.offer.web.endpoint.OfferCodeExportEndpoint
@FrameworkRestController
@DataRouteByExample(Offer.class)
public class OfferCodeExportEndpoint
extends Object
-
Constructor Summary
ConstructorDescriptionOfferCodeExportEndpoint
(com.broadleafcommerce.common.dataexport.service.ExportManager exportManager, com.broadleafcommerce.common.dataexport.service.ExportService<com.broadleafcommerce.common.dataexport.domain.Export> exportService, com.broadleafcommerce.common.dataexport.service.ExportDownloadService exportDownloadService) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody>
downloadOfferCodeExport
(String exportId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, jakarta.servlet.http.HttpServletResponse response) com.broadleafcommerce.common.dataexport.domain.Export
exportOfferCodes
(String exportTarget, com.broadleafcommerce.common.dataexport.domain.ExportRequest exportRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) com.broadleafcommerce.common.dataexport.domain.Export
exportOfferCodes
(String filterString, String exportTarget, com.broadleafcommerce.common.dataexport.domain.ExportRequest exportRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Deprecated, for removal: This API element is subject to removal in a future version.protected com.broadleafcommerce.common.dataexport.service.ExportDownloadService
protected com.broadleafcommerce.common.dataexport.service.ExportManager
protected com.broadleafcommerce.common.dataexport.service.ExportService<com.broadleafcommerce.common.dataexport.domain.Export>
protected String[]
getPermissionRootsRequiredForExportTarget
(@NonNull String exportTarget) Gets the required permission roots for the givenDefaultExportTarget
.protected com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils
org.springframework.http.ResponseEntity<?>
readExportById
(String exportId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected org.springframework.http.ResponseEntity<Object>
readOfferCodeExportsForAuthor
(@NonNull String exportTarget, @NonNull String targetParentId, @NonNull cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable pageable, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads offer code exports for the author fromContextInfo
based on theDefaultExportTarget
and target parent id.org.springframework.http.ResponseEntity<Object>
readOfferCodeFromCampaignExportsForAuthor
(String campaignId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) org.springframework.http.ResponseEntity<Object>
readOfferCodeFromOfferExportsForAuthor
(String offerId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) void
setPolicyUtils
(com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils policyUtils) protected void
validatePermissionsByExportTarget
(@NonNull String exportTarget, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Validates the required permissions based on the givenDefaultExportTarget
.
-
Constructor Details
-
OfferCodeExportEndpoint
public OfferCodeExportEndpoint(com.broadleafcommerce.common.dataexport.service.ExportManager exportManager, com.broadleafcommerce.common.dataexport.service.ExportService<com.broadleafcommerce.common.dataexport.domain.Export> exportService, com.broadleafcommerce.common.dataexport.service.ExportDownloadService exportDownloadService)
-
-
Method Details
-
readExportById
@FrameworkGetMapping("/exports/offer-codes/{id}") @Policy(permissionRoots={"CAMPAIGN","OFFER"}) public org.springframework.http.ResponseEntity<?> readExportById(@PathVariable("id") String exportId, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
exportOfferCodes
@Deprecated(since="2.0.1", forRemoval=true) @FrameworkPostMapping(value="/exports/offer-codes", consumes="application/json", params="cq") @Policy(permissionRoots={"CAMPAIGN","OFFER"}) public com.broadleafcommerce.common.dataexport.domain.Export exportOfferCodes(@RequestParam(value="cq",defaultValue="",required=false) String filterString, @RequestParam("exportTarget") String exportTarget, @RequestBody com.broadleafcommerce.common.dataexport.domain.ExportRequest exportRequest, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0.1, in favor ofexportOfferCodes(String, ExportRequest, ContextInfo)
. The new implementation for export grids includes the filter string as part of theExportRequest
, instead of passing it as a parameter in the HTTP request. -
exportOfferCodes
@FrameworkPostMapping(value="/exports/offer-codes", consumes="application/json") @Policy(permissionRoots={"CAMPAIGN","OFFER"}) public com.broadleafcommerce.common.dataexport.domain.Export exportOfferCodes(@RequestParam("exportTarget") String exportTarget, @RequestBody com.broadleafcommerce.common.dataexport.domain.ExportRequest exportRequest, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context) -
downloadOfferCodeExport
@FrameworkGetMapping("/exports/offer-codes/{id}/download") @Policy(permissionRoots={"CAMPAIGN","OFFER"}) public org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> downloadOfferCodeExport(@PathVariable("id") String exportId, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, jakarta.servlet.http.HttpServletResponse response) -
readOfferCodeFromCampaignExportsForAuthor
@FrameworkGetMapping(value="/my-exports/offer-codes", params="campaignId") @Policy(permissionRoots="CAMPAIGN") public org.springframework.http.ResponseEntity<Object> readOfferCodeFromCampaignExportsForAuthor(@RequestParam("campaignId") String campaignId, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50) org.springframework.data.domain.Pageable pageable, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
readOfferCodeFromOfferExportsForAuthor
@FrameworkGetMapping(value="/my-exports/offer-codes", params="offerId") @Policy(permissionRoots="OFFER") public org.springframework.http.ResponseEntity<Object> readOfferCodeFromOfferExportsForAuthor(@RequestParam("offerId") String offerId, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50) org.springframework.data.domain.Pageable pageable, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
readOfferCodeExportsForAuthor
protected org.springframework.http.ResponseEntity<Object> readOfferCodeExportsForAuthor(@NonNull @NonNull String exportTarget, @NonNull @NonNull String targetParentId, @NonNull @NonNull cz.jirutka.rsql.parser.ast.Node filters, @NonNull @NonNull org.springframework.data.domain.Pageable pageable, @NonNull @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads offer code exports for the author fromContextInfo
based on theDefaultExportTarget
and target parent id.- Parameters:
exportTarget
- theDefaultExportTarget
targetParentId
- the target parent id, such as campaign id or offer idfilters
- additional RSQL filterspageable
- pagination paramscontextInfo
- additional sandbox and multitenant info- Returns:
- offer code exports for the author from
ContextInfo
based on theDefaultExportTarget
and target parent id
-
validatePermissionsByExportTarget
protected void validatePermissionsByExportTarget(@NonNull @NonNull String exportTarget, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Validates the required permissions based on the givenDefaultExportTarget
.- Parameters:
exportTarget
- theDefaultExportTarget
to validate againstcontextInfo
- additional sandbox and multitenant info
-
getPermissionRootsRequiredForExportTarget
Gets the required permission roots for the givenDefaultExportTarget
.- Parameters:
exportTarget
- theDefaultExportTarget
to validate against
-
getExportManager
protected com.broadleafcommerce.common.dataexport.service.ExportManager getExportManager() -
getExportService
protected com.broadleafcommerce.common.dataexport.service.ExportService<com.broadleafcommerce.common.dataexport.domain.Export> getExportService() -
getExportDownloadService
protected com.broadleafcommerce.common.dataexport.service.ExportDownloadService getExportDownloadService() -
getPolicyUtils
@Nullable protected com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils getPolicyUtils() -
setPolicyUtils
@Autowired(required=false) public void setPolicyUtils(@Nullable com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils policyUtils)
-
exportOfferCodes(String, ExportRequest, ContextInfo)
.