Package org.alfresco.repo.preference
Class PreferenceServiceImpl
- java.lang.Object
-
- org.alfresco.repo.preference.PreferenceServiceImpl
-
- All Implemented Interfaces:
PreferenceService,Extensible
public class PreferenceServiceImpl extends Object implements PreferenceService, Extensible
Preference Service Implementation- Author:
- Roy Wetherall
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPreferenceServiceImpl.PageDetails
-
Constructor Summary
Constructors Constructor Description PreferenceServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearPreferences(String userName)Clears all the preferences for a particular user.voidclearPreferences(String userName, String preferenceFilter)Clears the preferences for a particular user that match the filter optionally provided.PreferenceServiceTraitcreatePreferenceServiceTrait()PagingResults<Pair<String,Serializable>>getPagedPreferences(String userName, String preferenceFilter, PagingRequest pagingRequest)SerializablegetPreference(String userName, String preferenceName)Map<String,Serializable>getPreferences(String userName)Get all preferences for a particular userMap<String,Serializable>getPreferences(String userName, String preferenceFilter)Get the preferences for a particular user.<M extends Trait>
ExtendedTrait<M>getTrait(Class<? extends M> traitAPI)voidsetAuthenticationContext(AuthenticationContext authenticationContext)voidsetAuthorityService(AuthorityService authorityService)voidsetContentService(ContentService contentService)voidsetNodeService(NodeService nodeService)Set the node servicevoidsetPermissionService(PermissionService permissionService)voidsetPersonService(PersonService personService)Set the person servicevoidsetPreferences(String userName, Map<String,Serializable> preferences)Sets the preference values for a user.
-
-
-
Method Detail
-
setNodeService
public void setNodeService(NodeService nodeService)
Set the node service- Parameters:
nodeService- the node service
-
setContentService
public void setContentService(ContentService contentService)
-
setPersonService
public void setPersonService(PersonService personService)
Set the person service- Parameters:
personService- the person service
-
setPermissionService
public void setPermissionService(PermissionService permissionService)
-
setAuthenticationContext
public void setAuthenticationContext(AuthenticationContext authenticationContext)
-
setAuthorityService
public void setAuthorityService(AuthorityService authorityService)
-
getPreferences
public Map<String,Serializable> getPreferences(String userName)
Description copied from interface:PreferenceServiceGet all preferences for a particular user- Specified by:
getPreferencesin interfacePreferenceService- Parameters:
userName- the user name- Returns:
- a map containing the preference values, empty if none
- See Also:
PreferenceService.getPreferences(java.lang.String)
-
getPreference
public Serializable getPreference(String userName, String preferenceName)
- Specified by:
getPreferencein interfacePreferenceService
-
getPreferences
public Map<String,Serializable> getPreferences(String userName, String preferenceFilter)
Description copied from interface:PreferenceServiceGet the preferences for a particular user.If no filter if provided all preferences are returned.
If a filter is provided it's used to filter the results. For example the filter "alfresco.myComp" will only return filters that are in the "namespace" alfresco.myComp.
- Specified by:
getPreferencesin interfacePreferenceService- Parameters:
userName- the user namepreferenceFilter- the preference filter- Returns:
- a map containing the preference values, empty if none
-
getPagedPreferences
public PagingResults<Pair<String,Serializable>> getPagedPreferences(String userName, String preferenceFilter, PagingRequest pagingRequest)
- Specified by:
getPagedPreferencesin interfacePreferenceService
-
setPreferences
public void setPreferences(String userName, Map<String,Serializable> preferences)
Description copied from interface:PreferenceServiceSets the preference values for a user.Values provided overlay those already present.
Preference value names can be "namespaced" by using package notation. For example "alfresc.myComp.myValue".
- Specified by:
setPreferencesin interfacePreferenceService- Parameters:
userName- the user namepreferences- the preference values
-
clearPreferences
public void clearPreferences(String userName)
Description copied from interface:PreferenceServiceClears all the preferences for a particular user.- Specified by:
clearPreferencesin interfacePreferenceService- Parameters:
userName- the user name- See Also:
PreferenceService.clearPreferences(java.lang.String)
-
clearPreferences
public void clearPreferences(String userName, String preferenceFilter)
Description copied from interface:PreferenceServiceClears the preferences for a particular user that match the filter optionally provided.If no filter if present then all preferences are cleared.
- Specified by:
clearPreferencesin interfacePreferenceService- Parameters:
userName- the user namepreferenceFilter- the preference filter
-
getTrait
public <M extends Trait> ExtendedTrait<M> getTrait(Class<? extends M> traitAPI)
- Specified by:
getTraitin interfaceExtensible
-
createPreferenceServiceTrait
public PreferenceServiceTrait createPreferenceServiceTrait()
-
-