Class OfferCodeExportEndpoint

java.lang.Object
com.broadleafcommerce.promotion.offer.web.endpoint.OfferCodeExportEndpoint

@FrameworkRestController @DataRouteByExample(Offer.class) public class OfferCodeExportEndpoint extends Object
The endpoint to read or start exports for OfferCodes that belong to an Offer or Campaign.
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 Summary

    Modifier and Type
    Method
    Description
    org.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[]
    Gets the required permission roots for the given DefaultExportTarget.
    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 from ContextInfo based on the DefaultExportTarget 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 given DefaultExportTarget.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 of exportOfferCodes(String, ExportRequest, ContextInfo). The new implementation for export grids includes the filter string as part of the ExportRequest, 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 from ContextInfo based on the DefaultExportTarget and target parent id.
      Parameters:
      exportTarget - the DefaultExportTarget
      targetParentId - the target parent id, such as campaign id or offer id
      filters - additional RSQL filters
      pageable - pagination params
      contextInfo - additional sandbox and multitenant info
      Returns:
      offer code exports for the author from ContextInfo based on the DefaultExportTarget 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 given DefaultExportTarget.
      Parameters:
      exportTarget - the DefaultExportTarget to validate against
      contextInfo - additional sandbox and multitenant info
    • getPermissionRootsRequiredForExportTarget

      protected String[] getPermissionRootsRequiredForExportTarget(@NonNull @NonNull String exportTarget)
      Gets the required permission roots for the given DefaultExportTarget.
      Parameters:
      exportTarget - the DefaultExportTarget 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)