diff --git a/source/java/org/alfresco/repo/download/DownloadStorage.java b/source/java/org/alfresco/repo/download/DownloadStorage.java index ad5177efbb..20f3fa28d8 100644 --- a/source/java/org/alfresco/repo/download/DownloadStorage.java +++ b/source/java/org/alfresco/repo/download/DownloadStorage.java @@ -124,6 +124,12 @@ public class DownloadStorage final NodeRef downloadNodeRef = newChildAssoc.getChildRef(); + // MNT-11911 fix, add ASPECT_INDEX_CONTROL and property that not create indexes for search and not visible files/folders at 'My Documents' dashlet + Map aspectProperties = new HashMap(2); + aspectProperties.put(ContentModel.PROP_IS_INDEXED, Boolean.FALSE); + aspectProperties.put(ContentModel.PROP_IS_CONTENT_INDEXED, Boolean.FALSE); + nodeService.addAspect(downloadNodeRef, ContentModel.ASPECT_INDEX_CONTROL, aspectProperties); + if (log.isDebugEnabled()) { StringBuilder msg = new StringBuilder(); diff --git a/source/test-java/org/alfresco/repo/download/DownloadServiceIntegrationTest.java b/source/test-java/org/alfresco/repo/download/DownloadServiceIntegrationTest.java index 80382c6de5..5bae7fdb69 100644 --- a/source/test-java/org/alfresco/repo/download/DownloadServiceIntegrationTest.java +++ b/source/test-java/org/alfresco/repo/download/DownloadServiceIntegrationTest.java @@ -201,6 +201,11 @@ public class DownloadServiceIntegrationTest { Assert.assertTrue(association.getTargetRef().equals(rootFile) || association.getTargetRef().equals(rootFolder)); } + + Assert.assertTrue(NODE_SERVICE.hasAspect(downloadNode, ContentModel.ASPECT_INDEX_CONTROL)); + Assert.assertEquals(Boolean.FALSE,properties.get(ContentModel.PROP_IS_INDEXED)); + Assert.assertEquals(Boolean.FALSE,properties.get(ContentModel.PROP_IS_CONTENT_INDEXED)); + return null; } });