Introduction

Business

Development

Core

Entity Definitions

asciidoctor diagram LinkWidgetEntityDefinition

Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:

Property Description

linkName

stores the name of the respective link

url

stores the url of the respective link

urlEncoded

stores a boolean value, indicating if the url of the respective link is encoded or not

target

stores the target of the link

activePatterns

stores a collection of String url patterns to indicate the link as active

contentPage

stores the CmsPageEntityDefinition the link leads to

category

stores a CategoryEntityDefinition the link leads to

ProductLinkWidgetEntityDefinition

The ProductLinkWidgetEntityDefinition extends the LinkWidgetEntityDefinition. Following the inheritance tree of the LinkWidgetEntityDefinition, the extra extended interfaces are the WidgetEntityDefinition, the AbstractEntityDefinition, the AbstractActivatableEntityDefinition, the AbstractCatalogableEntityDefinition, the AbstractCmsEntityDefinition and the AbstractFilterableEntityDefinition:

asciidoctor diagram ProductLinkWidgetEntityDefinition

The extra getter-setter here is set via the product property. The respective column in the database stores the product we generate the link to.

Spring Data JPA Repositories

LinkWidgetRepository

The LinkWidgetRepository extends the ActivatableRepository and the BaseEntityRepository. This is the corresponding Spring Data JPA repository for the LinkWidgetEntityDefinition:

asciidoctor diagram LinkWidgetRepository

Facade

Configurers

LinkWidgetMapperFactoryConfigurer

The LinkWidgetMapperFactoryConfigurer implements the MapperFactoryConfigurer, converting the LinkWidgetEntityDefinition to LinkWidgetDtoDefinition:

asciidoctor diagram LinkWidgetMapperFactoryConfigurer

The conversion is done via the byDefault() method.

ProductLinkWidgetMapperFactoryConfigurer

The ProductLinkWidgetMapperFactoryConfigurer implements the MapperFactoryConfigurer:

asciidoctor diagram ProductLinkWidgetMapperFactoryConfigurer

There are 2 conversions, registered here:

  • form ProductEntityDefinition to ProductLinkProductDtoDefinition and from

  • from ProductLinkWidgetEntityDefinition to ProductLinkWidgetDtoDefinition

The conversion is done via the byDefault() method.

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

Dto definitions

LinkWidgetDtoDefinition

The LinkWidgetDtoDefinition extends the WidgetDtoDefinition, going further to the AbstractEntityDtoDefinition. This is the corresponding Dto object for the LinkWidgetEntityDefinition:

asciidoctor diagram LinkWidgetDtoDefinition
ProductLinkProductDtoDefinition

The ProductLinkProductDtoDefinition extends the AbstractProductDtoDefinition and the ProductBasicDtoDefinition. The ProductLinkProductDtoDefinition is the corresponding Dto object for the ProductEntityDefinition

asciidoctor diagram ProductLinkProductDtoDefinition
ProductLinkWidgetDtoDefinition

The ProductLinkWidgetDtoDefinition extends the LinkWidgetDtoDefinition, going further to the WidgetDtoDefinition and the AbstractEntityDtoDefinition.

asciidoctor diagram ProductLinkWidgetDtoDefinition

The ProductLinkWidgetDtoDefinition is the corresponding Dto object for the ProductLinkWidgetEntityDefinition.

Storefront

Renderer

LinkWidgetRenderer

The LinkWidgetRenderer extends the AbstractWidgetRenderer:

asciidoctor diagram LinkWidgetRenderer

Via the doRender() method, the respective view is constructed, based on the passed values.

There are no views, associated with the widget.

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-link</artifactId>
</dependency>