com.day.cq.wcm.api
Interface LanguageManager

All Known Implementing Classes:
LanguageManagerImpl

public interface LanguageManager

Provides a service for content languages. Note that this has nothing to do with the i18n of the WCM itself.


Nested Class Summary
static interface LanguageManager.Info
          Information about a resource in a language tree.
static interface LanguageManager.Tree
          Encapsulates information about language specific existences of resources in a tree.
static interface LanguageManager.TreeNode
          Denotes a node in the tree.
 
Method Summary
 LanguageManager.Tree compareLanguageTrees(org.apache.sling.api.resource.ResourceResolver resolver, String path)
          Compares language trees using the language of the page at the given path as main language.
 Map<Locale,LanguageManager.Info> getAdjacentInfo(org.apache.sling.api.resource.ResourceResolver resolver, String path)
          Returns a map of language information for each configured enabled language filled with information if respective hierarch or content exists for that language.
 Set<Locale> getEnabledLanguages()
          Returns a set of languages that are enabled as content languages.
 String getIsoCountry(Locale language)
          Returns the country iso code for the given locale.
 

Method Detail

getEnabledLanguages

Set<Locale> getEnabledLanguages()
Returns a set of languages that are enabled as content languages. The enabled languages are mainly used in language dialogs. the content can define more.

Returns:
a set of languages

getIsoCountry

String getIsoCountry(Locale language)
Returns the country iso code for the given locale. if the country is not already defined in the locale a configured default value is returned. If no iso code exists, an empty string is returned.

Parameters:
language - the language locale to retrieve the country from
Returns:
a country iso code or ""

getAdjacentInfo

Map<Locale,LanguageManager.Info> getAdjacentInfo(org.apache.sling.api.resource.ResourceResolver resolver,
                                                 String path)
Returns a map of language information for each configured enabled language filled with information if respective hierarch or content exists for that language.

Parameters:
resolver - resource resolver
path - path to check
Returns:
map of information or null if the given path does not reside on or below a language root.
See Also:
getEnabledLanguages(), LanguageUtil.getLanguageRoot(String)

compareLanguageTrees

LanguageManager.Tree compareLanguageTrees(org.apache.sling.api.resource.ResourceResolver resolver,
                                          String path)
Compares language trees using the language of the page at the given path as main language.

Parameters:
resolver - resource resolved
path - path to resource to start from
Returns:
the tree information


Copyright © 2008 Day Management AG. All Rights Reserved.