Package org.ametys.core.userpref
Class UserPreferencesDataProvider
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.userpref.UserPreferencesDataProvider
- All Implemented Interfaces:
UserDataProvider
,LogEnabled
,Prioritizable
,Supporter<String>
,Serviceable
public class UserPreferencesDataProvider
extends AbstractLogEnabled
implements UserDataProvider, Serviceable
A user data provider which gets the value from the global user preferences associated with the
User
for context admin-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ProfileImageProvider
The Default profile image providerprotected JSONUtils
The json utilsThe supported elementsprotected UserPreferencesExtensionPoint
The user preferences extension pointprotected UserPreferencesManager
The user preferences managerstatic final String
The ID of this data providerFields inherited from interface org.ametys.core.user.dataprovider.UserDataProvider
MAX_PRIORITY, MIN_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Get the priority for the component.getProfileImageSource
(String imageSourceStr) Get the profile image source given a source input stringGet the value for a data and a uservoid
service
(ServiceManager manager) boolean
Check if an element is supportedMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.core.user.dataprovider.UserDataProvider
hasValue
-
Field Details
-
USER_PREFERENCES_DATA_PROVIDER_ID
The ID of this data provider -
_supportedElements
The supported elements -
_userPrefEP
The user preferences extension point -
_userPrefManager
The user preferences manager -
_imageProvider
The Default profile image provider -
_jsonUtils
The json utils
-
-
Constructor Details
-
UserPreferencesDataProvider
public UserPreferencesDataProvider()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getPriority
Description copied from interface:Prioritizable
Get the priority for the component. On components usingPrioritizable
interface, each implementation define the order. In most cases, less is the number, more prior is the component.- Specified by:
getPriority
in interfacePrioritizable
- Returns:
- the priority
-
supports
Description copied from interface:Supporter
Check if an element is supported -
getValue
Description copied from interface:UserDataProvider
Get the value for a data and a user- Specified by:
getValue
in interfaceUserDataProvider
- Parameters:
user
- TheUser
dataId
- The id of the data wanted- Returns:
- The value of the data for the user, can be null
-
getProfileImageSource
Get the profile image source given a source input string- Parameters:
imageSourceStr
- The input string representing the source- Returns:
- The profile image source.
-