mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Merged HEAD (5.2) to 5.2.N (5.2.1)
126479 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 122547 gjames: RA-823: Allow the implementation to specify the "source entity" first. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126823 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -483,10 +483,10 @@ public class ResourceWebScriptHelper
|
||||
{
|
||||
PropertyCheck.mandatory(this, null, params);
|
||||
if (objectToWrap == null ) return null;
|
||||
if (objectToWrap instanceof SerializablePagedCollection<?>)
|
||||
if (objectToWrap instanceof CollectionWithPagingInfo<?>)
|
||||
{
|
||||
SerializablePagedCollection<?> collectionToWrap = (SerializablePagedCollection<?>) objectToWrap;
|
||||
Object sourceEntity = executeIncludedSource(res, api, params, entityCollectionName);
|
||||
CollectionWithPagingInfo<?> collectionToWrap = (CollectionWithPagingInfo<?>) objectToWrap;
|
||||
Object sourceEntity = executeIncludedSource(res, api, params, entityCollectionName, collectionToWrap);
|
||||
Collection<Object> resultCollection = new ArrayList(collectionToWrap.getCollection().size());
|
||||
if (!collectionToWrap.getCollection().isEmpty())
|
||||
{
|
||||
@@ -527,10 +527,16 @@ public class ResourceWebScriptHelper
|
||||
}
|
||||
}
|
||||
|
||||
private Object executeIncludedSource(WebScriptResponse response, Api api, Params params, String entityCollectionName)
|
||||
private Object executeIncludedSource(WebScriptResponse response, Api api, Params params, String entityCollectionName, CollectionWithPagingInfo<?> collectionToWrap)
|
||||
{
|
||||
if (params.includeSource())
|
||||
{
|
||||
if (collectionToWrap.getSourceEntity() != null)
|
||||
{
|
||||
//The implementation has already set it so return it;
|
||||
return collectionToWrap.getSourceEntity();
|
||||
}
|
||||
|
||||
ResourceWithMetadata res = locator.locateEntityResource(api, entityCollectionName, HttpMethod.GET);
|
||||
if (res != null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user