This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final List<ProductDraft> productDrafts = createProductDrafts(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final Logger logger = LoggerFactory.getLogger(MySync.class); | |
final ProductSyncOptions productsyncOptions = | |
ProductSyncOptionsBuilder.of(sphereClient) | |
.errorCallBack(logger::error) | |
.warningCallBack(logger::warn) | |
.build(); | |
final ProductSync productSync = new ProductSync(productSyncOptions); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// execute the sync on your list of productDrafts | |
final CompletionStage<ProductSyncStatistics> syncStatisticsStage = productSync.sync(productDrafts); | |
final ProductSyncStatistics stats = syncStatisticsStage.toCompletebleFuture().join(); | |
LOGGER.info(stats.getReportMessage()); | |
/*Prints the following line: "Summary: 2000 products were processed in total (1000 created, 995 updated and 5 failed to sync)."*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": { | |
"de-DE": "test name with 2 non-masterVariants" | |
}, | |
"productType": { | |
"key": "pt2", | |
"typeId": "product-type" | |
}, | |
"slug": { | |
"de-DE": "test-slug-no-variants3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SyncSolutionInfo extends SolutionInfo { | |
static final String UNSPECIFIED = "unspecified"; | |
- | |
+ static final String LIBRARY_PROPERTIES = "application.properties"; | |
+ static final String LIBRARY_NAME_PROPERTY = "name"; | |
+ static final String LIBRARY_VERSION_PROPERTY = "version"; | |
public SyncSolutionInfo() throws IOException, IllegalArgumentException { | |
final InputStream propertiesStream = SyncSolutionInfo.class.getClassLoader() | |
.getResourceAsStream(LIBRARY_PROPERTIES); |