Package org.ametys.web.userpref
Class FOUserPreferencesDataProvider
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.userpref.FOUserPreferencesDataProvider
- All Implemented Interfaces:
UserDataProvider
,LogEnabled
,Prioritizable
,Supporter<String>
,Contextualizable
,Serviceable
public class FOUserPreferencesDataProvider
extends AbstractLogEnabled
implements UserDataProvider, Serviceable, Contextualizable
A user data provider which gets the value from the user preferences associated with the
User
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected UserPreferencesExtensionPoint
The user preferences extension pointprotected UserPreferencesManager
The user preferences managerFields inherited from interface org.ametys.core.user.dataprovider.UserDataProvider
MAX_PRIORITY, MIN_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
contextualize
(Context context) int
Get the priority for the component.getUserPreferences
(UserIdentity userIdentity, String dataId) Get the user preferences of a userGet the value for a data and a uservoid
service
(ServiceManager serviceManager) 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
-
_userPrefEPFO
The user preferences extension point -
_userPrefManagerFO
The user preferences manager
-
-
Constructor Details
-
FOUserPreferencesDataProvider
public FOUserPreferencesDataProvider()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
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
-
getUserPreferences
public Map<String,String> getUserPreferences(UserIdentity userIdentity, String dataId) throws UserPreferencesException Get the user preferences of a user- Parameters:
userIdentity
- The userIdentity of the UserdataId
- The if of the data wanted- Returns:
- The user preferences depending on the context
- Throws:
UserPreferencesException
- If an error occurs
-