REPO-1090: fix regress (V1 REST API - list children within the context of a smart folder)

- follow-on (re: NodeApiTest.getChildrenAssocType fallout - when returning any assoc, not just cm:contains)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@129893 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2016-08-25 17:02:31 +00:00
parent 8dfbbeaf3d
commit 25988a8efb
3 changed files with 14 additions and 1 deletions

View File

@@ -493,6 +493,7 @@
<property name="nonAttachContentTypes" ref="nodes.nonAttachContentTypes"/>
<property name="poster" ref="activitiesPoster" />
<property name="nodeAssocService" ref="NodeAssocService"/>
<property name="smartStore" ref="smartStore"/>
</bean>
<bean id="Nodes" class="org.springframework.aop.framework.ProxyFactoryBean">

View File

@@ -74,6 +74,7 @@ import org.alfresco.repo.thumbnail.ThumbnailRegistry;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.version.VersionModel;
import org.alfresco.repo.virtual.store.VirtualStore;
import org.alfresco.rest.antlr.WhereClauseParser;
import org.alfresco.rest.api.Activities;
import org.alfresco.rest.api.Nodes;
@@ -207,6 +208,7 @@ public class NodesImpl implements Nodes
private RetryingTransactionHelper retryingTransactionHelper;
private NodeAssocService nodeAssocService;
private LockService lockService;
private VirtualStore smartStore; // note: remove as part of REPO-1173
private enum Activity_Type
{
@@ -305,6 +307,11 @@ public class NodesImpl implements Nodes
this.nodeAssocService = nodeAssocService;
}
public void setSmartStore(VirtualStore smartStore)
{
this.smartStore = smartStore;
}
// excluded namespaces (aspects, properties, assoc types)
private static final List<String> EXCLUDED_NS = Arrays.asList(NamespaceService.SYSTEM_MODEL_1_0_URI);
@@ -1327,7 +1334,8 @@ public class NodesImpl implements Nodes
// call GetChildrenCannedQuery (via FileFolderService)
if (((filterProps == null) || (filterProps.size() == 0)) &&
((assocTypeQNames == null) || (assocTypeQNames.size() == 0)))
((assocTypeQNames == null) || (assocTypeQNames.size() == 0)) &&
(smartStore.isVirtual(parentNodeRef)|| (smartStore.canVirtualize(parentNodeRef))))
{
pagingResults = fileFolderService.list(parentNodeRef, searchTypeQNames, ignoreAspectQNames, sortProps, pagingRequest);
}

View File

@@ -2124,6 +2124,10 @@ public class NodeApiTest extends AbstractSingleNetworkSiteTest
String c1Id = nodeResp.getId();
assertEquals(fId, nodeResp.getParentId());
response = getAll(getNodeChildrenUrl(fId), null, null, 200);
nodes = RestApiUtil.parseRestApiEntries(response.getJsonResponse(), Node.class);
assertEquals(1, nodes.size());
obj = new Node();
obj.setName("c2");
obj.setNodeType(TYPE_CM_CONTENT);