From ad229d966f874f1046f88c5c05c160da89a436c5 Mon Sep 17 00:00:00 2001 From: Erik Winlof Date: Wed, 3 Sep 2014 12:34:48 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud) 78564: Merged V4.2-BUG-FIX (4.2.4) to HEAD-BUG-FIX (5.0/Cloud) 77751: Merged DEV to V4.2-BUG-FIX (4.2.4) 77428 : MNT-11911 : Cancelling a download as ZIP archive leads to nodeRef-ID displayed at 'My Documents' dashlet - Added temp file aspect "indexControl", property "isIndexed" and "isContentIndexed" which allow not index files in the search. Added in JUnit test check to add properties and aspects. Now in "My Documents" dashlet is not visible zip file. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@82601 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/java/org/alfresco/repo/download/DownloadStorage.java | 6 ++++++ .../repo/download/DownloadServiceIntegrationTest.java | 5 +++++ 2 files changed, 11 insertions(+) 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; } });