Skip to content

Commit 1ac64ea

Browse files
committed
Merge branch 'master' into feature/actions
# Conflicts: # config.toml
2 parents 140d810 + d868d0e commit 1ac64ea

File tree

94 files changed

+23781
-3403
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+23781
-3403
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
- Edit theme design & layout in `themes/middleware`
1313
- Edit theme configuration in `config.toml`
1414

15-
Local : `hugo server -D`
15+
Open local server :
16+
- `hugo server -D`
17+
18+
Build static files:
19+
- `hugo`
1620

1721
## Maintainers
1822

config.toml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,34 @@ hasChildren = true
5252

5353
[[menu.main]]
5454
parent = "Core concepts"
55-
name = "Satellite"
55+
name = "Satellites"
5656
url = "core-concept/satellite"
5757
weight = 1
5858

5959
[[menu.main]]
6060
parent = "Core concepts"
6161
name = "Pipeline"
62-
url = "core-concept/pipeline"
62+
url = "core-concept/satellite/pipeline"
6363
weight = 2
6464

6565
[[menu.main]]
6666
parent = "Core concepts"
6767
name = "Workflow"
68-
url = "core-concept/workflow"
68+
url = "core-concept/satellite/workflow"
6969
weight = 3
7070

7171
[[menu.main]]
7272
parent = "Core concepts"
73-
name = "Action"
74-
url = "core-concept/action"
73+
name = "HTTP Hook"
74+
url = "core-concept/satellite/http-hook"
7575
weight = 4
7676

77+
[[menu.main]]
78+
parent = "Core concepts"
79+
name = "HTTP API"
80+
url = "core-concept/satellite/http-api"
81+
weight = 5
82+
7783
[[menu.main]]
7884
weight = 3
7985
name = "Features"
@@ -186,16 +192,23 @@ hasChildren = true
186192
url = "connectivity/filtering"
187193
weight = 12
188194

189-
[[menu.main]]
190-
name = "Actions"
191-
weight = 4
192-
hasChildren = true
195+
[[menu.main]]
196+
parent = "Connectivity"
197+
name = "Batch"
198+
url = "connectivity/batch"
199+
weight = 13
193200

194201
[[menu.main]]
195-
parent = "Actions"
196-
name = "Custom"
197-
url = "action/custom"
198-
weight = 1
202+
parent = "Connectivity"
203+
name = "Magento 2"
204+
url = "connectivity/magento-2"
205+
weight = 14
206+
207+
[[menu.main]]
208+
parent = "Connectivity"
209+
name = "Zoho CRM"
210+
url = "connectivity/zoho"
211+
weight = 15
199212

200213
[params]
201214
logo = "logo-web.svg"

content/connectivity/akeneo/plugin.en.md

