Episerver and Automapper illustration

Episerver + Apptus eSales DynamicPages

Published:

I just wanted to note down what I have done when integration Episerver CMS and Apptus eSales with DynamicPages.

ESales relies on building zones with panels to return all data in a single response.

As a close implementation Episerver CMS has blocks, blocks can contain custom logic and views depending on the locations the block is shown.

In my case i used Blocks as a substitute for eSales panel and then build a DynamicPage on the shown blocks in the page.

# Implementation

By intercepting when PageData passed into a controller method (solution) (opens new window), then get all ESalesPanelBlocks in currentPage (directly or in ContentArea) we can build a DynamicPage query.

ESalesPanelBlocks is an abstract block class with panelpath and attributes for the esales subpanel and a result property where data is returned.

When the DynamicPage content returns; look for the subpanels for the blocks and insert dem into ResultPanel property. The property should be marked with [Ignore], so the data is not stored.

I used AutoMapper to map dto-models to site-models as a last step before setting ResultPanel property.

# Efficiency

I have not yet tested its efficiency against using predefined zones in eSales, this far the response time seems to be very quick (100ms-200ms local episerver, remote on-premise eSales, two different “recommended products for user blocks”).

# Conclusion

By doing it this way we get a optimal solution, one eSales query for the entire page and Episerver blocks that is easy to place and use on your page. The best from both worlds.

# Future development

Make “ESalesZonePanelBlock” that implements the zone capabilities.

Last Updated: 2/25/2023, 10:04:42 PM