Class StaticUserPreferenceProvider
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.core.impl.userpref.StaticUserPreferenceProvider
- All Implemented Interfaces:
UserPreferenceProvider
,LogEnabled
,PluginAware
,Disposable
,Configurable
,Contextualizable
,Serviceable
public class StaticUserPreferenceProvider
extends AbstractLogEnabled
implements UserPreferenceProvider, Contextualizable, Serviceable, Configurable, PluginAware, Disposable
Provides user preferences based on static configuration.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Context
Avalon contextprotected ThreadSafeComponentManager<Enumerator>
ComponentManager forEnumerator
s.protected String
The plugin name.protected Map<String,
UserPreference> The user preferences, indexed by Idprotected ServiceManager
Avalon service managerprotected ThreadSafeComponentManager<Validator>
ComponentManager forValidator
s.Fields inherited from interface org.ametys.core.userpref.UserPreferenceProvider
CONTEXT_VAR_WORKSPACE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(Configuration configuration) protected void
configurePreference
(org.ametys.plugins.core.impl.userpref.StaticUserPreferenceProvider.UserPreferenceParser prefParser, Configuration configuration) Configure a user preference.void
contextualize
(Context context) void
dispose()
getPreferences
(Map<String, String> context) Get this provider's preferences.void
service
(ServiceManager manager) void
setPluginInfo
(String pluginName, String featureName, String id) Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_preferences
The user preferences, indexed by Id -
_validatorManager
ComponentManager forValidator
s. -
_enumeratorManager
ComponentManager forEnumerator
s. -
_serviceManager
Avalon service manager -
_context
Avalon context -
_pluginName
The plugin name.
-
-
Constructor Details
-
StaticUserPreferenceProvider
public StaticUserPreferenceProvider()
-
-
Method Details
-
setPluginInfo
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
dispose
- Specified by:
dispose
in interfaceDisposable
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
configurePreference
protected void configurePreference(org.ametys.plugins.core.impl.userpref.StaticUserPreferenceProvider.UserPreferenceParser prefParser, Configuration configuration) throws ConfigurationException Configure a user preference.- Parameters:
prefParser
- the preference parser.configuration
- The preference configuration.- Throws:
ConfigurationException
- if configuration is incomplete or invalid.
-
getPreferences
Description copied from interface:UserPreferenceProvider
Get this provider's preferences.- Specified by:
getPreferences
in interfaceUserPreferenceProvider
- Parameters:
context
- a Map of context variables.- Returns:
- a Collection of preferences for the context.
-