Lines changed: 62 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ weight: 1
1414
- [Installation](#installation)
1515
- [Usage](#usage)
1616
- [Connecting to Akeneo](#connecting-to-akeneo)
17-
- [Using the enterprise version](#using-the-enterprise-version)
1817
- [Building an extractor](#building-an-extractor)
1918
- [Building a lookup](#building-a-lookup)
2019
- [Building a conditional lookup](#building-a-conditional-lookup)
2120
- [Building a loader](#building-a-loader)
2221
- [Advanced Usage](#advanced-usage)
2322
- [Filtering your search](#filtering-your-search)
2423
- [Using ExpressionLanguage](#using-expressionlanguage)
24+
- [Available resources](#available-resources)
2525
---
2626
## What is it ?
2727

@@ -59,36 +59,29 @@ To retrieve these identifiers, you need to add a
5959
6060
Warning: For the `api_url` option, you must remove the `/` at the end of your URL if there is one.
6161

62-
### Using the enterprise edition
63-
64-
The `enterprise` option allows you to use the enterprise features in Akeneo and uses the Enterprise client accordingly. By default, it's set to `false`.
65-
66-
```yaml
67-
akeneo:
68-
enterprise: true
69-
# ...
70-
```
71-
7262
### Building an extractor
7363

74-
In the configuration of your extractor, you must specify the `type` of resource you will be working on
75-
and which `method you want to use to retrieve your data.
76-
77-
The list of available resources is quite long depend on the edition of your Akeneo (Enterprise, Growth or Community).
78-
79-
For a Community Edition or Growth Edition, you can choose between this types of resources : `product`, `category`, `attribute`,
80-
`attributeOption`, `attributeGroup`, `family`, `productMediaFile`, `locale`, `channel`, `currency`, `measureFamily`,
81-
`associationType`, `familyVariant`, `productModel`.
82-
83-
For an Enterprise Edition, you will be able to use in addition to the resources present in the Community Edition :
84-
`publishedProduct`, `productModelDraft`, `productDraft`, `asset`, `assetCategory`, `assetTag`, `referenceEntityRecord`,
85-
`referenceEntityAttribute`, `referenceEntityAttributeOption`, `referenceEntity`.
64+
In the configuration of your extractor, you must specify the `type` of resource (see [available-resources](#available-resources))
65+
you will be working on and which method you want to use to retrieve your data.
8666

8767
For each resource, the following 3 methods are available :
8868
- `all` : retrieves all data from a table
8969
- `get` : retrieve a row from a table
9070
- `listPerPage` : retrieves a set number of data from a table
9171

72+
Depending on the resource and the method used, different options are available in the YAML configuration :
73+
74+
| Resource | Method | Option(s) required |
75+
|--------------------------------------|-------------|-------------------------------|
76+
| **All resources** | all | _No options required_ |
77+
| **All resources** | get | identifier |
78+
| **All resources** | listPerPage | _No options required_ |
79+
| **attributeOption** | all | attribute_code |
80+
| **attributeOption** | get | attribute_code, code |
81+
| **assetManager** | all | asset_family_code |
82+
| **assetManager** | get | asset_family_code, asset_code |
83+
| **productMediaFile, assetMediaFile** | get | file |
84+
9285
```yaml
9386
akeneo:
9487
extractor:
@@ -110,7 +103,8 @@ this is called a lookup.
110103
In the configuration of your lookup, you must specify the `type` of resource you will be working on
111104
and which `method` you want to use to retrieve your data.
112105

113-
The list of available resources is quite long and depends on the edition of your Akeneo (Enterprise, Growth or Community).
106+
You can retrieve the list of available resources [here](#available-resources).
107+
114108
The options available are the same as for the [loader](#building-a-loader).
115109

116110
The `merge` option allows you to add data to your dataset, in a sense merging your actual dataset with your new data.
@@ -171,19 +165,8 @@ akeneo:
171165

172166
### Building a loader
173167

174-
In the configuration of your loader, you must specify the `type` of resource you are going to write
175-
and which `method` you want to use to insert your data.
176-
177-
The list of available resources is quite long and dépends on your Akeneo edition (Enterprise, Growth or Community).
178-
179-
For a Community Edition or Growth Edition, you can choose between these types of resources: `product`, `category`, `attribute`,
180-
`attributeOption`, `attributeGroup`, `family`, `productMediaFile`, `locale`, `channel`, `currency`, `measureFamily`,
181-
`associationType`, `familyVariant`, `productModel`.
182-
183-
For an Enterprise Edition, you will be able to use in addition to the resources present in the Community Edition:
184-
`publishedProduct`,
185-
`productModelDraft`, `productDraft`, `asset`, `assetCategory`, `assetTag`, `referenceEntityRecord`, `referenceEntityAttribute`,
186-
`referenceEntityAttributeOption`, `referenceEntity`.
168+
In the configuration of your loader, you must specify the `type` of resource (see [available-resources](#available-resources))
169+
you are going to write and which `method` you want to use to insert your data.
187170

188171
For each resource, the following 4 methods are available :
189172

@@ -192,13 +175,24 @@ For each resource, the following 4 methods are available :
192175
- `upsertList`: will try to update a resources list, otherwise the resources will be created
193176
- `delete`: delete a resource from the table
194177

178+
Depending on the resource and the method used, different options are available in the YAML configuration :
179+
180+
| Resource | Method | Option(s) required |
181+
|------------------------------------|------------|----------------------------------------------------|
182+
| **All resources** | upsert | code |
183+
| **All resources** | upsertList | _No options required_ |
184+
| **referenceEntityRecord** | upsert | reference_entity, code |
185+
| **referenceEntityRecord** | upsertList | reference_entity |
186+
| **referenceEntityAttributeOption** | upsert | reference_entity, reference_entity_attribute, code |
187+
| **referenceEntityAttributeOption** | upsertList | reference_entity, reference_entity_attribute |
188+
| **attributeOption** | upsert | attribute_code, code |
189+
| **attributeOption** | upsertList | attribute_code |
190+
195191
```yaml
196192
akeneo:
197193
loader:
198194
type: products
199195
method: create
200-
logger:
201-
type: stderr
202196
client:
203197
api_url: 'http://demo.akeneo.com/'
204198
client_id: '414yc7d9mnk044ko4wswgw80o8ssw80gssos488kk8ogss40ko'
@@ -248,3 +242,32 @@ akeneo:
248242
- 'Kiboko\Component\ExpressionLanguage\Akeneo\AkeneoFilterProvider'
249243
# ...
250244
```
245+
246+
## Available resources
247+
248+
| Resources | Akeneo's Edition(s) |
249+
|------------------------------------|-------------------------------|
250+
| **product** | Community, Growth, Enterprise |
251+
| **category** | Community, Growth, Enterprise |
252+
| **attribute** | Community, Growth, Enterprise |
253+
| **attributeOption** | Community, Growth, Enterprise |
254+
| **attributeGroup** | Community, Growth, Enterprise |
255+
| **family** | Community, Growth, Enterprise |
256+
| **productMediaFile** | Community, Growth, Enterprise |
257+
| **locale** | Community, Growth, Enterprise |
258+
| **channel** | Community, Growth, Enterprise |
259+
| **currency** | Community, Growth, Enterprise |
260+
| **measureFamily** | Community, Growth, Enterprise |
261+
| **associationType** | Community, Growth, Enterprise |
262+
| **familyVariant** | Community, Growth, Enterprise |
263+
| **productModel** | Community, Growth, Enterprise |
264+
| **publishedProduct** | Enterprise |
265+
| **productModelDraft** | Enterprise |
266+
| **productDraft** | Enterprise |
267+
| **asset** | Enterprise |
268+
| **assetCategory** | Enterprise |
269+
| **assetTag** | Enterprise |
270+
| **referenceEntityRecord** | Enterprise |
271+
| **referenceEntityAttribute** | Enterprise |
272+
| **referenceEntityAttributeOption** | Enterprise |
273+
| **referenceEntity** | Enterprise |
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
title: "Batch"
3+
date: 2023-06-22T12:00:02+02:00
4+
draft: false
5+
type: "plugins"
6+
description: "Fork a single line into multiple lines, or merge multiple lines into one."
7+
weight: 13
8+
---
9+
10+
- [What is it?](#what-is-it)
11+
- [Installation](#installation)
12+
- [Usage](#usage)
13+
- [Forking a line](#forking-a-line)
14+
- [Merging multiple lines](#merging-multiple-lines)
15+
---
16+
17+
## What is it?
18+
19+
The Batch plugin can split a single line of data into multiple ones, or can merge multiple lines into a single one.
20+
21+
## Installation
22+
23+
This plugin is already integrated into the Satellite package, so you can’t require it with composer.
24+
25+
## Usage
26+
27+
### Forking a line
28+
29+
`fork` splits data into multiple lines.
30+
31+
In the following example, we have one line containing 2 fields: an `id`, and `images` which contains multiple values.
32+
Instead we want to have multiple lines, each containing a single `image` along with the `id`.
33+
34+
Our example input looks like this:
35+
```json
36+
[{"images": ["one.jpg", "two.jpg", "three.jpg"], "id": 15}]
37+
```
38+
39+
We'll use the "fork" option to split the lines for each value under `images`:
40+
41+
{{< tabs name="fork" >}}
42+
43+
{{< tab name="YAML configuration" codelang="yaml" >}}
44+
batch:
45+
fork:
46+
foreach: '@=input["images"]'
47+
do: '@={ id: input["id"], image: item }'
48+
{{< /tab >}}
49+
50+
{{< tab name="interpreted code" codelang="php" >}}
51+
$results = [];
52+
foreach ($input["images"] as $key => $item) {
53+
$results[] = ["id" => $input["id"], "image" => $item];
54+
}
55+
{{< /tab >}}
56+
{{< /tabs >}}
57+
58+
The result will be:
59+
```json
60+
[{"id": 15, "image": "one.jpg"}]
61+
[{"id": 15, "image": "two.jpg"}]
62+
[{"id": 15, "image": "three.jpg"}]
63+
```
64+
65+
### Merging multiple lines
66+
67+
`merge` concatenates many lines traversing the pipeline into fewer lines.
68+
69+
This can be useful if the targeted API can handle many batches of data in a single payload, like Akeneo for example.
70+
71+
Our example input looks like this:
72+
```json
73+
[{"foo": "bar"}]
74+
[{"lorem": "ipsum"}]
75+
[{"ga": "bu"}]
76+
[{"zo": "meu"}]
77+
[{"bla": "bli"}]
78+
```
79+
80+
We'll use the "merge" option. `size` dictates the maximum number of lines to concatenate:
81+
82+
{{< tabs name="fork" >}}
83+
84+
{{< tab name="YAML configuration" codelang="yaml" >}}
85+
batch:
86+
merge:
87+
size: 2
88+
{{< /tab >}}
89+
{{< /tabs >}}
90+
91+
When the number of item reaches `size`, the merge will be applied to the next lines, and so on.
92+
93+
The output will be:
94+
```json
95+
[{"foo": "bar"},{"lorem": "ipsum"}]
96+
[{"ga": "bu"},{"zo": "meu"}]
97+
[{"bla": "bli"}]
98+
```
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: "Lookup mapper"
3+
date: 2023-07-31T12:07:47+02:00
4+
draft: false
5+
type: "plugins"
6+
icon: "ti-settings"
7+
description: "Learn how to write a custom mapper"
8+
weight: 1
9+
---
10+
11+
A lookup mapper is a class that implements `Kiboko\Contract\Mapping\CompiledMapperInterface`.
12+
13+
Its purpose is to merge the result of the lookup back into your line.
14+
15+
`$output` is your line, and `$input` is the result of the lookup.
16+
17+
```php
18+
<?php
19+
20+
declare(strict_types=1);
21+
22+
namespace Acme\Custom;
23+
24+
use Kiboko\Contract\Mapping\CompiledMapperInterface;
25+
26+
class LookupMapper implements CompiledMapperInterface
27+
{
28+
public function __invoke($input, $output = null)
29+
{
30+
$output['actual_customer_id'] = $input['id'];
31+
32+
return $output;
33+
}
34+
}
35+
```

0 commit comments

Comments
 (0)