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
Copy file name to clipboardExpand all lines: docs/usage/CATEGORY_SYNC.md
+13-14Lines changed: 13 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,8 +41,8 @@ against a [CategoryDraft](https://docs.commercetools.com/api/projects/categories
41
41
42
42
#### ProjectApiRoot
43
43
44
-
Use the [ClientConfigurationUtils](#todo) which apply the best practices for `ProjectApiRoot` creation.
45
-
To create `ClientCredentials` which are required for creating a client please use the `ClientCredentialsBuilder` provided in java-sdk-v2 [Client OAUTH2 package](#todo)
44
+
Use the [ClientConfigurationUtils](/src/main/java/com/commercetools/sync/commons/utils/ClientConfigurationUtils.java) which apply the best practices for `ProjectApiRoot` creation.
45
+
To create `ClientCredentials` which are required for creating a client please use the `ClientCredentialsBuilder` provided in java-sdk-v2 [Client OAUTH2 package](https://github.com/commercetools/commercetools-sdk-java-v2/blob/main/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/oauth2/ClientCredentialsBuilder.java)
46
46
If you have custom requirements for the client creation, have a look into the [Important Usage Tips](IMPORTANT_USAGE_TIPS.md).
47
47
48
48
````java
@@ -145,7 +145,7 @@ As soon, as the referenced parent Category Draft is supplied to the sync, the Ca
145
145
146
146
##### Syncing from a commercetools project
147
147
148
-
When syncing from a source commercetools project, you can use [`toCategoryDrafts`](#todo)
148
+
When syncing from a source commercetools project, you can use [`toCategoryDrafts`](/src/main/java/com/commercetools/sync/categories/utils/CategoryTransformUtils.java)
149
149
method that transforms(resolves by querying and caching key-id pairs) and maps from a `Category` to `CategoryDraft` using cache in order to make them ready for reference resolution by the sync, for example:
150
150
151
151
````java
@@ -161,8 +161,8 @@ final List<Categories> categories = QueryUtils.queryAll(byProjectKeyCategoriesGe
161
161
````
162
162
163
163
In order to transform and map the `Category` to `CategoryDraft`,
164
-
Utils method `toCategoryDrafts` requires `projectApiRoot`, implementation of [`ReferenceIdToKeyCache`](#todo) and `categories` as parameters.
165
-
For cache implementation, You can use your own cache implementation or use the class in the library - which implements the cache using caffeine library with an LRU (Least Recently Used) based cache eviction strategy[`CaffeineReferenceIdToKeyCacheImpl`](#todo).
164
+
Utils method `toCategoryDrafts` requires `projectApiRoot`, implementation of [`ReferenceIdToKeyCache`](/src/main/java/com/commercetools/sync/commons/utils/ReferenceIdToKeyCache.java) and `categories` as parameters.
165
+
For cache implementation, You can use your own cache implementation or use the class in the library - which implements the cache using caffeine library with an LRU (Least Recently Used) based cache eviction strategy[`CaffeineReferenceIdToKeyCacheImpl`](/src/main/java/com/commercetools/sync/commons/utils/CaffeineReferenceIdToKeyCacheImpl.java).
166
166
Example as shown below:
167
167
168
168
````java
@@ -343,8 +343,8 @@ __Note__ The statistics object contains the processing time of the last batch on
343
343
344
344
##### More examples of how to use the sync
345
345
346
-
1.[Sync from another CTP project as a source](#todo).
347
-
2.[Sync from an external source](#todo).
346
+
1.[Sync from another CTP project as a source](/src/integration-test/java/com/commercetools/sync/integration/ctpprojectsource/categories/CategorySyncIT.java).
347
+
2.[Sync from an external source](/src/integration-test/java/com/commercetools/sync/integration/externalsource/categories/CategorySyncIT.java).
348
348
349
349
*Make sure to read the [Important Usage Tips](IMPORTANT_USAGE_TIPS.md) for optimal performance.*
350
350
@@ -355,18 +355,17 @@ A utility method provided by the library to compare a Category with a new Catego
More examples of those utils for different fields can be found [here](#todo).
368
+
More examples of those utils for different fields can be found [here](/src/test/java/com/commercetools/sync/categories/utils/CategoryUpdateActionUtilsTest.java).
370
369
371
370
## Migration Guide
372
371
@@ -396,14 +395,14 @@ any HTTP client module. The default one is `commercetools-http-client`.
396
395
397
396
### Client configuration and creation
398
397
399
-
For client creation use [ClientConfigurationUtils](#todo) which apply the best practices for `ProjectApiRoot` creation.
398
+
For client creation use [ClientConfigurationUtils](/src/main/java/com/commercetools/sync/commons/utils/ClientConfigurationUtils.java) which apply the best practices for `ProjectApiRoot` creation.
400
399
If you have custom requirements for the client creation make sure to replace `SphereClientFactory` with `ApiRootBuilder` as described in this [Migration Document](https://docs.commercetools.com/sdk/java-sdk-migrate#client-configuration-and-creation).
401
400
402
401
### Signature of CategorySyncOptions
403
402
404
403
As models and update actions have changed in the JVM-SDK-V2 the signature of SyncOptions is different. It's constructor now takes a `ProjectApiRoot` as first argument. The callback functions are signed with `CategoryDraft`, `Category` and `CategoryUpdateAction` from `package com.commercetools.api.models.category.*`
405
404
406
-
> Note: Type `UpdateAction<Category>` has changed to `CategoryUpdateAction`. Make sure you create and supply a specific CategoryUpdateAction in `beforeUpdateCallback`. For that you can use the [library-utilities](#todo) or use a JVM-SDK builder ([see also](https://docs.commercetools.com/sdk/java-sdk-migrate#update-resources)):
405
+
> Note: Type `UpdateAction<Category>` has changed to `CategoryUpdateAction`. Make sure you create and supply a specific CategoryUpdateAction in `beforeUpdateCallback`. For that you can use the [library-utilities](/src/main/java/com/commercetools/sync/categories/utils/CategorySyncUtils.java) or use a JVM-SDK builder ([see also](https://docs.commercetools.com/sdk/java-sdk-migrate#update-resources)):
407
406
408
407
```java
409
408
// Example: Create a category update action to change name taking the 'newName' of the categoryDraft
@@ -448,7 +447,7 @@ For more information, see the [Guide to replace DraftBuilders](https://docs.comm
448
447
449
448
### Query for Categories (syncing from CTP project)
450
449
451
-
If you sync categories between different commercetools projects you probably use [CategoryTransformUtils#toCategoryDrafts](#todo) to transform `Category` into `CategoryDraft` which can be used by the category-sync.
450
+
If you sync categories between different commercetools projects you probably use [CategoryTransformUtils#toCategoryDrafts](/src/main/java/com/commercetools/sync/categories/utils/CategoryTransformUtils.java) to transform `Category` into `CategoryDraft` which can be used by the category-sync.
452
451
However, if you need to query `Categories` from a commercetools project instead of passing `CategoryQuery`s to a `sphereClient`, create (and execute) requests directly from the `apiRoot`.
Copy file name to clipboardExpand all lines: docs/usage/CUSTOMER_SYNC.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,7 +200,7 @@ During the sync process, if a customer draft should be created, this callback ca
200
200
201
201
* customer draft that should be created
202
202
203
-
Please refer to the [example in the product sync document](https://github.com/commercetools/commercetools-sync-java/blob/master/docs/usage/PRODUCT_SYNC.md#example-set-publish-stage-if-category-references-of-given-product-draft-exists).
203
+
Please refer to the [example in the product sync document](./PRODUCT_SYNC.md#example-set-publish-stage-if-category-references-of-given-product-draft-exists).
204
204
205
205
##### batchSize
206
206
A number that could be used to set the batch size with which customers are fetched and processed,
Copy file name to clipboardExpand all lines: docs/usage/CUSTOM_OBJECT_SYNC.md
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,8 +36,8 @@ against a [CustomObjectDraft](https://docs.commercetools.com/api/projects/custom
36
36
37
37
#### ProjectApiRoot
38
38
39
-
Use the [ClientConfigurationUtils](#todo) which apply the best practices for `ProjectApiRoot` creation.
40
-
To create `ClientCredentials` which are required for creating a client please use the `ClientCredentialsBuilder` provided in java-sdk-v2 [Client OAUTH2 package](#todo)
39
+
Use the [ClientConfigurationUtils](/src/main/java/com/commercetools/sync/commons/utils/ClientConfigurationUtils.java) which apply the best practices for `ProjectApiRoot` creation.
40
+
To create `ClientCredentials` which are required for creating a client please use the `ClientCredentialsBuilder` provided in java-sdk-v2 [Client OAUTH2 package](https://github.com/commercetools/commercetools-sdk-java-v2/blob/main/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/oauth2/ClientCredentialsBuilder.java)
41
41
If you have custom requirements for the client creation, have a look into the [Important Usage Tips](IMPORTANT_USAGE_TIPS.md).
42
42
43
43
````java
@@ -78,7 +78,7 @@ following context about the error-event:
78
78
* sync exception
79
79
* custom object draft from the source
80
80
* custom object of the target project (only provided if an existing custom object could be found)
81
-
* a fake list of update actions, as custom objects API does not provide update actions. [NoopResourceUpdateAction.java](#todo)
81
+
* a fake list of update actions, as custom objects API does not provide update actions. [NoopResourceUpdateAction.java](/src/main/java/com/commercetools/sync/customobjects/models/NoopResourceUpdateAction.java)
@@ -168,12 +168,10 @@ __Note__ The statistics object contains the processing time of the last batch on
168
168
169
169
#### More examples of how to use the sync
170
170
171
-
-[Sync from an external source](#todo).
171
+
-[Sync from an external source](/src/integration-test/java/com/commercetools/sync/integration/externalsource/customobjects/CustomObjectSyncIT.java).
172
172
173
173
*Make sure to read the [Important Usage Tips](IMPORTANT_USAGE_TIPS.md) for optimal performance.*
174
174
175
-
More examples of those utils for different custom objects can be found [here](#todo).
176
-
177
175
## Migration Guide
178
176
179
177
The custom-object-sync uses the [JVM-SDK-V2](http://commercetools.github.io/commercetools-sdk-java-v2), therefore ensure you [Install JVM SDK](https://docs.commercetools.com/sdk/java-sdk-getting-started#install-the-java-sdk) module `commercetools-sdk-java-api` with
@@ -202,7 +200,7 @@ any HTTP client module. The default one is `commercetools-http-client`.
202
200
203
201
### Client configuration and creation
204
202
205
-
For client creation use [ClientConfigurationUtils](#todo) which apply the best practices for `ProjectApiRoot` creation.
203
+
For client creation use [ClientConfigurationUtils](/src/main/java/com/commercetools/sync/commons/utils/ClientConfigurationUtils.java) which apply the best practices for `ProjectApiRoot` creation.
206
204
If you have custom requirements for the client creation make sure to replace `SphereClientFactory` with `ApiRootBuilder` as described in this [Migration Document](https://docs.commercetools.com/sdk/java-sdk-migrate#client-configuration-and-creation).
Copy file name to clipboardExpand all lines: docs/usage/INVENTORY_SYNC.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,8 +40,8 @@ against a [InventoryEntryDraft](https://docs.commercetools.com/api/projects/inve
40
40
41
41
#### ProjectApiRoot
42
42
43
-
Use the [ClientConfigurationUtils](#todo) which apply the best practices for `ProjectApiRoot` creation.
44
-
To create `ClientCredentials` which are required for creating a client please use the `ClientCredentialsBuilder` provided in java-sdk-v2 [Client OAUTH2 package](#todo)
43
+
Use the [ClientConfigurationUtils](/src/main/java/com/commercetools/sync/commons/utils/ClientConfigurationUtils.java) which apply the best practices for `ProjectApiRoot` creation.
44
+
To create `ClientCredentials` which are required for creating a client please use the `ClientCredentialsBuilder` provided in java-sdk-v2 [Client OAUTH2 package](https://github.com/commercetools/commercetools-sdk-java-v2/blob/main/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/oauth2/ClientCredentialsBuilder.java)
45
45
If you have custom requirements for the client creation, have a look into the [Important Usage Tips](IMPORTANT_USAGE_TIPS.md).
46
46
47
47
````java
@@ -77,7 +77,7 @@ Therefore, in order to resolve the actual ids of those references in the sync pr
77
77
78
78
##### Syncing from a commercetools project
79
79
80
-
When syncing from a source commercetools project, you can use [`toInventoryEntryDrafts`](#todo)
80
+
When syncing from a source commercetools project, you can use [`toInventoryEntryDrafts`](/src/main/java/com/commercetools/sync/inventories/utils/InventoryTransformUtils.java)
81
81
method that transforms(resolves by querying and caching key-id pairs) and maps from a `InventoryEntry` to `InventoryEntryDraft` using cache in order to make them ready for reference resolution by the sync, for example:
82
82
83
83
````java
@@ -93,8 +93,8 @@ final List<InventoryEntry> categories = QueryUtils.queryAll(inventoryEntryQuery,
93
93
````
94
94
95
95
In order to transform and map the `InventoryEntry` to `InventoryEntryDraft`,
96
-
Utils method `toInventoryEntryDrafts` requires `projectApiRoot`, implementation of [`ReferenceIdToKeyCache`](#todo) and `inventoryEntries` as parameters.
97
-
For cache implementation, You can use your own cache implementation or use the class in the library - which implements the cache using caffeine library with an LRU (Least Recently Used) based cache eviction strategy[`CaffeineReferenceIdToKeyCacheImpl`](#todo).
96
+
Utils method `toInventoryEntryDrafts` requires `projectApiRoot`, implementation of [`ReferenceIdToKeyCache`](/src/main/java/com/commercetools/sync/commons/utils/ReferenceIdToKeyCache.java) and `inventoryEntries` as parameters.
97
+
For cache implementation, You can use your own cache implementation or use the class in the library - which implements the cache using caffeine library with an LRU (Least Recently Used) based cache eviction strategy[`CaffeineReferenceIdToKeyCacheImpl`](/src/main/java/com/commercetools/sync/commons/utils/CaffeineReferenceIdToKeyCacheImpl.java).
98
98
Example as shown below:
99
99
100
100
````java
@@ -254,7 +254,7 @@ __Note__ The statistics object contains the processing time of the last batch on
254
254
2. It is not known by the sync which batch is going to be the last one supplied.
255
255
256
256
257
-
More examples of how to use the sync [here](#todo).
257
+
More examples of how to use the sync can be found [here](/src/integration-test/java/com/commercetools/sync/integration/externalsource/inventories/InventorySyncIT.java).
258
258
259
259
*Make sure to read the [Important Usage Tips](IMPORTANT_USAGE_TIPS.md) for optimal performance.*
260
260
@@ -307,14 +307,14 @@ any HTTP client module. The default one is `commercetools-http-client`.
307
307
308
308
### Client configuration and creation
309
309
310
-
For client creation use [ClientConfigurationUtils](#todo) which apply the best practices for `ProjectApiRoot` creation.
310
+
For client creation use [ClientConfigurationUtils](/src/main/java/com/commercetools/sync/commons/utils/ClientConfigurationUtils.java) which apply the best practices for `ProjectApiRoot` creation.
311
311
If you have custom requirements for the client creation make sure to replace `SphereClientFactory` with `ApiRootBuilder` as described in this [Migration Document](https://docs.commercetools.com/sdk/java-sdk-migrate#client-configuration-and-creation).
312
312
313
313
### Signature of InventorySyncOptions
314
314
315
315
As models and update actions have changed in the JVM-SDK-V2 the signature of SyncOptions is different. It's constructor now takes a `ProjectApiRoot` as first argument. The callback functions are signed with `InventoryEntryDraft`, `InventoryEntry` and `InventoryEntryUpdateAction` from `package com.commercetools.api.models.inventory.*`
316
316
317
-
> Note: Type `UpdateAction<InventoryEntry>` has changed to `InventoryEntryUpdateAction`. Make sure you create and supply a specific InventoryEntryUpdateAction in `beforeUpdateCallback`. For that you can use the [library-utilities](#todo) or use a JVM-SDK builder ([see also](https://docs.commercetools.com/sdk/java-sdk-migrate#update-resources)):
317
+
> Note: Type `UpdateAction<InventoryEntry>` has changed to `InventoryEntryUpdateAction`. Make sure you create and supply a specific InventoryEntryUpdateAction in `beforeUpdateCallback`. For that you can use the [library-utilities](/src/main/java/com/commercetools/sync/inventories/utils/InventorySyncUtils.java) or use a JVM-SDK builder ([see also](https://docs.commercetools.com/sdk/java-sdk-migrate#update-resources)):
318
318
319
319
```java
320
320
// Example: Create a inventory update action to change quantity taking the 'newQuantity' of the InventoryEntryDraft
@@ -359,7 +359,7 @@ For more information, see the [Guide to replace DraftBuilders](https://docs.comm
359
359
360
360
### Query for Inventories (syncing from CTP project)
361
361
362
-
If you sync inventories between different commercetools projects you probably use [InventoryTransformUtils#toInventoryEntryDrafts](#todo) to transform `InventoryEntry` into `InventoryEntryDraft` which can be used by the inventory-sync.
362
+
If you sync inventories between different commercetools projects you probably use [InventoryTransformUtils#toInventoryEntryDrafts](/src/main/java/com/commercetools/sync/inventories/utils/InventoryTransformUtils.java) to transform `InventoryEntry` into `InventoryEntryDraft` which can be used by the inventory-sync.
363
363
However, if you need to query `Inventories` from a commercetools project instead of passing `InventoryEntryQuery`s to a `sphereClient`, create (and execute) requests directly from the `apiRoot`.
0 commit comments