Package org.alfresco.repo.model.ml
Class ContentFilterLanguagesMap
java.lang.Object
org.alfresco.repo.model.ml.ContentFilterLanguagesMap
- All Implemented Interfaces:
ContentFilterLanguagesService
Provides a an implementation of the Content Filter Languages Service
Content Filter Languages Service- Author:
- Yannick Pignot
-
Field Summary
Fields inherited from interface org.alfresco.service.cmr.ml.ContentFilterLanguagesService
MESSAGE_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToNewISOCode(String code) Sincejava.util.Localeuses and returns old ISO code and the content-filter-lang.xml respects the new ones.convertToOldISOCode(String code) Sincejava.util.Localeuses and returns old ISO code and the content-filter-lang.xml respects the new ones.Get ordered list of languages codegetLabelByCode(String code) Get the language of the specified language codegetMissingLanguages(List<String> availableLanguages) Get the the odered filter which results form an extract of availableLanguages on the filterLanguagesintgetOrderByCode(String code) Get the order of the specified language codevoidinit()Initialises the map using the configuration service providedvoidsetConfigService(org.springframework.extensions.config.ConfigService configService)
-
Constructor Details
-
ContentFilterLanguagesMap
public ContentFilterLanguagesMap()
-
-
Method Details
-
setConfigService
public void setConfigService(org.springframework.extensions.config.ConfigService configService) - Parameters:
configService- the config service to use to read languages
-
getFilterLanguages
Description copied from interface:ContentFilterLanguagesServiceGet ordered list of languages code- Specified by:
getFilterLanguagesin interfaceContentFilterLanguagesService- Returns:
- the map of displays indexed by extension
-
getMissingLanguages
Description copied from interface:ContentFilterLanguagesServiceGet the the odered filter which results form an extract of availableLanguages on the filterLanguages- Specified by:
getMissingLanguagesin interfaceContentFilterLanguagesService- Parameters:
availableLanguages- the languages list whose will be removed from the filterLanguages
-
getLabelByCode
Description copied from interface:ContentFilterLanguagesServiceGet the language of the specified language code- Specified by:
getLabelByCodein interfaceContentFilterLanguagesService- Parameters:
code- String- Returns:
- String
-
getOrderByCode
Description copied from interface:ContentFilterLanguagesServiceGet the order of the specified language code- Specified by:
getOrderByCodein interfaceContentFilterLanguagesService- Parameters:
code- String- Returns:
- int
-
getDefaultLanguage
- Specified by:
getDefaultLanguagein interfaceContentFilterLanguagesService- Returns:
- the default content filter language, null if it's not set.
-
init
public void init()Initialises the map using the configuration service provided -
convertToOldISOCode
Description copied from interface:ContentFilterLanguagesServiceSincejava.util.Localeuses and returns old ISO code and the content-filter-lang.xml respects the new ones. This method convert new codes into old codes:(he, yi, and id) new codes to (iw, ji, and in) old codes
- Specified by:
convertToOldISOCodein interfaceContentFilterLanguagesService- Parameters:
code- the ISO language code to convert- Returns:
- the convertion of the codes he, yi, and id or the given code
-
convertToNewISOCode
Description copied from interface:ContentFilterLanguagesServiceSincejava.util.Localeuses and returns old ISO code and the content-filter-lang.xml respects the new ones. This method convert old codes into new codes:(iw, ji, and in) old codes to (he, yi, and id) new codes
- Specified by:
convertToNewISOCodein interfaceContentFilterLanguagesService- Parameters:
code- the ISO language code to convert- Returns:
- the convertion of the codes iw, ji, and in or the given code
-