loading table of contents...

5.3. Communication

CoreMedia DXP 8 and IBM WebSphere communicate over REST interfaces. The concrete communication differs slightly based on the selected deployment scenario which are the content-led scenario and the commerce-led scenario. The following picture shows the communication how fragments of a page are delivered from the CAE and from the commerce system.

Content-led/Commerce-led scenario communication

Figure 5.13. Content-led/Commerce-led scenario communication


In the content-led scenario common pages and detail pages are delivered by the CAE, including fragments like the login information and the shopping cart. For product teasers and the shopping cart, additional data is requested from the commerce system to display the price and other details. The CAE can only render products as teaser. The document type CMProductTeaser is used for this, because it contains a reference to the concrete product variant inside the commerce system. Therefore, also the teaser text, title and picture are read from the CMS and only the pricing information is read (through the commerce API) from the product:

Example of a Commerce API Request

Figure 5.14. Example of a Commerce API Request


The image shows what happens when the CAE requests data from commerce. First of all, the Store- and UserContextInterceptors are executed to determine the store (and locale) and user the request is executed for. Depending on the commerce request, an additional authentication is performed to authorize the user to request the data. The response authentication token is used to retrieve the data itself, for example, the details of a product or a shop category. The return format is JSON which is wrapped into Java objects. These objects are used to render commerce data like the name of a product inside a product teaser.

When the user clicks on a product teaser, the CAE redirects the user to the commerce system which renders the product detail page. Depending on the scenario (Content-led/Commerce-led) the header and footer fragments are rendered by the CAE or the commerce system. The commerce system requests the fragments using the CoreMedia Fragment Connector.

Example of a Fragment Connector Request

Figure 5.15. Example of a Fragment Connector Request


Fragment requests are executed through the lc:include tag. The tag is parameterized with several attributes and additional HTTP headers that are set through request context providers which are defined in the web.xml of the commerce system. The fragment request contains all cookies of the commerce system too. This is mandatory since the CAE needs to know if the user is already authenticated against the system to deliver the corresponding fragments.

Each response of the CAE contains HTML with JSON placeholders (wrapped inside an HTML comment). The link building is executed by the commerce system by applying a template for every link, depending on the JSON data that was returned for the link. The lookup folder for these templates are also defined in the web.xml of the commerce system.