Class ApplicationSettingsUtils
java.lang.Object
io.meeds.appcenter.util.ApplicationSettingsUtils
Reads and checks the values of an application settings object as the
layout tools pass them: JSON values, every refusal being
value is not accepted for <option>-
Method Summary
Modifier and TypeMethodDescriptionbooleanSchema(String description) enumSchema(Collection<String> values, String description) getLanguages(org.exoplatform.services.resources.LocaleConfigService localeConfigService) integerSchema(int min, int max, String description) static IllegalArgumentExceptionnotAccepted(String option) objectSchema(Map<String, Object> properties) static voidrequireKnownOptions(Map<String, Object> settings, Collection<String> options) stringSchema(String description) static booleanstatic longstatic inttoLanguageLabels(Map<Locale, String> labels) toLocaleLabels(Map<String, String> translations) static StringtoTranslations(Object value, String option, int maxLength, Collection<String> languages, Map<String, String> stored) static StringtoValue(Object value, String option, Collection<String> values) translationsSchema(int maxLength, String description)
-
Method Details
-
notAccepted
-
requireKnownOptions
-
toBoolean
-
toInt
-
toText
-
toValue
-
toIds
-
toId
-
toTranslations
public static Map<String,String> toTranslations(Object value, String option, int maxLength, Collection<String> languages, Map<String, String> stored) - Parameters:
value- a JSON object of language tag to textoption- the option holding itmaxLength- the longest text acceptedlanguages- the language tags the platform offersstored- the stored translations, an entry equal to one of them accepted unchecked, as the read returned it- Returns:
- the translations, an empty text dropped: an empty text removes the translation of its language
-
getLanguages
-
toLocaleLabels
-
toLanguageLabels
-
objectSchema
-
booleanSchema
-
integerSchema
-
stringSchema
-
enumSchema
-
idsSchema
-
translationsSchema
-