Search in sources :

Example 11 with SeoTags

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;
}
Also used : SeoTags(com.adobe.aem.wcm.seo.SeoTags) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

SeoTags (com.adobe.aem.wcm.seo.SeoTags)11 Utils.getTestExporterJSONPath (com.adobe.cq.wcm.core.components.Utils.getTestExporterJSONPath)8 Utils.testJSONExport (com.adobe.cq.wcm.core.components.Utils.testJSONExport)8 HtmlPageItemsConfig (com.adobe.cq.wcm.core.components.config.HtmlPageItemsConfig)8 HtmlPageItem (com.adobe.cq.wcm.core.components.models.HtmlPageItem)8 NavigationItem (com.adobe.cq.wcm.core.components.models.NavigationItem)8 Page (com.adobe.cq.wcm.core.components.models.Page)8 MockHtmlLibraryManager (com.adobe.cq.wcm.core.components.testing.MockHtmlLibraryManager)8 MockPersistenceStrategy (com.adobe.cq.wcm.core.components.testing.MockPersistenceStrategy)8 MockProductInfoProvider (com.adobe.cq.wcm.core.components.testing.MockProductInfoProvider)8 Utils (com.adobe.cq.wcm.core.components.testing.Utils)8 ClientLibrary (com.adobe.granite.ui.clientlibs.ClientLibrary)8 ImmutableMap (com.google.common.collect.ImmutableMap)8 AemContextExtension (io.wcm.testing.mock.aem.junit5.AemContextExtension)8 ParseException (java.text.ParseException)8 SimpleDateFormat (java.text.SimpleDateFormat)8 Arrays (java.util.Arrays)8 Calendar (java.util.Calendar)8 Collections (java.util.Collections)8 HashMap (java.util.HashMap)8