From cd834d48ab0a2383827cedc7bc140b508ca59f42 Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Mon, 19 May 2014 08:48:27 +0000 Subject: [PATCH 01/15] Added JIRA-Ticket Info git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.1@70625 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org_alfresco_module_rm/script/slingshot/RMSearchGet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/slingshot/RMSearchGet.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/slingshot/RMSearchGet.java index eb46eb54fb..58272a84e0 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/slingshot/RMSearchGet.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/slingshot/RMSearchGet.java @@ -208,7 +208,7 @@ public class RMSearchGet extends DeclarativeWebScript List items = new ArrayList(results.size()); for (NodeRef nodeRef : results) { - // FIXME: This is a workaround for DOD Recert + // FIXME: See RM-478 // TC 3-3 Create User Groups try { From 4938d4f2392347c9e697b9b5576156aa12da062c Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Tue, 20 May 2014 13:08:44 +0000 Subject: [PATCH 02/15] Fixed RM 2.1 to get it working with Alfresco 4.2.2 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.1@71381 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- gradle.properties | 2 +- .../alfresco/module/org_alfresco_module_rm/rm-model-context.xml | 2 +- .../module/org_alfresco_module_rm/rm-ui-evaluators-context.xml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 429e591382..2ce9c67304 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ alfrescoEnterpriseMavenPwd= # set to org.alfresco.enterprise when enterprise version required alfrescoGroupId=org.alfresco -alfrescoBaseVersion=4.2.0 +alfrescoBaseVersion=4.2.2-SNAPSHOT # indicates whether this is a local build or not localBuild=true 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 db13fd4aec..c2f7b6c779 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 @@ -4,7 +4,7 @@ - + alfresco/module/org_alfresco_module_rm/model/recordsModel.xml diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml index e7cf19c2dd..a62f5a1b93 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml @@ -10,6 +10,7 @@ + Date: Fri, 28 Aug 2015 06:09:45 +0000 Subject: [PATCH 03/15] RM-2391 - also check for the access audit capability on each node from the report git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.2@111064 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../rm-service-context.xml | 1 + .../RecordsManagementAuditServiceImpl.java | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml index 6de002f343..016ae2361a 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml @@ -917,6 +917,7 @@ + cm:lastThumbnailModification diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java index b0b406217c..6c2e81679f 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java @@ -40,6 +40,7 @@ import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction; import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionService; import org.alfresco.module.org_alfresco_module_rm.audit.event.AuditEvent; +import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService; import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService; import org.alfresco.repo.audit.AuditComponent; import org.alfresco.repo.audit.model.AuditApplication; @@ -62,6 +63,7 @@ import org.alfresco.service.cmr.repository.ContentWriter; import org.alfresco.service.cmr.repository.MLText; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.security.AccessStatus; import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.QName; import org.alfresco.service.transaction.TransactionService; @@ -98,6 +100,8 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean /** Logger */ private static Log logger = LogFactory.getLog(RecordsManagementAuditServiceImpl.class); + private static final String ACCESS_AUDIT_CAPABILITY = "AccessAudit"; + private static final String KEY_RM_AUDIT_NODE_RECORDS = "RMAUditNodeRecords"; protected static final String RM_AUDIT_EVENT_LOGIN_SUCCESS = "Login.Success"; @@ -179,6 +183,7 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean private RecordsManagementActionService rmActionService; private FilePlanService filePlanService; private NamespaceService namespaceService; + protected CapabilityService capabilityService; private boolean shutdown = false; @@ -270,6 +275,17 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean { this.namespaceService = namespaceService; } + + /** + * @param capabilityService capability service + */ + public void setCapabilityService(CapabilityService capabilityService) + { + this.capabilityService = capabilityService; + } + + + /** * @param ignoredAuditProperties @@ -904,6 +920,13 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean // Skip it return true; } + + if( nodeRef != null && + !AccessStatus.ALLOWED.equals( + capabilityService.getCapabilityAccessState(nodeRef, ACCESS_AUDIT_CAPABILITY))) + { + return true; + } // TODO: Refactor this to use the builder pattern RecordsManagementAuditEntry entry = new RecordsManagementAuditEntry( From d422ee361a89556dd06dc74df07b5254ab4a6e07 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Tue, 8 Sep 2015 15:14:05 +0000 Subject: [PATCH 04/15] Update Alfresco to 4.2.2.24. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.1@111641 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 2ce9c67304..217d5d6f31 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ alfrescoEnterpriseMavenPwd= # set to org.alfresco.enterprise when enterprise version required alfrescoGroupId=org.alfresco -alfrescoBaseVersion=4.2.2-SNAPSHOT +alfrescoBaseVersion=4.2.2.24 # indicates whether this is a local build or not localBuild=true From 0ea934401677a458acf88196e402d4a9f9cd335c Mon Sep 17 00:00:00 2001 From: Tom Page Date: Wed, 9 Sep 2015 10:30:08 +0000 Subject: [PATCH 05/15] Merged BRANCHES/V2.1 to BRANCHES/V2.2: 111636: Merged BRANCHES/V2.1.0.x to BRANCHES/V2.1: 68559: Change base Alfresco version from 4.2.0-RC4 to 4.2.0 68568: Merge from HEAD to BRANCHES/V2.1.0.x 68569: Update module version to 2.1.0.1 76475: Merge HEAD to BRANCHES/V2.1.0.x: 76597: Merge HEAD to BRANCHES/V2.1.0.x: 74932: RM-1461: CLONE - RM slower then standard repo/sites when rendering document details when folder contains 15k documents 76598: Merged HEAD to BRANCHES/V2.1.0.x: 75102: RM Performance testing 76599: Update module version to 2.1.0.2 76601: Merged HEAD to BRANCHES/V2.1.0.x: 75186: RM Performance Improvements 76673: Root container cache to improve unfiled record browse performance * relates to RM-1594 and RM-1595 76850: RM performance enhancements * serach improvements * in-place record browse improvements * saved search via file plan browse improvements 76851: Additional unit test to check extended security with cache is working as expected. 76852: Rollback checked in config 77709: RM-1630: Error on manage references page * regression caused by performance improvements 84337: Update version to 2.1.0.3 84421: Transaction level cahcing of declarative capability evaluation 84676: Fix build 84677: Prevent unnessary repeated creation of QName 84678: Improvements to extended dynamic authorities * requiredFor set * direct access to extended permission information, not via service 84679: Correct requiredFor value 88087: RM-1661 (Performance on setting permissions at a high category level) 88092: RM-1661 (Performance on setting permissions at a high category level) * Fixed failing unit tests 88144: RM-1661 (Performance on setting permissions at a high category level) 88182: RM-1724 (Inheritance is not off for root categories, unfiled records, holds and transfers) 88192: RM-1661 (Performance on setting permissions at a high category level) * Added unit tests 88193: RM-1661 (Performance on setting permissions at a high category level) * Fixed failing unit tests 88358: RM-1661 (Performance on setting permissions at a high category level) * Added unit tests 88685: RM-1742 (Locally Set Permissions for moved Record duplicate parent folder Locally Set Permissions) 88686: RM-1741 (Moved root category doesn't inherit permissions) 88687: RM-1741 (Moved root category doesn't inherit permissions) * Unit test added 88688: RM-1742 (Locally Set Permissions for moved Record duplicate parent folder Locally Set Permissions) * Unit test added 88691: RM-1745 (RM Admin role can only be added with read permission on the manage permission page) 88772: RM-1741 (Moved root category doesn't inherit permissions) 88860: RM-1661 (Performance on setting permissions at a high category level) 88864: RM-1661 (Performance on setting permissions at a high category level) * Fixed failing unit tests 88959: RM-1746 (Moved record/category always have the inheritance on) 88960: RM-1661 (Performance on setting permissions at a high category level) * Fixed failing unit tests 88961: RM-1661 (Performance on setting permissions at a high category level) * Fixed failing unit tests 88962: RM-1661 (Performance on setting permissions at a high category level) * Fixed failing unit tests 91745: RM-1785 (RM: HF 2.1.0.3-33 causes permissions to not be displayed in Share everywhere else in the repo) 91838: Update version to 2.1.0.4 111641: Update Alfresco to 4.2.2.24. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.2@111776 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../extended-repository-context.xml | 57 +++++++++++++++++++ .../org_alfresco_module_rm/rm-job-context.xml | 2 + .../rm-service-context.xml | 1 + 3 files changed, 60 insertions(+) diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/extended-repository-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/extended-repository-context.xml index 2b10615154..989dfc2be0 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/extended-repository-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/extended-repository-context.xml @@ -3,12 +3,38 @@ +<<<<<<< .working +======= + + +>>>>>>> .merge-right.r111658 @@ -42,7 +68,12 @@ +<<<<<<< .working +======= + + +>>>>>>> .merge-right.r111658 @@ -67,11 +98,19 @@ +<<<<<<< .working +======= + + + + + +>>>>>>> .merge-right.r111658 @@ -198,6 +237,7 @@ ${rm.autocompletesuggestion.maxsuggestions.node} +<<<<<<< .working @@ -208,6 +248,9 @@ +======= + +>>>>>>> .merge-right.r111658 @@ -235,6 +278,7 @@ false +<<<<<<< .working @@ -244,6 +288,19 @@ +======= + + + + + + ${rm.rule.runasrmadmin} + + + + + +>>>>>>> .merge-right.r111658 diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-job-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-job-context.xml index 1a28ac1156..c975a79827 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-job-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-job-context.xml @@ -94,6 +94,8 @@ + + ${rm.dispositionlifecycletrigger.cronexpression} diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml index 016ae2361a..72735a2f1c 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml @@ -387,6 +387,7 @@ + From 7a2598dfc76746642e6f9c992d15dfb0a58e30ba Mon Sep 17 00:00:00 2001 From: Tom Page Date: Wed, 9 Sep 2015 13:19:06 +0000 Subject: [PATCH 06/15] Fixing unresolved merge conflicts. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.2@111786 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../extended-repository-context.xml | 57 ------------------- .../rm-service-context.xml | 1 - .../rm-ui-evaluators-context.xml | 1 + 3 files changed, 1 insertion(+), 58 deletions(-) diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/extended-repository-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/extended-repository-context.xml index 989dfc2be0..2b10615154 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/extended-repository-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/extended-repository-context.xml @@ -3,38 +3,12 @@ -<<<<<<< .working -======= - - ->>>>>>> .merge-right.r111658 @@ -68,12 +42,7 @@ -<<<<<<< .working -======= - - ->>>>>>> .merge-right.r111658 @@ -98,19 +67,11 @@ -<<<<<<< .working -======= - - - - - ->>>>>>> .merge-right.r111658 @@ -237,7 +198,6 @@ ${rm.autocompletesuggestion.maxsuggestions.node} -<<<<<<< .working @@ -248,9 +208,6 @@ -======= - ->>>>>>> .merge-right.r111658 @@ -278,7 +235,6 @@ false -<<<<<<< .working @@ -288,19 +244,6 @@ -======= - - - - - - ${rm.rule.runasrmadmin} - - - - - ->>>>>>> .merge-right.r111658 diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml index 72735a2f1c..016ae2361a 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml @@ -387,7 +387,6 @@ - diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml index 5db8392b28..14b6209dc4 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml @@ -15,6 +15,7 @@ + From 1855987fe9c839245319cc816cc416b01a1c956c Mon Sep 17 00:00:00 2001 From: Tom Page Date: Wed, 9 Sep 2015 15:37:04 +0000 Subject: [PATCH 07/15] Merged BRANCHES/V2.2.1.x to V2.2: 103185: RM-2162: Records Management patch RMv22DODModelSeparationModulePatch taking too long with large amount of records git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.2@111793 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco-global.properties | 10 ++ .../model/recordsModel.xml | 67 +++++++++ .../patch/rm-patch-v22-context.xml | 8 +- .../dod5015/DOD5015Model.java | 2 + .../email/CustomEmailMappingServiceImpl.java | 10 +- .../patch/AbstractModulePatch.java | 12 +- .../patch/v22/RMv22DODCompliantSitePatch.java | 40 ++++-- .../RMv22DODModelSeparationModulePatch.java | 133 +++++++++++------- 8 files changed, 203 insertions(+), 79 deletions(-) diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/alfresco-global.properties b/rm-server/config/alfresco/module/org_alfresco_module_rm/alfresco-global.properties index 1270de1af6..c7dd143366 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/alfresco-global.properties +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/alfresco-global.properties @@ -52,3 +52,13 @@ rm.dispositionlifecycletrigger.cronexpression=0 0/5 * * * ? # Indicates whether mandatory properties are checked before completing a record # rm.completerecord.mandatorypropertiescheck.enabled=true + +# +# Indicates whether the existing file plan is converted to a standard file plan during +# upgrade to V2.2, otherwise it will be converted to a DoD compliant file plan. +# +# Note that when converted to a standard file plan that DoD related record meta-data remains +# on the individual records and will not be visible in the UI, but can be assessed via +# deprecated model properties in the rma namespace. +# +rm.patch.v22.convertToStandardFilePlan=false diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/model/recordsModel.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/model/recordsModel.xml index 981675198a..e4957c7b11 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/model/recordsModel.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/model/recordsModel.xml @@ -735,6 +735,73 @@ d:text true + + + + + + + d:date + false + + + d:text + false + + true + false + false + + + + d:text + false + + true + false + false + + + + d:text + false + + true + false + false + + + + d:text + false + + true + false + false + + + + d:date + false + + + d:text + false + + true + false + false + + + + d:text + false + + true + false + false + + diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/patch/rm-patch-v22-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/patch/rm-patch-v22-context.xml index a9f5b2c601..ebe66b66e7 100755 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/patch/rm-patch-v22-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/patch/rm-patch-v22-context.xml @@ -4,7 +4,6 @@ - @@ -32,9 +31,9 @@ - + + - + @@ -101,6 +101,6 @@ - + \ No newline at end of file diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/dod5015/DOD5015Model.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/dod5015/DOD5015Model.java index 539add123f..3fcc87ac46 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/dod5015/DOD5015Model.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/dod5015/DOD5015Model.java @@ -46,6 +46,8 @@ public interface DOD5015Model QName PROP_MEDIA_TYPE = QName.createQName(DOD_URI, "mediaType"); QName PROP_FORMAT = QName.createQName(DOD_URI, "format"); QName PROP_DATE_RECEIVED = QName.createQName(DOD_URI, "dateReceived"); + QName PROP_ADDRESS = QName.createQName(DOD_URI, "address"); + QName PROP_OTHER_ADDRESS = QName.createQName(DOD_URI, "otherAddress"); // Scanned Record QName ASPECT_SCANNED_RECORD = QName.createQName(DOD_URI, "scannedRecord"); diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/email/CustomEmailMappingServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/email/CustomEmailMappingServiceImpl.java index 54aaacea30..904e9e50c0 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/email/CustomEmailMappingServiceImpl.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/email/CustomEmailMappingServiceImpl.java @@ -72,11 +72,11 @@ public class CustomEmailMappingServiceImpl extends AbstractLifecycleBean impleme /** Default custom mappings (TODO move to spring config) */ private static final CustomMapping[] DEFAULT_MAPPINGS = { - new CustomMapping("Date", "rma:dateReceived"), - new CustomMapping("messageTo", "rma:address"), - new CustomMapping("messageFrom", "rma:originator"), - new CustomMapping("messageSent", "rma:publicationDate"), - new CustomMapping("messageCc", "rma:otherAddress") + new CustomMapping("Date", "dod:dateReceived"), + new CustomMapping("messageTo", "dod:address"), + new CustomMapping("messageFrom", "dod:originator"), + new CustomMapping("messageSent", "dod:publicationDate"), + new CustomMapping("messageCc", "dod:otherAddress") }; /** Extractor */ diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/AbstractModulePatch.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/AbstractModulePatch.java index 54f526acb3..c3bed75b30 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/AbstractModulePatch.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/AbstractModulePatch.java @@ -18,6 +18,8 @@ */ package org.alfresco.module.org_alfresco_module_rm.patch; +import java.util.concurrent.TimeUnit; + import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; import org.alfresco.service.transaction.TransactionService; import org.apache.commons.logging.Log; @@ -73,12 +75,12 @@ public abstract class AbstractModulePatch implements ModulePatch, BeanNameAware modulePatchExecuter.register(this); } - protected void setTxnReadOnly(boolean txnReadOnly) + public void setTxnReadOnly(boolean txnReadOnly) { this.txnReadOnly = txnReadOnly; } - protected void setTxnRequiresNew(boolean txnRequiresNew) + public void setTxnRequiresNew(boolean txnRequiresNew) { this.txnRequiresNew = txnRequiresNew; } @@ -229,15 +231,19 @@ public abstract class AbstractModulePatch implements ModulePatch, BeanNameAware ",target=" + targetSchema); } + long startTime = System.nanoTime(); + // do patch in transaction transactionService.getRetryingTransactionHelper().doInTransaction( new ApplyCallback(), txnReadOnly, txnRequiresNew); + + long elapsedTime = System.nanoTime() - startTime; if (LOGGER.isInfoEnabled()) { - LOGGER.info(" ... module patch applied"); + LOGGER.info(" ... module patch applied in " + TimeUnit.NANOSECONDS.toMillis(elapsedTime) + "ms"); } } diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/v22/RMv22DODCompliantSitePatch.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/v22/RMv22DODCompliantSitePatch.java index e034b626ef..6d5cd5d907 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/v22/RMv22DODCompliantSitePatch.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/v22/RMv22DODCompliantSitePatch.java @@ -36,6 +36,9 @@ public class RMv22DODCompliantSitePatch extends AbstractModulePatch { /** QName DAO */ private QNameDAO qnameDAO; + + /** indicates whether we convert to a standard file plan or not */ + private boolean convertToStandardFilePlan = false; /** * @param qnameDAO QName DAO @@ -45,24 +48,35 @@ public class RMv22DODCompliantSitePatch extends AbstractModulePatch this.qnameDAO = qnameDAO; } + /** + * @param convertToStandardFilePlan convert to standard file if true, false otherwise + */ + public void setConvertToStandardFilePlan(boolean convertToStandardFilePlan) + { + this.convertToStandardFilePlan = convertToStandardFilePlan; + } + /** * @see org.alfresco.module.org_alfresco_module_rm.patch.AbstractModulePatch#applyInternal() */ @Override public void applyInternal() { - // ensure all existing sites are of the correct type - if (qnameDAO.getQName(RecordsManagementModel.TYPE_RM_SITE) != null && - qnameDAO.getQName(DOD5015Model.TYPE_DOD_5015_SITE) == null) - { - qnameDAO.updateQName(RecordsManagementModel.TYPE_RM_SITE, DOD5015Model.TYPE_DOD_5015_SITE); - } - - // ensure all the existing file plans are of the correct type - if (qnameDAO.getQName(RecordsManagementModel.TYPE_FILE_PLAN) != null && - qnameDAO.getQName(DOD5015Model.TYPE_DOD_5015_FILE_PLAN) == null) - { - qnameDAO.updateQName(RecordsManagementModel.TYPE_FILE_PLAN, DOD5015Model.TYPE_DOD_5015_FILE_PLAN); - } + if (!convertToStandardFilePlan) + { + // ensure all existing sites are of the correct type + if (qnameDAO.getQName(RecordsManagementModel.TYPE_RM_SITE) != null && + qnameDAO.getQName(DOD5015Model.TYPE_DOD_5015_SITE) == null) + { + qnameDAO.updateQName(RecordsManagementModel.TYPE_RM_SITE, DOD5015Model.TYPE_DOD_5015_SITE); + } + + // ensure all the existing file plans are of the correct type + if (qnameDAO.getQName(RecordsManagementModel.TYPE_FILE_PLAN) != null && + qnameDAO.getQName(DOD5015Model.TYPE_DOD_5015_FILE_PLAN) == null) + { + qnameDAO.updateQName(RecordsManagementModel.TYPE_FILE_PLAN, DOD5015Model.TYPE_DOD_5015_FILE_PLAN); + } + } } } diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/v22/RMv22DODModelSeparationModulePatch.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/v22/RMv22DODModelSeparationModulePatch.java index 5df14828f2..b2b0296f37 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/v22/RMv22DODModelSeparationModulePatch.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/v22/RMv22DODModelSeparationModulePatch.java @@ -20,7 +20,6 @@ package org.alfresco.module.org_alfresco_module_rm.patch.v22; import java.io.Serializable; import java.util.Collections; -import java.util.List; import java.util.Map; import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model; @@ -28,7 +27,8 @@ import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; import org.alfresco.module.org_alfresco_module_rm.patch.AbstractModulePatch; import org.alfresco.repo.domain.node.NodeDAO; import org.alfresco.repo.domain.patch.PatchDAO; -import org.alfresco.repo.domain.qname.QNameDAO; +import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; +import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; import org.alfresco.util.Pair; @@ -43,9 +43,9 @@ public class RMv22DODModelSeparationModulePatch extends AbstractModulePatch { /** query batch size */ private static final long BATCH_SIZE = 100000L; - - /** QName DAO */ - private QNameDAO qnameDAO; + + /** indicates whether we convert to a standard file plan or not */ + private boolean convertToStandardFilePlan = false; /** Patch DAO */ private PatchDAO patchDAO; @@ -61,16 +61,18 @@ public class RMv22DODModelSeparationModulePatch extends AbstractModulePatch DOD5015Model.PROP_PUBLICATION_DATE, DOD5015Model.PROP_MEDIA_TYPE, DOD5015Model.PROP_FORMAT, - DOD5015Model.PROP_DATE_RECEIVED + DOD5015Model.PROP_DATE_RECEIVED, + DOD5015Model.PROP_ADDRESS, + DOD5015Model.PROP_OTHER_ADDRESS }; - + /** - * @param qnameDAO QName DAO + * @param convertToStandardFilePlan convert to standard file if true, false otherwise */ - public void setQnameDAO(QNameDAO qnameDAO) + public void setConvertToStandardFilePlan(boolean convertToStandardFilePlan) { - this.qnameDAO = qnameDAO; - } + this.convertToStandardFilePlan = convertToStandardFilePlan; + } /** * @param patchDAO patch DAO @@ -94,50 +96,73 @@ public class RMv22DODModelSeparationModulePatch extends AbstractModulePatch @Override public void applyInternal() { - Long maxNodeId = patchDAO.getMaxAdmNodeID(); - long recordCount = patchDAO.getCountNodesWithAspects(Collections.singleton(ASPECT_RECORD)); - if (LOGGER.isDebugEnabled()) - { - LOGGER.debug(" ... updating " + recordCount + " records"); - } + if (!convertToStandardFilePlan) + { + Long maxNodeId = patchDAO.getMaxAdmNodeID(); + long recordCount = patchDAO.getCountNodesWithAspects(Collections.singleton(ASPECT_RECORD)); + if (LOGGER.isDebugEnabled()) + { + LOGGER.debug(" ... updating " + recordCount + " records in batches of " + BATCH_SIZE); + } + + // apply the DOD record aspect to all exiting records + int completed = 0; + for (Long i = 0L; i < maxNodeId; i+=BATCH_SIZE) + { + final Long finali = i; + Integer batchCount = transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback() + { + int batchCount = 0; + + public Integer execute() throws Throwable + { + nodeDAO.getNodesWithAspects(Collections.singleton(ASPECT_RECORD), finali, finali + BATCH_SIZE, new NodeDAO.NodeRefQueryCallback() + { + public boolean handle(Pair nodePair) + { + // get the records properties + Map properties = nodeDAO.getNodeProperties(nodePair.getFirst()); + boolean changed = false; - // apply the DOD record aspect to all exiting records - int completed = 0; - Pair recordAspect = qnameDAO.getQName(ASPECT_RECORD); - if (recordAspect != null) - { - for (Long i = 0L; i < maxNodeId; i+=BATCH_SIZE) - { - List nodeIds = patchDAO.getNodesByAspectQNameId(recordAspect.getFirst(), i, i + BATCH_SIZE); - for (Long nodeId : nodeIds) - { - // get the records properties - Map properties = nodeDAO.getNodeProperties(nodeId); - - for (QName qname : qnames) - { - // if the record has any of the moved properties - QName origional = QName.createQName(RecordsManagementModel.RM_URI, qname.getLocalName()); - if (properties.containsKey(origional)) - { - // move the property value - Serializable value = properties.get(origional); - properties.put(qname, value); - properties.remove(origional); - } - } - - // set properties and add aspect - nodeDAO.setNodeProperties(nodeId, properties); - nodeDAO.addNodeAspects(nodeId, Collections.singleton(DOD5015Model.ASPECT_DOD_5015_RECORD)); - } + for (QName qname : qnames) + { + // if the record has any of the moved properties + QName origional = QName.createQName(RecordsManagementModel.RM_URI, qname.getLocalName()); + if (properties.containsKey(origional)) + { + // move the property value + Serializable value = properties.get(origional); + properties.put(qname, value); + properties.remove(origional); + changed = true; + } + } - completed += completed + nodeIds.size(); - if (LOGGER.isDebugEnabled()) - { - LOGGER.debug(" ... completed " + completed + " of " + recordCount); - } - } - } + // set properties and add aspect + if (changed) + { + nodeDAO.setNodeProperties(nodePair.getFirst(), properties); + } + nodeDAO.addNodeAspects(nodePair.getFirst(), Collections.singleton(DOD5015Model.ASPECT_DOD_5015_RECORD)); + batchCount ++; + + return true; + } + }); + + return batchCount; + } + } , false, true); + + if (batchCount != 0) + { + completed = completed + batchCount; + if (LOGGER.isDebugEnabled()) + { + LOGGER.debug(" ... completed " + completed + " of " + recordCount); + } + } + } + } } } From 7bacbf5ee8ab37b5c4f5ed3466f7673a7f79bd63 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Tue, 22 Sep 2015 07:04:30 +0000 Subject: [PATCH 08/15] Update module version to 2.1.2 after merge of hot fix branch. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.1@112549 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/module/org_alfresco_module_rm/module.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/module.properties b/rm-server/config/alfresco/module/org_alfresco_module_rm/module.properties index 289d2b1f83..90c598dbb0 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/module.properties +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/module.properties @@ -6,6 +6,6 @@ module.aliases=org_alfresco_module_dod5015 module.title=Records Management module.description=Alfresco Record Management Extension -module.version=2.1.0.4 +module.version=2.1.2 module.repo.version.min=4.2 \ No newline at end of file From f6cac0c78c7678e8e4084f73801a70ce412e8ada Mon Sep 17 00:00:00 2001 From: Tom Page Date: Tue, 22 Sep 2015 07:09:42 +0000 Subject: [PATCH 09/15] Merged BRANCHES/V2.1 to BRANCHES/V2.2: 112549: Update module version to 2.1.2 after merge of hot fix branch. Result of merge is to update module version to 2.2.2. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.2@112550 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/module/org_alfresco_module_rm/module.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/module.properties b/rm-server/config/alfresco/module/org_alfresco_module_rm/module.properties index ece629124a..3b2812d6e9 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/module.properties +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/module.properties @@ -6,6 +6,6 @@ module.aliases=org_alfresco_module_dod5015 module.title=Records Management module.description=Alfresco Record Management Extension -module.version=2.2.1 +module.version=2.2.2 module.repo.version.min=4.2 \ No newline at end of file From 01b719872e6995ce0300a8a769d20fb62b8d51b0 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Tue, 22 Sep 2015 14:09:30 +0000 Subject: [PATCH 10/15] Merged BRANCHES/V2.2 to BRANCHES/V2.3: 97445: (RECORD ONLY) RM-1932 Changed the notification frequency based on 2.3 code changes git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@112606 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 From 3cdeced07c81ff52d6ecc48b6f813d3b4e0919cf Mon Sep 17 00:00:00 2001 From: Tom Page Date: Tue, 22 Sep 2015 15:29:08 +0000 Subject: [PATCH 11/15] Merged BRANCHES/V2.2 to BRANCHES/V2.3: 99084: (RECORD ONLY) Merged V2.3 to V2.2 : 93334: RM-1822 (Non-system-admin user not allowed to read inheritable permissions) 99085: (RECORD ONLY) Merged V2.3 to V2.2: 92881: RM-1799 (Root category is not displayed for the non-rm-admin user who created it) 99086: (RECORD ONLY) Merged V2.3 to V2.2: 96580: RM-1904 (SubCategory moved to root have inheritance on) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@112629 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 From e8fb9500a8b7507680d98cbd56d4d37da2b591e2 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Wed, 23 Sep 2015 08:33:16 +0000 Subject: [PATCH 12/15] Merged BRANCHES/V2.2 to BRANCHES/V2.3: 99087: Upgrade Alfresco version to 4.2.4.6 99088: RM-2026: Unable to complete historical records when mandatory meta-data missing 99089: Merged HEAD to V2.2: 89735: RM-1677- No items error for RM Admin if record was declared from moderated/private site git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@112663 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco-global.properties | 2 +- .../rm-action-context.xml | 3 +- .../action/impl/DeclareRecordAction.java | 14 +- .../jscript/app/JSONConversionComponent.java | 17 ++ .../dod/RM1194ExcludeDoDRecordTypesTest.java | 2 +- .../record/CompleteRecordTest.java | 233 ++++++++++++++++++ .../integration/record/RecordTestSuite.java | 1 + .../legacy/service/RecordServiceImplTest.java | 2 +- rm-server/test/resources/test-context.xml | 9 +- rm-server/test/resources/test-model.xml | 9 + 10 files changed, 286 insertions(+), 6 deletions(-) create mode 100644 rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/record/CompleteRecordTest.java diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/alfresco-global.properties b/rm-server/config/alfresco/module/org_alfresco_module_rm/alfresco-global.properties index d28ff30e4f..40134471ca 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/alfresco-global.properties +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/alfresco-global.properties @@ -58,7 +58,7 @@ rm.record.contributors.group.enabled=false # record contributors group, default value 'RECORD_CONTRIBUTORS' rm.record.contributors.group.name=RECORD_CONTRIBUTORS -## Indicates whether mandatory properties are checked before completing a record +# Indicates whether mandatory properties are checked before completing a record # rm.completerecord.mandatorypropertiescheck.enabled=true diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-action-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-action-context.xml index 8aeaa34a0a..f5e8590fde 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-action-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-action-context.xml @@ -265,7 +265,7 @@ - + @@ -384,6 +384,7 @@ + diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/DeclareRecordAction.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/DeclareRecordAction.java index 1d946695fb..50d51fd4f3 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/DeclareRecordAction.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/DeclareRecordAction.java @@ -54,6 +54,17 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase /** Logger */ private static Log logger = LogFactory.getLog(DeclareRecordAction.class); + + /** check mandatory properties */ + private boolean checkMandatoryPropertiesEnabled = true; + + /** + * @param checkMandatoryPropertiesEnabled true if check mandatory properties is enabled, false otherwise + */ + public void setCheckMandatoryPropertiesEnabled(boolean checkMandatoryPropertiesEnabled) + { + this.checkMandatoryPropertiesEnabled = checkMandatoryPropertiesEnabled; + } /** * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef) @@ -69,7 +80,8 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase { List missingProperties = new ArrayList(5); // Aspect not already defined - check mandatory properties then add - if (mandatoryPropertiesSet(actionedUponNodeRef, missingProperties)) + if (!checkMandatoryPropertiesEnabled || + mandatoryPropertiesSet(actionedUponNodeRef, missingProperties)) { getRecordService().disablePropertyEditableCheck(); try diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java index 931752d6ef..33ee47b069 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java @@ -347,6 +347,23 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS rootJSONObject.put("originatingLocationPath", originatingLocationPath.toString()); } } + + /** + * Helper method to get the display path. + * + * @param nodeRef node reference + * @return String display path + */ + private String getDisplayPath(final NodeRef nodeRef) + { + return AuthenticationUtil.runAs(new RunAsWork() + { + public String doWork() throws Exception + { + return PathUtil.getDisplayPath(nodeService.getPath(nodeRef), true); + } + }, AuthenticationUtil.getAdminUserName()); + } /** * Helper method to get the display path. diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/dod/RM1194ExcludeDoDRecordTypesTest.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/dod/RM1194ExcludeDoDRecordTypesTest.java index 5019fc9114..f44d4bb753 100755 --- a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/dod/RM1194ExcludeDoDRecordTypesTest.java +++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/dod/RM1194ExcludeDoDRecordTypesTest.java @@ -108,7 +108,7 @@ public class RM1194ExcludeDoDRecordTypesTest extends BaseRMTestCase implements D assertNotNull(record); Set aspects = recordService.getRecordMetadataAspects(record); assertNotNull(aspects); - assertEquals(1, aspects.size()); + assertEquals(2, aspects.size()); } }); } diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/record/CompleteRecordTest.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/record/CompleteRecordTest.java new file mode 100644 index 0000000000..c86a12e277 --- /dev/null +++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/record/CompleteRecordTest.java @@ -0,0 +1,233 @@ +/* + * Copyright (C) 2005-2014 Alfresco Software Limited. + * + * This file is part of Alfresco + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ +package org.alfresco.module.org_alfresco_module_rm.test.integration.record; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionResult; +import org.alfresco.module.org_alfresco_module_rm.action.impl.DeclareRecordAction; +import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.namespace.QName; + +/** + * Complete record tests. + * + * @author Roy Wetherall + * @since 2.2.1 + */ +public class CompleteRecordTest extends BaseRMTestCase +{ + private static final QName ASPECT_TEST = QName.createQName("http://www.alfresco.org/model/rmtest/1.0", "recordMetaDataWithProperty"); + private static final QName PROP_TEST = QName.createQName("http://www.alfresco.org/model/rmtest/1.0", "customMandatoryProperty"); + + /** complete record action */ + private DeclareRecordAction action; + + /** + * @see org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase#initServices() + */ + @Override + protected void initServices() + { + super.initServices(); + + // get the action + action = (DeclareRecordAction)applicationContext.getBean("declareRecord"); + } + + /** + * @see org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase#tearDownImpl() + */ + @Override + protected void tearDownImpl() + { + super.tearDownImpl(); + + // ensure action is returned to original state + action.setCheckMandatoryPropertiesEnabled(true); + } + + /** + * Given the the application is configured to check for mandatory values before complete + * And a filed record is missing mandatory values + * When I try to complete the record + * Then the missing properties parameter of the action will be populated + * And the record will not be complete + */ + public void testCheckForMandatoryValuesMissing() throws Exception + { + doBehaviourDrivenTest(new BehaviourDrivenTest() + { + private NodeRef record; + private RecordsManagementActionResult result; + + public void given() + { + // enable mandatory parameter check + action.setCheckMandatoryPropertiesEnabled(true); + + // create a record + record = utils.createRecord(rmFolder, "record.txt", "title"); + + // add the record aspect (that has a mandatory property) + nodeService.addAspect(record, ASPECT_TEST, null); + } + + public void when() + { + // complete record + result = rmActionService.executeRecordsManagementAction(record, "declareRecord"); + } + + public void then() + { + assertNotNull(result); + assertNotNull(result.getValue()); + assertFalse(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD)); + } + }); + } + + /** + * Given the the application is configured to check for mandatory values before complete + * And a filed record has all mandatory values + * When I try to complete the record + * Then the record is completed + */ + public void testCheckForMandatoryValuePresent() throws Exception + { + doBehaviourDrivenTest(new BehaviourDrivenTest() + { + private NodeRef record; + private RecordsManagementActionResult result; + + public void given() + { + // enable mandatory parameter check + action.setCheckMandatoryPropertiesEnabled(true); + + // create a record + record = utils.createRecord(rmFolder, "record.txt", "title"); + + // add the record aspect (that has a mandatory property) + Map properties = new HashMap(1); + properties.put(PROP_TEST, "something"); + nodeService.addAspect(record, ASPECT_TEST, properties); + } + + public void when() + { + // complete record + result = rmActionService.executeRecordsManagementAction(record, "declareRecord"); + } + + public void then() + { + assertNotNull(result); + assertNull(result.getValue()); + assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD)); + } + }); + } + + /** + * Given the the application is configured not to check for mandatory values before complete + * And a filed record is missing mandatory values + * When I try to complete the record + * Then the record is completed + */ + public void testDontCheckForMandatoryValuesMissing() throws Exception + { + doBehaviourDrivenTest(new BehaviourDrivenTest() + { + private NodeRef record; + private RecordsManagementActionResult result; + + public void given() + { + // disable mandatory parameter check + action.setCheckMandatoryPropertiesEnabled(false); + + // create a record + record = utils.createRecord(rmFolder, "record.txt", "title"); + + // add the record aspect (that has a mandatory property) + nodeService.addAspect(record, ASPECT_TEST, null); + } + + public void when() + { + // complete record + result = rmActionService.executeRecordsManagementAction(record, "declareRecord"); + } + + public void then() + { + assertNotNull(result); + assertNull(result.getValue()); + assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD)); + } + }); + } + + /** + * Given the the application is configured to not to check for mandatory values before complete + * And a filed record has all mandatory values + * When I try to complete the record + * Then the record is completed + */ + public void testDontCheckForMandatoryValuePresent() throws Exception + { + doBehaviourDrivenTest(new BehaviourDrivenTest() + { + private NodeRef record; + private RecordsManagementActionResult result; + + public void given() + { + // enable mandatory parameter check + action.setCheckMandatoryPropertiesEnabled(false); + + // create a record + record = utils.createRecord(rmFolder, "record.txt", "title"); + + // add the record aspect (that has a mandatory property) + Map properties = new HashMap(1); + properties.put(PROP_TEST, "something"); + nodeService.addAspect(record, ASPECT_TEST, properties); + } + + public void when() + { + // complete record + result = rmActionService.executeRecordsManagementAction(record, "declareRecord"); + } + + public void then() + { + assertNotNull(result); + assertNull(result.getValue()); + assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD)); + } + }); + } +} diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/record/RecordTestSuite.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/record/RecordTestSuite.java index d2b3b8e498..40d7495bd6 100644 --- a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/record/RecordTestSuite.java +++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/record/RecordTestSuite.java @@ -34,6 +34,7 @@ import org.junit.runners.Suite.SuiteClasses; RejectRecordTest.class, CreateRecordTest.class, MoveRecordTest.class, + CompleteRecordTest.class, HideInplaceRecordTest.class, MoveInplaceRecordTest.class, ViewRecordTest.class, diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/service/RecordServiceImplTest.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/service/RecordServiceImplTest.java index 600a54854d..1cf86bb235 100644 --- a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/service/RecordServiceImplTest.java +++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/service/RecordServiceImplTest.java @@ -93,7 +93,7 @@ public class RecordServiceImplTest extends BaseRMTestCase { Set aspects = recordService.getRecordMetadataAspects(filePlan); assertNotNull(aspects); - assertEquals(1, aspects.size()); + assertEquals(2, aspects.size()); assertTrue(aspects.containsAll(getAspectList())); return null; diff --git a/rm-server/test/resources/test-context.xml b/rm-server/test/resources/test-context.xml index f5e35faf58..e4d4131b90 100644 --- a/rm-server/test/resources/test-context.xml +++ b/rm-server/test/resources/test-context.xml @@ -217,7 +217,14 @@ - + + + + + + + + false diff --git a/rm-server/test/resources/test-model.xml b/rm-server/test/resources/test-model.xml index 2f7b137c3a..41869338d5 100644 --- a/rm-server/test/resources/test-model.xml +++ b/rm-server/test/resources/test-model.xml @@ -54,6 +54,15 @@ + + + + + d:text + true + + + From 307dd3293f5dc5326690afc7ff50e9cf35590dc4 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Wed, 23 Sep 2015 08:45:50 +0000 Subject: [PATCH 13/15] Fix merge - delete duplicate method. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@112665 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../jscript/app/JSONConversionComponent.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java index 33ee47b069..931752d6ef 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java @@ -347,23 +347,6 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS rootJSONObject.put("originatingLocationPath", originatingLocationPath.toString()); } } - - /** - * Helper method to get the display path. - * - * @param nodeRef node reference - * @return String display path - */ - private String getDisplayPath(final NodeRef nodeRef) - { - return AuthenticationUtil.runAs(new RunAsWork() - { - public String doWork() throws Exception - { - return PathUtil.getDisplayPath(nodeService.getPath(nodeRef), true); - } - }, AuthenticationUtil.getAdminUserName()); - } /** * Helper method to get the display path. From 109b623450a64ad0c44b29e18a1acebdce85f752 Mon Sep 17 00:00:00 2001 From: Ana Bozianu Date: Wed, 23 Sep 2015 12:19:12 +0000 Subject: [PATCH 14/15] MNT-14728 : CLONE for HF - RM: Not all files are found when searching for a keyword using advanced search. - partial workaround (the elements can be scrolled down but the total result number is still wrong) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@112691 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../capability/RMAfterInvocationProvider.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMAfterInvocationProvider.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMAfterInvocationProvider.java index 1b4d91b18c..437f1c4c08 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMAfterInvocationProvider.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMAfterInvocationProvider.java @@ -412,8 +412,29 @@ public class RMAfterInvocationProvider extends RMSecurityCommon return null; } + class RMFilteringResultSet extends FilteringResultSet + { + private long numberFound; + + public RMFilteringResultSet(ResultSet unfiltered, BitSet inclusionMask) + { + super(unfiltered, inclusionMask); + } + + @Override + public long getNumberFound() + { + return numberFound; + } + + private void setNumberFound(long numberFound) + { + this.numberFound = numberFound; + } + } + BitSet inclusionMask = new BitSet(returnedObject.length()); - FilteringResultSet filteringResultSet = new FilteringResultSet(returnedObject, inclusionMask); + RMFilteringResultSet filteringResultSet = new RMFilteringResultSet(returnedObject, inclusionMask); List supportedDefinitions = extractSupportedDefinitions(config); @@ -524,6 +545,9 @@ public class RMAfterInvocationProvider extends RMSecurityCommon break; } } + + filteringResultSet.setNumberFound(returnedObject.getNumberFound()); + return filteringResultSet; } From 85a91628cb860315255f92b2ad5f959f900e156f Mon Sep 17 00:00:00 2001 From: Tom Page Date: Wed, 23 Sep 2015 13:03:04 +0000 Subject: [PATCH 15/15] Merged BRANCHES/V2.2 to BRANCHES/V2.3: 98839: GERMAN: Updated bundle for RM 2.2.1 based on EN-rev98763 98840: SPANISH: Updated bundle for RM 2.2.1 based on EN-rev98763 98841: FRENCH: Updated bundle for RM 2.2.1 based on EN-rev98763 98842: ITALIAN: Updated bundle for RM 2.2.1 based on EN-rev98763 98843: JAPANESE: Updated bundle for RM 2.2.1 based on EN-rev98763 98844: DUTCH: Updated bundle for RM 2.2.1 based on EN-rev98763 98845: RUSSIAN: Updated bundle for RM 2.2.1 based on EN-rev98763 98846: BRAZILIAN PORTUGUESE: Updated bundle for RM 2.2.1 based on EN-rev98763 98847: SIMPLIFIED CHINESE: Updated bundle for RM 2.2.1 based on EN-rev98763 98848: BRAZILIAN PORTUGUESE: Updated file and remove of wrongly named file for RM 2.2.1 based on EN-rev98763 98849: ALL LANG: remove file that does not need to be localised git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@112694 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../messages/admin-service_es.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/messages/admin-service_es.properties b/rm-server/config/alfresco/module/org_alfresco_module_rm/messages/admin-service_es.properties index f8fa25e9f9..9c79eaf9e1 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/messages/admin-service_es.properties +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/messages/admin-service_es.properties @@ -8,9 +8,9 @@ rm.admin.custom-prop-exist=El modelo personalizado no contiene la propiedad ''{0 rm.admin.unknown-aspect=Aspecto desconocido ''{0}''. rm.admin.constraint-exists=La restricci\u00f3n ''{0}'' ya existe. rm.admin.contraint-cannot-find=No se puede encontrar la definici\u00f3n para la restricci\u00f3n ''{0}''. -rm.admin.unexpected_type_constraint=Tipo ineseperado ''{0}'' para la restricci\u00f3n ''{1}''. The expected is ''{2}''. +rm.admin.unexpected_type_constraint=Tipo inesperado ''{0}'' para la restricci\u00f3n ''{1}''. Lo esperado es ''{2}''. rm.admin.custom-model-not-found=No se puede encontrar el modelo personalizado ''{0}''. -rm.admin.custom-model-no-content=El modelo personalizado no t (nodeRef={0}) +rm.admin.custom-model-no-content=El modelo personalizado no tiene contenido (nodeRef={0}) rm.admin.error-write-custom-model=Error al escribir contenido de modelo personalizado. (nodeRef={0}) rm.admin.error-client-id=Error al generar el identificador del cliente porque ya est\u00e1 en uso. (clientid={0}) rm.admin.error-split-id=No se puede separar el identificador ''{0}'', porque el separador ''{1}'' no est\u00e1 presente. \ No newline at end of file