Package org.alfresco.repo.favourites
Class FavouritesServiceImpl
- java.lang.Object
-
- org.alfresco.repo.favourites.FavouritesServiceImpl
-
- All Implemented Interfaces:
FavouritesService,org.springframework.beans.factory.InitializingBean
public class FavouritesServiceImpl extends java.lang.Object implements FavouritesService, org.springframework.beans.factory.InitializingBean
Favourites service implementation that uses the PreferencesService for persisting favourites. Unfortunately, we are tied to the PreferencesService and to the preference names and data structure because Share uses the PreferenceService directly.- Author:
- steveglover
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFavouritesServiceImpl.OnAddFavouritePolicystatic interfaceFavouritesServiceImpl.OnRemoveFavouritePolicy-
Nested classes/interfaces inherited from interface org.alfresco.service.cmr.favourites.FavouritesService
FavouritesService.SortFields, FavouritesService.Type
-
-
Field Summary
-
Fields inherited from interface org.alfresco.service.cmr.favourites.FavouritesService
DEFAULT_SORT_PROPS
-
-
Constructor Summary
Constructors Constructor Description FavouritesServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PersonFavouriteaddFavourite(java.lang.String userName, org.alfresco.service.cmr.repository.NodeRef nodeRef)Add the entity identified by nodeRef as a favourite for user "userName".voidafterPropertiesSet()PersonFavouritegetFavourite(java.lang.String userName, org.alfresco.service.cmr.repository.NodeRef nodeRef)Get a specific favourite for user "userName".org.alfresco.query.PagingResults<PersonFavourite>getPagedFavourites(java.lang.String userName, java.util.Set<FavouritesService.Type> types, java.util.List<org.alfresco.util.Pair<FavouritesService.SortFields,java.lang.Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)A paged list of favourites for user "userName".FavouritesService.TypegetType(org.alfresco.service.cmr.repository.NodeRef nodeRef)voidinit()booleanisFavourite(java.lang.String userName, org.alfresco.service.cmr.repository.NodeRef nodeRef)Is the entity identified by nodeRef a favourite document of user "userName".booleanremoveFavourite(java.lang.String userName, org.alfresco.service.cmr.repository.NodeRef nodeRef)Remove the document identified by nodeRef as a favourite for user "userName".voidsetAuthenticationContext(AuthenticationContext authenticationContext)voidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)voidsetEventPublisher(org.alfresco.sync.repo.events.EventPublisher eventPublisher)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)voidsetPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)voidsetPersonService(PersonService personService)voidsetPolicyComponent(PolicyComponent policyComponent)voidsetPreferenceService(PreferenceService preferenceService)voidsetSiteService(SiteService siteService)
-
-
-
Method Detail
-
setPermissionService
public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
-
setPersonService
public void setPersonService(PersonService personService)
-
setAuthenticationContext
public void setAuthenticationContext(AuthenticationContext authenticationContext)
-
setPolicyComponent
public void setPolicyComponent(PolicyComponent policyComponent)
-
setSiteService
public void setSiteService(SiteService siteService)
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
-
setPreferenceService
public void setPreferenceService(PreferenceService preferenceService)
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
init
public void init()
-
getType
public FavouritesService.Type getType(org.alfresco.service.cmr.repository.NodeRef nodeRef)
- Specified by:
getTypein interfaceFavouritesService
-
addFavourite
public PersonFavourite addFavourite(java.lang.String userName, org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface:FavouritesServiceAdd the entity identified by nodeRef as a favourite for user "userName". If the nodeRef is already favourited, the favourite entity is returned. No information regarding the favourite e.g. createdAt is updated.- Specified by:
addFavouritein interfaceFavouritesService- Parameters:
userName- StringnodeRef- NodeRef- Returns:
- PersonFavourite
-
removeFavourite
public boolean removeFavourite(java.lang.String userName, org.alfresco.service.cmr.repository.NodeRef nodeRef)Description copied from interface:FavouritesServiceRemove the document identified by nodeRef as a favourite for user "userName".- Specified by:
removeFavouritein interfaceFavouritesService- Parameters:
userName- StringnodeRef- NodeRef- Returns:
- boolean
-
isFavourite
public boolean isFavourite(java.lang.String userName, org.alfresco.service.cmr.repository.NodeRef nodeRef)Description copied from interface:FavouritesServiceIs the entity identified by nodeRef a favourite document of user "userName".- Specified by:
isFavouritein interfaceFavouritesService- Parameters:
userName- StringnodeRef- NodeRef- Returns:
- boolean
-
getPagedFavourites
public org.alfresco.query.PagingResults<PersonFavourite> getPagedFavourites(java.lang.String userName, java.util.Set<FavouritesService.Type> types, java.util.List<org.alfresco.util.Pair<FavouritesService.SortFields,java.lang.Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
Description copied from interface:FavouritesServiceA paged list of favourites for user "userName".- Specified by:
getPagedFavouritesin interfaceFavouritesService- Parameters:
userName- StringpagingRequest- PagingRequest
-
getFavourite
public PersonFavourite getFavourite(java.lang.String userName, org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface:FavouritesServiceGet a specific favourite for user "userName".- Specified by:
getFavouritein interfaceFavouritesService- Parameters:
userName- StringnodeRef- NodeRef- Returns:
- PersonFavourite
-
setEventPublisher
public void setEventPublisher(org.alfresco.sync.repo.events.EventPublisher eventPublisher)
-
-