Liferay DXP · SEO module · 2 min
OSGi Struts action on /portal/sitemap that returns sitemap.org XML for a layout set.
Liferay DXP · OSGi · Java · SEO
Architecture
From the real repo — how the pieces fit.
SEO Sitemap
Struts action on /portal/sitemap → sitemap.org 0.9 XML
GET /portal/sitemap
Optional groupId · privateLayout
Resolve layout set
- Query groupId + privateLayout
- Else virtual host → layout set
- Else guest public pages
Filter layouts
Skip hidden · system · unpublished
<?xml version="1.0"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://…/page</loc>
<lastmod>ISO date</lastmod>
<changefreq>daily</changefreq>
<priority>0.5–1.0</priority>
</url>
<!-- …more urls… -->
</urlset>
// 200 text/xmlAn OSGi module that serves a sitemap.org 0.9 XML document for a Liferay layout set on the portal sitemap path.
What it is
Registers a Struts action on /portal/sitemap (high service ranking) and returns UTF-8 text/xml. Built for DXP (workspace example: dxp-2026.q1.5-lts). Source: codepapu/seo-sitemap.
Which site
- Optional query
groupIdandprivateLayout. - Else match the HTTP Host to a virtual host layout set.
- Else the guest site's public pages.
Missing or inactive groups return 404.
Which pages
Published, non-hidden, non-system layouts with a friendly URL. Each entry has loc, lastmod, changefreq daily, and priority 1.0 (root) or 0.8.