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:

  1. Press Next from the sheet overview
  2. Press Next from the import type
  3. 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 to Attribute
  • Product ID is mapped to ID
  • Product Name is mapped to Name

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:

  1. Add to channel
  2. Choose Select channel and category
  3. Make sure the selected channel is the one you have created, and select the single category called All products
  4. 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:

  1. A full Spring application is loaded using SDK setup defined in @AdapterApplication
  2. This will locate your implementation of the bean RegularSubmitHandler which is located in handlers/SubmitHandler.class
  3. Periodically, the SDK will perform a call to the events-endpoint you tried by hand before using the API-token you placed in application.yml
  4. 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
  5. Now it is up to you to process those products and map them to something your system will understand
  6. 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 the FakeProductService currently, which only runs locally, but you should replace both this and the SubmitHandler 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.