You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Important:** Active development of new features for this library has been deprioritized. However, the library is designed to be extensible, and **community contributions are welcome**. If you need to sync a field that isn't supported yet, you can add support for it yourself by following the [Adding Additional Fields](/docs/usage/ADDING_ADDITIONAL_FIELDS.md) guide. For a full list of currently supported fields per resource, see the [Supported Resources and Fields](/docs/SUPPORTED_RESOURCES.md) document.
18
+
> **Important:** Active development of new features for this library has been put on hold. However, the library is designed to be extensible, and **community contributions are welcome**. If you need to sync a field that isn't supported yet, you can add support for it yourself by following the [Adding Additional Fields](/docs/usage/ADDING_ADDITIONAL_FIELDS.md) guide. For a full list of currently supported fields per resource, see the [Supported Resources and Fields](/docs/SUPPORTED_RESOURCES.md) document.
19
19
20
20
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
21
21
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Copy file name to clipboardExpand all lines: docs/usage/ADDING_ADDITIONAL_FIELDS.md
+27-27Lines changed: 27 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,9 @@
24
24
25
25
## Overview
26
26
27
-
The library supports specific fields for each resource type. For a full list of currently supported fields, see the [Supported Resources and Fields](../SUPPORTED_RESOURCES.md) document.
27
+
The commercetools-sync-java library supports specific fields for each resource type. For a full list of supported fields, see the [Supported Resources and Fields](../SUPPORTED_RESOURCES.md) document.
28
28
29
-
If the field you need is not listed there, you can add native support by following the steps in this guide. All changes are made within the existing library files — no external dependencies are needed.
29
+
If the field you need is not listed, you can add native support by following the steps in this guide. All changes are made within the existing library files — no external dependencies are needed.
30
30
31
31
## Step-by-Step Guide
32
32
@@ -36,9 +36,9 @@ This guide walks through a concrete example: adding support for a hypothetical u
36
36
37
37
Open the `{Resource}UpdateActionUtils.java` file for the resource you want to extend. For CartDiscounts, this is:
Add a new static method that compares the field's old and new values and returns an `Optional<{Resource}UpdateAction>`. Use the `buildUpdateAction()` helper from `CommonTypeUpdateActionUtils` for the comparison.
41
+
Add a new static method that compares the field's old and new values and returns an `Optional<{Resource}UpdateAction>`. Use the `buildUpdateAction()` helper from [`CommonTypeUpdateActionUtils`](https://github.com/commercetools/commercetools-sync-java/blob/master/src/main/java/com/commercetools/sync/commons/utils/CommonTypeUpdateActionUtils.java) for the comparison.
42
42
43
43
**Example — adding a `store` field to CartDiscounts:**
44
44
@@ -78,7 +78,7 @@ public static Optional<CartDiscountUpdateAction> buildSetStoresUpdateAction(
78
78
79
79
Open the `{Resource}SyncUtils.java` file. For CartDiscounts:
When syncing from a commercetools project, resources are fetched as full objects and need to be converted to drafts. The `{Resource}ReferenceResolutionUtils` handles this mapping.
293
+
When syncing from a commercetools project, resources are fetched as full objects and must be converted to drafts. The `{Resource}ReferenceResolutionUtils` handles this mapping.
294
294
295
295
In `{Resource}ReferenceResolutionUtils.java`, add a mapping method and call it from `mapTo{Resource}Draft()`:
| States |[`StateUpdateActionUtils.java`](https://github.com/commercetools/commercetools-sync-java/blob/master/src/main/java/com/commercetools/sync/states/utils/StateUpdateActionUtils.java)|[`StateSyncUtils.java`](https://github.com/commercetools/commercetools-sync-java/blob/master/src/main/java/com/commercetools/sync/states/utils/StateSyncUtils.java)|[`StateUpdateActionUtilsTest.java`](https://github.com/commercetools/commercetools-sync-java/blob/master/src/test/java/com/commercetools/sync/states/utils/StateUpdateActionUtilsTest.java)|
0 commit comments