Introduction

Business

Development

Core

Entity Definitions

asciidoctor diagram ProductsCompareWidgetEntityDefinition

Spring Data JPA Repositories

ProductsCompareWidgetRepository

The ProductsCompareWidgetRepository extends the ActivatableRepository and the BaseEntityRepository:

asciidoctor diagram ProductsCompareWidgetRepository

This is the corresponding Spring Data JPA repository for the ProductsCompareWidgetEntityDefinition.

Facade

MapperFactoryConfigurers

ProductsCompareWidgetMapperFactoryConfigurer

The ProductsCompareWidgetMapperFactoryConfigurer implements the MapperFactoryConfigurer:

asciidoctor diagram ProductsCompareWidgetMapperFactoryConfigurer

The registered conversions here are:

  • from ProductsCompareWidgetEntityDefinition to ProductsCompareWidgetDtoDefinition,

  • from ProductEntityDefinition to ProductCompareProductDtoDefinition and

  • from ProductEntityDefinition to ProductCompareListProductDtoDefinition

More about the mapping configurations you may read in the respective Orika guide.

Dto definitions

ProductCompareListProductDtoDefinition

The ProductCompareListProductDtoDefinition extends the AbstractProductDtoDefinition and the ProductBasicDtoDefinition:

asciidoctor diagram ProductCompareListProductDtoDefinition

This is the corresponding Dto object for the ProductEntityDefinition.

asciidoctor diagram ProductCompareProductDtoDefinition

This is the corresponding Dto object for the ProductEntityDefinition.

ProductsCompareWidgetDtoDefinition

The ProductsCompareWidgetDtoDefinition extends the WidgetDtoDefinition, going further to the AbstractEntityDtoDefinition:

asciidoctor diagram ProductsCompareWidgetDtoDefinition

This is the corresponding Dto object for the ProductsCompareWidgetEntityDefinition.

Facades

ProductCompareFacade

The ProductCompareFacade defines the getProductCompareData() method that returns the resulting map, from the specified Dto comparision.

Storefront

ProductsCompareWidgetController

The ProductsCompareWidgetController extends the AbstractWidgetController:

asciidoctor diagram ProductsCompareWidgetController

The defined HTTP Endpoints can be accessed at:

  • /add/{productCode},

  • /remove/{productCode} and at

  • /compare

Some custom JavaScript files handle the appearance and behaviour of the products' comparison. They can be found at resources/META-INF/resources/resources/productscompare/js/script.js

Integration

The integration with the Nemesis platform is pretty straight-forward - just need to add the widget in your classpath:

<dependency>
    <groupId>io.nemesis.platform.module.widget</groupId>
    <artifactId>nemesis-widget-productscompare</artifactId>
</dependency>