Skip to content

Commit d47199f

Browse files
committed
Small fixes and documentation
1 parent 4b1c395 commit d47199f

4 files changed

Lines changed: 74 additions & 16 deletions

File tree

INSTALL.md

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ To required environment add:
2222
1. Add "Api Mesh" service to your environment.
2323
2. Rename file `adobe-api/mesh/mesh.json.dist` into `adobe-api/mesh/mesh.json`.
2424
3. Change required options inside `adobe-api/mesh/mesh.json`.
25-
* MAGENTO-URL (This should be your Adobe Commerce system's base URL.)
26-
* MAGENTO-TOKEN
27-
28-
You can obtain the token by following these [steps](https://experienceleague.adobe.com/en/docs/commerce-admin/systems/integrations). Copy the Access Token value once generated. Additionally, you need to enable the "[Integration Token](https://experienceleague.adobe.com/en/docs/commerce-admin/systems/integrations)" functionality if it is not enabled yet. The generated token does not expire, but it can be updated if necessary.
25+
* AC-URL (This should be your Adobe Commerce system's base URL to GQL Endpoint)
2926

3027
3. Provision Mesh by using this file with `aio api-mesh create adobe-api/mesh/mesh.json`.
3128

@@ -39,19 +36,47 @@ To required environment add:
3936
Set following variables:
4037

4138
```
42-
AC_GRAPHQL_URL= // Your Mesh URL
43-
AC_API_TOKEN= // Adobe Commerce Integration Bearer Token
39+
AC_GRAPHQL_URL= // Your GraphQL URL
4440
AC_DEFAULT_STORE_CODE= // Default Adobe Commerce Store Code
41+
AC_ENVIRONMENT_ID= // Your Environment ID for Catalog Service if used (optional)
42+
```
43+
44+
6. Configure Adobe Commerce Authorization
45+
46+
In env.dist file you will find set of Auth parameters.
47+
48+
**For Adobe Commerce PaaS:**
49+
50+
These values can be copied from the Integration Details under System > Integrations in your Adobe Commerce backend
51+
52+
```
53+
COMMERCE_CONSUMER_KEY=
54+
COMMERCE_CONSUMER_SECRET=
55+
COMMERCE_ACCESS_TOKEN=
56+
COMMERCE_ACCESS_TOKEN_SECRET=
57+
```
58+
59+
**For Adobe Commerce SaaS:**
60+
61+
Documentation how to get these values is available here: https://developer.adobe.com/developer-console/docs/guides/authentication/ServerToServerAuthentication/implementation
62+
63+
```
64+
OAUTH_CLIENT_ID=
65+
OAUTH_CLIENT_SECRET=
66+
OAUTH_TECHNICAL_ACCOUNT_ID=
67+
OAUTH_TECHNICAL_ACCOUNT_EMAIL=
68+
OAUTH_ORG_ID=
69+
OAUTH_SCOPES=AdobeID, openid, read_organizations, additional_info.projectedProductContext, additional_info.roles, adobeio_api, read_client_secret, manage_client_secrets, event_receiver_api
4570
```
4671

47-
6. Create Event Provider for Feed Generator. Run `aio event provider create` and define name. Copy `id` from output.
72+
7. Create Event Provider for Feed Generator. Run `aio event provider create` and define name. Copy `id` from output.
4873
Add to `.env` line `FEED_GENERATOR_PROVIDER_ID=<id>`
4974

50-
7. Create Event Metadata for Feed Generator. Run `aio event eventmetadata create PROVIDERID`. Define event code as `feed.generate` and define description as `Generate Feed`.
75+
8. Create Event Metadata for Feed Generator. Run `aio event eventmetadata create PROVIDERID`. Define event code as `feed.generate` and define description as `Generate Feed`.
5176

52-
8. Run `aio app deploy` to deploy the app.
77+
9. Run `aio app deploy` to deploy the app.
5378

54-
9. Go To your application environment via Browser. Click on "Add Service" -> Event -> 3rd Party Custom Events -> And select your provider and event subscription. In Receiver define "Runtime action" as `processGeneration` action.
79+
10. Go To your application environment via Browser. Click on "Add Service" -> Event -> 3rd Party Custom Events -> And select your provider and event subscription. In Receiver define "Runtime action" as `processGeneration` action.
5580

56-
10. The app is ready to use. Please save the link to your application environment. Additionally, you can replicate all steps in your production environment and publish the application, so it will be available on your exchange dashboard.
81+
11. The app is ready to use. Please save the link to your application environment. Additionally, you can replicate all steps in your production environment and publish the application, so it will be available on your exchange dashboard.
5782

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Feed Generator is a service that simplifies the process of generating product fe
44

55
## Installation
66

7+
Module compartible with both Adobe Commerce SaaS and PaaS.
8+
79
Please see [INSTALL.md](INSTALL.md) for more details.
810

911
## Home page / Grid
@@ -97,8 +99,24 @@ Based on this GQL schema you can use the following variables (starting inside of
9799
* {{description.html}}
98100
* {{price_range.minimum_price.regular_price.value}}
99101
* {{price_range.minimum_price.regular_price.currency}}
102+
* {{SimpleProduct||weight}}
103+
104+
SimpleProduct||** definition will be decoded like:
105+
106+
```graphql
107+
products(search: "Motiv") {
108+
items {
109+
... on SimpleProduct {
110+
weight
111+
}
112+
}
113+
}
114+
```
100115

101-
… and so on depends on a schema used
116+
… and so on depends on a schema used.
117+
118+
[!NOTE]
119+
In case you do not see some fields in autocompletion, it may be because your Schema has some custom or complex attributes. You can always enter them manually, and we would be happy to hear from you to add them to a future release.
102120

103121
### Filtering
104122

@@ -188,17 +206,26 @@ Variables are defined using double curly braces (`{{ }}`) and correspond to fiel
188206
When a variable corresponds to an array, you can use the `count` property to repeat the XML tag for each element in the array. For instance, using `count=5` will generate up to 5 tags, each containing a different value from the array.
189207

190208
```xml
191-
<g:brand count=5>{{manufacturer}}</g:brand>
209+
<g:brand>{{manufacturer count="5"}}</g:brand>
192210
```
193211

194212
##### Selecting Specific Array Elements with `index`
195213

196214
To select a specific element from an array, use the `index` property. This will generate a single tag with the value of the specified element from the array.
197215

198216
```xml
199-
<g:product_type index=2>{{categories.name}}</g:product_type>
217+
<g:product_type>{{categories.name index="2"}}</g:product_type>
218+
```
219+
220+
##### Selecting Attribute with Specific code
221+
222+
```xml
223+
<color>{{attributes.value code='color'}}</color>
200224
```
201225

226+
Add attributes.value is an Array of attributes, to get specific attribute, you can use "code" parameter and define attribute with which code you want to use.
227+
228+
202229
#### Example
203230

204231
```xml
@@ -260,6 +287,8 @@ Regenerate Feed - will trigger the event “generate.feed” for a particular fe
260287

261288
* `generateByCron` - trigger feed generation by OpenWisk alarms.
262289

290+
* `getConfig` - receive public module configs. Currently only return type of authorization (ims vs oauth).
291+
263292
Action is running every 30 minutes and checking by feed settings if it have to be regenerate. Process regeneration if necessary.
264293

265294
### Web elements

app.config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ extensions:
33
$include: src/commerce-backend-ui-1/ext.config.yaml
44
productDependencies:
55
- code: COMMC
6-
minVersion: 2.4.5
6+
minVersion: 2.4.5
7+
maxVersion: 3.0.0

src/commerce-backend-ui-1/actions/utils/placeholderHandler.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,15 @@ const handleDefault = (placeholder, item, feed, type) => {
240240
let placeholderParts = dataKey.split(".");
241241
for (let placeholderPart of placeholderParts) {
242242

243+
if (value === undefined || value === null) {
244+
break;
245+
}
246+
243247
if (isDebug === true) {
244248
logger.error("value before every loop " + JSON.stringify(value));
245249
}
246250

247251
if (value.toString() === "") {
248-
249252
if (isDebug === true) {
250253
logger.error("item[placeholderPart] " + JSON.stringify(item[placeholderPart]));
251254
}

0 commit comments

Comments
 (0)