@Override protected String doGetValue(String key) { Object object = _getProperty(key); if (object == null) { return null; } String value = null; if (object instanceof LocalizedValuesMap) { value = ((LocalizedValuesMap)object).getDefaultValue(); } else { value = object.toString(); } if (_locationVariableResolver.isLocationVariable(value)) { return _locationVariableResolver.resolve(value); } return value; }
protected void removeDefaultValue( PortletRequest portletRequest, ModifiableSettings modifiableSettings, String key, LocalizedValuesMap localizedMap) { String defaultValue = localizedMap.getDefaultValue(); Map<Locale, String> localizedMapValues = localizedMap.getValues(); for (Locale locale : localizedMapValues.keySet()) { String languageKeyId = key + "_" + LocaleUtil.toLanguageId(locale); String value = getParameter(portletRequest, languageKeyId); if (defaultValue.equals(value) || StringUtil.equalsIgnoreBreakLine(defaultValue, value)) { modifiableSettings.reset(languageKeyId); } } }
public static Map<Locale, String> getEmailAssetEntryAddedSubjectMap( PortletPreferences portletPreferences) { Map<Locale, String> emailAssetEntryAddedSubjectMap = LocalizationUtil.getLocalizationMap( portletPreferences, "emailAssetEntryAddedSubject", StringPool.BLANK, StringPool.BLANK, AssetPublisherUtil.class.getClassLoader()); Locale defaultLocale = LocaleUtil.getSiteDefault(); if (Validator.isNull( emailAssetEntryAddedSubjectMap.get(defaultLocale))) { LocalizedValuesMap emailAssetEntryAddedLocalizedSubjectMap = _assetPublisherPortletInstanceConfiguration. emailAssetEntryAddedSubject(); emailAssetEntryAddedSubjectMap.put( defaultLocale, emailAssetEntryAddedLocalizedSubjectMap.getDefaultValue()); } return emailAssetEntryAddedSubjectMap; }
public static Map<Locale, String> getEmailAssetEntryAddedBodyMap( PortletPreferences portletPreferences) { Map<Locale, String> emailAssetEntryAddedBodyMap = LocalizationUtil.getLocalizationMap( portletPreferences, "emailAssetEntryAddedBody", StringPool.BLANK, StringPool.BLANK, AssetPublisherUtil.class.getClassLoader()); Locale defaultLocale = LocaleUtil.getSiteDefault(); if (Validator.isNull(emailAssetEntryAddedBodyMap.get(defaultLocale))) { LocalizedValuesMap emailAssetEntryAddedLocalizedBodyMap = _assetPublisherPortletInstanceConfiguration. emailAssetEntryAddedBody(); emailAssetEntryAddedBodyMap.put( defaultLocale, emailAssetEntryAddedLocalizedBodyMap.getDefaultValue()); } return emailAssetEntryAddedBodyMap; }
public Map<Locale, String> getEmailAssetEntryAddedBodyMap( PortletPreferences portletPreferences) { Map<Locale, String> emailAssetEntryAddedBodyMap = LocalizationUtil.getLocalizationMap( portletPreferences, "emailAssetEntryAddedBody", StringPool.BLANK, StringPool.BLANK, AssetPublisherWebUtil.class.getClassLoader()); Locale defaultLocale = LocaleUtil.getSiteDefault(); if (Validator.isNull(emailAssetEntryAddedBodyMap.get(defaultLocale))) { LocalizedValuesMap emailAssetEntryAddedLocalizedBodyMap = _assetPublisherPortletInstanceConfiguration. emailAssetEntryAddedBody(); emailAssetEntryAddedBodyMap.put( defaultLocale, emailAssetEntryAddedLocalizedBodyMap.getDefaultValue()); } return emailAssetEntryAddedBodyMap; }
public Map<Locale, String> getEmailAssetEntryAddedSubjectMap( PortletPreferences portletPreferences) { Map<Locale, String> emailAssetEntryAddedSubjectMap = LocalizationUtil.getLocalizationMap( portletPreferences, "emailAssetEntryAddedSubject", StringPool.BLANK, StringPool.BLANK, AssetPublisherWebUtil.class.getClassLoader()); Locale defaultLocale = LocaleUtil.getSiteDefault(); if (Validator.isNull( emailAssetEntryAddedSubjectMap.get(defaultLocale))) { LocalizedValuesMap emailAssetEntryAddedLocalizedSubjectMap = _assetPublisherPortletInstanceConfiguration. emailAssetEntryAddedSubject(); emailAssetEntryAddedSubjectMap.put( defaultLocale, emailAssetEntryAddedLocalizedSubjectMap.getDefaultValue()); } return emailAssetEntryAddedSubjectMap; }