Merged HEAD (5.2) to 5.2.N (5.2.1)

127316 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
      127312 jkaabimofrad: SFS-577, SFS-581: Fixed the shared-link no-auth APIs issue with multi-tenancy.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@127385 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Raluca Munteanu
2016-05-24 14:59:05 +00:00
parent 337f5bc8a3
commit 94215263cf
7 changed files with 239 additions and 16 deletions

View File

@@ -28,6 +28,7 @@ package org.alfresco.rest.api.impl;
import org.alfresco.model.ContentModel;
import org.alfresco.query.PagingResults;
import org.alfresco.repo.tenant.TenantService;
import org.alfresco.repo.thumbnail.ThumbnailDefinition;
import org.alfresco.repo.thumbnail.ThumbnailHelper;
import org.alfresco.repo.thumbnail.ThumbnailRegistry;
@@ -103,6 +104,7 @@ public class RenditionsImpl implements Renditions, ResourceLoaderAware
private NamespaceService namespaceService;
private ServiceRegistry serviceRegistry;
private ResourceLoader resourceLoader;
private TenantService tenantService;
public void setNodes(Nodes nodes)
{
@@ -130,12 +132,18 @@ public class RenditionsImpl implements Renditions, ResourceLoaderAware
this.resourceLoader = resourceLoader;
}
public void setTenantService(TenantService tenantService)
{
this.tenantService = tenantService;
}
public void init()
{
PropertyCheck.mandatory(this, "nodes", nodes);
PropertyCheck.mandatory(this, "thumbnailService", thumbnailService);
PropertyCheck.mandatory(this, "scriptThumbnailService", scriptThumbnailService);
PropertyCheck.mandatory(this, "serviceRegistry", serviceRegistry);
PropertyCheck.mandatory(this, "tenantService", tenantService);
this.nodeService = serviceRegistry.getNodeService();
this.actionService = serviceRegistry.getActionService();
@@ -295,7 +303,13 @@ public class RenditionsImpl implements Renditions, ResourceLoaderAware
public BinaryResource getContent(String nodeId, String renditionId, Parameters parameters)
{
final NodeRef sourceNodeRef = validateSourceNode(nodeId);
final NodeRef renditionNodeRef = getRenditionByName(sourceNodeRef, renditionId, parameters);
return getContent(sourceNodeRef, renditionId, parameters);
}
@Override
public BinaryResource getContent(NodeRef sourceNodeRef, String renditionId, Parameters parameters)
{
NodeRef renditionNodeRef = getRenditionByName(sourceNodeRef, renditionId, parameters);
// By default set attachment header (with rendition Id) unless attachment=false
boolean attach = true;
@@ -389,7 +403,8 @@ public class RenditionsImpl implements Renditions, ResourceLoaderAware
{
return null;
}
return nodeRefRendition.getChildRef();
return tenantService.getName(nodeRef, nodeRefRendition.getChildRef());
}
protected Rendition toApiRendition(NodeRef renditionNodeRef)