Introduction
The module’s integration:
-
adds a sitemap to your website;
-
defines a cronjob that will create a sitemap on a certain period;
-
sends the sitemap to Google for indexing
Development
Core
Entity Definitions
The definitions in this module have id discriminators in the range 270-280. |
The SitemapChangeFrequencyDefinition extends the AbstractEntityEnum, going further to the MixInEnum:

The enumeration specifies how frequently the sitemap to be changed - ALWAYS
, HOURLY
, DAILY
, WEEKLY
, MONTHLY
, YEARLY
, or NEVER
.
The SitemapConfigEntityDefinition extends the AbstractEntityDefinition:

This JPA entity specifies the configuration of the sitemap. Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:
Property | Description |
---|---|
baseUrl |
stores the base url for the exported sitemap |
media |
stores the media where the sitemap will be exported |
sitemapPages |
stores a set of pages for the sitemap |
The SitemapPageEntityDefinition extends the AbstractEntityDefinition and the AbstractActivatableEntityDefinition:

This JPA entity defines the sitemap page. Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:
Property | Description |
---|---|
sitemapConfig |
stores sitemap configuraiton for the sitemap |
urlResolver |
stores the Spring Bean url resolver to use when constructing the sitemap |
url |
stores the url for the sitemap |
locale |
stores the locale for the sitemap |
sitemapChangeFrequency |
stores the change frequency of the sitemap |
priority |
stores the priority of the sitemap |
The SitemapSiteEntityDefinition extends the SiteEntityDefinition, going further to the AbstractEntityDefinition and the AbstractDescriptionableEntityDefinition:

The only sitemap-related attribute, defined here, is sitemapConfig. It stores the sitemap configuration for the particular sitemap.
Spring Data JPA Repositories
The SitemapConfigRepository extends the BaseEntityRepository and is the corresponding Spring Data JPA repository for the SitemapConfigEntityDefinition
:

The SitemapPageRepository extends the ActivatableRepository and the BaseEntityRepository :

This is the corresponding Spring Data JPA repository for the SitemapPageEntityDefinition
.
Business Services
The SitemapService defines a method that obtains the sitemap media file for the given site.
Facade
Facades
The functionalities, defined in the SitemapFacade, let you:
-
check if the current site has a sitemap;
-
initialize a Dto stream from the current site’s sitemap media file;
-
store the given Dto stream in the current site’s sitemap media file;
Storefront
The SitemapController defines an HTTP Endpoint at /sitemap.xml
.
There are no views, associated with the module.