From 0ceba1359b3528d0040f15e21a8755c9bcabfbce Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Mon, 19 Dec 2016 13:45:52 +0000 Subject: [PATCH 1/5] MNT-17241 (Access denied exception thrown during preview of certain content by non-admin/non-site member users) --- .../model/rma/aspect/FilePlanComponentAspect.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/FilePlanComponentAspect.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/FilePlanComponentAspect.java index a2cbdb696c..5a9b7f0ce4 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/FilePlanComponentAspect.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/FilePlanComponentAspect.java @@ -211,6 +211,19 @@ public class FilePlanComponentAspect extends BaseBehaviourBean { nodeService.setProperty(nodeRef, PROP_ROOT_NODEREF, root); } + + // If the node has any renditions, they inherit the file plan from their source node. + List renditions = renditionService.getRenditions(nodeRef); + NodeRef rendition; + for (ChildAssociationRef chAssRef : renditions) + { + rendition = chAssRef.getChildRef(); + if (nodeService.exists(rendition)) + { + // Apply file plan component aspect to node's renditions + nodeService.addAspect(rendition, ASPECT_FILE_PLAN_COMPONENT, null); + } + } } return null; From 70776d52400027fcd39f368d92388b1361cae0a6 Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Mon, 19 Dec 2016 18:45:17 +0000 Subject: [PATCH 2/5] Added a check to see if the aspect hasn't been removed in the same transaction. --- .../model/rma/aspect/FilePlanComponentAspect.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/FilePlanComponentAspect.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/FilePlanComponentAspect.java index 5a9b7f0ce4..93d241389b 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/FilePlanComponentAspect.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/FilePlanComponentAspect.java @@ -203,7 +203,8 @@ public class FilePlanComponentAspect extends BaseBehaviourBean @Override public Void doWork() { - if (nodeService.exists(nodeRef)) + // Check if the node exists and the aspect hasn't been removed in the same transaction (see RM-3266) + if (nodeService.exists(nodeRef) && nodeService.hasAspect(nodeRef, aspectTypeQName)) { // Look up the root and set on the aspect if found NodeRef root = filePlanService.getFilePlan(nodeRef); From 86ad1304c26ab095b011ae264803c85989cbeb5a Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Mon, 19 Dec 2016 20:41:11 +0000 Subject: [PATCH 3/5] Set renditionService property for filePlanComponent bean definition --- .../alfresco/module/org_alfresco_module_rm/rm-model-context.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml index 0d6a6f6119..b19c9647fa 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml @@ -103,6 +103,7 @@ + From 4e239abd1a7a8f3c9de42340e42dc52fef121bdc Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Mon, 19 Dec 2016 21:24:29 +0000 Subject: [PATCH 4/5] Fixed Alfresco installer download config --- rm-automation/pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index 60843ec89e..f2360ce503 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -152,8 +152,7 @@ Recreating database... drop database if exists alfresco; create database alfresco Downloading Alfresco installer... - - + Installing Alfresco... From dc3ecec202c24ecfb02197339de20c2b1be0ed4c Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Tue, 20 Dec 2016 11:04:18 +0000 Subject: [PATCH 5/5] Copied the ui-automation code from release/v2.3 --- rm-automation/pom.xml | 651 +++++++++++++++++++++++------------------- 1 file changed, 351 insertions(+), 300 deletions(-) diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index f2360ce503..c854ebf442 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -1,311 +1,362 @@ - - org.alfresco - alfresco-rm-parent - 2.3.0.9-SNAPSHOT - - 4.0.0 - alfresco-rm-automation - - 2.43.1 - 4.0.5.RELEASE - - - - + + 4.0.0 + alfresco-rm-automation + Alfresco Records Management Automation + + + org.alfresco + alfresco-rm-parent + 2.3.0.9-SNAPSHOT + + + + 2.45.0 + 4.0.5.RELEASE + 1.8 + testng.xml + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-test-source + + add-test-source + + + + src/unit-test/java + + + + + + + maven-surefire-plugin + + false + + ${project.build.testOutputDirectory}/${suiteXmlFile} + + ${skip.automationtests} + + + + maven-antrun-plugin + + + default-cli + + + Stopping Alfresco... + + + + + + + + + + org.codehaus.mojo + license-maven-plugin + + alfresco_enterprise + file:${project.parent.basedir}/license + ${project.parent.basedir}/license/description.ftl + + + + + - org.codehaus.mojo - build-helper-maven-plugin - - - add-test-source + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.codehaus.mojo + license-maven-plugin + [1.8,) + + update-file-header + + + + + + + + + + + + + + + + + org.alfresco.test + dataprep + 1.8 + + + org.alfresco.test + alfresco-testng + 1.1 + + + org.alfresco + selenium-grid + 1.8 + + + org.springframework + spring-beans + ${spring.version} + + + org.springframework + spring-core + ${spring.version} + + + org.springframework + spring-context + ${spring.version} + + + org.springframework + spring-tx + ${spring.version} + test + + + org.springframework + spring-test + ${spring.version} + test + + + org.testng + testng + 6.8.8 + + + ru.yandex.qatools.htmlelements + htmlelements-all + 1.15 + + + ru.yandex.qatools.properties + properties-loader + 1.5 + test + + + com.github.tomakehurst + wiremock + 1.56 + + + org.mockito + mockito-all + 1.9.5 + test + + + org.slf4j + slf4j-log4j12 + 1.7.22 + test + + + org.slf4j + jul-to-slf4j + 1.7.21 + test + + + + + + install-alfresco + + + + maven-antrun-plugin + + + fetch-installer + generate-test-resources - add-test-source + run - - src/unit-test/java - + + Recreating database... + drop database if exists alfresco; create database alfresco + Downloading Alfresco installer... + + + Installing Alfresco... + + + + - - - - - maven-surefire-plugin - - false - - - usedefaultlisteners - false - - - listener - org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter - - - - ${project.build.testOutputDirectory}/testng.xml - - - - - - maven-antrun-plugin - - - default-cli + + + + + org.apache.ant + ant-jsch + 1.8.2 + + + postgresql + postgresql + 9.1-901-1.jdbc4 + + + + + maven-dependency-plugin + + + fetch-amps + process-test-resources + + copy + - - Stopping Alfresco... - - - - + + + org.alfresco + alfresco-rm-share + ${project.version} + amp + amp + + + org.alfresco + alfresco-rm-server + ${project.version} + amp + amp + + + ${project.build.directory}/amps + true - - - - - - - - org.alfresco - webdrone - 2.6.1 - - - org.seleniumhq.selenium - selenium-java - ${selenium.version} - - - org.seleniumhq.selenium - selenium-server - ${selenium.version} - test - - - org.springframework - spring-beans - ${spring.version} - - - org.springframework - spring-context - ${spring.version} - - - org.springframework - spring-tx - ${spring.version} - test - - - org.springframework - spring-test - ${spring.version} - test - - - org.testng - testng - 6.8.8 - test - - - org.uncommons - reportng - 1.1.4 - test - - - ru.yandex.qatools.htmlelements - htmlelements-all - 1.12 - - - ru.yandex.qatools.properties - properties-loader - 1.5 - test - - - - - install-alfresco - - - - - maven-antrun-plugin - - - fetch-installer - generate-test-resources - - run - - - - Recreating database... - drop database if exists alfresco; create database alfresco - Downloading Alfresco installer... - - - Installing Alfresco... - - - - - - - - - - org.apache.ant - ant-jsch - 1.8.2 - - - postgresql - postgresql - 9.1-901-1.jdbc4 - - - - - maven-dependency-plugin - - - fetch-amps - process-test-resources - - copy - - - - - org.alfresco - alfresco-rm-share - ${project.version} - amp - amp - - - org.alfresco - alfresco-rm-server - ${project.version} - amp - amp - - - ${project.build.directory}/amps - true - - - - - - org.alfresco.maven.plugin - alfresco-maven-plugin - true - - - install-server-amp - - install - - process-test-resources - - true - ${project.build.directory}/amps/alfresco-rm-server-${project.version}-amp.amp - ${project.build.directory}/alf-installation/tomcat/webapps/alfresco.war - amp - - - - install-share-amp - - install - - process-test-resources - - true - ${project.build.directory}/amps/alfresco-rm-share-${project.version}-amp.amp - ${project.build.directory}/alf-installation/tomcat/webapps/share.war - amp - - - - - - - - - run-alfresco - - - - - org.jacoco - jacoco-maven-plugin - 0.6.3.201306030806 - - - prepare-jacoco - - prepare-agent - - - + + + + + org.alfresco.maven.plugin + alfresco-maven-plugin + true + + + install-server-amp + + install + + process-test-resources - - org.alfresco.* - + true + ${project.build.directory}/amps/alfresco-rm-server-${project.version}-amp.amp + ${project.build.directory}/alf-installation/tomcat/webapps/alfresco.war - - - - maven-antrun-plugin - - - start-alfresco - process-test-classes - - run - - - - Starting Alfresco... - - - - - - - - - - stop-alfresco - post-integration-test - - run - - - - Stopping Alfresco... - - - - - - - - - - - - - \ No newline at end of file + + + install-share-amp + + install + + process-test-resources + + true + ${project.build.directory}/amps/alfresco-rm-share-${project.version}-amp.amp + ${project.build.directory}/alf-installation/tomcat/webapps/share.war + + + + + + + + + run-alfresco + + + + org.jacoco + jacoco-maven-plugin + 0.7.5.201505241946 + + + prepare-jacoco + + prepare-agent + + + + + + org.alfresco.* + + + + + maven-antrun-plugin + + + start-alfresco + process-test-classes + + run + + + + Starting Alfresco... + + + + + + + + + + stop-alfresco + post-integration-test + + run + + + + Stopping Alfresco... + + + + + + + + + + + + +