Episerver + Apptus eSales DynamicPages

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), 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.

 

3 Replies to “Episerver + Apptus eSales DynamicPages”

  1. Nice post!

    I’ve been doing something similar recently. How do handle the response from eSales? I theory the response from eSales might return less subpanels than queried. Lets say you have four blocks, and only three of them returns a subpanel. My experince is that eSales doesn’t even return a subpanel instead of an empty one.

    1. Hey, thanks for commenting!

      I understand your problem, I coded around this issue doing a null check in the block-view.

      I’m using the .Net Connector Library. Calling the subpanel method on the returned content will always return a panel, even if it is empty. So I have the opposite problem, I don’t want a panel if it is empty (unless there is an error message).

      I going to ask Apptus about why it is not returning error messages.
      It would be nice to show the error messages in edit mode.

Comments are closed.