Class 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
    • Constructor Detail

      • FavouritesServiceImpl

        public FavouritesServiceImpl()
    • 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:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception
      • init

        public void init()
      • addFavourite

        public PersonFavourite addFavourite​(java.lang.String userName,
                                            org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Description copied from interface: FavouritesService
        Add 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:
        addFavourite in interface FavouritesService
        Parameters:
        userName - String
        nodeRef - NodeRef
        Returns:
        PersonFavourite
      • removeFavourite

        public boolean removeFavourite​(java.lang.String userName,
                                       org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Description copied from interface: FavouritesService
        Remove the document identified by nodeRef as a favourite for user "userName".
        Specified by:
        removeFavourite in interface FavouritesService
        Parameters:
        userName - String
        nodeRef - NodeRef
        Returns:
        boolean
      • isFavourite

        public boolean isFavourite​(java.lang.String userName,
                                   org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Description copied from interface: FavouritesService
        Is the entity identified by nodeRef a favourite document of user "userName".
        Specified by:
        isFavourite in interface FavouritesService
        Parameters:
        userName - String
        nodeRef - NodeRef
        Returns:
        boolean
      • getFavourite

        public PersonFavourite getFavourite​(java.lang.String userName,
                                            org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Description copied from interface: FavouritesService
        Get a specific favourite for user "userName".
        Specified by:
        getFavourite in interface FavouritesService
        Parameters:
        userName - String
        nodeRef - NodeRef
        Returns:
        PersonFavourite
      • setEventPublisher

        public void setEventPublisher​(org.alfresco.sync.repo.events.EventPublisher eventPublisher)