mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.0/Cloud)
87733: Merged V4.2-BUG-FIX (4.2.4) to HEAD-BUG-FIX (5.0/Cloud) 87683: Merged V4.1-BUG-FIX (4.1.10) to V4.2-BUG-FIX (4.2.4) 87387: MNT-12504: Unable to Download as Zip if there is an association between nodes - try\catch block was added in ExporterComponent.isWithinExport() method. Appropriate unit test was added. 87633: MNT-12504: Unable to Download as Zip if there is an association between nodes - Corrections for unit test that creates test user if one does not exist. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94550 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -35,6 +35,7 @@ import java.util.Set;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.node.MLPropertyInterceptor;
|
||||
import org.alfresco.repo.security.permissions.AccessDeniedException;
|
||||
import org.alfresco.service.cmr.dictionary.AssociationDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.ClassDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
@@ -45,6 +46,7 @@ import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ContentData;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
||||
import org.alfresco.service.cmr.repository.MLText;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
@@ -921,30 +923,42 @@ public class ExporterComponent
|
||||
private boolean isWithinExport(NodeRef nodeRef, ExporterCrawlerParameters parameters)
|
||||
{
|
||||
boolean isWithin = false;
|
||||
|
||||
// Current strategy is to determine if node is a child of the root exported node
|
||||
for (NodeRef exportRoot : context.getExportList())
|
||||
|
||||
try
|
||||
{
|
||||
if (nodeRef.equals(exportRoot) && parameters.isCrawlSelf() == true)
|
||||
// Current strategy is to determine if node is a child of the root exported node
|
||||
for (NodeRef exportRoot : context.getExportList())
|
||||
{
|
||||
// node to export is the root export node (and root is to be exported)
|
||||
isWithin = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// locate export root in primary parent path of node
|
||||
Path nodePath = nodeService.getPath(nodeRef);
|
||||
for (int i = nodePath.size() -1; i >= 0; i--)
|
||||
if (nodeRef.equals(exportRoot) && parameters.isCrawlSelf() == true)
|
||||
{
|
||||
Path.ChildAssocElement pathElement = (Path.ChildAssocElement)nodePath.get(i);
|
||||
if (pathElement.getRef().getChildRef().equals(exportRoot))
|
||||
// node to export is the root export node (and root is to be exported)
|
||||
isWithin = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// locate export root in primary parent path of node
|
||||
Path nodePath = nodeService.getPath(nodeRef);
|
||||
for (int i = nodePath.size() - 1; i >= 0; i--)
|
||||
{
|
||||
isWithin = true;
|
||||
break;
|
||||
Path.ChildAssocElement pathElement = (Path.ChildAssocElement) nodePath.get(i);
|
||||
if (pathElement.getRef().getChildRef().equals(exportRoot))
|
||||
{
|
||||
isWithin = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (AccessDeniedException accessErr)
|
||||
{
|
||||
// use default if this occurs
|
||||
}
|
||||
catch (InvalidNodeRefException nodeErr)
|
||||
{
|
||||
// use default if this occurs
|
||||
}
|
||||
|
||||
return isWithin;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user