Package org.alfresco.repo.model.ml
Class ContentFilterLanguagesMap
- java.lang.Object
-
- org.alfresco.repo.model.ml.ContentFilterLanguagesMap
-
- All Implemented Interfaces:
ContentFilterLanguagesService
public class ContentFilterLanguagesMap extends java.lang.Object implements ContentFilterLanguagesService
Provides a an implementation of the Content Filter Languages ServiceContent Filter Languages Service- Author:
- Yannick Pignot
-
-
Field Summary
-
Fields inherited from interface org.alfresco.service.cmr.ml.ContentFilterLanguagesService
MESSAGE_PREFIX
-
-
Constructor Summary
Constructors Constructor Description ContentFilterLanguagesMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringconvertToNewISOCode(java.lang.String code)Sincejava.util.Localeuses and returns old ISO code and the content-filter-lang.xml respects the new ones.java.lang.StringconvertToOldISOCode(java.lang.String code)Sincejava.util.Localeuses and returns old ISO code and the content-filter-lang.xml respects the new ones.java.lang.StringgetDefaultLanguage()java.util.List<java.lang.String>getFilterLanguages()Get ordered list of languages codejava.lang.StringgetLabelByCode(java.lang.String code)Get the language of the specified language codejava.util.List<java.lang.String>getMissingLanguages(java.util.List<java.lang.String> availableLanguages)Get the the odered filter which results form an extract of availableLanguages on the filterLanguagesintgetOrderByCode(java.lang.String code)Get the order of the specified language codevoidinit()Initialises the map using the configuration service providedvoidsetConfigService(org.springframework.extensions.config.ConfigService configService)
-
-
-
Method Detail
-
setConfigService
public void setConfigService(org.springframework.extensions.config.ConfigService configService)
- Parameters:
configService- the config service to use to read languages
-
getFilterLanguages
public java.util.List<java.lang.String> getFilterLanguages()
Description copied from interface:ContentFilterLanguagesServiceGet ordered list of languages code- Specified by:
getFilterLanguagesin interfaceContentFilterLanguagesService- Returns:
- the map of displays indexed by extension
-
getMissingLanguages
public java.util.List<java.lang.String> getMissingLanguages(java.util.List<java.lang.String> availableLanguages)
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
public java.lang.String getLabelByCode(java.lang.String code)
Description copied from interface:ContentFilterLanguagesServiceGet the language of the specified language code- Specified by:
getLabelByCodein interfaceContentFilterLanguagesService- Parameters:
code- String- Returns:
- String
-
getOrderByCode
public int getOrderByCode(java.lang.String code)
Description copied from interface:ContentFilterLanguagesServiceGet the order of the specified language code- Specified by:
getOrderByCodein interfaceContentFilterLanguagesService- Parameters:
code- String- Returns:
- int
-
getDefaultLanguage
public java.lang.String 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
public java.lang.String convertToOldISOCode(java.lang.String code)
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
public java.lang.String convertToNewISOCode(java.lang.String code)
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
-
-