com.liferay.portal.kernel.util
Class LocalizationUtil
java.lang.Object
com.liferay.portal.kernel.util.LocalizationUtil
- Direct Known Subclasses:
- LocalizationUtil
public class LocalizationUtil
- extends Object
- See Also:
Localization
|
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 String |
getLocalization(String xml,
String requestedLanguageId,
boolean useDefault,
String defaultValue)
|
static Map<Locale,String> |
getLocalizationMap(Collection<Locale> locales,
Locale defaultLocale,
String key)
|
static Map<Locale,String> |
getLocalizationMap(javax.servlet.http.HttpServletRequest request,
String parameter)
|
static Map<Locale,String> |
getLocalizationMap(PortletPreferences preferences,
String preferenceName)
|
static Map<Locale,String> |
getLocalizationMap(PortletPreferences preferences,
String preferenceName,
String propertyName)
|
static Map<Locale,String> |
getLocalizationMap(PortletPreferences preferences,
String preferenceName,
String propertyName,
String defaultPropertyValue,
ClassLoader classLoader)
|
static Map<Locale,String> |
getLocalizationMap(PortletRequest portletRequest,
String parameter)
|
static Map<Locale,String> |
getLocalizationMap(PortletRequest portletRequest,
String parameter,
Map<Locale,String> defaultValues)
|
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 String |
getLocalizationXmlFromPreferences(PortletPreferences preferences,
PortletRequest portletRequest,
String parameter,
String prefix,
String defaultValue)
|
static String |
getLocalizedName(String name,
String languageId)
|
static Map<Locale,String> |
getLocalizedParameter(PortletRequest portletRequest,
String parameter)
Deprecated. As of 6.2.0, replaced by getLocalizationMap(java.util.Collection, java.util.Locale, java.lang.String) |
static Map<Locale,String> |
getMap(LocalizedValuesMap localizedValuesMap)
|
static List<Locale> |
getModifiedLocales(Map<Locale,String> oldMap,
Map<Locale,String> newMap)
|
static String |
getPreferencesKey(String key,
String languageId)
Deprecated. As of 7.0.0 replaced by getLocalizedName(String,
String) |
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 |
getSettingsValue(Settings settings,
String key,
String languageId)
|
static String |
getSettingsValue(Settings settings,
String key,
String languageId,
boolean useDefault)
|
static String[] |
getSettingsValues(Settings settings,
String key,
String languageId)
|
static String[] |
getSettingsValues(Settings settings,
String key,
String languageId,
boolean useDefault)
|
static String |
getXml(LocalizedValuesMap localizedValuesMap,
String key)
|
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 |
LocalizationUtil
public LocalizationUtil()
deserialize
public static Object deserialize(JSONObject jsonObject)
getAvailableLanguageIds
public static String[] getAvailableLanguageIds(Document document)
getAvailableLanguageIds
public static String[] getAvailableLanguageIds(String xml)
getAvailableLocales
@Deprecated
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
@Deprecated
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)
getLocalization
public static String getLocalization(String xml,
String requestedLanguageId,
boolean useDefault,
String defaultValue)
getLocalizationMap
public static Map<Locale,String> getLocalizationMap(Collection<Locale> locales,
Locale defaultLocale,
String key)
getLocalizationMap
public static Map<Locale,String> getLocalizationMap(javax.servlet.http.HttpServletRequest request,
String parameter)
getLocalizationMap
public static Map<Locale,String> getLocalizationMap(PortletPreferences preferences,
String preferenceName)
getLocalizationMap
public static Map<Locale,String> getLocalizationMap(PortletPreferences preferences,
String preferenceName,
String propertyName)
getLocalizationMap
public static Map<Locale,String> getLocalizationMap(PortletPreferences preferences,
String preferenceName,
String propertyName,
String defaultPropertyValue,
ClassLoader classLoader)
getLocalizationMap
public static Map<Locale,String> getLocalizationMap(PortletRequest portletRequest,
String parameter)
getLocalizationMap
public static Map<Locale,String> getLocalizationMap(PortletRequest portletRequest,
String parameter,
Map<Locale,String> defaultValues)
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)
getLocalizationXmlFromPreferences
public static String getLocalizationXmlFromPreferences(PortletPreferences preferences,
PortletRequest portletRequest,
String parameter,
String prefix,
String defaultValue)
getLocalizedName
public static String getLocalizedName(String name,
String languageId)
getLocalizedParameter
@Deprecated
public static Map<Locale,String> getLocalizedParameter(PortletRequest portletRequest,
String parameter)
- Deprecated. As of 6.2.0, replaced by
getLocalizationMap(java.util.Collection, java.util.Locale, java.lang.String)
getMap
public static Map<Locale,String> getMap(LocalizedValuesMap localizedValuesMap)
getModifiedLocales
public static List<Locale> getModifiedLocales(Map<Locale,String> oldMap,
Map<Locale,String> newMap)
getPreferencesKey
@Deprecated
public static String getPreferencesKey(String key,
String languageId)
- Deprecated. As of 7.0.0 replaced by
getLocalizedName(String,
String)
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)
getSettingsValue
public static String getSettingsValue(Settings settings,
String key,
String languageId)
getSettingsValue
public static String getSettingsValue(Settings settings,
String key,
String languageId,
boolean useDefault)
getSettingsValues
public static String[] getSettingsValues(Settings settings,
String key,
String languageId)
getSettingsValues
public static String[] getSettingsValues(Settings settings,
String key,
String languageId,
boolean useDefault)
getXml
public static String getXml(LocalizedValuesMap localizedValuesMap,
String key)
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)