Liferay 6.2-ce-ga5

com.liferay.portal.kernel.util
Class LocalizationUtil

java.lang.Object
  extended by com.liferay.portal.kernel.util.LocalizationUtil
Direct Known Subclasses:
LocalizationUtil

public class LocalizationUtil
extends Object

See Also:
Localization

Constructor Summary
LocalizationUtil()
           
 
Method Summary
static Object deserialize(JSONObject jsonObject)
           
static String[] getAvailableLanguageIds(Document document)
           
static String[] getAvailableLanguageIds(String xml)
           
static String[] getAvailableLocales(String xml)
          Deprecated. As of 6.2.0, replaced by getAvailableLanguageIds(String)
static Locale getDefaultImportLocale(String className, long classPK, Locale contentDefaultLocale, Locale[] contentAvailableLocales)
           
static String getDefaultLanguageId(Document document)
           
static String getDefaultLanguageId(Document document, Locale defaultLocale)
           
static String getDefaultLanguageId(String xml)
           
static String getDefaultLanguageId(String xml, Locale defaultLocale)
           
static String getDefaultLocale(String xml)
          Deprecated. As of 6.2.0, replaced by getDefaultLanguageId(String)
static Localization getLocalization()
           
static String getLocalization(String xml, String requestedLanguageId)
           
static String getLocalization(String xml, String requestedLanguageId, boolean useDefault)
           
static Map<Locale,String> getLocalizationMap(javax.servlet.http.HttpServletRequest request, String parameter)
           
static Map<Locale,String> getLocalizationMap(PortletPreferences preferences, String parameter)
           
static Map<Locale,String> getLocalizationMap(PortletRequest portletRequest, String parameter)
           
static Map<Locale,String> getLocalizationMap(String xml)
           
static Map<Locale,String> getLocalizationMap(String[] languageIds, String[] values)
           
static Map<Locale,String> getLocalizationMap(String xml, boolean useDefault)
           
static Map<Locale,String> getLocalizationMap(String bundleName, ClassLoader classLoader, String key, boolean includeBetaLocales)
           
static String getLocalizationXmlFromPreferences(PortletPreferences preferences, PortletRequest portletRequest, String parameter)
           
static String getLocalizationXmlFromPreferences(PortletPreferences preferences, PortletRequest portletRequest, String parameter, String defaultValue)
           
static Map<Locale,String> getLocalizedParameter(PortletRequest portletRequest, String parameter)
          Deprecated. As of 6.2.0, replaced by getLocalizationMap(javax.servlet.http.HttpServletRequest, java.lang.String)
static List<Locale> getModifiedLocales(Map<Locale,String> oldMap, Map<Locale,String> newMap)
           
static String getPreferencesKey(String key, String languageId)
           
static String getPreferencesValue(PortletPreferences preferences, String key, String languageId)
           
static String getPreferencesValue(PortletPreferences preferences, String key, String languageId, boolean useDefault)
           
static String[] getPreferencesValues(PortletPreferences preferences, String key, String languageId)
           
static String[] getPreferencesValues(PortletPreferences preferences, String key, String languageId, boolean useDefault)
           
static String removeLocalization(String xml, String key, String requestedLanguageId)
           
static String removeLocalization(String xml, String key, String requestedLanguageId, boolean cdata)
           
static String removeLocalization(String xml, String key, String requestedLanguageId, boolean cdata, boolean localized)
           
 void setLocalization(Localization localization)
           
static void setLocalizedPreferencesValues(PortletRequest portletRequest, PortletPreferences preferences, String parameter)
           
static void setPreferencesValue(PortletPreferences preferences, String key, String languageId, String value)
           
static void setPreferencesValues(PortletPreferences preferences, String key, String languageId, String[] values)
           
static String updateLocalization(Map<Locale,String> localizationMap, String xml, String key, String defaultLanguageId)
           
static String updateLocalization(String xml, String key, String value)
           
static String updateLocalization(String xml, String key, String value, String requestedLanguageId)
           
static String updateLocalization(String xml, String key, String value, String requestedLanguageId, String defaultLanguageId)
           
static String updateLocalization(String xml, String key, String value, String requestedLanguageId, String defaultLanguageId, boolean cdata)
           
static String updateLocalization(String xml, String key, String value, String requestedLanguageId, String defaultLanguageId, boolean cdata, boolean localized)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalizationUtil

public LocalizationUtil()
Method Detail

deserialize

public static Object deserialize(JSONObject jsonObject)

getAvailableLanguageIds

public static String[] getAvailableLanguageIds(Document document)

getAvailableLanguageIds

public static String[] getAvailableLanguageIds(String xml)

getAvailableLocales

public static String[] getAvailableLocales(String xml)
Deprecated. As of 6.2.0, replaced by getAvailableLanguageIds(String)


getDefaultImportLocale

public static Locale getDefaultImportLocale(String className,
                                            long classPK,
                                            Locale contentDefaultLocale,
                                            Locale[] contentAvailableLocales)

getDefaultLanguageId

public static String getDefaultLanguageId(Document document)

getDefaultLanguageId

