org.alfresco.repo.model.ml
Class ContentFilterLanguagesMap

java.lang.Object
  extended by 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 Service Content Filter Languages Service


Field Summary
 
Fields inherited from interface org.alfresco.service.cmr.ml.ContentFilterLanguagesService
MESSAGE_PREFIX
 
Constructor Summary
ContentFilterLanguagesMap()
           
 
Method Summary
 java.lang.String convertToNewISOCode(java.lang.String code)
          Since java.util.Locale uses and returns old ISO code and the content-filter-lang.xml respects the new ones.
 java.lang.String convertToOldISOCode(java.lang.String code)
          Since java.util.Locale uses and returns old ISO code and the content-filter-lang.xml respects the new ones.
 java.lang.String getDefaultLanguage()
           
 java.util.List getFilterLanguages()
          Get ordered list of languages code
 java.lang.String getLabelByCode(java.lang.String code)
          Get the language of the specified language code
 java.util.List getMissingLanguages(java.util.List availableLanguages)
          Get the the odered filter which results form an extract of availableLanguages on the filterLanguages
 int getOrderByCode(java.lang.String code)
          Get the order of the specified language code
 void init()
          Initialises the map using the configuration service provided
 void setConfigService(org.springframework.extensions.config.ConfigService configService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentFilterLanguagesMap

public ContentFilterLanguagesMap()
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 getFilterLanguages()
Description copied from interface: ContentFilterLanguagesService
Get ordered list of languages code

Specified by:
getFilterLanguages in interface ContentFilterLanguagesService
Returns:
the map of displays indexed by extension

getMissingLanguages

public java.util.List getMissingLanguages(java.util.List availableLanguages)
Description copied from interface: ContentFilterLanguagesService
Get the the odered filter which results form an extract of availableLanguages on the filterLanguages

Specified by:
getMissingLanguages in interface ContentFilterLanguagesService
Parameters:
availableLanguages - the languages list whose will be removed from the filterLanguages
Returns:

getLabelByCode

public java.lang.String getLabelByCode(java.lang.String code)
Description copied from interface: ContentFilterLanguagesService
Get the language of the specified language code

Specified by:
getLabelByCode in interface ContentFilterLanguagesService
Returns:

getOrderByCode

public int getOrderByCode(java.lang.String code)
Description copied from interface: ContentFilterLanguagesService
Get the order of the specified language code

Specified by:
getOrderByCode in interface ContentFilterLanguagesService
Returns:

getDefaultLanguage

public java.lang.String getDefaultLanguage()
Specified by:
getDefaultLanguage in interface ContentFilterLanguagesService
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: ContentFilterLanguagesService
Since java.util.Locale uses 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:
convertToOldISOCode in interface ContentFilterLanguagesService
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: ContentFilterLanguagesService
Since java.util.Locale uses 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:
convertToNewISOCode in interface ContentFilterLanguagesService
Parameters:
code - the ISO language code to convert
Returns:
the convertion of the codes iw, ji, and in or the given code


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.