mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-9153 Add unit tests for the new discussions hot topics CQ and service method
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30028 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -111,11 +111,29 @@ public class GetDiscussionTopcisWithPostsCannedQuery extends AbstractCannedQuery
|
||||
result.setChildren(wantedPosts);
|
||||
}
|
||||
|
||||
// Ignore any topic with no replies
|
||||
// (As topics have a primary post, that means any with less than 2 children)
|
||||
if(result.getChildren().size() <= 1)
|
||||
// If required, filter out the primary post
|
||||
if(paramBean.getExcludePrimaryPost())
|
||||
{
|
||||
// No posts at all, or only the primary one
|
||||
List<NameAndCreatedAt> wantedPosts = new ArrayList<NameAndCreatedAt>();
|
||||
for(NameAndCreatedAt post : result.getChildren())
|
||||
{
|
||||
if(post.getName().equals( result.getName() ))
|
||||
{
|
||||
// Primary post, skip
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
wantedPosts.add(post);
|
||||
}
|
||||
}
|
||||
result.setChildren(wantedPosts);
|
||||
}
|
||||
|
||||
// Ignore any topic with no posts
|
||||
if(result.getChildren().size() == 0)
|
||||
{
|
||||
// No valid posts
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user