Merged 5.1.N (5.1.1) to HEAD (5.1)

118308 nsmintanca: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)
      118237 aleahu: MNT-14853 : Unable to download zip with non primary child
         - Fixed spacing by removing tabs as per Derek's request.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@123592 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-03-11 17:29:58 +00:00
parent 967c55b264
commit c067ed1215
3 changed files with 41 additions and 41 deletions

View File

@@ -81,7 +81,7 @@
<bean id="downloadStatusUpdateService" class="org.alfresco.repo.download.DownloadStatusUpdateServiceImpl"> <bean id="downloadStatusUpdateService" class="org.alfresco.repo.download.DownloadStatusUpdateServiceImpl">
<property name="storage" ref="downloadStorage" /> <property name="storage" ref="downloadStorage" />
</bean> </bean>
<bean id="downloadContentServiceHelper" class="org.alfresco.repo.download.LocalContentServiceHelper"> <bean id="downloadContentServiceHelper" class="org.alfresco.repo.download.LocalContentServiceHelper">
@@ -91,13 +91,13 @@
<bean id="createDownloadArchiveAction" class="org.alfresco.repo.download.CreateDownloadArchiveAction" parent="action-executer"> <bean id="createDownloadArchiveAction" class="org.alfresco.repo.download.CreateDownloadArchiveAction" parent="action-executer">
<property name="checkOutCheckInSerivce" ref="checkOutCheckInService"/> <property name="checkOutCheckInSerivce" ref="checkOutCheckInService"/>
<property name="contentServiceHelper" ref="downloadContentServiceHelper" /> <property name="contentServiceHelper" ref="downloadContentServiceHelper" />
<property name="downloadStorage" ref="downloadStorage" /> <property name="downloadStorage" ref="downloadStorage" />
<property name="exporterService" ref="downloadExporterComponent" /> <property name="exporterService" ref="downloadExporterComponent" />
<property name="maximumContentSize" value="${download.maxContentSize}" /> <property name="maximumContentSize" value="${download.maxContentSize}" />
<property name="nodeService" ref="nodeService" /> <property name="nodeService" ref="nodeService" />
<property name="publicAction" value="false"/> <property name="publicAction" value="false"/>
<property name="transactionHelper" ref="retryingTransactionHelper"/> <property name="transactionHelper" ref="retryingTransactionHelper"/>
<property name="updateService" ref="downloadStatusUpdateService"/> <property name="updateService" ref="downloadStatusUpdateService"/>
</bean> </bean>
<bean id="downloadExporterComponent" parent="exporterComponent"> <bean id="downloadExporterComponent" parent="exporterComponent">

View File

