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.xlsxThen do the following:
- Press
Nextfrom the sheet overview - Press
Nextfrom 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:
Attributeis mapped toAttributeProduct IDis mapped toIDProduct Nameis 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.ymland fill in the API-token you were given:
pdx.api:
url: https://tagglo-preprod.io/api/v1/adapter-gateway
token: place your API-token hererun the main-method from:
.../adapter/YourCompanyAdapter.classthis will do the following:
- A full Spring application is loaded using SDK setup defined in
@AdapterApplication - This will locate your implementation of the bean
RegularSubmitHandlerwhich is located inhandlers/SubmitHandler.class - Periodically, the SDK will perform a call to the
events-endpoint you tried by hand before using theAPI-tokenyou 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
RegularSubmitHandlerwith 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
IDlocating your version of the product on your system - this role is played by theFakeProductServicecurrently, which only runs locally, but you should replace both this and theSubmitHandlerto 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.htmlfound in the project root.
Updated 6 months ago
