Skip to content

Commit 23a1795

Browse files
authored
Merge pull request #2 from comwrap/review-25-09
Review 25 09
2 parents f2b6601 + 4326fcb commit 23a1795

38 files changed

Lines changed: 3272 additions & 3506 deletions

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,7 @@ coverage
4141
# logs folder for aio-run-detached
4242
logs
4343

44-
adobe-api/mesh/mesh.json
44+
server.js
45+
test-placeholder-handler.js
46+
key.pem
47+
cert.pem

INSTALL.md

Lines changed: 88 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,79 @@
44

55
- Node.js 18+
66
- Adobe I/O CLI
7+
- For PaaS integration with Admin UI: Adobe Commerce Admin UI SDK v3+ (see [Installation Guide](https://developer.adobe.com/commerce/extensibility/admin-ui-sdk/installation/))
78

89
## Adobe Console preparation
910

1011
### Create a new project
1112

12-
Go to console.adobe.io and create a new project from template: "App Builder"
13+
Go to https://developer.adobe.com/console and create a new project from template: "App Builder"
1314

1415
To required environment add:
1516

1617
* I/O Management API with OAuth Server-to-Server
1718
* I/O Events
19+
* Adobe Commerce as a Cloud Service (SaaS) - is required to manage authorization between the application and your Adobe Commerce instance.
1820

21+
## Installation
1922

20-
### Adobe Api Mesh (Optional)
23+
1. Clone the repository
24+
2. Run `npm install` to install the dependencies
25+
3. Copy the env.dist file into .env file: `cp env.dist .env`
26+
4. Configure the project environment using one of the following methods:
2127

22-
1. Add "Api Mesh" service to your environment.
23-
2. Rename file `adobe-api/mesh/mesh.json.dist` into `adobe-api/mesh/mesh.json`.
24-
3. Change required options inside `adobe-api/mesh/mesh.json`.
25-
* AC-URL (This should be your Adobe Commerce system's base URL to GQL Endpoint)
28+
**Option A: Download configuration from Console**
2629

27-
3. Provision Mesh by using this file with `aio api-mesh create adobe-api/mesh/mesh.json`.
30+
- Go to [Adobe Developer Console](https://developer.adobe.com/console), select your Project and Environment
31+
- Click on "Download All" button
32+
- Execute `aio app use <path-to-downloaded-file>` (Merge files if you already have .env file)
2833

29-
## Installation
34+
**Option B: Configure via CLI**
35+
36+
```bash
37+
aio login
38+
aio console org select
39+
aio console project select
40+
aio console workspace select
41+
aio app use
42+
```
3043

31-
1. Clone the repository
32-
2. Run `npm install` to install the dependencies
33-
3. Go to [Project](https://developer.adobe.com/console), select Environment and click on "Download All" button.
34-
4. Execute `aio app use <path-to-file>` with file you just downloaded. (Merge files if you already have .env file)
3544
5. Edit `.env` file with your project details.
3645
Set following variables:
3746

3847
```
3948
AC_GRAPHQL_URL= // Your GraphQL URL
4049
AC_DEFAULT_STORE_CODE= // Default Adobe Commerce Store Code
4150
AC_ENVIRONMENT_ID= // Your Environment ID for Catalog Service if used (optional)
51+
COMMERCE_BASE_URL= // Commerce instance REST API Url
4252
```
4353

54+
> [!NOTE]
55+
> When configuring the `COMMERCE_BASE_URL` environment variable, the format differs between PaaS and SaaS:
56+
>
57+
> For PaaS (On-Premise/Cloud):
58+
>
59+
> - Must include your base site URL + `/rest/` suffix
60+
> - Example: `https://[environment-name].us-4.magentosite.cloud/rest/`
61+
>
62+
> For SaaS:
63+
>
64+
> - Must be the REST API endpoint provided by Adobe Commerce
65+
> - Example: `https://na1-sandbox.api.commerce.adobe.com/[tenant-id]/`
66+
>
67+
> Make sure to use your actual environment name or tenant ID in the URL. The examples above use placeholder values.
68+
69+
4470
6. Configure Adobe Commerce Authorization
4571

4672
In env.dist file you will find set of Auth parameters.
4773

48-
**For Adobe Commerce PaaS:**
74+
**For Adobe Commerce (PaaS Only):**
75+
76+
> [!NOTE]
77+
> For SaaS Installation those values are not needed and can be skipped.
4978
50-
These values can be copied from the Integration Details under System > Integrations in your Adobe Commerce backend
79+
These values can be copied from the Integration Details under System > Integrations in your Adobe Commerce backend.
5180

5281
```
5382
COMMERCE_CONSUMER_KEY=
@@ -56,7 +85,7 @@ COMMERCE_ACCESS_TOKEN=
5685
COMMERCE_ACCESS_TOKEN_SECRET=
5786
```
5887

59-
**For Adobe Commerce SaaS:**
88+
**For Adobe Commerce (SaaS & PaaS):**
6089

6190
Documentation how to get these values is available here: https://developer.adobe.com/developer-console/docs/guides/authentication/ServerToServerAuthentication/implementation
6291

@@ -72,11 +101,53 @@ OAUTH_SCOPES=AdobeID, openid, read_organizations, additional_info.projectedProdu
72101
7. Create Event Provider for Feed Generator. Run `aio event provider create` and define name. Copy `id` from output.
73102
Add to `.env` line `FEED_GENERATOR_PROVIDER_ID=<id>`
74103

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`.
104+
8. Create Event Metadata for Feed Generator. Run:
105+
```bash
106+
aio event eventmetadata create <FEED_GENERATOR_PROVIDER_ID>
107+
```
108+
Replace `<FEED_GENERATOR_PROVIDER_ID>` with the `id` generated in the previous step. Define event code as `feed.generate` and define description as `Generate Feed`.
76109

77110
9. Run `aio app deploy` to deploy the app.
78111

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.
112+
10. Go to Developer console via Browser. Open your application. Click on "Add Service" -> Event -> 3rd Party Custom Events -> And select your provider and event subscription. In Receiver define "Runtime action" as `processGeneration` action.
80113

81114
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.
82115

116+
## Adding to Adobe Admin UI (SaaS)
117+
118+
For Adobe Commerce SaaS, follow the steps below to add the deployed application to the Commerce Admin
119+
120+
1. Go to Stores -> Configuration in your Adobe Commerce Admin
121+
2. Go to Adobe Services -> Admin UI SDK
122+
3. Click "Configure extensions" and choose respective Environment and Application.
123+
4. Save changes.
124+
125+
For more information and troubleshooting please go to: https://developer.adobe.com/commerce/extensibility/admin-ui-sdk/configuration/
126+
127+
## Adding to Adobe Admin UI (PaaS)
128+
129+
For Adobe Commerce PaaS (On-Premise/Cloud), you need to install and configure the Admin UI SDK module.
130+
131+
### Install the Admin UI SDK Module
132+
133+
1. Install the module via Composer:
134+
135+
```bash
136+
composer require "magento/commerce-backend-sdk": ">=3.0"
137+
```
138+
139+
2. Enable the module (for On-premises installation):
140+
141+
```bash
142+
bin/magento module:enable Magento_AdminUiSdk
143+
bin/magento setup:upgrade
144+
bin/magento cache:clean
145+
```
146+
147+
### Configure the Admin UI SDK
148+
149+
Follow the official Adobe documentation for configuration steps:
150+
- [Admin UI SDK Configuration](https://developer.adobe.com/commerce/extensibility/admin-ui-sdk/configuration/)
151+
152+
For detailed installation instructions, please refer to:
153+
- [Admin UI SDK Installation](https://developer.adobe.com/commerce/extensibility/admin-ui-sdk/installation/)

README.md

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@ 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.
7+
Module compatible with both Adobe Commerce SaaS and PaaS.
88

99
Please see [INSTALL.md](INSTALL.md) for more details.
1010

11+
> [!IMPORTANT]
12+
> This application is designed to run within the Adobe Experience Cloud Shell or Adobe Commerce Admin UI.
13+
> Viewing the deployed application directly via its URL outside of these environments will result in the UI not loading correctly.
14+
> Always access the application through the Experience Cloud Shell or via the Adobe Commerce Admin panel.
15+
1116
## Home page / Grid
1217

1318
On the application home page you will see list of the feeds:
1419

15-
![Home page](./docs/images/a6b730f0-513e-4c80-ab0a-460cc80d4efd.png)
20+
![Home page](./docs/images/home-page.png)
1621

1722
For each feed you can:
1823

@@ -42,7 +47,7 @@ If during feed generation an error occurs, you can see an error in the grid.
4247

4348
On a Grid page you can click on a Feed name, and you will be landed on Edit page of selected feed:
4449

45-
![Edit Feed](./docs/images/c6960caf-13fb-4d76-a42b-e43d86b802bd.png)
50+
![Edit Feed](./docs/images/edit-feed.png)
4651

4752
Here you can change the following elements:
4853

@@ -191,22 +196,24 @@ For that go to Settings and click on clean the cache button.
191196

192197
#### Fixed Variables
193198

194-
Header and Footer currently have a support to variables (Only 1 actualy)
199+
Header and Footer currently have a support to variables (Only 1 actually)
195200

196201
`{{DATA}}` - Current Date/Time - will be in format 2024-10-21T14:45:30.123Z
197202

198203
### Dynamic variables
199204

200205
Variables are defined using double curly braces (`{{ }}`) and correspond to fields in the Adobe Commerce GraphQL product output. For example, `{{sku}}` will be replaced with the product's SKU.
201206

202-
##### Additonal parameters
207+
##### Additional parameterss
208+
209+
Note: The examples in 'Additional parameters' show how to use the parameters. The tag names may be different in your API, as they are specific to your system.
203210

204211
###### Repeating Tags with `count`
205212

206213
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.
207214

208215
```xml
209-
<g:brand>{{manufacturer count="5"}}</g:brand>
216+
<image>{{media_gallery.url count="2"}}</image>
210217
```
211218

212219
##### Selecting Specific Array Elements with `index`
@@ -217,37 +224,60 @@ To select a specific element from an array, use the `index` property. This will
217224
<g:product_type>{{categories.name index="2"}}</g:product_type>
218225
```
219226

220-
##### Selecting Attribute with Specific code
227+
##### Selecting Attribute with Specific code (SaaS specific feature)
221228

222229
```xml
223230
<color>{{attributes.value code='color'}}</color>
224231
```
225232

226233
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.
227234

235+
#### Example for Google Feed
236+
237+
##### Header
238+
```xml
239+
<?xml version="1.0"?>
240+
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
241+
<channel>
242+
```
228243

229-
#### Example
244+
##### Body (PaaS)
230245

231246
```xml
232247
<item>
233248
<g:id>{{sku}}</g:id>
234249
<title>{{name}}</title>
235250
<description>{{description.html}}</description>
236-
<link>https://www.native-instruments.com/{{detail_page}}</link>
251+
<link>https://www.URL.com/{{url_key}}</link>
237252
<g:image_link>{{image.url}}</g:image_link>
238253
<g:condition>new</g:condition>
239254
<g:price>{{price_range.maximum_price.final_price.value}} {{price_range.maximum_price.final_price.currency}}</g:price>
240-
<g:availability>In Stock</g:availability>
241-
<g:google_product_category><![CDATA[Arts &amp; Entertainment &gt; Hobbies &amp; Creative Arts &gt; Musical Instruments &gt; Electronic Musical Instruments]]></g:google_product_category>
242-
<g:identifier_exists>true</g:identifier_exists>
243-
<g:product_type index=2>{{categories.name}}</g:product_type>
244-
<g:sale_price>{{price_range.minimum_price.final_price.value}}</g:sale_price>
245-
<g:brand count=5>{{manufacturer}}</g:brand>
255+
<g:category index="2">{{categories.name}}</g:category>
246256
<g:mpn>{{sku}}</g:mpn>
247257
<g:additional_image_link><![CDATA[{{image.url}}?width=350&height=350&fit=crop]]></g:additional_image_link>
248258
</item>
249259
```
250260

261+
262+
##### Body (SaaS)
263+
```xml
264+
<item>
265+
<sku>{{sku}}</sku>
266+
<description>{{description}}</description>
267+
<image>{{images.url count="2"}}</image>
268+
<color>{{attributes.value code='color'}}</color>
269+
<weight>{{attributes.value code='weight'}}</weight>
270+
<price>{{SimpleProductView||price.final.amount.value}} {{SimpleProductView||price.final.amount.currency}}</price>
271+
</item>
272+
```
273+
274+
##### Footer
275+
```xml
276+
</channel>
277+
</rss>
278+
```
279+
280+
251281
## Technical Module implementation
252282

253283
Delete Feed - deleting current feed from the database and from all schedules
@@ -285,7 +315,7 @@ Regenerate Feed - will trigger the event “generate.feed” for a particular fe
285315

286316
* `getAllStores` - get all Adobe Commerce Stores by API
287317

288-
* `generateByCron` - trigger feed generation by OpenWisk alarms.
318+
* `generateByCron` - trigger feed generation by OpenWhisk alarms.
289319

290320
* `getConfig` - receive public module configs. Currently only return type of authorization (ims vs oauth).
291321

@@ -306,8 +336,8 @@ Action is running every 30 minutes and checking by feed settings if it have to b
306336
Edit / Create New Feed form will contain form to save new Feed.
307337

308338
Current elements:
309-
* Feed Format - select - JSON | XML
310-
* Feed Item: Big text field to have XML | JSON there with feed item body
339+
* Feed Format - select - XML
340+
* Feed Item: Big text field to have XML there with feed item body
311341
* Feed Header
312342
* Feed Footer
313343
* Store View - select with list of available store views on Adobe Commerce (websites also have to be there, but it is not possible to select them)

0 commit comments

Comments
 (0)