From 63de5f87a039d78877fada02dfcb26cc57888cc5 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Fri, 15 May 2020 09:45:33 +0300 Subject: [PATCH 1/8] APPS-41 Automate AC for Declare and File as Record Share rule UI --- .../rest/rm/community/model/rules/RuleDefinition.java | 4 ++-- .../src/main/java/org/alfresco/rest/v0/RulesAPI.java | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/rules/RuleDefinition.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/rules/RuleDefinition.java index 80f9b07200..434af22d6f 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/rules/RuleDefinition.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/rules/RuleDefinition.java @@ -41,7 +41,7 @@ public class RuleDefinition private boolean runInBackground = false; private String ruleType = ConditionsOnRule.ADDED.getWhenConditionValue(); private String path; - private boolean createRecordPath = false; + private Boolean createRecordPath; private String contentTitle; private String contentDescription; private String rejectReason; @@ -145,7 +145,7 @@ public class RuleDefinition return this; } - public boolean isCreateRecordPath() + public Boolean isCreateRecordPath() { return createRecordPath; } diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RulesAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RulesAPI.java index 798d50761b..614907c909 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RulesAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RulesAPI.java @@ -257,7 +257,10 @@ public class RulesAPI extends BaseAPI JSONObject parameters = new JSONObject(); if (ruleProperties.getPath() != null) { - parameters.put("createRecordPath", ruleProperties.isCreateRecordPath()); + if(ruleProperties.isCreateRecordPath() != null) + { + parameters.put("createRecordPath", ruleProperties.isCreateRecordPath()); + } parameters.put("path", ruleProperties.getPath()); } if (ruleProperties.getContentTitle() != null) From b399099f08313f32b94074e94f91a6a27274e7e9 Mon Sep 17 00:00:00 2001 From: ehardon Date: Tue, 16 Jun 2020 10:51:03 +0300 Subject: [PATCH 2/8] WIP APPS-37: Declare and File as Record add select folder button --- .../module/org_alfresco_module_rm/messages/actions.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 cade03818a..993ff71a05 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 @@ -47,11 +47,12 @@ isRecordType.description=Records have a specified record type # i18n for Records Management Actions # # Declare As Record -create-record.title=Declare as Record +create-record.title=Declare and File as Record create-record.description=Declares file as a record and optionally files it create-record.file-plan.display-label=File Plan 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 and optionally files it From 92382a3978ede66762f6be2a8e269c3f0bc092b1 Mon Sep 17 00:00:00 2001 From: ehardon Date: Wed, 17 Jun 2020 21:27:16 +0300 Subject: [PATCH 3/8] APPS-37: - add hide record parameter in rule UI - rename hide-record parameter to hideRecord - rename action to File as Record - added localisation for the buttons - created a new destination-dialog-button for the dm page so it won't collide with the one in rm - set base site as rm for the destination-dialog-button so it builds the tree for rm --- .../org_alfresco_module_rm/action/dm/CreateRecordAction.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/CreateRecordAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/CreateRecordAction.java index 2a6ab6942f..a50b4d95e6 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 @@ -59,7 +59,7 @@ public class CreateRecordAction extends AuditableActionExecuterAbstractBase /** Parameter names */ public static final String PARAM_FILE_PLAN = "file-plan"; - public static final String PARAM_HIDE_RECORD = "hide-record"; + public static final String PARAM_HIDE_RECORD = "hideRecord"; public static final String PARAM_PATH = "path"; /** From a84f02474208e5d84f4196c49bf3753789b32cf9 Mon Sep 17 00:00:00 2001 From: ehardon Date: Fri, 19 Jun 2020 12:20:32 +0300 Subject: [PATCH 4/8] APPS-37: - update action label to File as Record - imported style for treeview - fixed some minor issues --- .../module/org_alfresco_module_rm/messages/actions.properties | 2 +- .../org/alfresco/slingshot/documentlibrary/rm-treenode.get.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 993ff71a05..edad51740f 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 @@ -47,7 +47,7 @@ isRecordType.description=Records have a specified record type # i18n for Records Management Actions # # Declare As Record -create-record.title=Declare and File as Record +create-record.title=File as Record create-record.description=Declares file as a record and optionally files it create-record.file-plan.display-label=File Plan create-record.hide-record.display-label=Hide Record diff --git a/rm-community/rm-community-repo/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/rm-treenode.get.js b/rm-community/rm-community-repo/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/rm-treenode.get.js index 667a41fcc9..fb95431d67 100644 --- a/rm-community/rm-community-repo/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/rm-treenode.get.js +++ b/rm-community/rm-community-repo/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/rm-treenode.get.js @@ -93,7 +93,7 @@ function getTreenode() // - hasCreateCapability = rmNode.hasCapability("Create"); + var hasCreateCapability = rmNode.hasCapability("Create"); if (evalChildFolders) { From f04ac6bef1c338d7bb4a1b963c17d9b57803ef27 Mon Sep 17 00:00:00 2001 From: ehardon Date: Fri, 19 Jun 2020 16:46:47 +0300 Subject: [PATCH 5/8] APPS-37: - hide unfiled records folder when rm site not available(add check to see if rm site exists) - renamed dialog to avoid collision with copy move actions dialogs - set unfiled parameter to false and remove other checks related to this in copy-move-link-file-to.js --- .../org/alfresco/slingshot/documentlibrary/rm-treenode.get.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rm-community/rm-community-repo/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/rm-treenode.get.js b/rm-community/rm-community-repo/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/rm-treenode.get.js index fb95431d67..667a41fcc9 100644 --- a/rm-community/rm-community-repo/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/rm-treenode.get.js +++ b/rm-community/rm-community-repo/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/rm-treenode.get.js @@ -93,7 +93,7 @@ function getTreenode() // - var hasCreateCapability = rmNode.hasCapability("Create"); + hasCreateCapability = rmNode.hasCapability("Create"); if (evalChildFolders) { From f05db32d363de8cf9b24dbfb53b0f5c7a1809c54 Mon Sep 17 00:00:00 2001 From: ehardon Date: Fri, 19 Jun 2020 18:19:56 +0300 Subject: [PATCH 6/8] APPS-37: - changed dialog button from ok to declare and file - add button localisation - removed unused imports - deleted unused js file - removed unused properties --- .../module/org_alfresco_module_rm/messages/actions.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 edad51740f..34215766fe 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 @@ -46,7 +46,7 @@ isRecordType.description=Records have a specified record type # # i18n for Records Management Actions # -# Declare As Record +# File As Record create-record.title=File as Record create-record.description=Declares file as a record and optionally files it create-record.file-plan.display-label=File Plan From af98f7c4a21eff97bc6cc569947422f03b0cae73 Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Mon, 22 Jun 2020 14:43:16 +0300 Subject: [PATCH 7/8] code review comments --- .../rest/rm/community/model/rules/RuleDefinition.java | 2 +- .../src/main/java/org/alfresco/rest/v0/RulesAPI.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/rules/RuleDefinition.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/rules/RuleDefinition.java index 434af22d6f..927fd0fec5 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/rules/RuleDefinition.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/rules/RuleDefinition.java @@ -145,7 +145,7 @@ public class RuleDefinition return this; } - public Boolean isCreateRecordPath() + public Boolean getCreateRecordPath() { return createRecordPath; } diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RulesAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RulesAPI.java index 614907c909..773d5d8fd1 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RulesAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RulesAPI.java @@ -257,9 +257,9 @@ public class RulesAPI extends BaseAPI JSONObject parameters = new JSONObject(); if (ruleProperties.getPath() != null) { - if(ruleProperties.isCreateRecordPath() != null) + if(ruleProperties.getCreateRecordPath() != null) { - parameters.put("createRecordPath", ruleProperties.isCreateRecordPath()); + parameters.put("createRecordPath", ruleProperties.getCreateRecordPath()); } parameters.put("path", ruleProperties.getPath()); } From f92659632ea30701e870e9b83473b1edda00b34f Mon Sep 17 00:00:00 2001 From: ehardon Date: Tue, 23 Jun 2020 13:49:23 +0300 Subject: [PATCH 8/8] APPS-37: - rearrange actions in rule actions dropdown - revert hideRecord property to hide-record --- .../org_alfresco_module_rm/action/dm/CreateRecordAction.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/CreateRecordAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/CreateRecordAction.java index a50b4d95e6..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 @@ -59,7 +59,7 @@ public class CreateRecordAction extends AuditableActionExecuterAbstractBase /** Parameter names */ public static final String PARAM_FILE_PLAN = "file-plan"; - public static final String PARAM_HIDE_RECORD = "hideRecord"; + public static final String PARAM_HIDE_RECORD = "hide-record"; public static final String PARAM_PATH = "path"; /**