Interface ExportManager
- All Known Implementing Classes:
DefaultExportManager
ExportService
is purely in charge of CRUD-related operations on Export
,
this service is a higher level abstraction that performs the surrounding logic of processing
export operations. This includes processing requests and emitting the required messages. It
internally delegates to ExportService
for CRUD operations.
Resource services should directly interact with this manager rather than the
ExportService
for export processing.
For actual processing of exports, the manager delegates to ExportProcessor
, and for
writing the files, the manager delegates to the ExportFileWriter
.
- Author:
- Samarth Dhruva (samarthd)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioninitiateExport
(ExportRequest request, String target, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) This method accepts an export request and the context of the request to build aExport
and persist it in the data store.initiateExport
(ExportRequest request, String target, String filterString, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.void
processExport
(Export export)
-
Method Details
-
initiateExport
@Deprecated(since="2.0.1") Export initiateExport(ExportRequest request, String target, @Nullable String filterString, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.since 2.0.1, in favor ofinitiateExport(ExportRequest, String, 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.This method accepts an export request and the context of the request to build aExport
and persist it in the data store.Sends a
ProcessExportRequest
message to request that the export be processed.- Parameters:
request
- a request to perform anExport
.For each of the "exporting context" fields describing where the operation will be performed, the default implementation will first check if the field is supplied in
ExportRequest
, and if not, use the value from theContextInfo
.target
- the target of the export. This is some value that can be mapped to a particular domain by the logic performing an export, rather than explicitly requiring the fully qualified classname. Used to populateExport.target
.filterString
- ifExportRequest.getFilterString()
is not provided, then this will be used instead as the filter string to find the records to export. Used to populateExport.filterString
.contextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- the newly created
Export
- Throws:
com.broadleafcommerce.common.error.validation.ValidationException
- if therequest
failed validationIllegalArgumentException
- ifrequest
is null ortarget
is blankcom.broadleafcommerce.data.tracking.core.exception.NotVisibleException
- if the currently authenticated user is not permitted to perform an export in the final determined exporting context
-
initiateExport
Export initiateExport(ExportRequest request, String target, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) This method accepts an export request and the context of the request to build aExport
and persist it in the data store.Sends a
ProcessExportRequest
message to request that the export be processed.- Parameters:
request
- a request to perform anExport
.The filter string that is used to filter the contents of the Export is also retrieved from
ExportRequest.getFilterString()
.For each of the "exporting context" fields describing where the operation will be performed, the default implementation will first check if the field is supplied in
ExportRequest
, and if not, use the value from theContextInfo
.target
- the target of the export. This is some value that can be mapped to a particular domain by the logic performing an export, rather than explicitly requiring the fully qualified classname. Used to populateExport.target
.contextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- the newly created
Export
- Throws:
com.broadleafcommerce.common.error.validation.ValidationException
- if therequest
failed validationIllegalArgumentException
- ifrequest
is null ortarget
is blankcom.broadleafcommerce.data.tracking.core.exception.NotVisibleException
- if the currently authenticated user is not permitted to perform an export in the final determined exporting context
-
processExport
Performs anExport
, processing the requested records and writing the file in batches while updating the status for theExport
as it goes.Note: this method should always be called with the result of
ExportService.setProcessingStatus(String)
if the value is not null.The
ExportManager
will delegate processing to the firstExportProcessor
for whichExportProcessor.canHandle(Export)
returns true. Thus if more than oneExportProcessor
can handle a request, the bean registered with the higher priority will be used.The
ExportManager
will delegate file writing to the firstExportFileWriter
for whichExportFileWriter.canHandle(Export)
returns true. Thus if more than oneExportFileWriter
can handle a request, the bean registered with the higher priority will be used.- Parameters:
export
- the export to perform - this should always be the result ofExportService.setProcessingStatus(String)
if it is not null
-
initiateExport(ExportRequest, String, ContextInfo)
.