public class LocalizationUtil
extends Object
Localization
Constructor and Description |
---|
LocalizationUtil() |
Modifier and Type | Method and Description |
---|---|
static Object |
deserialize(JSONObject jsonObject) |
static String[] |
getAvailableLanguageIds(Document document) |
static String[] |
getAvailableLanguageIds(String xml) |
static Locale |
getDefaultImportLocale(String className,
long classPK,
Locale contentDefaultLocale,
Locale[] contentAvailableLocales) |
static Locale |
getDefaultImportLocale(String className,
Serializable primaryKey,
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 Localization |
getLocalization() |
static String |
getLocalization(Function<String,String> localizationFunction,
String requestedLanguageId,
String defaultLanguageId) |
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 httpServletRequest,
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> |
getMap(LocalizedValuesMap localizedValuesMap) |
static List<Locale> |
getModifiedLocales(Map<Locale,String> oldMap,
Map<Locale,String> newMap) |
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 |
getXml(Map<String,String> map,
String defaultLanguageId,
String key) |
static Map<Locale,String> |
populateLocalizationMap(Map<Locale,String> localizationMap,
String defaultLanguageId,
long groupId) |
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) |
public static Object deserialize(JSONObject jsonObject)
public static String[] getAvailableLanguageIds(Document document)
public static String[] getAvailableLanguageIds(String xml)
public static Locale getDefaultImportLocale(String className, long classPK, Locale contentDefaultLocale, Locale[] contentAvailableLocales)
public static Locale getDefaultImportLocale(String className, Serializable primaryKey, Locale contentDefaultLocale, Locale[] contentAvailableLocales)
public static String getDefaultLanguageId(Document document)
public static String getDefaultLanguageId(Document document, Locale defaultLocale)
public static String getDefaultLanguageId(String xml)
public static String getDefaultLanguageId(String xml, Locale defaultLocale)
public static Localization getLocalization()
public static String getLocalization(Function<String,String> localizationFunction, String requestedLanguageId, String defaultLanguageId)
public static String getLocalization(String xml, String requestedLanguageId)
public static String getLocalization(String xml, String requestedLanguageId, boolean useDefault)
public static String getLocalization(String xml, String requestedLanguageId, boolean useDefault, String defaultValue)
public static Map<Locale,String> getLocalizationMap(Collection<Locale> locales, Locale defaultLocale, String key)
public static Map<Locale,String> getLocalizationMap(javax.servlet.http.HttpServletRequest httpServletRequest, String parameter)
public static Map<Locale,String> getLocalizationMap(PortletPreferences preferences, String preferenceName)
public static Map<Locale,String> getLocalizationMap(PortletPreferences preferences, String preferenceName, String propertyName)
public static Map<Locale,String> getLocalizationMap(PortletPreferences preferences, String preferenceName, String propertyName, String defaultPropertyValue, ClassLoader classLoader)
public static Map<Locale,String> getLocalizationMap(PortletRequest portletRequest, String parameter)
public static Map<Locale,String> getLocalizationMap(PortletRequest portletRequest, String parameter, Map<Locale,String> defaultValues)
public static Map<Locale,String> getLocalizationMap(String xml)
public static Map<Locale,String> getLocalizationMap(String xml, boolean useDefault)
public static Map<Locale,String> getLocalizationMap(String bundleName, ClassLoader classLoader, String key, boolean includeBetaLocales)
public static Map<Locale,String> getLocalizationMap(String[] languageIds, String[] values)
public static String getLocalizationXmlFromPreferences(PortletPreferences preferences, PortletRequest portletRequest, String parameter)
public static String getLocalizationXmlFromPreferences(PortletPreferences preferences, PortletRequest portletRequest, String parameter, String defaultValue)
public static String getLocalizationXmlFromPreferences(PortletPreferences preferences, PortletRequest portletRequest, String parameter, String prefix, String defaultValue)
public static String getLocalizedName(String name, String languageId)
public static Map<Locale,String> getMap(LocalizedValuesMap localizedValuesMap)
public static List<Locale> getModifiedLocales(Map<Locale,String> oldMap, Map<Locale,String> newMap)
public static String getPreferencesValue(PortletPreferences preferences, String key, String languageId)
public static String getPreferencesValue(PortletPreferences preferences, String key, String languageId, boolean useDefault)
public static String[] getPreferencesValues(PortletPreferences preferences, String key, String languageId)
public static String[] getPreferencesValues(PortletPreferences preferences, String key, String languageId, boolean useDefault)
public static String getSettingsValue(Settings settings, String key, String languageId)
public static String getSettingsValue(Settings settings, String key, String languageId, boolean useDefault)
public static String[] getSettingsValues(Settings settings, String key, String languageId)
public static String[] getSettingsValues(Settings settings, String key, String languageId, boolean useDefault)
public static String getXml(LocalizedValuesMap localizedValuesMap, String key)
public static String getXml(Map<String,String> map, String defaultLanguageId, String key)
public static Map<Locale,String> populateLocalizationMap(Map<Locale,String> localizationMap, String defaultLanguageId, long groupId)
public static String removeLocalization(String xml, String key, String requestedLanguageId)
public static String removeLocalization(String xml, String key, String requestedLanguageId, boolean cdata)
public static String removeLocalization(String xml, String key, String requestedLanguageId, boolean cdata, boolean localized)
public static void setLocalizedPreferencesValues(PortletRequest portletRequest, PortletPreferences preferences, String parameter) throws Exception
Exception
public static void setPreferencesValue(PortletPreferences preferences, String key, String languageId, String value) throws Exception
Exception
public static void setPreferencesValues(PortletPreferences preferences, String key, String languageId, String[] values) throws Exception
Exception
public static String updateLocalization(Map<Locale,String> localizationMap, String xml, String key, String defaultLanguageId)
public static String updateLocalization(String xml, String key, String value)
public static String updateLocalization(String xml, String key, String value, String requestedLanguageId)
public static String updateLocalization(String xml, String key, String value, String requestedLanguageId, String defaultLanguageId)
public static String updateLocalization(String xml, String key, String value, String requestedLanguageId, String defaultLanguageId, boolean cdata)
public static String updateLocalization(String xml, String key, String value, String requestedLanguageId, String defaultLanguageId, boolean cdata, boolean localized)
public void setLocalization(Localization localization)