com.atlassian.confluence.plugins.dailysummary.content.popular
Class DefaultPopularContentManager

java.lang.Object
  extended by com.atlassian.confluence.plugins.dailysummary.content.popular.DefaultPopularContentManager
All Implemented Interfaces:
PopularContentManager

public class DefaultPopularContentManager
extends java.lang.Object
implements PopularContentManager


Constructor Summary
DefaultPopularContentManager(FollowManager followManager, FavouriteManager favouritesManager, LikeManager likeManager, PopularContentDtoFactory popularContentDtoFactory, PopularContentQueries contentQueries)
           
 
Method Summary
 java.util.List<PopularContentExcerptDto> getPopularContent(ConfluenceUser user, java.util.Date date, Space space, int maxResults, int numDays)
          Creates a list with popular content excerpt DTOs that have been active in the last number of days.
 java.util.List<PopularContentExcerptDto> getPopularContent(com.atlassian.user.User user, java.util.Date date, Space space, int maxResults, int numDays)
          Deprecated. 
protected  int score(ContentEntityObject content, com.atlassian.user.User user, java.util.Set<java.lang.String> followingSet, java.util.Date since)
           
protected  java.util.List<ContentStat> sortByRelevance(java.util.List<ContentEntityObject> ceos, com.atlassian.user.User user, java.util.Date since)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPopularContentManager

public DefaultPopularContentManager(FollowManager followManager,
                                    FavouriteManager favouritesManager,
                                    LikeManager likeManager,
                                    PopularContentDtoFactory popularContentDtoFactory,
                                    PopularContentQueries contentQueries)
Method Detail

getPopularContent

public java.util.List<PopularContentExcerptDto> getPopularContent(ConfluenceUser user,
                                                                  java.util.Date date,
                                                                  @Nullable
                                                                  Space space,
                                                                  int maxResults,
                                                                  int numDays)
Description copied from interface: PopularContentManager
Creates a list with popular content excerpt DTOs that have been active in the last number of days. A piece of content is only considered popular if it has at least one like or one comment.

Specified by:
getPopularContent in interface PopularContentManager
Parameters:
user - the user who will view the results, this is used both to filter for permissions and as a context to rank the results.
date - the date to evaluate the numberOfDays prior to, to determine whether the content was active
space - the space this content will be constrained to, may be null
maxResults - the maximum number of results to return
numDays - the number of days to evaluate the content score over.
Returns:
a list of excerpt that were active in the previous numberOfDays ranked by relevance for the user.

getPopularContent

@Deprecated
public java.util.List<PopularContentExcerptDto> getPopularContent(com.atlassian.user.User user,
                                                                             java.util.Date date,
                                                                             @Nullable
                                                                             Space space,
                                                                             int maxResults,
                                                                             int numDays)
Deprecated. 

Specified by:
getPopularContent in interface PopularContentManager

sortByRelevance

protected java.util.List<ContentStat> sortByRelevance(java.util.List<ContentEntityObject> ceos,
                                                      com.atlassian.user.User user,
                                                      java.util.Date since)

score

protected int score(ContentEntityObject content,
                    com.atlassian.user.User user,
                    java.util.Set<java.lang.String> followingSet,
                    java.util.Date since)


Copyright © 2003-2014 Atlassian. All Rights Reserved.