mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
On advice from Derek, pre-load node details when wrapping CQ results as higher level objects, for Calendar, Wiki, Links and Discussions
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29796 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -33,6 +33,7 @@ import org.alfresco.query.CannedQuerySortDetails;
|
||||
import org.alfresco.query.EmptyPagingResults;
|
||||
import org.alfresco.query.PagingRequest;
|
||||
import org.alfresco.query.PagingResults;
|
||||
import org.alfresco.repo.domain.node.NodeDAO;
|
||||
import org.alfresco.repo.node.getchildren.GetChildrenAuditableCannedQuery;
|
||||
import org.alfresco.repo.node.getchildren.GetChildrenAuditableCannedQueryFactory;
|
||||
import org.alfresco.repo.query.NodeBackedEntity;
|
||||
@@ -71,6 +72,7 @@ public class WikiServiceImpl implements WikiService
|
||||
@SuppressWarnings("unused")
|
||||
private static Log logger = LogFactory.getLog(WikiServiceImpl.class);
|
||||
|
||||
private NodeDAO nodeDAO;
|
||||
private NodeService nodeService;
|
||||
private SiteService siteService;
|
||||
private ContentService contentService;
|
||||
@@ -79,6 +81,11 @@ public class WikiServiceImpl implements WikiService
|
||||
private TransactionService transactionService;
|
||||
private NamedObjectRegistry<CannedQueryFactory<? extends Object>> cannedQueryRegistry;
|
||||
|
||||
public void setNodeDAO(NodeDAO nodeDAO)
|
||||
{
|
||||
this.nodeDAO = nodeDAO;
|
||||
}
|
||||
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
@@ -341,6 +348,15 @@ public class WikiServiceImpl implements WikiService
|
||||
*/
|
||||
private PagingResults<WikiPageInfo> wrap(final PagingResults<NodeBackedEntity> results, final NodeRef container)
|
||||
{
|
||||
// Pre-load the nodes before we create them
|
||||
List<Long> ids = new ArrayList<Long>();
|
||||
for(NodeBackedEntity node : results.getPage())
|
||||
{
|
||||
ids.add(node.getId());
|
||||
}
|
||||
nodeDAO.cacheNodesById(ids);
|
||||
|
||||
// Wrap
|
||||
return new PagingResults<WikiPageInfo>()
|
||||
{
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user