use of com.adobe.aem.wcm.seo.SeoTags in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class PageImpl method getAlternateLanguageLinks.
@Override
@NotNull
public Map<Locale, String> getAlternateLanguageLinks() {
if (alternateLanguageLinks == null) {
try {
if (currentStyle != null && currentStyle.get(PN_STYLE_RENDER_ALTERNATE_LANGUAGE_LINKS, Boolean.FALSE)) {
SeoTags seoTags = resource.adaptTo(SeoTags.class);
alternateLanguageLinks = seoTags != null && seoTags.getAlternateLanguages().size() > 0 ? Collections.unmodifiableMap(seoTags.getAlternateLanguages()) : Collections.emptyMap();
} else {
alternateLanguageLinks = Collections.emptyMap();
}
} catch (NoClassDefFoundError ex) {
alternateLanguageLinks = Collections.emptyMap();
}
}
return alternateLanguageLinks;
}
Aggregations