Interface LanguageAlternativesService
A service that provides access to a
Page's language alternatives.-
Method Summary
Modifier and TypeMethodDescription@Nullable PagegetLanguageAlternative(@NotNull Page page, @NotNull Locale locale) getLanguageAlternatives(@NotNull Page page) Traverses the site subtree of the givenPageusing depth-first-search up to a configured maximum depth and returns language alternatives of the given page in each of the found language roots in the subtree.getSiteRoot(Page page) Returns the site root as returned by the highest rankedSiteRootSelectionStrategyfor the givenPage.
-
Method Details
-
getSiteRoot
Returns the site root as returned by the highest rankedSiteRootSelectionStrategyfor the givenPage.- Parameters:
page- the givenPage- Returns:
- the site root, or
nullif not found
-
getLanguageAlternative
@Nullable @Nullable Page getLanguageAlternative(@NotNull @NotNull Page page, @NotNull @NotNull Locale locale) -
getLanguageAlternatives
Traverses the site subtree of the givenPageusing depth-first-search up to a configured maximum depth and returns language alternatives of the given page in each of the found language roots in the subtree. Language roots that are ancestors of other language roots are skipped. For example/content/wknd/fr/fris taking precedence over/content/wknd/frfor whichLocalederived from the path would be the same.The
Page's site root is defined by an implementation ofSiteRootSelectionStrategy.getSiteRoot(Page).- Parameters:
page- the givenPageto return language alternatives for- Returns:
- a
Collectionof all language alternatives within thePage's site root
-