Create adapter for PDX
Import and submit sample products
Import products to PDX master data
Go to PDX UI and press the import button, and import the following Excel file (from the project root):
samples/simple-products-for-import.xlsx
Then do the following:
- Press
Next
from the sheet overview - Press
Next
from the import type - Disable auto assignment for now and choose
Import products
in the pop up, press Edit mappings
and make sure you have the following:
Attribute
is mapped toAttribute
Product ID
is mapped toID
Product Name
is mapped toName
then press the Import
-button and verify that you want to import the products. Then go to master data and see that the products ended up there.
Add products to your channel
From master data, select all products and press the burger menu
-button. Then select:
Add to channel
- Choose
Select channel and category
- Make sure the selected channel is the one you have created, and select the single category called
All products
- Choose
Add products
Now the products should show up in your channel with status Progress
. This will change to Ready
in a bit, once we fill in the missing channel values by creating a mapping:
Add channel mappings
Submit products
From your channel>All products
, select all products and press the burger menu
:
- Select the submit-symbol (a folder with a star) in order to submit the products
Run adapter locally
Add API-token to adapter
Create the file:
src/main/resources/application.yml
and fill in the API-token
you were given:
pdx.api:
url: https://tagglo-preprod.io/api/v1/adapter-gateway
token: place your API-token here
run the main
-method from:
.../adapter/YourCompanyAdapter.class
this will do the following:
- A full Spring application is loaded using SDK setup defined in
@AdapterApplication
- This will locate your implementation of the bean
RegularSubmitHandler
which is located inhandlers/SubmitHandler.class
- Periodically, the SDK will perform a call to the
events
-endpoint you tried by hand before using theAPI-token
you placed inapplication.yml
- If it finds a submit-event in your queue, it then calls other endpoints to get the data and call your implementation of
RegularSubmitHandler
with the given event data split into the params you can see there - Now it is up to you to process those products and map them to something your system will understand
- Finally, you send it to your system and received back an
ID
locating your version of the product on your system - this role is played by theFakeProductService
currently, which only runs locally, but you should replace both this and theSubmitHandler
to fit your mappings and communication to your system
Submit products again - and view them locally
The current "fake" version will store received products in product-table.html
in the project root, and this can be viewed by opening the page:
display-product-table.html
found in the project root.
Updated 8 months ago