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 Object
implements PopularContentManager


Constructor Summary
DefaultPopularContentManager(PageManager pageManager, FollowManager followManager, FavouriteManager favouritesManager, LikeManager likeManager, PopularContentDtoFactory popularContentDtoFactory, net.sf.hibernate.SessionFactory sf, PopularContentQueries contentQueries, PermissionManager permissionManager)
           
 
Method Summary
 List<PopularContentExcerptDto> getPopularContent(com.atlassian.user.User user, Date date, int maxResults, int numDays)
          Creates a list with popular content excerpt DTOs that have been active in the last number of days.
protected  int score(ContentEntityObject content, com.atlassian.user.User user, Set<String> followingSet, Date since)
           
protected  List<ContentStat> sortByRelevance(List<ContentEntityObject> ceos, com.atlassian.user.User user, 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(PageManager pageManager,
                                    FollowManager followManager,
                                    FavouriteManager favouritesManager,
                                    LikeManager likeManager,
                                    PopularContentDtoFactory popularContentDtoFactory,
                                    net.sf.hibernate.SessionFactory sf,
                                    PopularContentQueries contentQueries,
                                    PermissionManager permissionManager)
Method Detail

getPopularContent

public List<PopularContentExcerptDto> getPopularContent(com.atlassian.user.User user,
                                                        Date date,
                                                        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
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.

sortByRelevance

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

score

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


Copyright © 2003-2013 Atlassian. All Rights Reserved.