Package org.ametys.core.userpref
Class UserPreferencesExtensionPoint
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.runtime.plugin.component.AbstractThreadSafeComponentExtensionPoint<UserPreferenceProvider>
-
- org.ametys.core.userpref.UserPreferencesExtensionPoint
-
- All Implemented Interfaces:
LogEnabled,ExtensionPoint<UserPreferenceProvider>,Disposable,Initializable,Component,Contextualizable,Serviceable,ThreadSafe
public class UserPreferencesExtensionPoint extends AbstractThreadSafeComponentExtensionPoint<UserPreferenceProvider>
Extension point holding allUserPreferencedefinitions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classUserPreferencesExtensionPoint.I18nizableTextComparator(package private) classUserPreferencesExtensionPoint.UserPrefOrderComparatorCompares user preferences on their "order" attribute.
-
Field Summary
Fields Modifier and Type Field Description private UserPreferencesExtensionPoint.UserPrefOrderComparator_comparatorUser preference parser.static StringROLEAvalon Role-
Fields inherited from class org.ametys.runtime.plugin.component.AbstractThreadSafeComponentExtensionPoint
_cocoonManager, _context, _manager
-
-
Constructor Summary
Constructors Constructor Description UserPreferencesExtensionPoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<I18nizableText,List<UserPreference>>getCategorizedPreferences(Map<String,String> contextVars)Get all the preferences, classified by group and ordered.protected Map<I18nizableText,List<UserPreference>>getCategorizedPreferencesMap(Map<String,String> contextVars)Compute the grouped preferences map.protected Map<String,UserPreference>getPreferencesMap(Map<String,String> contextVars)Compute the preferences map.UserPreferencegetUserPreference(Map<String,String> contextVars, String id)Get all the declared user preferences.Map<String,UserPreference>getUserPreferences(Map<String,String> contextVars)Get all the declared user preferences.voidinitialize()voidvalidatePreferences(Map<String,String> contextVars, Map<String,String> values, UserPreferencesErrors errors)Validate preference values.-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractThreadSafeComponentExtensionPoint
addComponent, addExtension, contextualize, dispose, getExtension, getExtensionsIds, hasExtension, initializeExtensions, service
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_comparator
private UserPreferencesExtensionPoint.UserPrefOrderComparator _comparator
User preference parser.
-
-
Constructor Detail
-
UserPreferencesExtensionPoint
public UserPreferencesExtensionPoint()
-
-
Method Detail
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Overrides:
initializein classAbstractThreadSafeComponentExtensionPoint<UserPreferenceProvider>- Throws:
Exception
-
getUserPreference
public UserPreference getUserPreference(Map<String,String> contextVars, String id)
Get all the declared user preferences.- Parameters:
contextVars- The context variables including environment elementsid- The preference id- Returns:
- the user preferences (read-only collection).
-
getUserPreferences
public Map<String,UserPreference> getUserPreferences(Map<String,String> contextVars)
Get all the declared user preferences.- Parameters:
contextVars- The context variables including environment elements- Returns:
- the user preferences (read-only collection).
-
getCategorizedPreferences
public Map<I18nizableText,List<UserPreference>> getCategorizedPreferences(Map<String,String> contextVars)
Get all the preferences, classified by group and ordered.- Parameters:
contextVars- The context variables including environment elements- Returns:
- the preferences classified by group and ordered.
-
validatePreferences
public void validatePreferences(Map<String,String> contextVars, Map<String,String> values, UserPreferencesErrors errors)
Validate preference values.- Parameters:
contextVars- The context variables including environment elementsvalues- the values.errors- the errors object to fill in.
-
getPreferencesMap
protected Map<String,UserPreference> getPreferencesMap(Map<String,String> contextVars)
Compute the preferences map.- Parameters:
contextVars- The context variables including environment elements- Returns:
- the preferences map.
-
getCategorizedPreferencesMap
protected Map<I18nizableText,List<UserPreference>> getCategorizedPreferencesMap(Map<String,String> contextVars)
Compute the grouped preferences map.- Parameters:
contextVars- The context variables including environment elements- Returns:
- the grouped preferences map.
-
-