public static String getDefaultLanguageId(Document document,
                                          Locale defaultLocale)

getDefaultLanguageId

public static String getDefaultLanguageId(String xml)

getDefaultLanguageId

public static String getDefaultLanguageId(String xml,
                                          Locale defaultLocale)

getDefaultLocale

public static String getDefaultLocale(String xml)
Deprecated. As of 6.2.0, replaced by getDefaultLanguageId(String)


getLocalization

public static Localization getLocalization()

getLocalization

public static String getLocalization(String xml,
                                     String requestedLanguageId)

getLocalization

public static String getLocalization(String xml,
                                     String requestedLanguageId,
                                     boolean useDefault)

getLocalizationMap

public static Map<Locale,String> getLocalizationMap(javax.servlet.http.HttpServletRequest request,
                                                    String parameter)

getLocalizationMap

public static Map<Locale,String> getLocalizationMap(PortletPreferences preferences,
                                                    String parameter)

getLocalizationMap

public static Map<Locale,String> getLocalizationMap(PortletRequest portletRequest,
                                                    String parameter)

getLocalizationMap

public static Map<Locale,String> getLocalizationMap(String xml)

getLocalizationMap

public static Map<Locale,String> getLocalizationMap(String xml,
                                                    boolean useDefault)

getLocalizationMap

public static Map<Locale,String> getLocalizationMap(String bundleName,
                                                    ClassLoader classLoader,
                                                    String key,
                                                    boolean includeBetaLocales)

getLocalizationMap

public static Map<Locale,String> getLocalizationMap(String[] languageIds,
                                                    String[] values)

getLocalizationXmlFromPreferences

public static String getLocalizationXmlFromPreferences(PortletPreferences preferences,
                                                       PortletRequest portletRequest,
                                                       String parameter)

getLocalizationXmlFromPreferences

public static String getLocalizationXmlFromPreferences(PortletPreferences preferences,
                                                       PortletRequest portletRequest,
                                                       String parameter,
                                                       String defaultValue)

getLocalizedParameter

public static Map<Locale,String> getLocalizedParameter(PortletRequest portletRequest,
                                                       String parameter)
Deprecated. As of 6.2.0, replaced by getLocalizationMap(javax.servlet.http.HttpServletRequest, java.lang.String)


getModifiedLocales

public static List<Locale> getModifiedLocales(Map<Locale,String> oldMap,
                                              Map<Locale,String> newMap)

getPreferencesKey

public static String getPreferencesKey(String key,
                                       String languageId)

getPreferencesValue

public static String getPreferencesValue(PortletPreferences preferences,
                                         String key,
                                         String languageId)

getPreferencesValue

public static String getPreferencesValue(PortletPreferences preferences,
                                         String key,
                                         String languageId,
                                         boolean useDefault)

getPreferencesValues

public static String[] getPreferencesValues(PortletPreferences preferences,
                                            String key,
                                            String languageId)

getPreferencesValues

public static String[] getPreferencesValues(PortletPreferences preferences,
                                            String key,
                                            String languageId,
                                            boolean useDefault)

removeLocalization

public static String removeLocalization(String xml,
                                        String key,
                                        String requestedLanguageId)

removeLocalization

public static String removeLocalization(String xml,
                                        String key,
                                        String requestedLanguageId,
                                        boolean cdata)

removeLocalization

public static String removeLocalization(String xml,
                                        String key,
                                        String requestedLanguageId,
                                        boolean cdata,
                                        boolean localized)

setLocalizedPreferencesValues

public static void setLocalizedPreferencesValues(PortletRequest portletRequest,
                                                 PortletPreferences preferences,
                                                 String parameter)
                                          throws Exception
Throws:
Exception

setPreferencesValue

public static void setPreferencesValue(PortletPreferences preferences,
                                       String key,
                                       String languageId,
                                       String value)
                                throws Exception
Throws:
Exception

setPreferencesValues

public static void setPreferencesValues(PortletPreferences preferences,
                                        String key,
                                        String languageId,
                                        String[] values)
                                 throws Exception
Throws:
Exception

updateLocalization

public static String updateLocalization(Map<Locale,String> localizationMap,
                                        String xml,
                                        String key,
                                        String defaultLanguageId)

updateLocalization

public static String updateLocalization(String xml,
                                        String key,
                                        String value)

updateLocalization

public static String updateLocalization(String xml,
                                        String key,
                                        String value,
                                        String requestedLanguageId)

updateLocalization

public static String updateLocalization(String xml,
                                        String key,
                                        String value,
                                        String requestedLanguageId,
                                        String defaultLanguageId)

updateLocalization

public static String updateLocalization(String xml,
                                        String key,
                                        String value,
                                        String requestedLanguageId,
                                        String defaultLanguageId,
                                        boolean cdata)

updateLocalization

public static String updateLocalization(String xml,
                                        String key,
                                        String value,
                                        String requestedLanguageId,
                                        String defaultLanguageId,
                                        boolean cdata,
                                        boolean localized)

setLocalization

public void setLocalization(Localization localization)

Liferay 6.2-ce-ga5