ALF-9385. Separation of taggingService from Blog CannedQueries.

Initial implementation provides separate 'findTaggedBlogPosts' method and removes taggingService from the CQs.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28816 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2011-07-05 18:00:21 +00:00
parent 38e82ebe68
commit 7901f5ce66
7 changed files with 101 additions and 38 deletions

View File

@@ -56,17 +56,14 @@ public class DraftsAndPublishedBlogPostsCannedQuery extends AbstractCannedQueryP
private static final String QUERY_SELECT_GET_BLOGS = "select_GetBlogsCannedQuery";
private final CannedQueryDAO cannedQueryDAO;
private final TaggingService taggingService;
public DraftsAndPublishedBlogPostsCannedQuery(
CannedQueryDAO cannedQueryDAO,
TaggingService taggingService,
MethodSecurityBean<BlogPostInfo> methodSecurity,
CannedQueryParameters params)
{
super(params, methodSecurity);
this.cannedQueryDAO = cannedQueryDAO;
this.taggingService = taggingService;
}
@Override
@@ -80,7 +77,6 @@ public class DraftsAndPublishedBlogPostsCannedQuery extends AbstractCannedQueryP
DraftsAndPublishedBlogPostsCannedQueryParams paramBean = (DraftsAndPublishedBlogPostsCannedQueryParams) paramBeanObj;
String requestedCreator = paramBean.getCmCreator();
String requestedTag = paramBean.getTag();
Date createdFromDate = paramBean.getCreatedFromDate();
Date createdToDate = paramBean.getCreatedToDate();
@@ -135,13 +131,6 @@ public class DraftsAndPublishedBlogPostsCannedQuery extends AbstractCannedQueryP
}
}
// TODO review use-case and either remove or push-down
// Only return blog posts tagged with the specified tag string.
if (requestedTag != null && !taggingService.getTags(result.getNode().getNodeRef()).contains(requestedTag))
{
nextNodeIsAcceptable = false;
}
if (nextNodeIsAcceptable)
{
filtered.add(result);