From d3b91c9296c098678754fd4ed270f2717eb76c49 Mon Sep 17 00:00:00 2001 From: rodicasutu Date: Mon, 18 May 2020 18:33:39 +0300 Subject: [PATCH 01/59] updates according to https://github.com/Alfresco/rest-api-explorer/pull/78/files --- .../src/main/webapp/index.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rm-community/rm-community-rest-api-explorer/src/main/webapp/index.html b/rm-community/rm-community-rest-api-explorer/src/main/webapp/index.html index 0a66c86a80..0162e8338f 100644 --- a/rm-community/rm-community-rest-api-explorer/src/main/webapp/index.html +++ b/rm-community/rm-community-rest-api-explorer/src/main/webapp/index.html @@ -37,11 +37,16 @@ - - + + + + + + - + + From 7af9f4a293a8782d2a62df06b3f83263ea30969a Mon Sep 17 00:00:00 2001 From: rodicasutu Date: Tue, 19 May 2020 08:52:15 +0300 Subject: [PATCH 02/59] fix enterprise rest api test failure --- .../model/fileplancomponents/FilePlanComponentFields.java | 1 + .../model/recordcategory/RecordCategoryChildProperties.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java index 074604353f..fec6c5695f 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java @@ -58,6 +58,7 @@ public class FilePlanComponentFields public static final String PROPERTIES_RECORD_SEARCH_DISPOSITION_ACTION_NAME = "rma:recordSearchDispositionActionName"; public static final String PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS_ELIGIBLE = "rma:recordSearchDispositionEventsEligible"; public static final String PROPERTIES_RECORD_SEARCH_DISPOSITION_INSTRUCTIONS = "rma:recordSearchDispositionInstructions"; + public static final String PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS = "rma:recordSearchDispositionEvents"; public static final String PROPERTIES_DECLASSIFICATION_REVIEW_COMPLETED_BY = "rma:declassificationReviewCompletedBy"; public static final String PROPERTIES_DECLASSIFICATION_REVIEW_COMPLETED_AT = "rma:declassificationReviewCompletedAt"; diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/recordcategory/RecordCategoryChildProperties.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/recordcategory/RecordCategoryChildProperties.java index 1e83caecf9..64432087b0 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/recordcategory/RecordCategoryChildProperties.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/recordcategory/RecordCategoryChildProperties.java @@ -32,6 +32,7 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_IS_CLOSED; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_LOCATION; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_OWNER; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_HAS_DISPOSITION_SCHEDULE; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_PERIOD_EXPRESSION; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_AUTHORITY; @@ -132,6 +133,10 @@ public class RecordCategoryChildProperties extends TestModel @JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_INSTRUCTIONS) private String recordSearchDispositionInstructions; + @JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS) + private Boolean recordSearchDispositionEvents; + @JsonProperty (PROPERTIES_OWNER) private Owner owner; + } From 80635e41e4b088ea4b64d5c11279d7575b547960 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Tue, 19 May 2020 10:03:06 +0300 Subject: [PATCH 03/59] Fix gs-api-explorer (#1135) * updates according to https://github.com/Alfresco/rest-api-explorer/pull/78/files * fix enterprise rest api test failure --- .../fileplancomponents/FilePlanComponentFields.java | 1 + .../recordcategory/RecordCategoryChildProperties.java | 5 +++++ .../src/main/webapp/index.html | 11 ++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java index 074604353f..fec6c5695f 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java @@ -58,6 +58,7 @@ public class FilePlanComponentFields public static final String PROPERTIES_RECORD_SEARCH_DISPOSITION_ACTION_NAME = "rma:recordSearchDispositionActionName"; public static final String PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS_ELIGIBLE = "rma:recordSearchDispositionEventsEligible"; public static final String PROPERTIES_RECORD_SEARCH_DISPOSITION_INSTRUCTIONS = "rma:recordSearchDispositionInstructions"; + public static final String PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS = "rma:recordSearchDispositionEvents"; public static final String PROPERTIES_DECLASSIFICATION_REVIEW_COMPLETED_BY = "rma:declassificationReviewCompletedBy"; public static final String PROPERTIES_DECLASSIFICATION_REVIEW_COMPLETED_AT = "rma:declassificationReviewCompletedAt"; diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/recordcategory/RecordCategoryChildProperties.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/recordcategory/RecordCategoryChildProperties.java index 1e83caecf9..64432087b0 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/recordcategory/RecordCategoryChildProperties.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/recordcategory/RecordCategoryChildProperties.java @@ -32,6 +32,7 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_IS_CLOSED; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_LOCATION; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_OWNER; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_HAS_DISPOSITION_SCHEDULE; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_PERIOD_EXPRESSION; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_AUTHORITY; @@ -132,6 +133,10 @@ public class RecordCategoryChildProperties extends TestModel @JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_INSTRUCTIONS) private String recordSearchDispositionInstructions; + @JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS) + private Boolean recordSearchDispositionEvents; + @JsonProperty (PROPERTIES_OWNER) private Owner owner; + } diff --git a/rm-community/rm-community-rest-api-explorer/src/main/webapp/index.html b/rm-community/rm-community-rest-api-explorer/src/main/webapp/index.html index 0a66c86a80..0162e8338f 100644 --- a/rm-community/rm-community-rest-api-explorer/src/main/webapp/index.html +++ b/rm-community/rm-community-rest-api-explorer/src/main/webapp/index.html @@ -37,11 +37,16 @@ - - + + + + + + - + + From 7db7030a98f845b79ee7d0536d2bf9466d8cd54a Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Wed, 20 May 2020 08:57:14 +0300 Subject: [PATCH 04/59] Fix gs-api-explorer (#1135) (#1138) * updates according to https://github.com/Alfresco/rest-api-explorer/pull/78/files * fix enterprise rest api test failure --- .../fileplancomponents/FilePlanComponentFields.java | 1 + .../recordcategory/RecordCategoryChildProperties.java | 5 +++++ .../src/main/webapp/index.html | 11 ++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java index 074604353f..fec6c5695f 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java @@ -58,6 +58,7 @@ public class FilePlanComponentFields public static final String PROPERTIES_RECORD_SEARCH_DISPOSITION_ACTION_NAME = "rma:recordSearchDispositionActionName"; public static final String PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS_ELIGIBLE = "rma:recordSearchDispositionEventsEligible"; public static final String PROPERTIES_RECORD_SEARCH_DISPOSITION_INSTRUCTIONS = "rma:recordSearchDispositionInstructions"; + public static final String PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS = "rma:recordSearchDispositionEvents"; public static final String PROPERTIES_DECLASSIFICATION_REVIEW_COMPLETED_BY = "rma:declassificationReviewCompletedBy"; public static final String PROPERTIES_DECLASSIFICATION_REVIEW_COMPLETED_AT = "rma:declassificationReviewCompletedAt"; diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/recordcategory/RecordCategoryChildProperties.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/recordcategory/RecordCategoryChildProperties.java index 1e83caecf9..64432087b0 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/recordcategory/RecordCategoryChildProperties.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/recordcategory/RecordCategoryChildProperties.java @@ -32,6 +32,7 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_IS_CLOSED; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_LOCATION; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_OWNER; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_HAS_DISPOSITION_SCHEDULE; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_PERIOD_EXPRESSION; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_AUTHORITY; @@ -132,6 +133,10 @@ public class RecordCategoryChildProperties extends TestModel @JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_INSTRUCTIONS) private String recordSearchDispositionInstructions; + @JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS) + private Boolean recordSearchDispositionEvents; + @JsonProperty (PROPERTIES_OWNER) private Owner owner; + } diff --git a/rm-community/rm-community-rest-api-explorer/src/main/webapp/index.html b/rm-community/rm-community-rest-api-explorer/src/main/webapp/index.html index 0a66c86a80..0162e8338f 100644 --- a/rm-community/rm-community-rest-api-explorer/src/main/webapp/index.html +++ b/rm-community/rm-community-rest-api-explorer/src/main/webapp/index.html @@ -37,11 +37,16 @@ - - + + + + + + - + + From 2447291a7a7e0db6b9c0f36a8f7229c70f824e4c Mon Sep 17 00:00:00 2001 From: Roxana Lucanu Date: Wed, 20 May 2020 15:55:57 +0300 Subject: [PATCH 05/59] APPS-139 added backend functionality for Declare and file version as record --- .../messages/actions.properties | 4 +- .../action/dm/CreateRecordAction.java | 132 ++----------- .../dm/DeclareAsVersionRecordAction.java | 106 ++++++----- .../action/dm/RecordActionUtils.java | 175 ++++++++++++++++++ 4 files changed, 258 insertions(+), 159 deletions(-) create mode 100644 rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/actions.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/actions.properties index 8095c5c74e..cade03818a 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/actions.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/actions.properties @@ -54,8 +54,10 @@ create-record.hide-record.display-label=Hide Record create-record.path.display-label=Record Folder Location # Declare As Version Record declare-as-version-record.title=Declare Version as Record -declare-as-version-record.description=Declares this version of the file as a record +declare-as-version-record.description=Declares this version of the file as a record and optionally files it declare-as-version-record.file-plan.display-label=File Plan +declare-as-version-record.path.display-label=Record Folder Location + # Complete record declareRecord.title=Complete Record declareRecord.description=Completes a record diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/CreateRecordAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/CreateRecordAction.java index 569bcc9121..ef9245ed29 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/CreateRecordAction.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/CreateRecordAction.java @@ -27,12 +27,10 @@ package org.alfresco.module.org_alfresco_module_rm.action.dm; -import java.util.Arrays; import java.util.List; -import org.alfresco.error.AlfrescoRuntimeException; -import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.action.AuditableActionExecuterAbstractBase; +import org.alfresco.module.org_alfresco_module_rm.action.dm.RecordActionUtils.Services; import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService; import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; import org.alfresco.module.org_alfresco_module_rm.record.RecordService; @@ -43,11 +41,6 @@ import org.alfresco.service.cmr.action.ParameterDefinition; import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; -import org.alfresco.service.namespace.QName; - -import org.springframework.util.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; /** * Creates a new record from an existing content object. @@ -59,9 +52,6 @@ import org.apache.commons.logging.LogFactory; public class CreateRecordAction extends AuditableActionExecuterAbstractBase implements RecordsManagementModel { - /** Logger */ - private static final Log LOGGER = LogFactory.getLog(CreateRecordAction.class); - /** Action name */ public static final String NAME = "create-record"; @@ -70,20 +60,26 @@ public class CreateRecordAction extends AuditableActionExecuterAbstractBase public static final String PARAM_HIDE_RECORD = "hide-record"; public static final String PARAM_PATH = "path"; - /** Node service */ + /** + * Node service + */ private NodeService nodeService; - /** File plan service */ + /** + * File plan service + */ private FilePlanService filePlanService; - /** Authentication util */ + /** + * Authentication util + */ private AuthenticationUtil authenticationUtil; /** Record service */ private RecordService recordService; /** - * @param nodeService node service + * @param nodeService node service */ public void setNodeService(NodeService nodeService) { @@ -91,7 +87,7 @@ public class CreateRecordAction extends AuditableActionExecuterAbstractBase } /** - * @param filePlanService file plan service + * @param filePlanService file plan service */ public void setFilePlanService(FilePlanService filePlanService) { @@ -99,13 +95,14 @@ public class CreateRecordAction extends AuditableActionExecuterAbstractBase } /** - * @param authenticationUtil authentication util + * @param authenticationUtil authentication util */ public void setAuthenticationUtil(AuthenticationUtil authenticationUtil) { this.authenticationUtil = authenticationUtil; } + /** * @param recordService record service */ @@ -136,7 +133,8 @@ public class CreateRecordAction extends AuditableActionExecuterAbstractBase if (pathParameter != null && !pathParameter.isEmpty()) { - destinationRecordFolder = resolvePath(filePlan, pathParameter); + RecordActionUtils.Services services = new Services(nodeService, filePlanService, authenticationUtil); + destinationRecordFolder = RecordActionUtils.resolvePath(services, filePlan, pathParameter, NAME); } synchronized (this) @@ -162,102 +160,4 @@ public class CreateRecordAction extends AuditableActionExecuterAbstractBase params.add(new ParameterDefinitionImpl(PARAM_PATH, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_PATH))); params.add(new ParameterDefinitionImpl(PARAM_HIDE_RECORD, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_HIDE_RECORD))); } - - /** - * Helper method to get the target record folder node reference from the action path parameter - * - * @param filePlan The filePlan containing the path - * @param pathParameter The path - * @return The NodeRef of the resolved path - */ - private NodeRef resolvePath(NodeRef filePlan, final String pathParameter) - { - NodeRef destinationFolder; - - if (filePlan == null) - { - filePlan = getDefaultFilePlan(); - } - - final String[] pathElementsArray = StringUtils.tokenizeToStringArray(pathParameter, "/", false, true); - if ((pathElementsArray != null) && (pathElementsArray.length > 0)) - { - destinationFolder = resolvePath(filePlan, Arrays.asList(pathElementsArray)); - - // destination must be a record folder - QName nodeType = nodeService.getType(destinationFolder); - if (!nodeType.equals(RecordsManagementModel.TYPE_RECORD_FOLDER)) - { - throw new AlfrescoRuntimeException("Unable to execute " + NAME + " action, because the destination path is not a record folder."); - } - } - else - { - throw new AlfrescoRuntimeException("Unable to execute " + NAME + " action, because the destination path could not be found."); - } - return destinationFolder; - } - - /** - * Helper method to recursively get the next path element node reference from the action path parameter - * - * @param parent The parent of the path elements - * @param pathElements The path elements still to be resolved - * @return The NodeRef of the resolved path element - */ - private NodeRef resolvePath(NodeRef parent, List pathElements) - { - NodeRef nodeRef; - String childName = pathElements.get(0); - - nodeRef = nodeService.getChildByName(parent, ContentModel.ASSOC_CONTAINS, childName); - - if (nodeRef == null) - { - throw new AlfrescoRuntimeException("Unable to execute " + NAME + " action, because the destination path could not be found."); - } - else - { - QName nodeType = nodeService.getType(nodeRef); - if (nodeType.equals(RecordsManagementModel.TYPE_HOLD_CONTAINER) || - nodeType.equals(RecordsManagementModel.TYPE_TRANSFER_CONTAINER) || - nodeType.equals(RecordsManagementModel.TYPE_UNFILED_RECORD_CONTAINER)) - { - throw new AlfrescoRuntimeException("Unable to execute " + NAME + " action, because the destination path is invalid."); - } - } - if (pathElements.size() > 1) - { - nodeRef = resolvePath(nodeRef, pathElements.subList(1, pathElements.size())); - } - return nodeRef; - } - - /** - * Helper method to get the default RM filePlan - * - * @return The NodeRef of the default RM filePlan - */ - private NodeRef getDefaultFilePlan() - { - NodeRef filePlan = authenticationUtil.runAsSystem(new org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork() - { - @Override - public NodeRef doWork() - { - return filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID); - } - }); - - // if the file plan is still null, raise an exception - if (filePlan == null) - { - if (LOGGER.isDebugEnabled()) - { - LOGGER.debug("Unable to execute " + NAME + " action, because the fileplan path could not be determined. Make sure at least one file plan has been created."); - throw new AlfrescoRuntimeException("Unable to execute " + NAME + " action, because the fileplan path could not be determined."); - } - } - return filePlan; - } } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java index 82b1fd52c8..ad076c240c 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java @@ -27,21 +27,29 @@ package org.alfresco.module.org_alfresco_module_rm.action.dm; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Map.Entry; import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.action.AuditableActionExecuterAbstractBase; +import org.alfresco.module.org_alfresco_module_rm.action.dm.RecordActionUtils.Services; import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService; import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; +import org.alfresco.module.org_alfresco_module_rm.record.RecordService; import org.alfresco.module.org_alfresco_module_rm.util.AuthenticationUtil; import org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionService; +import org.alfresco.repo.action.ParameterDefinitionImpl; import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.ParameterDefinition; +import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.namespace.QName; +import org.apache.commons.collections.map.HashedMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -63,6 +71,7 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac /** Parameter names */ public static final String PARAM_FILE_PLAN = "file-plan"; + public static final String PARAM_PATH = "path"; /** Sync Model URI */ private static final String SYNC_MODEL_1_0_URI = "http://www.alfresco.org/model/sync/1.0"; @@ -85,6 +94,10 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac /** authentication util */ private AuthenticationUtil authenticationUtil; + /** Record service */ + private RecordService recordService; + + /** * @param nodeService node service */ @@ -125,6 +138,14 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac this.authenticationUtil = authenticationUtil; } + /** + * @param recordService record service + */ + public void setRecordService(RecordService recordService) + { + this.recordService = recordService; + } + /** * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef) */ @@ -147,47 +168,7 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac logger.debug("Can not declare version as record, because " + actionedUponNodeRef.toString() + " is not a supported type."); } } - else if (!nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE)) - { - if (logger.isDebugEnabled()) - { - logger.debug("Can not declare version record, because " + actionedUponNodeRef.toString() + " does not have the versionable aspect applied."); - } - } - else if (nodeService.hasAspect(actionedUponNodeRef, ASPECT_RECORD)) - { - // Do not declare version record if the actioned upon node is already a record! - if (logger.isDebugEnabled()) - { - logger.debug("Can not declare version record, because " + actionedUponNodeRef.toString() + " is already a record."); - } - } - else if (nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY)) - { - // We can not create records from working copies - if (logger.isDebugEnabled()) - { - logger.debug("Can not declare version record, because " + actionedUponNodeRef.toString() + " is a working copy."); - } - - } - else if (nodeService.hasAspect(actionedUponNodeRef, ASPECT_RECORD_REJECTION_DETAILS)) - { - // can not create a record from a previously rejected one - if (logger.isDebugEnabled()) - { - logger.debug("Can not declare version record, because " + actionedUponNodeRef.toString() + " has previously been rejected."); - } - } - else if (nodeService.hasAspect(actionedUponNodeRef, ASPECT_SYNCED)) - { - // can't declare the record if the node is sync'ed - if (logger.isDebugEnabled()) - { - logger.debug("Can't declare version record, because " + actionedUponNodeRef.toString() + " is synched content."); - } - } - else + else if (!checkAspects(actionedUponNodeRef)) { NodeRef filePlan = (NodeRef)action.getParameterValue(PARAM_FILE_PLAN); if (filePlan == null) @@ -225,8 +206,23 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac throw new AlfrescoRuntimeException("Can not declare version record, because the provided file plan node reference is not a file plan."); } } - + + // resolve destination record folder if path supplied + NodeRef destinationRecordFolder = null; + String pathParameter = (String) action.getParameterValue(PARAM_PATH); + if (pathParameter != null && !pathParameter.isEmpty()) + { + RecordActionUtils.Services services = new Services(nodeService, filePlanService, authenticationUtil); + destinationRecordFolder = RecordActionUtils.resolvePath(services, filePlan, pathParameter, NAME); + } + + // create record from latest version + if (destinationRecordFolder != null) + { + recordableVersionService.createRecordFromLatestVersion(destinationRecordFolder, actionedUponNodeRef); + recordService.file(actionedUponNodeRef); + } recordableVersionService.createRecordFromLatestVersion(filePlan, actionedUponNodeRef); } } @@ -239,6 +235,32 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac { // NOTE: commented out for now so that it doesn't appear in the UI ... enable later when multi-file plan support is added //params.add(new ParameterDefinitionImpl(PARAM_FILE_PLAN, DataTypeDefinition.NODE_REF, false, getParamDisplayLabel(PARAM_FILE_PLAN))); + params.add(new ParameterDefinitionImpl(PARAM_PATH, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_PATH))); + } + + /* Check aspects that stop declaring the version as record.*/ + private boolean checkAspects(NodeRef actionedUponNodeRef) + { + Map mapedAspects = new HashMap<>(); + + mapedAspects.put(ContentModel.ASPECT_VERSIONABLE, " does not have the versionable aspect applied."); + mapedAspects.put(ASPECT_RECORD, " is already a record."); + mapedAspects.put(ContentModel.ASPECT_WORKING_COPY, " is a working copy."); + mapedAspects.put(ASPECT_RECORD_REJECTION_DETAILS, " has previously been rejected."); + mapedAspects.put(ASPECT_SYNCED, " is synched content."); + + for (Map.Entry aspect : mapedAspects.entrySet()) + { + if (!nodeService.hasAspect(actionedUponNodeRef, aspect.getKey())) + { + if (logger.isDebugEnabled()) + { + logger.debug("Can not declare version record, because " + actionedUponNodeRef.toString() + aspect.getValue()); + } + return true; + } + } + return false; } } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java new file mode 100644 index 0000000000..11c74918b5 --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java @@ -0,0 +1,175 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * 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 . + * #L% + */ +package org.alfresco.module.org_alfresco_module_rm.action.dm; + +import java.util.Arrays; +import java.util.List; + +import org.alfresco.error.AlfrescoRuntimeException; +import org.alfresco.model.ContentModel; +import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService; +import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; +import org.alfresco.module.org_alfresco_module_rm.util.AuthenticationUtil; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.namespace.QName; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.util.StringUtils; + +public class RecordActionUtils +{ + /** + * Logger + */ + private static final Log LOGGER = LogFactory.getLog(CreateRecordAction.class); + + static class Services + { + private NodeService nodeService; + private FilePlanService filePlanService; + private AuthenticationUtil authenticationUtil; + + Services(NodeService nodeService, FilePlanService filePlanService, AuthenticationUtil authenticationUtil) + { + this.nodeService = nodeService; + this.filePlanService = filePlanService; + this.authenticationUtil = authenticationUtil; + } + + public NodeService getNodeService() + { + return nodeService; + } + + public FilePlanService getFilePlanService() + { + return filePlanService; + } + + public AuthenticationUtil getAuthenticationUtil() + { + return authenticationUtil; + } + } + + /** + * Helper method to get the target record folder node reference from the action path parameter + * + * @param filePlan The filePlan containing the path + * @param pathParameter The path + * @return The NodeRef of the resolved path + */ + static NodeRef resolvePath(Services services, NodeRef filePlan, final String pathParameter, String actionName) + { + NodeRef destinationFolder; + + if (filePlan == null) + { + filePlan = getDefaultFilePlan(services.getAuthenticationUtil(), services.getFilePlanService(), actionName); + } + + final String[] pathElementsArray = StringUtils.tokenizeToStringArray(pathParameter, "/", false, true); + if ((pathElementsArray != null) && (pathElementsArray.length > 0)) + { + destinationFolder = resolvePath(services.getNodeService(), filePlan, Arrays.asList(pathElementsArray), actionName); + + // destination must be a record folder + QName nodeType = services.getNodeService().getType(destinationFolder); + if (!nodeType.equals(RecordsManagementModel.TYPE_RECORD_FOLDER)) + { + throw new AlfrescoRuntimeException("Unable to execute " + actionName + " action, because the destination path is not a record folder."); + } + } else + { + throw new AlfrescoRuntimeException("Unable to execute " + actionName + " action, because the destination path could not be found."); + } + return destinationFolder; + } + + /** + * Helper method to recursively get the next path element node reference from the action path parameter + * + * @param parent The parent of the path elements + * @param pathElements The path elements still to be resolved + * @return The NodeRef of the resolved path element + */ + static NodeRef resolvePath(NodeService nodeService, NodeRef parent, List pathElements, String actionName) + { + NodeRef nodeRef; + String childName = pathElements.get(0); + + nodeRef = nodeService.getChildByName(parent, ContentModel.ASSOC_CONTAINS, childName); + + if (nodeRef == null) + { + throw new AlfrescoRuntimeException("Unable to execute " + actionName + " action, because the destination path could not be found."); + } else + { + QName nodeType = nodeService.getType(nodeRef); + if (nodeType.equals(RecordsManagementModel.TYPE_HOLD_CONTAINER) || + nodeType.equals(RecordsManagementModel.TYPE_TRANSFER_CONTAINER) || + nodeType.equals(RecordsManagementModel.TYPE_UNFILED_RECORD_CONTAINER)) + { + throw new AlfrescoRuntimeException("Unable to execute " + actionName + " action, because the destination path is invalid."); + } + } + if (pathElements.size() > 1) + { + nodeRef = resolvePath(nodeService, nodeRef, pathElements.subList(1, pathElements.size()), actionName); + } + return nodeRef; + } + + /** + * Helper method to get the default RM filePlan + * + * @return The NodeRef of the default RM filePlan + */ + static NodeRef getDefaultFilePlan(AuthenticationUtil authenticationUtil, FilePlanService filePlanService, String actionName) + { + NodeRef filePlan = authenticationUtil.runAsSystem(new org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork() + { + @Override + public NodeRef doWork() + { + return filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID); + } + }); + + // if the file plan is still null, raise an exception + if (filePlan == null) + { + if (LOGGER.isDebugEnabled()) + { + LOGGER.debug("Unable to execute " + actionName + " action, because the fileplan path could not be determined. Make sure at least one file plan has been created."); + throw new AlfrescoRuntimeException("Unable to execute " + actionName + " action, because the fileplan path could not be determined."); + } + } + return filePlan; + } +} From 3d2d74a9d9071af9f04d84233816d80b0d78d938 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu Date: Wed, 20 May 2020 21:16:34 +0300 Subject: [PATCH 06/59] APPS-139 fixes --- .../module/org_alfresco_module_rm/action-context.xml | 10 ++++++---- .../action/dm/DeclareAsVersionRecordAction.java | 11 +++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/action-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/action-context.xml index 477d319ef4..52797d1848 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/action-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/action-context.xml @@ -7,11 +7,12 @@ - + - - - + + + {http://www.alfresco.org/model/content/1.0}content @@ -26,6 +27,7 @@ + {http://www.alfresco.org/model/content/1.0}content diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java index ad076c240c..97dfa9a6e2 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java @@ -243,7 +243,6 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac { Map mapedAspects = new HashMap<>(); - mapedAspects.put(ContentModel.ASPECT_VERSIONABLE, " does not have the versionable aspect applied."); mapedAspects.put(ASPECT_RECORD, " is already a record."); mapedAspects.put(ContentModel.ASPECT_WORKING_COPY, " is a working copy."); mapedAspects.put(ASPECT_RECORD_REJECTION_DETAILS, " has previously been rejected."); @@ -251,7 +250,7 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac for (Map.Entry aspect : mapedAspects.entrySet()) { - if (!nodeService.hasAspect(actionedUponNodeRef, aspect.getKey())) + if (nodeService.hasAspect(actionedUponNodeRef, aspect.getKey())) { if (logger.isDebugEnabled()) { @@ -260,6 +259,14 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac return true; } } + if (!nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE)) + { + if (logger.isDebugEnabled()) + { + logger.debug("Can not declare version record, because " + actionedUponNodeRef.toString() + " does not have the versionable aspect applied."); + } + return true; + } return false; } From d9a88691cf8fd6ae288369ddf9772c7b42b46d4e Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Thu, 21 May 2020 13:10:37 +0300 Subject: [PATCH 07/59] File the declared record version if the destination record folder is specified --- .../action/dm/DeclareAsVersionRecordAction.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java index 97dfa9a6e2..da16aea68a 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java @@ -216,14 +216,16 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac destinationRecordFolder = RecordActionUtils.resolvePath(services, filePlan, pathParameter, NAME); } - // create record from latest version if (destinationRecordFolder != null) { - recordableVersionService.createRecordFromLatestVersion(destinationRecordFolder, actionedUponNodeRef); - recordService.file(actionedUponNodeRef); + NodeRef recordedVersion = recordableVersionService.createRecordFromLatestVersion(destinationRecordFolder, actionedUponNodeRef); + recordService.file(recordedVersion); + } + else + { + recordableVersionService.createRecordFromLatestVersion(filePlan, actionedUponNodeRef); } - recordableVersionService.createRecordFromLatestVersion(filePlan, actionedUponNodeRef); } } From e6ebe6f58e86febf5f8f170dab8c9b10ee155a22 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu Date: Wed, 27 May 2020 09:23:22 +0300 Subject: [PATCH 08/59] APPS-139 check capability --- .../org_alfresco_module_rm/action-context.xml | 1 + .../rm-capabilities-record-context.xml | 7 ++++- .../dm/DeclareAsVersionRecordAction.java | 26 ++++++++++++++----- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/action-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/action-context.xml index 52797d1848..e7358d2770 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/action-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/action-context.xml @@ -28,6 +28,7 @@ + {http://www.alfresco.org/model/content/1.0}content diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml index 40a454449b..6fcab797ad 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml @@ -158,7 +158,12 @@ parent="declarativeCapability"> - + + + RECORD_FOLDER + RECORD + + diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java index da16aea68a..6cb62888db 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java @@ -30,12 +30,12 @@ package org.alfresco.module.org_alfresco_module_rm.action.dm; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.action.AuditableActionExecuterAbstractBase; import org.alfresco.module.org_alfresco_module_rm.action.dm.RecordActionUtils.Services; +import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService; import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService; import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; import org.alfresco.module.org_alfresco_module_rm.record.RecordService; @@ -49,7 +49,6 @@ import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.namespace.QName; -import org.apache.commons.collections.map.HashedMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -73,6 +72,8 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac public static final String PARAM_FILE_PLAN = "file-plan"; public static final String PARAM_PATH = "path"; + private static final String FILE_UNFILED_RECORDS_CAPABILITY = "FileUnfiledRecords"; + /** Sync Model URI */ private static final String SYNC_MODEL_1_0_URI = "http://www.alfresco.org/model/sync/1.0"; @@ -88,15 +89,17 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac /** Dictionary service */ private DictionaryService dictionaryService; - /** recordable version service */ + /** Recordable version service */ private RecordableVersionService recordableVersionService; - /** authentication util */ + /** Authentication util */ private AuthenticationUtil authenticationUtil; /** Record service */ private RecordService recordService; + /** Capability service */ + private CapabilityService capabilityService; /** * @param nodeService node service @@ -146,6 +149,11 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac this.recordService = recordService; } + public void setCapabilityService(CapabilityService capabilityService) + { + this.capabilityService = capabilityService; + } + /** * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef) */ @@ -219,8 +227,13 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac // create record from latest version if (destinationRecordFolder != null) { - NodeRef recordedVersion = recordableVersionService.createRecordFromLatestVersion(destinationRecordFolder, actionedUponNodeRef); - recordService.file(recordedVersion); + boolean hasFilingCapability = capabilityService.hasCapability(destinationRecordFolder, FILE_UNFILED_RECORDS_CAPABILITY); + // validate destination record folder + if (hasFilingCapability) + { + NodeRef recordedVersion = recordableVersionService.createRecordFromLatestVersion(destinationRecordFolder, actionedUponNodeRef); + recordService.file(recordedVersion); + } } else { @@ -271,5 +284,4 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac } return false; } - } From 2b3a0c9740ec137ba13aca59893639005219d4c7 Mon Sep 17 00:00:00 2001 From: rodicasutu Date: Wed, 27 May 2020 16:44:22 +0300 Subject: [PATCH 09/59] tests for APPS-85 --- .../rm-automation-community-rest-api/pom.xml | 16 +- .../FilePlanComponentAspects.java | 3 + .../FilePlanComponentFields.java | 2 + .../model/record/RecordProperties.java | 8 + .../UnfiledContainerChildProperties.java | 8 + .../gscore/api/ActionsExecutionAPI.java | 27 ++ .../rm/community/base/BaseRMRestTest.java | 68 ++++ .../DeclareAndFileVersionAsRecordTests.java | 290 ++++++++++++++++++ 8 files changed, 408 insertions(+), 14 deletions(-) create mode 100644 rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileVersionAsRecordTests.java diff --git a/rm-automation/rm-automation-community-rest-api/pom.xml b/rm-automation/rm-automation-community-rest-api/pom.xml index 0a5b1d93e4..91271d9dfe 100644 --- a/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/rm-automation/rm-automation-community-rest-api/pom.xml @@ -15,7 +15,7 @@ false alfresco-governance-services-community-share alfresco-governance-services-community-repo - 6.0.1.2 + 1.38 2.0.0 2.7.7 @@ -54,7 +54,7 @@ org.alfresco.tas - restapi-test + restapi ${tas.restapi.version} @@ -63,18 +63,6 @@ - - org.alfresco.tas - restapi-test - ${tas.restapi.version} - test-jar - - - com.fasterxml.jackson.core - jackson-databind - - - org.projectlombok lombok diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentAspects.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentAspects.java index 78fa8ebe49..32faaa8667 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentAspects.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentAspects.java @@ -56,4 +56,7 @@ public class FilePlanComponentAspects // retention schedule cut off aspect public static final String CUT_OFF_ASPECT = "rma:cutOff"; + + //declare version as record aspect + public static final String VERSION_AS_RECORD="rmv:versionRecord"; } diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java index fec6c5695f..d1978542fe 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java @@ -88,6 +88,8 @@ public class FilePlanComponentFields /** Electronic record properties */ public static final String PROPERTIES_VERSION_TYPE = "cm:versionType"; public static final String PROPERTIES_VERSION_LABEL = "cm:versionLabel"; + public static final String PROPERTIES_VERSIONED_NODEREF = "rmv:versionedNodeRef"; + public static final String PROPERTIES_RMV_VERSIONED = "rmv:versionLabel"; public static final String PROPERTIES_DATE_TIME_ORIGINAL = "exif:dateTimeOriginal"; public static final String PROPERTIES_EXPOSURE_TIME = "exif:exposureTime"; public static final String PROPERTIES_FLASH = "exif:flash"; diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/record/RecordProperties.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/record/RecordProperties.java index bb9bab1eca..d3480b9544 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/record/RecordProperties.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/record/RecordProperties.java @@ -65,11 +65,13 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RESOLUTION_UNIT; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_REVIEW_AS_OF; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RMV_VERSIONED; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_ROOT_NODE_REF; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SHELF; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SOFTWARE; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_STORAGE_LOCATION; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VERSIONED_NODEREF; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VERSION_LABEL; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VERSION_TYPE; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_X_RESOLUTION; @@ -133,6 +135,12 @@ public class RecordProperties extends TestModel @JsonProperty (PROPERTIES_VERSION_LABEL) private String versionLabel; + @JsonProperty(PROPERTIES_VERSIONED_NODEREF) + private String versionedNodeRef; + + @JsonProperty (PROPERTIES_RMV_VERSIONED) + private String recordVersionLabel; + @JsonProperty (PROPERTIES_DATE_TIME_ORIGINAL) private String dateTimeOriginal; diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/unfiledcontainer/UnfiledContainerChildProperties.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/unfiledcontainer/UnfiledContainerChildProperties.java index 0c00fcd5fd..46178a07e4 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/unfiledcontainer/UnfiledContainerChildProperties.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/unfiledcontainer/UnfiledContainerChildProperties.java @@ -47,11 +47,13 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_PIXEL_Y_DIMENSION; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_HAS_DISPOSITION_SCHEDULE; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RESOLUTION_UNIT; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RMV_VERSIONED; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_ROOT_NODE_REF; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SHELF; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SOFTWARE; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_STORAGE_LOCATION; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VERSIONED_NODEREF; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VERSION_LABEL; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VERSION_TYPE; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_X_RESOLUTION; @@ -111,6 +113,12 @@ public class UnfiledContainerChildProperties extends TestModel @JsonProperty (PROPERTIES_VERSION_LABEL) private String versionLabel; + @JsonProperty(PROPERTIES_VERSIONED_NODEREF) + private String versionedNodeRef; + + @JsonProperty (PROPERTIES_RMV_VERSIONED) + private String recordVersionLabel; + @JsonProperty (PROPERTIES_DATE_TIME_ORIGINAL) private String dateTimeOriginal; diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/ActionsExecutionAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/ActionsExecutionAPI.java index 7a52305bf2..fdf5b74f90 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/ActionsExecutionAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/ActionsExecutionAPI.java @@ -75,4 +75,31 @@ public class ActionsExecutionAPI extends RMModelRequest return getRmRestWrapper().withCoreAPI().usingActions() .executeAction(ActionsOnRule.DECLARE_AS_RECORD.getActionValue(), targetNode); } + + + /** + * Declares and file a document version as record to a record folder using v1 actions api + * + * @param targetNode the node on which the action is executed + * @param destinationPath the path to the record folder + * @throws Exception + */ + public JSONObject declareAndFileVersionAsRecord(RepoTestModel targetNode, String destinationPath) throws Exception + { + return getRmRestWrapper().withCoreAPI().usingActions() + .executeAction(ActionsOnRule.DECLARE_VERSION_AS_RECORD.getActionValue(), targetNode, + ImmutableMap.of("path", destinationPath)); + } + + /** + * Declares a document version as record using v1 actions api + * + * @param targetNode the node on which the action is executed + * @throws Exception + */ + public JSONObject declareVersionAsRecord(RepoTestModel targetNode) throws Exception + { + return getRmRestWrapper().withCoreAPI().usingActions() + .executeAction(ActionsOnRule.DECLARE_VERSION_AS_RECORD.getActionValue(), targetNode); + } } diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java index 59dacf4212..afd58ae54a 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java @@ -32,6 +32,7 @@ import static org.alfresco.rest.rm.community.base.TestData.RECORD_CATEGORY_TITLE import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAspects.ASPECTS_COMPLETED_RECORD; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAspects.VERSION_AS_RECORD; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.CONTENT_TYPE; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.NON_ELECTRONIC_RECORD_TYPE; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_CATEGORY_TYPE; @@ -879,4 +880,71 @@ public class BaseRMRestTest extends RestTest return false; } } + /** + * Helper method to verify if the document version is declared as record version in unfiled container + * + * @param testFile the file declared as record version + * @param version the document version + * @return true if matching record version is found in unfiled record container, false otherwise + */ + protected boolean isRecordVersionInUnfiledRecords(FileModel testFile, String version) + { + try + { + Utility.sleep(5000, 15000, + () -> { + UnfiledContainerChildEntry matchingRecord = getRestAPIFactory().getUnfiledContainersAPI() + .getUnfiledContainerChildren(UNFILED_RECORDS_CONTAINER_ALIAS, "include=properties,aspectNames") + .getEntries() + .stream() + .filter(e -> e.getEntry().getName().contains(testFile.getName().replace(".txt", "")) + && e.getEntry().getProperties().getVersionedNodeRef().equals(testFile.getNodeRefWithoutVersion()) + && e.getEntry().getProperties().getRecordVersionLabel().equalsIgnoreCase(version) + ) + .findFirst().get(); + + assertTrue(hasAspect(matchingRecord.getEntry().getId(), VERSION_AS_RECORD)); + }); + return true; + } + catch (AssertionError | Exception e) + { + return false; + } + } + /** + * Helper method to verify if the document version is declared as record version in a specific record folder + * + * @param testFile the file declared as record version + * @param recordFolder the record folder where the versioned record is filled + * @param version the document version + * @return true if matching record version is found in record folder, false otherwise + */ + protected boolean isRecordVersionInRecordFolder(FileModel testFile, RecordCategoryChild recordFolder, + String version) + { + try + { + Utility.sleep(5000, 15000, + () -> { + RecordFolderEntry matchingRecord = getRestAPIFactory().getRecordFolderAPI() + .getRecordFolderChildren(recordFolder.getId(),"include=properties,aspectNames") + .getEntries() + .stream() + .filter(e -> e.getEntry().getName().contains(testFile.getName().replace(".txt", "")) + && e.getEntry().getProperties().getVersionedNodeRef().equals(testFile.getNodeRefWithoutVersion()) + && e.getEntry().getProperties().getRecordVersionLabel().equalsIgnoreCase(version) + ) + .findFirst().get(); + + assertTrue(hasAspect(matchingRecord.getEntry().getId(), VERSION_AS_RECORD)); + }); + return true; + } + catch (AssertionError | Exception e) + { + return false; + } + } + } diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileVersionAsRecordTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileVersionAsRecordTests.java new file mode 100644 index 0000000000..220ba6d42e --- /dev/null +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileVersionAsRecordTests.java @@ -0,0 +1,290 @@ +/*- + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * 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 . + * #L% + */ +package org.alfresco.rest.rm.community.files; + +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE; +import static org.alfresco.rest.rm.community.model.user.UserPermissions.PERMISSION_FILING; +import static org.alfresco.rest.rm.community.model.user.UserPermissions.PERMISSION_READ_RECORDS; +import static org.alfresco.rest.rm.community.model.user.UserRoles.ROLE_RM_POWER_USER; +import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric; +import static org.alfresco.utility.data.RandomData.getRandomName; +import static org.alfresco.utility.report.log.Step.STEP; +import static org.springframework.http.HttpStatus.ACCEPTED; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; + +import java.io.File; +import java.util.List; + +import org.alfresco.dataprep.CMISUtil; +import org.alfresco.rest.rm.community.base.BaseRMRestTest; +import org.alfresco.rest.rm.community.model.recordcategory.RecordCategory; +import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild; +import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledContainerChild; +import org.alfresco.rest.rm.community.util.DockerHelper; +import org.alfresco.rest.v0.service.RoleService; +import org.alfresco.test.AlfrescoTest; +import org.alfresco.utility.Utility; +import org.alfresco.utility.model.FileModel; +import org.alfresco.utility.model.FolderModel; +import org.alfresco.utility.model.SiteModel; +import org.alfresco.utility.model.UserModel; +import org.springframework.beans.factory.annotation.Autowired; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * API tests for declaring a document version as record and filing to a record folder location within the file plan + * + * @author Rodica Sutu + * @since 3.4 + */ +@AlfrescoTest (jira = "APPS-35") +public class DeclareAndFileVersionAsRecordTests extends BaseRMRestTest +{ + private final static String DESTINATION_PATH_NOT_FOUND_EXC = "Unable to execute declare-version-record action, " + + "because the destination path could not be found."; + private final static String INVALID_DESTINATION_PATH_EXC = "Unable to execute declare-version-record action, " + + "because the destination path is invalid."; + private final static String DESTINATION_PATH_NOT_RECORD_FOLDER_EXC = "Unable to execute declare-version-record " + + "action, because the destination path is not a record folder."; + private final static String CLOSED_RECORD_FOLDER_EXC = "You can't add new items to a closed record folder."; + + private UserModel userFillingPermission, userReadOnlyPermission; + private SiteModel publicSite; + private FileModel testFile; + private FolderModel testFolder; + private RecordCategory recordCategory; + private RecordCategoryChild recordFolder, closedRecordFolder; + private UnfiledContainerChild unfiledContainerFolder; + + @Autowired + private RoleService roleService; + @Autowired + private DockerHelper dockerHelper; + + @BeforeClass (alwaysRun = true) + public void declareAndFileVersionAsRecordSetup() throws Exception + { + STEP("Create test collaboration site to store documents in."); + publicSite = dataSite.usingAdmin().createPublicRandomSite(); + + STEP("Create a test folder within the collaboration site"); + testFolder = dataContent.usingAdmin().usingSite(publicSite).createFolder(); + + STEP("Create record categories and record folders"); + recordCategory = createRootCategory(getRandomName("recordCategory")); + recordFolder = createFolder(recordCategory.getId(), getRandomName("recordFolder")); + closedRecordFolder = createFolder(recordCategory.getId(), getRandomName("closedRecordFolder")); + closeFolder(closedRecordFolder.getId()); + unfiledContainerFolder = createUnfiledContainerChild(UNFILED_RECORDS_CONTAINER_ALIAS, + "Unfiled Folder " + getRandomAlphanumeric(), UNFILED_RECORD_FOLDER_TYPE); + + STEP("Create rm users with different permissions on the record category"); + userFillingPermission = roleService.createCollaboratorWithRMRoleAndPermission(publicSite, recordCategory, + ROLE_RM_POWER_USER, PERMISSION_FILING); + userReadOnlyPermission = roleService.createCollaboratorWithRMRoleAndPermission(publicSite, recordCategory, + ROLE_RM_POWER_USER, PERMISSION_READ_RECORDS); + } + + @BeforeMethod (alwaysRun = true) + public void createDocument() + { + STEP("Create a document in the collaboration site"); + testFile = dataContent.usingSite(publicSite) + .usingAdmin() + .createContent(CMISUtil.DocumentType.TEXT_PLAIN); + } + + /** + * Given I am calling the "declare version as record" action + * And I am not providing a location parameter value + * When I execute the action + * Then the document is declared as a version record + * And is placed in the Unfiled Records location + */ + @Test + public void declareVersionAndFileNoLocationUsingActionsAPI() throws Exception + { + STEP("Declare document version as record without providing a location parameter value using v1 actions api"); + getRestAPIFactory().getActionsAPI(userReadOnlyPermission).declareVersionAsRecord(testFile); + + STEP("Verify the declared version record is placed in the Unfiled Records folder and is a record version"); + assertTrue(isRecordVersionInUnfiledRecords(testFile, "1.0"), "Version record should be filed to Unfiled " + + "Records folder"); + } + + /** + * Given I am calling the "declare version as record" action + * And I provide a valid record folder in the location parameter + * When I execute the action + * Then the document is declared as a version record + * And is filed to the record folder specified + */ + @Test + public void fileVersionAsRecordToValidLocationUsingActionsAPI() throws Exception + { + STEP("Declare document version as record with a location parameter value"); + getRestAPIFactory().getActionsAPI(userFillingPermission).declareAndFileVersionAsRecord(testFile, + Utility.buildPath(recordCategory.getName(), recordFolder.getName())); + + STEP("Verify the declared version record is placed in the record folder"); + assertTrue(isRecordVersionInRecordFolder(testFile, recordFolder, "1.0"), "Record version should be filed to " + + "record folder"); + } + + /** + * Invalid destination paths where version records can't be filed + */ + @DataProvider (name = "invalidDestinationPaths") + public Object[][] getInvalidDestinationPaths() + { + return new String[][] + { + { "/", DESTINATION_PATH_NOT_FOUND_EXC }, + { "Unfiled Records", INVALID_DESTINATION_PATH_EXC }, + { "Transfers", INVALID_DESTINATION_PATH_EXC }, + { "Holds", INVALID_DESTINATION_PATH_EXC }, + { "rm/documentlibrary", DESTINATION_PATH_NOT_FOUND_EXC }, + { recordCategory.getName(), DESTINATION_PATH_NOT_RECORD_FOLDER_EXC }, + // a closed record folder + { Utility.buildPath(recordCategory.getName(), closedRecordFolder.getName()), + CLOSED_RECORD_FOLDER_EXC }, + // an arbitrary unfiled records folder + { "Unfiled Records/" + unfiledContainerFolder.getName(), INVALID_DESTINATION_PATH_EXC }, + // a collaboration site folder + { testFolder.getCmisLocation(), DESTINATION_PATH_NOT_FOUND_EXC } + }; + } + + /** + * Given I am calling the "declare version as record" action + * And I provide an invalid record folder in the location parameter + * When I execute the action + * Then I receive an error indicating that I have attempted to file version as record a document into an invalid + * record folder + * And the document is not declared as a version record + */ + @Test (dataProvider = "invalidDestinationPaths") + public void declareVersionAndFileToInvalidLocationUsingActionsAPI(String containerPath, String expectedException) throws Exception + { + STEP("Declare document as record version with an invalid location parameter value"); + getRestAPIFactory().getActionsAPI().declareAndFileVersionAsRecord(testFile, containerPath); + assertStatusCode(ACCEPTED); + + STEP("Check the exception thrown in alfresco logs"); + //Retry the operation because sometimes it takes few seconds to throw the exception + Utility.sleep(6000, 30000, () -> + { + List alfrescoLogs = dockerHelper.getAlfrescoLogs(); + assertTrue(alfrescoLogs.stream().anyMatch(logLine -> logLine.contains(expectedException))); + }); + + } + + /** + * Given I am an user with read only permissions on a record folder + * When I declare and file a version record to the record folder + * Then I receive an error indicating that the access is denied + * And the document is not declared as a record + */ + @Test + public void declareAndFileByUserWithReadOnlyPermission() throws Exception + { + STEP("Declare document as record with a record folder as location parameter"); + getRestAPIFactory().getActionsAPI(userReadOnlyPermission).declareAndFileVersionAsRecord(testFile, + Utility.buildPath(recordCategory.getName(), recordFolder.getName())); + + STEP("Check that the record version is not added to the record folder"); + assertFalse(isRecordVersionInRecordFolder(testFile, recordFolder, "1.0"), "Record version is filed to " + + "record folder where the user doesn't have filling permission"); + } + + /** + * Given I am calling the "declare version as record" action for a minor document version + * And I am not providing a location parameter value + * When I execute the action + * Then the document version is declared as a version record + * And is placed in the Unfiled Records location + */ + @Test + public void declareVersionAsRecordMinorVersionUsingActionsAPI() throws Exception + { + STEP("Update document in the collaboration site"); + dataContent.usingSite(publicSite).usingAdmin().usingResource(testFile).updateContent("This is the new content" + + " " + + "for " + testFile.getName()); + + STEP("Declare document version as record without providing a location parameter value using v1 actions api"); + getRestAPIFactory().getActionsAPI(userFillingPermission).declareAndFileVersionAsRecord(testFile, + Utility.buildPath(recordCategory.getName(), recordFolder.getName())); + + STEP("Verify the declared version record is placed in the Unfiled Records folder and is a record version"); + assertTrue(isRecordVersionInRecordFolder(testFile, recordFolder, "1.1"), "Record should be filed to fileplan " + + "location"); + } + + /** + * Given I am calling the "declare version as record" action for a major document version + * And I am not providing a location parameter value + * When I execute the action + * Then the document version is declared as a version record version + * And is placed in the Unfiled Records location + */ + @Test + public void declareVersionAsRecordMajorVersionUsingActionsAPI() throws Exception + { + STEP("Update document in the collaboration site"); + File sampleFile = Utility.getResourceTestDataFile("SampleTextFile_10kb.txt"); + restClient.authenticateUser(getAdminUser()).withCoreAPI().usingParams("majorVersion=true").usingNode(testFile).updateNodeContent(sampleFile); + + STEP("Declare document version as record without providing a location parameter value using v1 actions api"); + getRestAPIFactory().getActionsAPI(userFillingPermission).declareAndFileVersionAsRecord(testFile, + Utility.buildPath(recordCategory.getName(), recordFolder.getName())); + + STEP("Verify the declared version record is placed in the Unfiled Records folder and is a record version"); + assertTrue(isRecordVersionInRecordFolder(testFile, recordFolder, "2.0"), "Version record should be filed to " + + "the record folder"); + } + + @AfterClass (alwaysRun = true) + public void declareAndFileVersionAsRecordCleanUp() + { + deleteRecordCategory(recordCategory.getId()); + + //delete created collaboration site + dataSite.deleteSite(publicSite); + + //delete users + getDataUser().deleteUser(userFillingPermission); + getDataUser().deleteUser(userReadOnlyPermission); + } +} From a76384b1eb7f004f339d2fa326057412e12e6fc2 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu Date: Wed, 27 May 2020 17:04:41 +0300 Subject: [PATCH 10/59] APPS-139 added exception --- .../action/dm/DeclareAsVersionRecordAction.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java index 6cb62888db..374a9f14b6 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java @@ -42,6 +42,7 @@ import org.alfresco.module.org_alfresco_module_rm.record.RecordService; import org.alfresco.module.org_alfresco_module_rm.util.AuthenticationUtil; import org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionService; import org.alfresco.repo.action.ParameterDefinitionImpl; +import org.alfresco.repo.security.permissions.AccessDeniedException; import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.ParameterDefinition; import org.alfresco.service.cmr.dictionary.DataTypeDefinition; @@ -234,6 +235,10 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac NodeRef recordedVersion = recordableVersionService.createRecordFromLatestVersion(destinationRecordFolder, actionedUponNodeRef); recordService.file(recordedVersion); } + else + { + throw new AccessDeniedException("The" + authenticationUtil.getRunAsUser() + "user doesn't have file permission on the specified location"); + } } else { From f0f5af8be1aaff073f74452545149e76d99e1ef9 Mon Sep 17 00:00:00 2001 From: rodicasutu Date: Thu, 28 May 2020 14:14:14 +0300 Subject: [PATCH 11/59] address review comments --- .../DeclareAndFileVersionAsRecordTests.java | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileVersionAsRecordTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileVersionAsRecordTests.java index 220ba6d42e..9756949711 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileVersionAsRecordTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileVersionAsRecordTests.java @@ -26,6 +26,8 @@ */ package org.alfresco.rest.rm.community.files; +import static org.alfresco.rest.rm.community.base.TestData.HOLD_DESCRIPTION; +import static org.alfresco.rest.rm.community.base.TestData.HOLD_REASON; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS; import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE; import static org.alfresco.rest.rm.community.model.user.UserPermissions.PERMISSION_FILING; @@ -47,6 +49,7 @@ import org.alfresco.rest.rm.community.model.recordcategory.RecordCategory; import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild; import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledContainerChild; import org.alfresco.rest.rm.community.util.DockerHelper; +import org.alfresco.rest.v0.HoldsAPI; import org.alfresco.rest.v0.service.RoleService; import org.alfresco.test.AlfrescoTest; import org.alfresco.utility.Utility; @@ -77,19 +80,23 @@ public class DeclareAndFileVersionAsRecordTests extends BaseRMRestTest private final static String DESTINATION_PATH_NOT_RECORD_FOLDER_EXC = "Unable to execute declare-version-record " + "action, because the destination path is not a record folder."; private final static String CLOSED_RECORD_FOLDER_EXC = "You can't add new items to a closed record folder."; + private final static String FROZEN_RECORD_FOLDER_EXC = "You can't add new items to a frozen record folder."; + private final static String HOLD_NAME = getRandomName("holdName"); private UserModel userFillingPermission, userReadOnlyPermission; private SiteModel publicSite; private FileModel testFile; private FolderModel testFolder; private RecordCategory recordCategory; - private RecordCategoryChild recordFolder, closedRecordFolder; + private RecordCategoryChild recordFolder, closedRecordFolder, heldRecordFolder; private UnfiledContainerChild unfiledContainerFolder; @Autowired private RoleService roleService; @Autowired private DockerHelper dockerHelper; + @Autowired + private HoldsAPI holdsAPI; @BeforeClass (alwaysRun = true) public void declareAndFileVersionAsRecordSetup() throws Exception @@ -107,6 +114,10 @@ public class DeclareAndFileVersionAsRecordTests extends BaseRMRestTest closeFolder(closedRecordFolder.getId()); unfiledContainerFolder = createUnfiledContainerChild(UNFILED_RECORDS_CONTAINER_ALIAS, "Unfiled Folder " + getRandomAlphanumeric(), UNFILED_RECORD_FOLDER_TYPE); + heldRecordFolder = createFolder(recordCategory.getId(), getRandomName("heldRecordFolder")); + holdsAPI.createHold(getAdminUser().getUsername(), getAdminUser().getPassword(), HOLD_NAME, HOLD_REASON, HOLD_DESCRIPTION); + holdsAPI.addItemToHold(getAdminUser().getUsername(), getAdminUser().getPassword(), heldRecordFolder.getId(), + HOLD_NAME); STEP("Create rm users with different permissions on the record category"); userFillingPermission = roleService.createCollaboratorWithRMRoleAndPermission(publicSite, recordCategory, @@ -178,6 +189,9 @@ public class DeclareAndFileVersionAsRecordTests extends BaseRMRestTest // a closed record folder { Utility.buildPath(recordCategory.getName(), closedRecordFolder.getName()), CLOSED_RECORD_FOLDER_EXC }, + // a frozen record folder + { Utility.buildPath(recordCategory.getName(), heldRecordFolder.getName()), + FROZEN_RECORD_FOLDER_EXC }, // an arbitrary unfiled records folder { "Unfiled Records/" + unfiledContainerFolder.getName(), INVALID_DESTINATION_PATH_EXC }, // a collaboration site folder @@ -187,7 +201,7 @@ public class DeclareAndFileVersionAsRecordTests extends BaseRMRestTest /** * Given I am calling the "declare version as record" action - * And I provide an invalid record folder in the location parameter + * And I provide an invalid record folder in the path parameter * When I execute the action * Then I receive an error indicating that I have attempted to file version as record a document into an invalid * record folder @@ -230,7 +244,7 @@ public class DeclareAndFileVersionAsRecordTests extends BaseRMRestTest /** * Given I am calling the "declare version as record" action for a minor document version - * And I am not providing a location parameter value + * And I am not providing a path parameter value * When I execute the action * Then the document version is declared as a version record * And is placed in the Unfiled Records location @@ -240,21 +254,20 @@ public class DeclareAndFileVersionAsRecordTests extends BaseRMRestTest { STEP("Update document in the collaboration site"); dataContent.usingSite(publicSite).usingAdmin().usingResource(testFile).updateContent("This is the new content" + - " " + - "for " + testFile.getName()); + "for " + testFile.getName()); STEP("Declare document version as record without providing a location parameter value using v1 actions api"); getRestAPIFactory().getActionsAPI(userFillingPermission).declareAndFileVersionAsRecord(testFile, Utility.buildPath(recordCategory.getName(), recordFolder.getName())); - STEP("Verify the declared version record is placed in the Unfiled Records folder and is a record version"); + STEP("Verify the declared version record is placed in the record folder and is a record version"); assertTrue(isRecordVersionInRecordFolder(testFile, recordFolder, "1.1"), "Record should be filed to fileplan " + "location"); } /** * Given I am calling the "declare version as record" action for a major document version - * And I am not providing a location parameter value + * And I am not providing a path parameter value * When I execute the action * Then the document version is declared as a version record version * And is placed in the Unfiled Records location @@ -270,7 +283,7 @@ public class DeclareAndFileVersionAsRecordTests extends BaseRMRestTest getRestAPIFactory().getActionsAPI(userFillingPermission).declareAndFileVersionAsRecord(testFile, Utility.buildPath(recordCategory.getName(), recordFolder.getName())); - STEP("Verify the declared version record is placed in the Unfiled Records folder and is a record version"); + STEP("Verify the declared version record is placed in the record folder and is a record version"); assertTrue(isRecordVersionInRecordFolder(testFile, recordFolder, "2.0"), "Version record should be filed to " + "the record folder"); } @@ -278,6 +291,7 @@ public class DeclareAndFileVersionAsRecordTests extends BaseRMRestTest @AfterClass (alwaysRun = true) public void declareAndFileVersionAsRecordCleanUp() { + holdsAPI.deleteHold(getAdminUser().getUsername(), getAdminUser().getPassword(), HOLD_NAME); deleteRecordCategory(recordCategory.getId()); //delete created collaboration site From a0455b6c9df5e9c2a3daebfa5c1e3e39eaa373e9 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu Date: Tue, 2 Jun 2020 19:02:07 +0300 Subject: [PATCH 12/59] APPS-139 code review comments --- .../dm/DeclareAsVersionRecordAction.java | 45 +++++++------------ .../action/dm/RecordActionUtils.java | 24 +++++----- 2 files changed, 27 insertions(+), 42 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java index 374a9f14b6..f1332a4cdc 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java @@ -52,6 +52,7 @@ import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.namespace.QName; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.extensions.surf.util.I18NUtil; /** * Creates a new record from the 'current' document version. @@ -135,7 +136,7 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac } /** - * @param authenticationUtil authentication util + * @param authenticationUtil authentication util */ public void setAuthenticationUtil(AuthenticationUtil authenticationUtil) { @@ -150,6 +151,9 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac this.recordService = recordService; } + /** + * @param capabilityService capability service + */ public void setCapabilityService(CapabilityService capabilityService) { this.capabilityService = capabilityService; @@ -177,31 +181,12 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac logger.debug("Can not declare version as record, because " + actionedUponNodeRef.toString() + " is not a supported type."); } } - else if (!checkAspects(actionedUponNodeRef)) + else if (!isActionEligible(actionedUponNodeRef)) { NodeRef filePlan = (NodeRef)action.getParameterValue(PARAM_FILE_PLAN); if (filePlan == null) { - // TODO .. eventually make the file plan parameter required - - filePlan = authenticationUtil.runAs(new org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork() - { - @Override - public NodeRef doWork() - { - return filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID); - } - }, authenticationUtil.getAdminUserName()); - - // if the file plan is still null, raise an exception - if (filePlan == null) - { - if (logger.isDebugEnabled()) - { - logger.debug("Can not declare version record, because the default file plan can not be determined. Make sure at least one file plan has been created."); - } - throw new AlfrescoRuntimeException("Can not declare version record, because the default file plan can not be determined."); - } + filePlan = RecordActionUtils.getDefaultFilePlan(authenticationUtil, filePlanService, NAME); } else { @@ -237,7 +222,7 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac } else { - throw new AccessDeniedException("The" + authenticationUtil.getRunAsUser() + "user doesn't have file permission on the specified location"); + throw new AccessDeniedException(I18NUtil.getMessage("permissions.err_access_denied")); } } else @@ -259,16 +244,16 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac } /* Check aspects that stop declaring the version as record.*/ - private boolean checkAspects(NodeRef actionedUponNodeRef) + private boolean isActionEligible(NodeRef actionedUponNodeRef) { - Map mapedAspects = new HashMap<>(); + Map mappedAspects = new HashMap<>(); - mapedAspects.put(ASPECT_RECORD, " is already a record."); - mapedAspects.put(ContentModel.ASPECT_WORKING_COPY, " is a working copy."); - mapedAspects.put(ASPECT_RECORD_REJECTION_DETAILS, " has previously been rejected."); - mapedAspects.put(ASPECT_SYNCED, " is synched content."); + mappedAspects.put(ASPECT_RECORD, " is already a record."); + mappedAspects.put(ContentModel.ASPECT_WORKING_COPY, " is a working copy."); + mappedAspects.put(ASPECT_RECORD_REJECTION_DETAILS, " has previously been rejected."); + mappedAspects.put(ASPECT_SYNCED, " is synched content."); - for (Map.Entry aspect : mapedAspects.entrySet()) + for (Map.Entry aspect : mappedAspects.entrySet()) { if (nodeService.hasAspect(actionedUponNodeRef, aspect.getKey())) { diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java index 11c74918b5..ba3935293f 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java @@ -46,7 +46,12 @@ public class RecordActionUtils /** * Logger */ - private static final Log LOGGER = LogFactory.getLog(CreateRecordAction.class); + private static final Log LOGGER = LogFactory.getLog(RecordActionUtils.class); + + /** Private constructor to prevent instantiation. */ + private RecordActionUtils() + { + } static class Services { @@ -94,7 +99,7 @@ public class RecordActionUtils } final String[] pathElementsArray = StringUtils.tokenizeToStringArray(pathParameter, "/", false, true); - if ((pathElementsArray != null) && (pathElementsArray.length > 0)) + if (pathElementsArray.length > 0) { destinationFolder = resolvePath(services.getNodeService(), filePlan, Arrays.asList(pathElementsArray), actionName); @@ -104,7 +109,8 @@ public class RecordActionUtils { throw new AlfrescoRuntimeException("Unable to execute " + actionName + " action, because the destination path is not a record folder."); } - } else + } + else { throw new AlfrescoRuntimeException("Unable to execute " + actionName + " action, because the destination path could not be found."); } @@ -128,7 +134,8 @@ public class RecordActionUtils if (nodeRef == null) { throw new AlfrescoRuntimeException("Unable to execute " + actionName + " action, because the destination path could not be found."); - } else + } + else { QName nodeType = nodeService.getType(nodeRef); if (nodeType.equals(RecordsManagementModel.TYPE_HOLD_CONTAINER) || @@ -152,14 +159,7 @@ public class RecordActionUtils */ static NodeRef getDefaultFilePlan(AuthenticationUtil authenticationUtil, FilePlanService filePlanService, String actionName) { - NodeRef filePlan = authenticationUtil.runAsSystem(new org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork() - { - @Override - public NodeRef doWork() - { - return filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID); - } - }); + NodeRef filePlan = authenticationUtil.runAsSystem(() -> filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID)); // if the file plan is still null, raise an exception if (filePlan == null) From 390106f9c6dea150fa67ac649ce836ea505a2c56 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu Date: Wed, 3 Jun 2020 15:49:00 +0300 Subject: [PATCH 13/59] APPS-139 changes around capabilities --- .../capability/rm-capabilities-record-context.xml | 8 ++------ .../action/dm/DeclareAsVersionRecordAction.java | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml index 6fcab797ad..6c70ad4bf8 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml @@ -158,12 +158,7 @@ parent="declarativeCapability"> - - - RECORD_FOLDER - RECORD - - + @@ -281,6 +276,7 @@ RECORD + RECORD_FOLDER diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java index f1332a4cdc..a05b3eddd4 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java @@ -74,7 +74,7 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac public static final String PARAM_FILE_PLAN = "file-plan"; public static final String PARAM_PATH = "path"; - private static final String FILE_UNFILED_RECORDS_CAPABILITY = "FileUnfiledRecords"; + private static final String EDIT_RECORD_METADATA_CAPABILITY = "EditRecordMetadata"; /** Sync Model URI */ private static final String SYNC_MODEL_1_0_URI = "http://www.alfresco.org/model/sync/1.0"; @@ -213,9 +213,9 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac // create record from latest version if (destinationRecordFolder != null) { - boolean hasFilingCapability = capabilityService.hasCapability(destinationRecordFolder, FILE_UNFILED_RECORDS_CAPABILITY); + boolean hasCapability = capabilityService.hasCapability(destinationRecordFolder, EDIT_RECORD_METADATA_CAPABILITY); // validate destination record folder - if (hasFilingCapability) + if (hasCapability) { NodeRef recordedVersion = recordableVersionService.createRecordFromLatestVersion(destinationRecordFolder, actionedUponNodeRef); recordService.file(recordedVersion); From e0dd6a1bfa19e89787081c70a798cda340049a10 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu Date: Thu, 4 Jun 2020 10:49:57 +0300 Subject: [PATCH 14/59] APPS-139 fix unit test --- .../org_alfresco_module_rm/action/dm/RecordActionUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java index ba3935293f..bfae201062 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java @@ -167,8 +167,8 @@ public class RecordActionUtils if (LOGGER.isDebugEnabled()) { LOGGER.debug("Unable to execute " + actionName + " action, because the fileplan path could not be determined. Make sure at least one file plan has been created."); - throw new AlfrescoRuntimeException("Unable to execute " + actionName + " action, because the fileplan path could not be determined."); } + throw new AlfrescoRuntimeException("Unable to execute " + actionName + " action, because the fileplan path could not be determined."); } return filePlan; } From fdf758b0d12a7a6fde24ab8b86ccb82d1476c531 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu Date: Thu, 4 Jun 2020 15:28:14 +0300 Subject: [PATCH 15/59] APPS-139 added unit test --- .../DeclareAsVersionRecordActionUnitTest.java | 107 ++++++++++++++++-- 1 file changed, 95 insertions(+), 12 deletions(-) diff --git a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordActionUnitTest.java b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordActionUnitTest.java index bee22e3a7d..0610fbd27e 100644 --- a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordActionUnitTest.java +++ b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordActionUnitTest.java @@ -38,12 +38,15 @@ import static org.mockito.Mockito.verify; import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.action.BaseActionUnitTest; +import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService; import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService; import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; import org.junit.Test; import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.springframework.extensions.webscripts.GUID; /** * Declare as version record action unit test. @@ -59,10 +62,19 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest /** actioned upon node reference */ private NodeRef actionedUponNodeRef; + + /** destination record folder node reference */ + private NodeRef destinationRecordFolderNodeRef; + + /** parent destination node reference */ + private NodeRef parentDestinationNodeRef; /** declare as version record action */ private @InjectMocks DeclareAsVersionRecordAction declareAsVersionRecordAction; - + + @Mock + private CapabilityService mockedCapabilityService; + /** * @see org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest#before() */ @@ -76,6 +88,12 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest // mocked actioned upon noderef actionedUponNodeRef = generateNodeRef(); + + // mocked destination record folder nodeRef + destinationRecordFolderNodeRef = generateNodeRef(); + + // mocked parent destination nodeRef + parentDestinationNodeRef = generateNodeRef(); } /** @@ -214,13 +232,13 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest // expect exception exception.expect(AlfrescoRuntimeException.class); - // exceute action + // execute action declareAsVersionRecordAction.executeImpl(mock(Action.class), actionedUponNodeRef); } - /** + /** * Given that no file plan is provided - * And adefault file plan exists + * And a default file plan exists * When I execute the action * Then a version record is declared */ @@ -230,18 +248,18 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest // setup doReturn(true).when(mockedNodeService).exists(actionedUponNodeRef); doReturn(true).when(mockedDictionaryService).isSubClass(any(QName.class), eq(ContentModel.TYPE_CONTENT)); - doReturn(true).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE); + doReturn(true).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE); doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD); doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY); doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD_REJECTION_DETAILS); doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_SYNCED); - + // no default file plan doReturn(filePlan).when(mockedFilePlanService).getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID); - - // exceute action - declareAsVersionRecordAction.executeImpl(mock(Action.class), actionedUponNodeRef); - verify(mockedRecordableVersionService, times(1)).createRecordFromLatestVersion(filePlan, actionedUponNodeRef); + + // execute action + declareAsVersionRecordAction.executeImpl(mock(Action.class), actionedUponNodeRef); + verify(mockedRecordableVersionService, times(1)).createRecordFromLatestVersion(filePlan, actionedUponNodeRef); } /** @@ -268,7 +286,7 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest // expect exception exception.expect(AlfrescoRuntimeException.class); - // exceute action + // execute action declareAsVersionRecordAction.executeImpl(getMockedAction(), actionedUponNodeRef); } @@ -295,8 +313,73 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest doReturn(true).when(mockedFilePlanService).isFilePlan(myFilePlan); mockActionParameterValue(DeclareAsVersionRecordAction.PARAM_FILE_PLAN, myFilePlan); - // exceute action + // execute action declareAsVersionRecordAction.executeImpl(getMockedAction(), actionedUponNodeRef); verify(mockedRecordableVersionService, times(1)).createRecordFromLatestVersion(myFilePlan, actionedUponNodeRef); } + + /** + * Given that a valid location is provided + * When I execute the action + * Then a version record is declared in the provided location + */ + @Test + public void validDestinationRecordFolderProvided() + { + String childName = GUID.generate(); + // setup + doReturn(true).when(mockedNodeService).exists(actionedUponNodeRef); + doReturn(true).when(mockedDictionaryService).isSubClass(any(QName.class), eq(ContentModel.TYPE_CONTENT)); + doReturn(true).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE); + doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD); + doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY); + doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD_REJECTION_DETAILS); + doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_SYNCED); + + // provided location + doReturn(destinationRecordFolderNodeRef).when(mockedNodeService).getChildByName(parentDestinationNodeRef, ContentModel.ASSOC_CONTAINS, childName); + doReturn(TYPE_RECORD_FOLDER).when(mockedNodeService).getType(destinationRecordFolderNodeRef); + + // capability check + doReturn(true).when(mockedCapabilityService).hasCapability(destinationRecordFolderNodeRef, "EditRecordMetadata"); + + // file plan service + doReturn(filePlan).when(mockedFilePlanService).getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID); + + // execute action + declareAsVersionRecordAction.executeImpl(mock(Action.class), actionedUponNodeRef); + verify(mockedRecordableVersionService, times(1)).createRecordFromLatestVersion(filePlan, actionedUponNodeRef); + } + + /** + * Given that an invalid location is provided + * When I execute the action + * Then an exception is thrown + */ + @Test + public void invalidDestinationRecordFolderProvided() + { + String childName = GUID.generate(); + // setup + doReturn(true).when(mockedNodeService).exists(actionedUponNodeRef); + doReturn(true).when(mockedDictionaryService).isSubClass(any(QName.class), eq(ContentModel.TYPE_CONTENT)); + doReturn(true).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE); + doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD); + doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY); + doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD_REJECTION_DETAILS); + doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_SYNCED); + + // provided location + doReturn(destinationRecordFolderNodeRef).when(mockedNodeService).getChildByName(parentDestinationNodeRef, ContentModel.ASSOC_CONTAINS, childName); + doReturn(TYPE_RECORD_FOLDER).when(mockedNodeService).getType(destinationRecordFolderNodeRef); + + // capability check + doReturn(false).when(mockedCapabilityService).hasCapability(destinationRecordFolderNodeRef, "EditRecordMetadata"); + + // expect exception + exception.expect(AlfrescoRuntimeException.class); + + // execute action + declareAsVersionRecordAction.executeImpl(mock(Action.class), actionedUponNodeRef); + } } From 122671eb2c8c8d71771fd0112a7964eba621ea14 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu Date: Thu, 4 Jun 2020 18:55:56 +0300 Subject: [PATCH 16/59] APPS-139 other code review comments --- .../action/dm/RecordActionUtils.java | 4 + .../DeclareAsVersionRecordActionUnitTest.java | 81 +++++++------------ 2 files changed, 33 insertions(+), 52 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java index bfae201062..3a350b940d 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java @@ -41,6 +41,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.util.StringUtils; +/** + * Utility class containing helper methods for record + */ + public class RecordActionUtils { /** diff --git a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordActionUnitTest.java b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordActionUnitTest.java index 0610fbd27e..edfef6560e 100644 --- a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordActionUnitTest.java +++ b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordActionUnitTest.java @@ -218,14 +218,8 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest public void noFilePlanParameterNoDefaultFilePlan() { // setup - doReturn(true).when(mockedNodeService).exists(actionedUponNodeRef); - doReturn(true).when(mockedDictionaryService).isSubClass(any(QName.class), eq(ContentModel.TYPE_CONTENT)); - doReturn(true).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD_REJECTION_DETAILS); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_SYNCED); - + setupMockedAspects(); + // no default file plan doReturn(null).when(mockedFilePlanService).getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID); @@ -235,7 +229,7 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest // execute action declareAsVersionRecordAction.executeImpl(mock(Action.class), actionedUponNodeRef); } - + /** * Given that no file plan is provided * And a default file plan exists @@ -246,13 +240,7 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest public void noFilePlanParameterDefaultFilePlan() { // setup - doReturn(true).when(mockedNodeService).exists(actionedUponNodeRef); - doReturn(true).when(mockedDictionaryService).isSubClass(any(QName.class), eq(ContentModel.TYPE_CONTENT)); - doReturn(true).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD_REJECTION_DETAILS); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_SYNCED); + setupMockedAspects(); // no default file plan doReturn(filePlan).when(mockedFilePlanService).getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID); @@ -261,7 +249,7 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest declareAsVersionRecordAction.executeImpl(mock(Action.class), actionedUponNodeRef); verify(mockedRecordableVersionService, times(1)).createRecordFromLatestVersion(filePlan, actionedUponNodeRef); } - + /** * Given that a file plan is provided * And it isn't a file plan @@ -272,14 +260,8 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest public void invalidFilePlanParameter() { // setup - doReturn(true).when(mockedNodeService).exists(actionedUponNodeRef); - doReturn(true).when(mockedDictionaryService).isSubClass(any(QName.class), eq(ContentModel.TYPE_CONTENT)); - doReturn(true).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD_REJECTION_DETAILS); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_SYNCED); - + setupMockedAspects(); + // not a file plan is provided in the parameters mockActionParameterValue(DeclareAsVersionRecordAction.PARAM_FILE_PLAN, generateNodeRef()); @@ -300,14 +282,8 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest public void validFilePlanParameter() { // setup - doReturn(true).when(mockedNodeService).exists(actionedUponNodeRef); - doReturn(true).when(mockedDictionaryService).isSubClass(any(QName.class), eq(ContentModel.TYPE_CONTENT)); - doReturn(true).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD_REJECTION_DETAILS); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_SYNCED); - + setupMockedAspects(); + // not a file plan is provided in the parameters NodeRef myFilePlan = generateNodeRef(TYPE_FILE_PLAN); doReturn(true).when(mockedFilePlanService).isFilePlan(myFilePlan); @@ -326,18 +302,14 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest @Test public void validDestinationRecordFolderProvided() { - String childName = GUID.generate(); + String pathParameter = GUID.generate(); // setup - doReturn(true).when(mockedNodeService).exists(actionedUponNodeRef); - doReturn(true).when(mockedDictionaryService).isSubClass(any(QName.class), eq(ContentModel.TYPE_CONTENT)); - doReturn(true).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD_REJECTION_DETAILS); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_SYNCED); + setupMockedAspects(); + + mockActionParameterValue(DeclareAsVersionRecordAction.PARAM_PATH, pathParameter); // provided location - doReturn(destinationRecordFolderNodeRef).when(mockedNodeService).getChildByName(parentDestinationNodeRef, ContentModel.ASSOC_CONTAINS, childName); + doReturn(destinationRecordFolderNodeRef).when(mockedNodeService).getChildByName(filePlan, ContentModel.ASSOC_CONTAINS, pathParameter); doReturn(TYPE_RECORD_FOLDER).when(mockedNodeService).getType(destinationRecordFolderNodeRef); // capability check @@ -347,8 +319,8 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest doReturn(filePlan).when(mockedFilePlanService).getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID); // execute action - declareAsVersionRecordAction.executeImpl(mock(Action.class), actionedUponNodeRef); - verify(mockedRecordableVersionService, times(1)).createRecordFromLatestVersion(filePlan, actionedUponNodeRef); + declareAsVersionRecordAction.executeImpl(getMockedAction(), actionedUponNodeRef); + verify(mockedRecordableVersionService, times(1)).createRecordFromLatestVersion(destinationRecordFolderNodeRef, actionedUponNodeRef); } /** @@ -361,13 +333,7 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest { String childName = GUID.generate(); // setup - doReturn(true).when(mockedNodeService).exists(actionedUponNodeRef); - doReturn(true).when(mockedDictionaryService).isSubClass(any(QName.class), eq(ContentModel.TYPE_CONTENT)); - doReturn(true).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD_REJECTION_DETAILS); - doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_SYNCED); + setupMockedAspects(); // provided location doReturn(destinationRecordFolderNodeRef).when(mockedNodeService).getChildByName(parentDestinationNodeRef, ContentModel.ASSOC_CONTAINS, childName); @@ -380,6 +346,17 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest exception.expect(AlfrescoRuntimeException.class); // execute action - declareAsVersionRecordAction.executeImpl(mock(Action.class), actionedUponNodeRef); + declareAsVersionRecordAction.executeImpl(getMockedAction(), actionedUponNodeRef); + } + + private void setupMockedAspects() + { + doReturn(true).when(mockedNodeService).exists(actionedUponNodeRef); + doReturn(true).when(mockedDictionaryService).isSubClass(any(QName.class), eq(ContentModel.TYPE_CONTENT)); + doReturn(true).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE); + doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD); + doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY); + doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD_REJECTION_DETAILS); + doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_SYNCED); } } From 0dfab9495ecac6d6e4e28c8d3b80b9ae06840f63 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 17/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- README.txt | 2 +- pom.xml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.txt b/README.txt index 726c5335de..07d9f7ecfa 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ Configuring and starting Alfresco/Share: ---------------------------------------- -- Clone the project (e.g. git clone git@gitlab.alfresco.com:records-management/records-management.git) +- Clone the project (e.g. git clone git@github.com:Alfresco/governance-services.git) - Import the project as a maven project diff --git a/pom.xml b/pom.xml index 99ba22c921..79a440a101 100644 --- a/pom.xml +++ b/pom.xml @@ -21,11 +21,11 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - HEAD - + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD + JIRA From 926b7f88c49ae22f7de19bc916d8d3e0e466ee42 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 18/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- README.txt | 2 +- pom.xml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.txt b/README.txt index 637a6736fd..0b7096410f 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ Configuring and starting Alfresco/Share: ---------------------------------------- -- Clone the project (e.g. git clone git@gitlab.alfresco.com:records-management/records-management.git) +- Clone the project (e.g. git clone git@github.com:Alfresco/governance-services.git) - Import the project as a maven project diff --git a/pom.xml b/pom.xml index 1b1b9995f3..473e03e16c 100644 --- a/pom.xml +++ b/pom.xml @@ -21,11 +21,11 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - HEAD - + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD + JIRA From d815790260724d75c8f2272da2938712e5fe1670 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 19/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- README.txt | 2 +- pom.xml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.txt b/README.txt index 637a6736fd..0b7096410f 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ Configuring and starting Alfresco/Share: ---------------------------------------- -- Clone the project (e.g. git clone git@gitlab.alfresco.com:records-management/records-management.git) +- Clone the project (e.g. git clone git@github.com:Alfresco/governance-services.git) - Import the project as a maven project diff --git a/pom.xml b/pom.xml index 8c62e4ebfc..704f99759a 100644 --- a/pom.xml +++ b/pom.xml @@ -21,11 +21,11 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - HEAD - + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD + JIRA From 226efd859b9b3bd73011fe065f3a59fc84d8d088 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 20/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- README.txt | 2 +- pom.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.txt b/README.txt index c834ccf83d..0d34840750 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ Configuring and starting Alfresco/Share: ---------------------------------------- -- Clone the project (e.g. git clone git@gitlab.alfresco.com:records-management/records-management.git) +- Clone the project (e.g. git clone git@github.com:Alfresco/governance-services.git) - Import the project as a maven project diff --git a/pom.xml b/pom.xml index 174410e56a..e720821e68 100644 --- a/pom.xml +++ b/pom.xml @@ -21,10 +21,10 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - V2.5.2 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD From 6037a677412bc1c6f715185e51fe8fd67958c059 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 21/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- README.txt | 2 +- pom.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.txt b/README.txt index c834ccf83d..0d34840750 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ Configuring and starting Alfresco/Share: ---------------------------------------- -- Clone the project (e.g. git clone git@gitlab.alfresco.com:records-management/records-management.git) +- Clone the project (e.g. git clone git@github.com:Alfresco/governance-services.git) - Import the project as a maven project diff --git a/pom.xml b/pom.xml index 37c07218a2..3e1381b2d6 100644 --- a/pom.xml +++ b/pom.xml @@ -21,10 +21,10 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - V2.5.3 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD From 5ea8461c06e9016965b58c55b4dd151988144b0d Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 22/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- README.txt | 2 +- pom.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.txt b/README.txt index c834ccf83d..0d34840750 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ Configuring and starting Alfresco/Share: ---------------------------------------- -- Clone the project (e.g. git clone git@gitlab.alfresco.com:records-management/records-management.git) +- Clone the project (e.g. git clone git@github.com:Alfresco/governance-services.git) - Import the project as a maven project diff --git a/pom.xml b/pom.xml index d8ad07760c..16580a61c7 100644 --- a/pom.xml +++ b/pom.xml @@ -21,10 +21,10 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - V2.5.4 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD From 6ed3187bdc9a8154868076df86f17e8574df2169 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 23/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- README.txt | 2 +- pom.xml | 8 ++++---- rm-community/documentation/overview.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.txt b/README.txt index 1d260c7466..5191713f84 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ Configuring and starting Alfresco/Share: ---------------------------------------- -- Clone the project (e.g. git clone git@gitlab.alfresco.com:records-management/records-management.git) +- Clone the project (e.g. git clone git@github.com:Alfresco/governance-services.git) - Import the project as a maven project diff --git a/pom.xml b/pom.xml index 673fb733a6..79a42a7d96 100644 --- a/pom.xml +++ b/pom.xml @@ -21,10 +21,10 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - V2.6.0 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD diff --git a/rm-community/documentation/overview.md b/rm-community/documentation/overview.md index ed79baa2d3..4fe00bda81 100644 --- a/rm-community/documentation/overview.md +++ b/rm-community/documentation/overview.md @@ -17,7 +17,7 @@ RM is split into two main parts - a repository integration and a Share integrati ### Artifacts and Guidance * [Community Source Code](https://github.com/Alfresco/records-management) -* [Enterprise Source Code](https://gitlab.alfresco.com/records-management/records-management) (for partners and customers) +* [Enterprise Source Code](https://github.com/Alfresco/governance-services) (for partners and customers) * [Community License](../LICENSE.txt) * [Enterprise License](../../rm-enterprise/LICENSE.txt) (this file will only be present in clones of the Enterprise repository) * [Issue Tracker Link](https://issues.alfresco.com/jira/projects/RM) From 5fc396bdbae1bcab3d4f60755b9422b420be6ed7 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 24/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- README.txt | 2 +- pom.xml | 8 ++++---- rm-community/documentation/overview.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.txt b/README.txt index 1d260c7466..5191713f84 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ Configuring and starting Alfresco/Share: ---------------------------------------- -- Clone the project (e.g. git clone git@gitlab.alfresco.com:records-management/records-management.git) +- Clone the project (e.g. git clone git@github.com:Alfresco/governance-services.git) - Import the project as a maven project diff --git a/pom.xml b/pom.xml index 5517a1a903..13108ece93 100644 --- a/pom.xml +++ b/pom.xml @@ -21,10 +21,10 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - V2.6.1 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD diff --git a/rm-community/documentation/overview.md b/rm-community/documentation/overview.md index ed79baa2d3..4fe00bda81 100644 --- a/rm-community/documentation/overview.md +++ b/rm-community/documentation/overview.md @@ -17,7 +17,7 @@ RM is split into two main parts - a repository integration and a Share integrati ### Artifacts and Guidance * [Community Source Code](https://github.com/Alfresco/records-management) -* [Enterprise Source Code](https://gitlab.alfresco.com/records-management/records-management) (for partners and customers) +* [Enterprise Source Code](https://github.com/Alfresco/governance-services) (for partners and customers) * [Community License](../LICENSE.txt) * [Enterprise License](../../rm-enterprise/LICENSE.txt) (this file will only be present in clones of the Enterprise repository) * [Issue Tracker Link](https://issues.alfresco.com/jira/projects/RM) From ed0b8635125ebac87d66dd9a0f5d5f71065b27e7 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 25/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- README.txt | 2 +- pom.xml | 8 ++++---- rm-community/documentation/overview.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.txt b/README.txt index 1d260c7466..5191713f84 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ Configuring and starting Alfresco/Share: ---------------------------------------- -- Clone the project (e.g. git clone git@gitlab.alfresco.com:records-management/records-management.git) +- Clone the project (e.g. git clone git@github.com:Alfresco/governance-services.git) - Import the project as a maven project diff --git a/pom.xml b/pom.xml index 3bacb45837..4e2103e1cf 100644 --- a/pom.xml +++ b/pom.xml @@ -21,10 +21,10 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - V2.6.2 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD diff --git a/rm-community/documentation/overview.md b/rm-community/documentation/overview.md index ed79baa2d3..4fe00bda81 100644 --- a/rm-community/documentation/overview.md +++ b/rm-community/documentation/overview.md @@ -17,7 +17,7 @@ RM is split into two main parts - a repository integration and a Share integrati ### Artifacts and Guidance * [Community Source Code](https://github.com/Alfresco/records-management) -* [Enterprise Source Code](https://gitlab.alfresco.com/records-management/records-management) (for partners and customers) +* [Enterprise Source Code](https://github.com/Alfresco/governance-services) (for partners and customers) * [Community License](../LICENSE.txt) * [Enterprise License](../../rm-enterprise/LICENSE.txt) (this file will only be present in clones of the Enterprise repository) * [Issue Tracker Link](https://issues.alfresco.com/jira/projects/RM) From 7743234096c17570a88cbb97f3aaa52c68e56dfb Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 26/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 1bfb66b473..b17a557917 100644 --- a/pom.xml +++ b/pom.xml @@ -21,10 +21,10 @@ - scm:git:ssh://git@github.com/Alfresco/governance-services.git - scm:git:ssh://git@github.com/Alfresco/governance-services.git - scm:git:ssh://git@github.com/Alfresco/governance-services.git - V2.6.3 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD From 475b46da60c1975ebbf1d9166ba50cb50ea9f734 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 27/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- pom.xml | 8 ++++---- rm-community/documentation/overview.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 8508225b38..b82c8eaff6 100644 --- a/pom.xml +++ b/pom.xml @@ -21,10 +21,10 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - V2.7.1 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD diff --git a/rm-community/documentation/overview.md b/rm-community/documentation/overview.md index d80c026457..c5918e396a 100644 --- a/rm-community/documentation/overview.md +++ b/rm-community/documentation/overview.md @@ -17,7 +17,7 @@ RM is split into two main parts - a repository integration and a Share integrati ### Artifacts and Guidance * [Community Source Code](https://github.com/Alfresco/records-management) -* [Enterprise Source Code](https://gitlab.alfresco.com/records-management/records-management) (for partners and customers) +* [Enterprise Source Code](https://github.com/Alfresco/governance-services) (for partners and customers) * [Community License](../LICENSE.txt) * [Enterprise License](../../rm-enterprise/LICENSE.txt) (this file will only be present in clones of the Enterprise repository) * [Issue Tracker Link](https://issues.alfresco.com/jira/projects/RM) From 30bafb944c0efd68b9dc8b209e65a4a60a2cbb5d Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 28/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- pom.xml | 8 ++++---- rm-community/documentation/overview.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index b6cdea62fd..1438bba142 100644 --- a/pom.xml +++ b/pom.xml @@ -21,10 +21,10 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - V2.7.2 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD diff --git a/rm-community/documentation/overview.md b/rm-community/documentation/overview.md index d80c026457..c5918e396a 100644 --- a/rm-community/documentation/overview.md +++ b/rm-community/documentation/overview.md @@ -17,7 +17,7 @@ RM is split into two main parts - a repository integration and a Share integrati ### Artifacts and Guidance * [Community Source Code](https://github.com/Alfresco/records-management) -* [Enterprise Source Code](https://gitlab.alfresco.com/records-management/records-management) (for partners and customers) +* [Enterprise Source Code](https://github.com/Alfresco/governance-services) (for partners and customers) * [Community License](../LICENSE.txt) * [Enterprise License](../../rm-enterprise/LICENSE.txt) (this file will only be present in clones of the Enterprise repository) * [Issue Tracker Link](https://issues.alfresco.com/jira/projects/RM) From 7c8b9d86bd221c34386c30831ed1289d569a8749 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 29/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- pom.xml | 8 ++++---- rm-community/documentation/overview.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 6080de91ad..a8112af457 100644 --- a/pom.xml +++ b/pom.xml @@ -15,10 +15,10 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - V3.0.0 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD diff --git a/rm-community/documentation/overview.md b/rm-community/documentation/overview.md index d80c026457..c5918e396a 100644 --- a/rm-community/documentation/overview.md +++ b/rm-community/documentation/overview.md @@ -17,7 +17,7 @@ RM is split into two main parts - a repository integration and a Share integrati ### Artifacts and Guidance * [Community Source Code](https://github.com/Alfresco/records-management) -* [Enterprise Source Code](https://gitlab.alfresco.com/records-management/records-management) (for partners and customers) +* [Enterprise Source Code](https://github.com/Alfresco/governance-services) (for partners and customers) * [Community License](../LICENSE.txt) * [Enterprise License](../../rm-enterprise/LICENSE.txt) (this file will only be present in clones of the Enterprise repository) * [Issue Tracker Link](https://issues.alfresco.com/jira/projects/RM) From b8b7b0ce05d11029c2575c03554f41579935fd2c Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 30/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- pom.xml | 6 +++--- rm-community/documentation/overview.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 5abb8617da..4258888f1c 100644 --- a/pom.xml +++ b/pom.xml @@ -15,9 +15,9 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services HEAD diff --git a/rm-community/documentation/overview.md b/rm-community/documentation/overview.md index d80c026457..c5918e396a 100644 --- a/rm-community/documentation/overview.md +++ b/rm-community/documentation/overview.md @@ -17,7 +17,7 @@ RM is split into two main parts - a repository integration and a Share integrati ### Artifacts and Guidance * [Community Source Code](https://github.com/Alfresco/records-management) -* [Enterprise Source Code](https://gitlab.alfresco.com/records-management/records-management) (for partners and customers) +* [Enterprise Source Code](https://github.com/Alfresco/governance-services) (for partners and customers) * [Community License](../LICENSE.txt) * [Enterprise License](../../rm-enterprise/LICENSE.txt) (this file will only be present in clones of the Enterprise repository) * [Issue Tracker Link](https://issues.alfresco.com/jira/projects/RM) From a159dd03bac3c54386708858fdc60bd76ba4c158 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 31/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- pom.xml | 8 ++++---- rm-community/documentation/overview.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 63d55fde35..35e263fbfb 100644 --- a/pom.xml +++ b/pom.xml @@ -15,10 +15,10 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - V3.0.2 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD diff --git a/rm-community/documentation/overview.md b/rm-community/documentation/overview.md index d80c026457..c5918e396a 100644 --- a/rm-community/documentation/overview.md +++ b/rm-community/documentation/overview.md @@ -17,7 +17,7 @@ RM is split into two main parts - a repository integration and a Share integrati ### Artifacts and Guidance * [Community Source Code](https://github.com/Alfresco/records-management) -* [Enterprise Source Code](https://gitlab.alfresco.com/records-management/records-management) (for partners and customers) +* [Enterprise Source Code](https://github.com/Alfresco/governance-services) (for partners and customers) * [Community License](../LICENSE.txt) * [Enterprise License](../../rm-enterprise/LICENSE.txt) (this file will only be present in clones of the Enterprise repository) * [Issue Tracker Link](https://issues.alfresco.com/jira/projects/RM) From 86ef3f62e04fa3e2977ea1d6757fe3e21d70763a Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 32/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- pom.xml | 8 ++++---- rm-community/documentation/overview.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index d5d0a9086a..f8e0d971c1 100644 --- a/pom.xml +++ b/pom.xml @@ -15,10 +15,10 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - V3.1.0 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD diff --git a/rm-community/documentation/overview.md b/rm-community/documentation/overview.md index d80c026457..c5918e396a 100644 --- a/rm-community/documentation/overview.md +++ b/rm-community/documentation/overview.md @@ -17,7 +17,7 @@ RM is split into two main parts - a repository integration and a Share integrati ### Artifacts and Guidance * [Community Source Code](https://github.com/Alfresco/records-management) -* [Enterprise Source Code](https://gitlab.alfresco.com/records-management/records-management) (for partners and customers) +* [Enterprise Source Code](https://github.com/Alfresco/governance-services) (for partners and customers) * [Community License](../LICENSE.txt) * [Enterprise License](../../rm-enterprise/LICENSE.txt) (this file will only be present in clones of the Enterprise repository) * [Issue Tracker Link](https://issues.alfresco.com/jira/projects/RM) From 06a8df491cb691e4ec0bef8afddaf5beb6860727 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 33/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- pom.xml | 8 ++++---- rm-community/documentation/overview.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 7822a92528..c3360da001 100644 --- a/pom.xml +++ b/pom.xml @@ -15,10 +15,10 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - V3.2.0 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD diff --git a/rm-community/documentation/overview.md b/rm-community/documentation/overview.md index d80c026457..c5918e396a 100644 --- a/rm-community/documentation/overview.md +++ b/rm-community/documentation/overview.md @@ -17,7 +17,7 @@ RM is split into two main parts - a repository integration and a Share integrati ### Artifacts and Guidance * [Community Source Code](https://github.com/Alfresco/records-management) -* [Enterprise Source Code](https://gitlab.alfresco.com/records-management/records-management) (for partners and customers) +* [Enterprise Source Code](https://github.com/Alfresco/governance-services) (for partners and customers) * [Community License](../LICENSE.txt) * [Enterprise License](../../rm-enterprise/LICENSE.txt) (this file will only be present in clones of the Enterprise repository) * [Issue Tracker Link](https://issues.alfresco.com/jira/projects/RM) From ac0287bff4d108cb4d5b7e11cd6a1f25ccc58a28 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 34/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- pom.xml | 8 ++++---- rm-community/documentation/overview.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 20a45c4bdf..ed90e70dca 100644 --- a/pom.xml +++ b/pom.xml @@ -15,10 +15,10 @@ - scm:git:https://git.alfresco.com/records-management/records-management.git - scm:git:https://git.alfresco.com/records-management/records-management.git - https://git.alfresco.com/records-management/records-management - V3.3.0 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD diff --git a/rm-community/documentation/overview.md b/rm-community/documentation/overview.md index d80c026457..c5918e396a 100644 --- a/rm-community/documentation/overview.md +++ b/rm-community/documentation/overview.md @@ -17,7 +17,7 @@ RM is split into two main parts - a repository integration and a Share integrati ### Artifacts and Guidance * [Community Source Code](https://github.com/Alfresco/records-management) -* [Enterprise Source Code](https://gitlab.alfresco.com/records-management/records-management) (for partners and customers) +* [Enterprise Source Code](https://github.com/Alfresco/governance-services) (for partners and customers) * [Community License](../LICENSE.txt) * [Enterprise License](../../rm-enterprise/LICENSE.txt) (this file will only be present in clones of the Enterprise repository) * [Issue Tracker Link](https://issues.alfresco.com/jira/projects/RM) From 2638a305dfc50ca11c3a44a90725ecc730199192 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 24 Mar 2020 12:34:57 +0200 Subject: [PATCH 35/59] RM-7131 Update old gitlab repo links with the new one from github (cherry picked from commit c3cdd88873997e9b6cfbbc3bc5880a70f729597d) --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 8871ca43d5..08652ed02d 100644 --- a/pom.xml +++ b/pom.xml @@ -15,10 +15,10 @@ - scm:git:ssh://git@github.com/Alfresco/governance-services.git - scm:git:ssh://git@github.com/Alfresco/governance-services.git - scm:git:ssh://git@github.com/Alfresco/governance-services.git - V3.3.1 + scm:git:https://github.com/Alfresco/governance-services.git + scm:git:https://github.com/Alfresco/governance-services.git + https://github.com/Alfresco/governance-services + HEAD From 36fe4bfe2319e5a0bf65151a0b3a40ac192f0677 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 36/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 79a440a101..eaa4854c2d 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From 42f75e408175236af6a146e1240b72991ac45786 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 37/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 473e03e16c..36e12dbcfa 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From dc8abe5078f851e063a6e3f1a3def92a898c22cb Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 38/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 704f99759a..a659ec5c7e 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From c7a600ca6c0cc796e5c714b3778e2599772157ad Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 39/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index e720821e68..c809ed1b2d 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From d6ac3025a726b1924551f60bb2ac0fa531885b72 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 40/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 3e1381b2d6..9d703e114e 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From f615b8e928003618923b15a42a4d06ab5fd8dfd5 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 41/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 16580a61c7..d3727eac1b 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From 25cdb7a437eac4995be7baa345dcd5ce13f5cd83 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 42/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 79a42a7d96..f94f72cdc1 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From e3337cdaf84e166fbc6a413d66ea385e8178324b Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 43/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 4e2103e1cf..61e7fb32ce 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From 267237bd68217fecd3ac7bb709e8f0425550e8ef Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 44/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index b17a557917..a7bb122483 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From 21083cc777692aa7ee72102d77c7d5e7ffe5d34b Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 45/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index b82c8eaff6..12987bbf2e 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From 13d770273cfc48e041f4dbb6e085f36200d5821e Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 46/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 1438bba142..c81fceaf63 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From 4d7b976a02189da5bc98a7a4fe17cbc13d97b505 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 47/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index a8112af457..6af8ebe90c 100644 --- a/pom.xml +++ b/pom.xml @@ -15,9 +15,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From 8d7622f12f31f1f2494f44a315b2caa2c82591a9 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 48/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 4258888f1c..bf2f01bbc1 100644 --- a/pom.xml +++ b/pom.xml @@ -15,9 +15,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From 0ee5bfa75f889516c25f41e9ac5e4ee158528df2 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 49/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 35e263fbfb..ee19f1a78f 100644 --- a/pom.xml +++ b/pom.xml @@ -15,9 +15,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From 0ed03e6aa3d78845728ce27848a249a8d1af0253 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 50/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index f8e0d971c1..c468690b31 100644 --- a/pom.xml +++ b/pom.xml @@ -15,9 +15,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From 6d225414375d444eca60fc32b7e007b3a11a4a1b Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 51/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c3360da001..aca6d2b0ef 100644 --- a/pom.xml +++ b/pom.xml @@ -15,9 +15,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From 08a6393ed948e3b8519c23d1bf485a8eaa3002eb Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 52/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index ed90e70dca..66e9d23947 100644 --- a/pom.xml +++ b/pom.xml @@ -15,9 +15,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From 4feb3b06fe5fdbaf619167d1bba030b6e5e5c4f6 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Tue, 14 Apr 2020 16:53:41 +0300 Subject: [PATCH 53/59] Change SCM URLs in order to switch to SSH authentication with 2FA for Github (cherry picked from commit 53f26b5793a6edf4eecaddad3b558aa8653ee747) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 08652ed02d..c58a0e408e 100644 --- a/pom.xml +++ b/pom.xml @@ -15,9 +15,9 @@ - scm:git:https://github.com/Alfresco/governance-services.git - scm:git:https://github.com/Alfresco/governance-services.git - https://github.com/Alfresco/governance-services + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git + scm:git:ssh://git@github.com/Alfresco/governance-services.git HEAD From 2132a7151a339a119ad09eb10146de5f017bd5b3 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu Date: Tue, 9 Jun 2020 14:29:51 +0300 Subject: [PATCH 54/59] APPS-139 other code review comments --- .../action/dm/CreateRecordAction.java | 6 ++-- .../dm/DeclareAsVersionRecordAction.java | 8 +++--- .../action/dm/RecordActionUtils.java | 28 ++++++++----------- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/CreateRecordAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/CreateRecordAction.java index ef9245ed29..2a6ab6942f 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/CreateRecordAction.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/CreateRecordAction.java @@ -27,6 +27,8 @@ package org.alfresco.module.org_alfresco_module_rm.action.dm; +import static org.alfresco.module.org_alfresco_module_rm.action.dm.RecordActionUtils.resolvePath; + import java.util.List; import org.alfresco.module.org_alfresco_module_rm.action.AuditableActionExecuterAbstractBase; @@ -128,13 +130,13 @@ public class CreateRecordAction extends AuditableActionExecuterAbstractBase Boolean hideRecordValue = ((Boolean) action.getParameterValue(PARAM_HIDE_RECORD)); if (hideRecordValue != null) { - hideRecord = hideRecordValue.booleanValue(); + hideRecord = hideRecordValue; } if (pathParameter != null && !pathParameter.isEmpty()) { RecordActionUtils.Services services = new Services(nodeService, filePlanService, authenticationUtil); - destinationRecordFolder = RecordActionUtils.resolvePath(services, filePlan, pathParameter, NAME); + destinationRecordFolder = resolvePath(services, filePlan, pathParameter, NAME); } synchronized (this) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java index a05b3eddd4..2a3fc4faf4 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java @@ -181,7 +181,7 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac logger.debug("Can not declare version as record, because " + actionedUponNodeRef.toString() + " is not a supported type."); } } - else if (!isActionEligible(actionedUponNodeRef)) + else if (isActionEligible(actionedUponNodeRef)) { NodeRef filePlan = (NodeRef)action.getParameterValue(PARAM_FILE_PLAN); if (filePlan == null) @@ -261,7 +261,7 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac { logger.debug("Can not declare version record, because " + actionedUponNodeRef.toString() + aspect.getValue()); } - return true; + return false; } } if (!nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE)) @@ -270,8 +270,8 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac { logger.debug("Can not declare version record, because " + actionedUponNodeRef.toString() + " does not have the versionable aspect applied."); } - return true; + return false; } - return false; + return true; } } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java index 3a350b940d..de087d4edd 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/RecordActionUtils.java @@ -37,8 +37,8 @@ import org.alfresco.module.org_alfresco_module_rm.util.AuthenticationUtil; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.namespace.QName; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.util.StringUtils; /** @@ -50,7 +50,7 @@ public class RecordActionUtils /** * Logger */ - private static final Log LOGGER = LogFactory.getLog(RecordActionUtils.class); + private static final Logger LOGGER = LoggerFactory.getLogger(RecordActionUtils.class); /** Private constructor to prevent instantiation. */ private RecordActionUtils() @@ -139,15 +139,12 @@ public class RecordActionUtils { throw new AlfrescoRuntimeException("Unable to execute " + actionName + " action, because the destination path could not be found."); } - else + QName nodeType = nodeService.getType(nodeRef); + if (nodeType.equals(RecordsManagementModel.TYPE_HOLD_CONTAINER) || + nodeType.equals(RecordsManagementModel.TYPE_TRANSFER_CONTAINER) || + nodeType.equals(RecordsManagementModel.TYPE_UNFILED_RECORD_CONTAINER)) { - QName nodeType = nodeService.getType(nodeRef); - if (nodeType.equals(RecordsManagementModel.TYPE_HOLD_CONTAINER) || - nodeType.equals(RecordsManagementModel.TYPE_TRANSFER_CONTAINER) || - nodeType.equals(RecordsManagementModel.TYPE_UNFILED_RECORD_CONTAINER)) - { - throw new AlfrescoRuntimeException("Unable to execute " + actionName + " action, because the destination path is invalid."); - } + throw new AlfrescoRuntimeException("Unable to execute " + actionName + " action, because the destination path is invalid."); } if (pathElements.size() > 1) { @@ -168,11 +165,10 @@ public class RecordActionUtils // if the file plan is still null, raise an exception if (filePlan == null) { - if (LOGGER.isDebugEnabled()) - { - LOGGER.debug("Unable to execute " + actionName + " action, because the fileplan path could not be determined. Make sure at least one file plan has been created."); - } - throw new AlfrescoRuntimeException("Unable to execute " + actionName + " action, because the fileplan path could not be determined."); + final String logMessage = + String.format("Unable to execute %s action, because the fileplan path could not be determined. Make sure at least one file plan has been created.", actionName); + LOGGER.debug(logMessage); + throw new AlfrescoRuntimeException(logMessage); } return filePlan; } From bbdcfef32c5d3ac02ef453510544135f4e52c80a Mon Sep 17 00:00:00 2001 From: Roxana Lucanu Date: Tue, 9 Jun 2020 21:26:07 +0300 Subject: [PATCH 55/59] APPS-139 added new specific capability --- .../rm-capabilities-record-context.xml | 2 -- .../rm-capabilities-recordfolder-context.xml | 21 +++++++++++++++++++ .../messages/capability-service.properties | 1 + .../model/recordsPermissionModel.xml | 8 ++++++- .../security/rm-default-roles-bootstrap.json | 13 +++++++----- .../dm/DeclareAsVersionRecordAction.java | 4 ++-- 6 files changed, 39 insertions(+), 10 deletions(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml index 6c70ad4bf8..0f1015f7fa 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml @@ -158,7 +158,6 @@ parent="declarativeCapability"> - @@ -276,7 +275,6 @@ RECORD - RECORD_FOLDER diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-recordfolder-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-recordfolder-context.xml index 2420858b34..97f9aee406 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-recordfolder-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-recordfolder-context.xml @@ -62,6 +62,27 @@ + + + + + + RECORD_FOLDER + + + + + + + + + + + + + + + @@ -114,7 +115,8 @@ - + + @@ -232,6 +234,10 @@ + + + + diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/security/rm-default-roles-bootstrap.json b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/security/rm-default-roles-bootstrap.json index 5771b8d991..257f495b84 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/security/rm-default-roles-bootstrap.json +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/security/rm-default-roles-bootstrap.json @@ -49,7 +49,8 @@ "RequestRecordInformation", "FileUnfiledRecords", "RejectRecords", - "LinkToRecords" + "LinkToRecords", + "FileVersionRecords" ] }, { @@ -74,7 +75,8 @@ "FileUnfiledRecords", "RejectRecords", "LinkToRecords", - "ManageAccessControls" + "ManageAccessControls", + "FileVersionRecords" ] }, { @@ -145,8 +147,8 @@ "DeleteHold", "EndRetention", "EditHold", - "ManageAccessControls" - + "ManageAccessControls", + "FileVersionRecords" ] }, { @@ -219,7 +221,8 @@ "FileHoldReport", "DeleteHold", "EditHold", - "EndRetention" + "EndRetention", + "FileVersionRecords" ] } ] \ No newline at end of file diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java index 2a3fc4faf4..0b8dc76dd8 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java @@ -74,7 +74,7 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac public static final String PARAM_FILE_PLAN = "file-plan"; public static final String PARAM_PATH = "path"; - private static final String EDIT_RECORD_METADATA_CAPABILITY = "EditRecordMetadata"; + private static final String FILE_VERSION_RECORDS_CAPABILITY = "FileVersionRecords"; /** Sync Model URI */ private static final String SYNC_MODEL_1_0_URI = "http://www.alfresco.org/model/sync/1.0"; @@ -213,7 +213,7 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac // create record from latest version if (destinationRecordFolder != null) { - boolean hasCapability = capabilityService.hasCapability(destinationRecordFolder, EDIT_RECORD_METADATA_CAPABILITY); + boolean hasCapability = capabilityService.hasCapability(destinationRecordFolder, FILE_VERSION_RECORDS_CAPABILITY); // validate destination record folder if (hasCapability) { From 6a12b25d15ca0944d2bec7e331b07a91f6792579 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu Date: Wed, 10 Jun 2020 08:53:58 +0300 Subject: [PATCH 56/59] APPS-139 fix unit test --- .../action/dm/DeclareAsVersionRecordActionUnitTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordActionUnitTest.java b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordActionUnitTest.java index edfef6560e..86a9f49bf0 100644 --- a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordActionUnitTest.java +++ b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordActionUnitTest.java @@ -313,7 +313,7 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest doReturn(TYPE_RECORD_FOLDER).when(mockedNodeService).getType(destinationRecordFolderNodeRef); // capability check - doReturn(true).when(mockedCapabilityService).hasCapability(destinationRecordFolderNodeRef, "EditRecordMetadata"); + doReturn(true).when(mockedCapabilityService).hasCapability(destinationRecordFolderNodeRef, "FileVersionRecords"); // file plan service doReturn(filePlan).when(mockedFilePlanService).getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID); From fe1dc3ac9246d42dbbae33d287c195524a1852a4 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu Date: Wed, 10 Jun 2020 09:56:56 +0300 Subject: [PATCH 57/59] APPS-139 code review changes --- .../capability/rm-capabilities-record-context.xml | 1 + .../action/dm/DeclareAsVersionRecordAction.java | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml index 0f1015f7fa..40a454449b 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-record-context.xml @@ -158,6 +158,7 @@ parent="declarativeCapability"> + diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java index 0b8dc76dd8..3ad3c4cf00 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/DeclareAsVersionRecordAction.java @@ -188,17 +188,14 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac { filePlan = RecordActionUtils.getDefaultFilePlan(authenticationUtil, filePlanService, NAME); } - else + // verify that the provided file plan is actually a file plan + else if (!filePlanService.isFilePlan(filePlan)) { - // verify that the provided file plan is actually a file plan - if (!filePlanService.isFilePlan(filePlan)) + if (logger.isDebugEnabled()) { - if (logger.isDebugEnabled()) - { - logger.debug("Can not declare version record, because the provided file plan node reference is not a file plan."); - } - throw new AlfrescoRuntimeException("Can not declare version record, because the provided file plan node reference is not a file plan."); + logger.debug("Can not declare version record, because the provided file plan node reference is not a file plan."); } + throw new AlfrescoRuntimeException("Can not declare version record, because the provided file plan node reference is not a file plan."); } // resolve destination record folder if path supplied From 9b13204cd75acd456e4890f455fb6b37cfac75ed Mon Sep 17 00:00:00 2001 From: rodicasutu Date: Wed, 10 Jun 2020 13:57:19 +0300 Subject: [PATCH 58/59] updates according to the latest changes --- ...ecordTests.java => FileVersionAsRecordTests.java} | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/{DeclareAndFileVersionAsRecordTests.java => FileVersionAsRecordTests.java} (96%) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileVersionAsRecordTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/FileVersionAsRecordTests.java similarity index 96% rename from rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileVersionAsRecordTests.java rename to rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/FileVersionAsRecordTests.java index 9756949711..98e57c02a2 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareAndFileVersionAsRecordTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/FileVersionAsRecordTests.java @@ -71,7 +71,7 @@ import org.testng.annotations.Test; * @since 3.4 */ @AlfrescoTest (jira = "APPS-35") -public class DeclareAndFileVersionAsRecordTests extends BaseRMRestTest +public class FileVersionAsRecordTests extends BaseRMRestTest { private final static String DESTINATION_PATH_NOT_FOUND_EXC = "Unable to execute declare-version-record action, " + "because the destination path could not be found."; @@ -79,9 +79,9 @@ public class DeclareAndFileVersionAsRecordTests extends BaseRMRestTest "because the destination path is invalid."; private final static String DESTINATION_PATH_NOT_RECORD_FOLDER_EXC = "Unable to execute declare-version-record " + "action, because the destination path is not a record folder."; - private final static String CLOSED_RECORD_FOLDER_EXC = "You can't add new items to a closed record folder."; - private final static String FROZEN_RECORD_FOLDER_EXC = "You can't add new items to a frozen record folder."; - private final static String HOLD_NAME = getRandomName("holdName"); + private final static String ACCESS_DENIED_EXC = "Access Denied. You do not have the appropriate " + + "permissions to perform this operation."; + private final static String HOLD_NAME = getRandomName("holdName"); private UserModel userFillingPermission, userReadOnlyPermission; private SiteModel publicSite; @@ -188,10 +188,10 @@ public class DeclareAndFileVersionAsRecordTests extends BaseRMRestTest { recordCategory.getName(), DESTINATION_PATH_NOT_RECORD_FOLDER_EXC }, // a closed record folder { Utility.buildPath(recordCategory.getName(), closedRecordFolder.getName()), - CLOSED_RECORD_FOLDER_EXC }, + ACCESS_DENIED_EXC }, // a frozen record folder { Utility.buildPath(recordCategory.getName(), heldRecordFolder.getName()), - FROZEN_RECORD_FOLDER_EXC }, + ACCESS_DENIED_EXC }, // an arbitrary unfiled records folder { "Unfiled Records/" + unfiledContainerFolder.getName(), INVALID_DESTINATION_PATH_EXC }, // a collaboration site folder From 44421529da08b51aeafd986886244541794eb632 Mon Sep 17 00:00:00 2001 From: rodicasutu Date: Fri, 12 Jun 2020 13:46:55 +0300 Subject: [PATCH 59/59] update step information --- .../rest/rm/community/files/FileVersionAsRecordTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/FileVersionAsRecordTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/FileVersionAsRecordTests.java index 98e57c02a2..4e32cf4790 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/FileVersionAsRecordTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/FileVersionAsRecordTests.java @@ -256,7 +256,7 @@ public class FileVersionAsRecordTests extends BaseRMRestTest dataContent.usingSite(publicSite).usingAdmin().usingResource(testFile).updateContent("This is the new content" + "for " + testFile.getName()); - STEP("Declare document version as record without providing a location parameter value using v1 actions api"); + STEP("Declare document version as record with providing a location parameter value using v1 actions api"); getRestAPIFactory().getActionsAPI(userFillingPermission).declareAndFileVersionAsRecord(testFile, Utility.buildPath(recordCategory.getName(), recordFolder.getName())); @@ -279,7 +279,7 @@ public class FileVersionAsRecordTests extends BaseRMRestTest File sampleFile = Utility.getResourceTestDataFile("SampleTextFile_10kb.txt"); restClient.authenticateUser(getAdminUser()).withCoreAPI().usingParams("majorVersion=true").usingNode(testFile).updateNodeContent(sampleFile); - STEP("Declare document version as record without providing a location parameter value using v1 actions api"); + STEP("Declare document version as record with providing a location parameter value using v1 actions api"); getRestAPIFactory().getActionsAPI(userFillingPermission).declareAndFileVersionAsRecord(testFile, Utility.buildPath(recordCategory.getName(), recordFolder.getName()));