@@ -391,8 +391,8 @@ public class ExporterComponent
// explicitly included ? // explicitly included ?
if (parameters.getIncludedPaths() != null) if (parameters.getIncludedPaths() != null)
{ {
String nodePathPrefixString = nodeService.getPath(nodeRef).toPrefixString(namespaceService); String nodePathPrefixString = nodeService.getPath(nodeRef).toPrefixString(namespaceService);
if (! (isIncludedPath(parameters.getIncludedPaths(), nodePathPrefixString))) if (! (isIncludedPath(parameters.getIncludedPaths(), nodePathPrefixString)))
{ {
return; return;
} }
@@ -515,7 +515,7 @@ public class ExporterComponent
// Export node children // Export node children
if (parameters.isCrawlChildNodes()) if (parameters.isCrawlChildNodes())
{ {
// sort associations into assoc type buckets filtering out unneccessary associations // sort associations into assoc type buckets filtering out unneccessary associations
Map<QName, List<ChildAssociationRef>> assocTypes = new HashMap<QName, List<ChildAssociationRef>>(); Map<QName, List<ChildAssociationRef>> assocTypes = new HashMap<QName, List<ChildAssociationRef>>();
List<ChildAssociationRef> childAssocs = nodeService.getChildAssocs(nodeRef); List<ChildAssociationRef> childAssocs = nodeService.getChildAssocs(nodeRef);
for (ChildAssociationRef childAssoc : childAssocs) for (ChildAssociationRef childAssoc : childAssocs)
@@ -540,7 +540,7 @@ public class ExporterComponent
} }
if (isExcludedURI(parameters.getExcludeNamespaceURIs(), childAssoc.getQName().getNamespaceURI())) if (isExcludedURI(parameters.getExcludeNamespaceURIs(), childAssoc.getQName().getNamespaceURI()))
{ {
continue; continue;
} }
List<ChildAssociationRef> assocRefs = assocTypes.get(childAssocType); List<ChildAssociationRef> assocRefs = assocTypes.get(childAssocType);
@@ -551,7 +551,7 @@ public class ExporterComponent
} }
assocRefs.add(childAssoc); assocRefs.add(childAssoc);
} }
// output each association type bucket // output each association type bucket
if (assocTypes.size() > 0) if (assocTypes.size() > 0)
{ {
@@ -592,7 +592,7 @@ public class ExporterComponent
else else
{ {
exporter.endNode(nodeRef); exporter.endNode(nodeRef);
} }
} }
/** /**
@@ -688,7 +688,7 @@ public class ExporterComponent
*/ */
private void walkNodeSecondaryLinks(NodeRef nodeRef, ExporterCrawlerParameters parameters, Exporter exporter) private void walkNodeSecondaryLinks(NodeRef nodeRef, ExporterCrawlerParameters parameters, Exporter exporter)
{ {
// sort associations into assoc type buckets filtering out unneccessary associations // sort associations into assoc type buckets filtering out unneccessary associations
Map<QName, List<ChildAssociationRef>> assocTypes = new HashMap<QName, List<ChildAssociationRef>>(); Map<QName, List<ChildAssociationRef>> assocTypes = new HashMap<QName, List<ChildAssociationRef>>();
List<ChildAssociationRef> childAssocs = nodeService.getChildAssocs(nodeRef); List<ChildAssociationRef> childAssocs = nodeService.getChildAssocs(nodeRef);
for (ChildAssociationRef childAssoc : childAssocs) for (ChildAssociationRef childAssoc : childAssocs)
@@ -724,7 +724,7 @@ public class ExporterComponent
} }
assocRefs.add(childAssoc); assocRefs.add(childAssoc);
} }
// output each association type bucket // output each association type bucket
if (assocTypes.size() > 0) if (assocTypes.size() > 0)
{ {
@@ -758,7 +758,7 @@ public class ExporterComponent
*/ */
private void walkNodeAssociations(NodeRef nodeRef, ExporterCrawlerParameters parameters, Exporter exporter) private void walkNodeAssociations(NodeRef nodeRef, ExporterCrawlerParameters parameters, Exporter exporter)
{ {
// sort associations into assoc type buckets filtering out unneccessary associations // sort associations into assoc type buckets filtering out unneccessary associations
Map<QName, List<AssociationRef>> assocTypes = new HashMap<QName, List<AssociationRef>>(); Map<QName, List<AssociationRef>> assocTypes = new HashMap<QName, List<AssociationRef>>();
List<AssociationRef> assocs = nodeService.getTargetAssocs(nodeRef, RegexQNamePattern.MATCH_ALL); List<AssociationRef> assocs = nodeService.getTargetAssocs(nodeRef, RegexQNamePattern.MATCH_ALL);
for (AssociationRef assoc : assocs) for (AssociationRef assoc : assocs)
@@ -781,7 +781,7 @@ public class ExporterComponent
} }
assocRefs.add(assoc); assocRefs.add(assoc);
} }
// output each association type bucket // output each association type bucket
if (assocTypes.size() > 0) if (assocTypes.size() > 0)
{ {

View File

@@ -106,9 +106,9 @@ public class DownloadServiceIntegrationTest
private static IntegrityChecker INTEGRITY_CHECKER; private static IntegrityChecker INTEGRITY_CHECKER;
// Test Content // Test Content
private NodeRef rootFolder; private NodeRef rootFolder;
private NodeRef rootFile; private NodeRef rootFile;
private NodeRef secondaryNode; private NodeRef secondaryNode;
private NodeRef level1Folder1; private NodeRef level1Folder1;
@@ -120,13 +120,13 @@ public class DownloadServiceIntegrationTest
@BeforeClass public static void init() @BeforeClass public static void init()
{ {
// Resolve required services // Resolve required services
CHECK_OUT_CHECK_IN_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("CheckOutCheckInService", CheckOutCheckInService.class); CHECK_OUT_CHECK_IN_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("CheckOutCheckInService", CheckOutCheckInService.class);
CONTENT_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("contentService", ContentService.class); CONTENT_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("contentService", ContentService.class);
DOWNLOAD_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("DownloadService", DownloadService.class); DOWNLOAD_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("DownloadService", DownloadService.class);
NODE_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("NodeService", NodeService.class); NODE_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("NodeService", NodeService.class);
PERMISSION_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("PermissionService", PermissionService.class); PERMISSION_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("PermissionService", PermissionService.class);
TRANSACTION_HELPER = APP_CONTEXT_INIT.getApplicationContext().getBean("retryingTransactionHelper", RetryingTransactionHelper.class); TRANSACTION_HELPER = APP_CONTEXT_INIT.getApplicationContext().getBean("retryingTransactionHelper", RetryingTransactionHelper.class);
INTEGRITY_CHECKER = APP_CONTEXT_INIT.getApplicationContext().getBean("integrityChecker", IntegrityChecker.class); INTEGRITY_CHECKER = APP_CONTEXT_INIT.getApplicationContext().getBean("integrityChecker", IntegrityChecker.class);
INTEGRITY_CHECKER.setEnabled(true); INTEGRITY_CHECKER.setEnabled(true);
INTEGRITY_CHECKER.setFailOnViolation(true); INTEGRITY_CHECKER.setFailOnViolation(true);
@@ -188,11 +188,11 @@ public class DownloadServiceIntegrationTest
@Test public void createDownload() throws IOException, InterruptedException @Test public void createDownload() throws IOException, InterruptedException
{ {
// Initiate the download // Initiate the download
final NodeRef downloadNode = DOWNLOAD_SERVICE.createDownload(new NodeRef[] {rootFile, rootFolder}, true); final NodeRef downloadNode = DOWNLOAD_SERVICE.createDownload(new NodeRef[] {rootFile, rootFolder}, true);
Assert.assertNotNull(downloadNode); Assert.assertNotNull(downloadNode);
testNodes.addNodeRef(downloadNode); testNodes.addNodeRef(downloadNode);
// Validate that the download node has been persisted correctly. // Validate that the download node has been persisted correctly.
TRANSACTION_HELPER.doInTransaction(new RetryingTransactionCallback<Object>() TRANSACTION_HELPER.doInTransaction(new RetryingTransactionCallback<Object>()
{ {
@@ -216,17 +216,17 @@ public class DownloadServiceIntegrationTest
return null; return null;
} }
}); });
DownloadStatus status = getDownloadStatus(downloadNode); DownloadStatus status = getDownloadStatus(downloadNode);
while (status.getStatus() == Status.PENDING) while (status.getStatus() == Status.PENDING)
{ {
Thread.sleep(PAUSE_TIME); Thread.sleep(PAUSE_TIME);
status = getDownloadStatus(downloadNode); status = getDownloadStatus(downloadNode);
} }
Assert.assertEquals(6l, status.getTotalFiles()); Assert.assertEquals(6l, status.getTotalFiles());
long elapsedTime = waitForDownload(downloadNode); long elapsedTime = waitForDownload(downloadNode);
Assert.assertTrue("Maximum creation time exceeded!", elapsedTime < MAX_TIME); Assert.assertTrue("Maximum creation time exceeded!", elapsedTime < MAX_TIME);
@@ -386,10 +386,10 @@ public class DownloadServiceIntegrationTest
AuthenticationUtil.setFullAuthentication(previousAuth); AuthenticationUtil.setFullAuthentication(previousAuth);
} }
try try
{ {
validateWorkingCopyFolder(preCheckoutExpectedEntries, level1Folder2, TEST_USER2.getUsername()); validateWorkingCopyFolder(preCheckoutExpectedEntries, level1Folder2, TEST_USER2.getUsername());
final Set<String> postCheckoutExpectedEntries = new TreeSet<String>(); final Set<String> postCheckoutExpectedEntries = new TreeSet<String>();
postCheckoutExpectedEntries.add("level1Folder2/"); postCheckoutExpectedEntries.add("level1Folder2/");
postCheckoutExpectedEntries.add("level1Folder2/level2File.txt"); postCheckoutExpectedEntries.add("level1Folder2/level2File.txt");
@@ -408,7 +408,7 @@ public class DownloadServiceIntegrationTest
{ {
AuthenticationUtil.setFullAuthentication(previousAuth); AuthenticationUtil.setFullAuthentication(previousAuth);
} }
} }
validateWorkingCopyFolder(preCheckoutExpectedEntries, level1Folder2, TEST_USER.getUsername()); validateWorkingCopyFolder(preCheckoutExpectedEntries, level1Folder2, TEST_USER.getUsername());
validateWorkingCopyFolder(preCheckoutExpectedEntries, level1Folder2, TEST_USER2.getUsername()); validateWorkingCopyFolder(preCheckoutExpectedEntries, level1Folder2, TEST_USER2.getUsername());
} }