public final class UserPreferencesHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areEmailNotificationsDisabled(JahiaUser user)
Returns
true if the user has explicitly disabled e-mail
notification in the profile. |
static boolean |
areEmailNotificationsDisabled(JCRUserNode user)
Returns
true if the user has explicitly disabled e-mail
notification in the profile. |
static String |
getEmailAddress(JCRUserNode user)
Returns user's e-mail address or
null if it is not provided. |
static String |
getFirstName(JCRUserNode user)
Returns the first name for the specified user or
null if it
is not provided or empty. |
static String |
getFullName(JCRUserNode user)
Returns the first + last name of the specified user or
null
if none is not provided or both are empty. |
static String |
getLastName(JCRUserNode user)
Returns the last name for the specified user or
null if it
is not provided or empty. |
static String |
getPersonalizedEmailAddress(JCRUserNode user)
Returns the e-mail address with the personal name of the specified user.
|
static String |
getPersonalizedEmailAddress(String email,
JCRUserNode user)
Returns the e-mail address with the personal name of the specified user.
|
static String |
getPersonalName(JCRUserNode user)
Returns the full user name (first name + last name) or the username if
the full name data is not provided.
|
static Locale |
getPreferredLocale(JCRUserNode user)
Returns the preferred locale of the specified user or the first one from
the list of available locales.
|
static Locale |
getPreferredLocale(JCRUserNode user,
JahiaSite site)
Returns the preferred locale of the specified user or the first one from
the list of available locales.
|
static Locale |
getPreferredLocale(JCRUserNode user,
Locale fallback)
Returns the preferred locale of the specified user or the first one from
the list of available locales.
|
public static boolean areEmailNotificationsDisabled(JahiaUser user)
true if the user has explicitly disabled e-mail
notification in the profile.user - the user to check preferencestrue if the user has explicitly disabled e-mail
notification in the profilepublic static boolean areEmailNotificationsDisabled(JCRUserNode user)
true if the user has explicitly disabled e-mail
notification in the profile.user - the user to check preferencestrue if the user has explicitly disabled e-mail
notification in the profilepublic static String getEmailAddress(JCRUserNode user)
null if it is not provided.user - the user to retrieve the e-mail addressnull if it is not providedpublic static String getFirstName(JCRUserNode user)
null if it
is not provided or empty.user - the user to retrieve the first namenull if it
is not provided or emptypublic static String getFullName(JCRUserNode user)
null
if none is not provided or both are empty.user - the user to retrieve the namenull
if none is not provided or both are emptypublic static String getLastName(JCRUserNode user)
null if it
is not provided or empty.user - the user to retrieve the first namenull if it
is not provided or emptypublic static String getPersonalizedEmailAddress(JCRUserNode user)
user - the user to retrieve the personal namepublic static String getPersonalizedEmailAddress(String email, JCRUserNode user)
email - the e-mail address itselfuser - the user to retrieve the personal namepublic static String getPersonalName(JCRUserNode user)
user - the user to retrieve the namepublic static Locale getPreferredLocale(JCRUserNode user)
user - the user to retrieve locale preferencespublic static Locale getPreferredLocale(JCRUserNode user, Locale fallback)
user - the user to retrieve locale preferencesfallback - the fallback locale to return if no preferred locale is set for the userpublic static Locale getPreferredLocale(JCRUserNode user, JahiaSite site)
user - the user to retrieve locale preferencessite - the siteCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.