This section covers the import and export features for various data types.
Note
|
Imports and exports are independent of each other and have different architectures. There is no implied guarantee that exported files of any given data type match the schema expected for an import. Exported files may structure data in a manner that may not be directly compatible with an import specification (different headers, row types, column value structures, etc). Custom implementations are welcome to create and add import/export specifications which have exact parity with each other. |
Out-of-box, Broadleaf provides support for importing data into the system from a user-provided file (for example, a CSV file).
At a high level, the ImportServices microservice is the centerpiece responsible for managing the overall lifecycle of imports as well as the meta-information around them. It breaks each import into batches of rows and publishes them over the message broker. Actual processing of each batch is handled by a handler component in a 'resource tier' service (for example, in the case of a product import, the 'resource tier' service would be CatalogServices). The resource tier handler is expected to perform the necessary persistence operations and publish detailed completion data about each batch over the message broker. ImportServices consumes this completion data to report progress and success/failure to the end-user.
Much of the boilerplate logic required for implementing a resource tier handler is provided in the broadleaf-import-services-consumer
common library.
Import Consumer Links:
This includes:
Standardized configuration for messaging and listeners that can process import batch request messages and send completion results, including BatchListener
Interfaces and abstract classes to serve as a base starting point for common handler components, including ImportBatchHandler
Data transfer objects and utilities providing functionality typically required for import processing
Services needing to implement this functionality should add this library as a dependency. Usage of this library is further discussed in the links below.
Property | Description | Default |
---|---|---|
|
Determines whether entity field validation is performed during import ingestion |
false |
|
Determines whether persistence messages are sent to the broker for each entity initially put into a sandbox during the import process |
false |
|
Scope behavior to a specific import type (i.e. as defined in com.broadleafcommerce.common.dataimport.messaging.BatchRequest#getType) |
n/a |
|
Scope behavior to a specific import type (i.e. as defined in com.broadleafcommerce.common.dataimport.messaging.BatchRequest#getType) |
n/a |
The Broadleaf Common Export library offers existing microservices the possibility to export data in the form of flat files. For a high-level overview of Export and its components, visit the following documentation:
For information on how to add a custom export implementation, visit the following tutorial:
Similar to import, there are several data types that support data export as well, for their docs, please see the following documentations for more details: