Package org.alfresco.repo.preference
Class PreferenceServiceImpl
- java.lang.Object
-
- org.alfresco.repo.preference.PreferenceServiceImpl
-
- All Implemented Interfaces:
PreferenceService,Extensible
public class PreferenceServiceImpl extends java.lang.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(java.lang.String userName)Clears all the preferences for a particular user.voidclearPreferences(java.lang.String userName, java.lang.String preferenceFilter)Clears the preferences for a particular user that match the filter optionally provided.PreferenceServiceTraitcreatePreferenceServiceTrait()org.alfresco.query.PagingResults<org.alfresco.util.Pair<java.lang.String,java.io.Serializable>>getPagedPreferences(java.lang.String userName, java.lang.String preferenceFilter, org.alfresco.query.PagingRequest pagingRequest)java.io.SerializablegetPreference(java.lang.String userName, java.lang.String preferenceName)java.util.Map<java.lang.String,java.io.Serializable>getPreferences(java.lang.String userName)Get all preferences for a particular userjava.util.Map<java.lang.String,java.io.Serializable>getPreferences(java.lang.String userName, java.lang.String preferenceFilter)Get the preferences for a particular user.<M extends Trait>
ExtendedTrait<M>getTrait(java.lang.Class<? extends M> traitAPI)voidsetAuthenticationContext(AuthenticationContext authenticationContext)voidsetAuthorityService(AuthorityService authorityService)voidsetContentService(ContentService contentService)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)Set the node servicevoidsetPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)voidsetPersonService(PersonService personService)Set the person servicevoidsetPreferences(java.lang.String userName, java.util.Map<java.lang.String,java.io.Serializable> preferences)Sets the preference values for a user.
-
-
-
Method Detail
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.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(org.alfresco.service.cmr.security.PermissionService permissionService)
-
setAuthenticationContext
public void setAuthenticationContext(AuthenticationContext authenticationContext)
-
setAuthorityService
public void setAuthorityService(AuthorityService authorityService)
-
getPreferences
public java.util.Map<java.lang.String,java.io.Serializable> getPreferences(java.lang.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 java.io.Serializable getPreference(java.lang.String userName, java.lang.String preferenceName)- Specified by:
getPreferencein interfacePreferenceService
-
getPreferences
public java.util.Map<java.lang.String,java.io.Serializable> getPreferences(java.lang.String userName, java.lang.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 org.alfresco.query.PagingResults<org.alfresco.util.Pair<java.lang.String,java.io.Serializable>> getPagedPreferences(java.lang.String userName, java.lang.String preferenceFilter, org.alfresco.query.PagingRequest pagingRequest)- Specified by:
getPagedPreferencesin interfacePreferenceService
-
setPreferences
public void setPreferences(java.lang.String userName, java.util.Map<java.lang.String,java.io.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(java.lang.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(java.lang.String userName, java.lang.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(java.lang.Class<? extends M> traitAPI)
- Specified by:
getTraitin interfaceExtensible
-
createPreferenceServiceTrait
public PreferenceServiceTrait createPreferenceServiceTrait()
-
-