Class CanonicalUrlService
java.lang.Object
fr.paris.lutece.plugins.seo.service.CanonicalUrlService
Canonical Url Service
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCanonicalUrl(String strContent, jakarta.servlet.http.HttpServletRequest request, Map<String, String> mapFriendlyUrls, String strBaseUrl) Add canonical URL into an HTML page's contentvoidinit()booleanTells if canonical urls are enabledvoidsetCanonicalUrlsEnabled(boolean bEnabled) Sets the status of Canonical URLs (Enabled or Disabled)
-
Constructor Details
-
CanonicalUrlService
public CanonicalUrlService()
-
-
Method Details
-
init
@PostConstruct public void init() -
isCanonicalUrlsEnabled
public boolean isCanonicalUrlsEnabled()Tells if canonical urls are enabled- Returns:
- True if canonical urls are enabled, otherwise false
-
setCanonicalUrlsEnabled
public void setCanonicalUrlsEnabled(boolean bEnabled) Sets the status of Canonical URLs (Enabled or Disabled)- Parameters:
bEnabled- The status
-
addCanonicalUrl
public String addCanonicalUrl(String strContent, jakarta.servlet.http.HttpServletRequest request, Map<String, String> mapFriendlyUrls, String strBaseUrl) Add canonical URL into an HTML page's content- Parameters:
strContent- The HTML page's contentrequest- The HTTP requestmapFriendlyUrls- The map of friendly URLSstrBaseUrl- The Base URL- Returns:
- The HTML page content with the canonical URL inserted
-