From 59d8605864f274eb1ec40f8017484bbd7762d8af Mon Sep 17 00:00:00 2001 From: rwetherall Date: Mon, 8 May 2017 12:50:46 +1000 Subject: [PATCH 1/7] Add info to README's on how to install lombok plugin for IDEs --- rm-automation/rm-automation-community-rest-api/README | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rm-automation/rm-automation-community-rest-api/README b/rm-automation/rm-automation-community-rest-api/README index 907f41ab0a..b5f976aa8b 100644 --- a/rm-automation/rm-automation-community-rest-api/README +++ b/rm-automation/rm-automation-community-rest-api/README @@ -1,3 +1,8 @@ FIXME: Add more info to the README file -In order to change the value of a property in "config.properties" create a file called "local.properties" under src/test/resources and redefine the property with the new value. \ No newline at end of file +In order to change the value of a property in "config.properties" create a file called "local.properties" under src/test/resources and redefine the property with the new value. + +Install lombok plugin for IDEs: +------------------------------- + +Follow the instructions here http://jnb.ociweb.com/jnb/jnbJan2010.html to install lombok plugin for IDEs. \ No newline at end of file From 6034a3ff6050649d586cf1d28330f089edf2d08b Mon Sep 17 00:00:00 2001 From: Sara Aspery Date: Tue, 9 May 2017 14:34:08 +0100 Subject: [PATCH 2/7] RM-5115 Get category children REST API disposition schedule fix --- .../recordcategories/RecordCategoryTests.java | 34 +++++++++++++++++-- .../rm/rest/api/impl/SearchTypesFactory.java | 13 +++++++ .../RecordCategoryChildrenRelation.java | 3 +- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordcategories/RecordCategoryTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordcategories/RecordCategoryTests.java index 9d1dfa9a90..5e3122cc2c 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordcategories/RecordCategoryTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordcategories/RecordCategoryTests.java @@ -52,6 +52,7 @@ import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.NoSuchElementException; @@ -66,7 +67,10 @@ import org.alfresco.rest.rm.community.model.recordfolder.RecordFolder; import org.alfresco.rest.rm.community.requests.gscore.api.FilePlanAPI; import org.alfresco.rest.rm.community.requests.gscore.api.RecordCategoryAPI; import org.alfresco.rest.rm.community.requests.gscore.api.RecordFolderAPI; +import org.alfresco.rest.v0.RecordCategoriesAPI; +import org.alfresco.rest.core.v0.BaseAPI.RETENTION_SCHEDULE; import org.alfresco.utility.report.Bug; +import org.springframework.beans.factory.annotation.Autowired; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -83,6 +87,9 @@ public class RecordCategoryTests extends BaseRMRestTest private static final int NUMBER_OF_CHILDREN = 10; private static final int NUMBER_OF_FOLDERS = 5; + @Autowired + private RecordCategoriesAPI recordCategoriesAPI; + /** * Invalid containers that cannot be deleted with record category end-point */ @@ -287,6 +294,7 @@ public class RecordCategoryTests extends BaseRMRestTest assertEquals(folderProperties.getTitle(), TITLE_PREFIX + RECORD_FOLDER_NAME); assertNotNull(folderProperties.getIdentifier()); } + /** *
      * Given that a record category exists
@@ -294,17 +302,37 @@ public class RecordCategoryTests extends BaseRMRestTest
      * When I ask the API to get me the children of the record category
      * Then I am returned the contained record categories and record folders and their details
      * 
+ *
+     * Given that a record category with a disposition schedule exists
+     * And contains a number of record categories and record folders
+     * When I ask the API to get me the children of the record category
+     * Then I am returned the contained record categories and record folders but not the disposition schedule
+     * 
*/ @Test - ( - description = "Get children of a record category" - ) + ( + description = "Get children of a record category excluding the disposition schedule" + ) + @Bug (id="RM-5115") public void getRecordCategoryChildren() throws Exception { // Create root level category RecordCategory rootRecordCategory = createRootCategory(getRandomAlphanumeric()); assertNotNull(rootRecordCategory.getId()); + // Create disposition schedule + String userName = getAdminUser().getUsername(); + String userPassword = getAdminUser().getPassword(); + String categoryName = rootRecordCategory.getName(); + recordCategoriesAPI.createRetentionSchedule(userName, userPassword, categoryName); + + // Add disposition schedule cut off step + HashMap cutOffStep = new HashMap<>(); + cutOffStep.put(RETENTION_SCHEDULE.NAME, "cutoff"); + cutOffStep.put(RETENTION_SCHEDULE.RETENTION_PERIOD, "day|2"); + cutOffStep.put(RETENTION_SCHEDULE.DESCRIPTION, "Cut off after 2 days"); + recordCategoriesAPI.addDispositionScheduleSteps(userName, userPassword, categoryName, cutOffStep); + // Add record category children List children = new ArrayList(); for (int i=0; i < NUMBER_OF_CHILDREN; i++) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/SearchTypesFactory.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/SearchTypesFactory.java index 2e103a9874..f45b4a85b9 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/SearchTypesFactory.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/SearchTypesFactory.java @@ -29,6 +29,7 @@ package org.alfresco.rm.rest.api.impl; import java.security.InvalidParameterException; import java.util.Collection; +import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -198,6 +199,7 @@ public class SearchTypesFactory Boolean isRecordFolder = propertyWalker.getProperty(RecordCategoryChild.PARAM_IS_RECORD_FOLDER, WhereClauseParser.EQUALS, Boolean.class); Boolean isRecordCategory = propertyWalker.getProperty(RecordCategoryChild.PARAM_IS_RECORD_CATEGORY, WhereClauseParser.EQUALS, Boolean.class); + if ((isRecordFolder != null && isRecordFolder.booleanValue()) || (isRecordCategory != null && !isRecordCategory.booleanValue())) { includeRecordFolders = true; @@ -221,6 +223,7 @@ public class SearchTypesFactory if (nodeTypeQNameStr.equals(RecordsManagementModel.TYPE_RECORD_FOLDER)) { includeRecordFolders = true; + } else if (filterNodeTypeQName.equals(RecordsManagementModel.TYPE_RECORD_CATEGORY)) { @@ -249,6 +252,16 @@ public class SearchTypesFactory return searchTypeQNames; } + /** + * Helper method to build association types for categories endpoint + * @return + */ + public Set buildAssocTypesCategoriesEndpoint() + { + Set assocTypeQNames = Collections.singleton(ContentModel.ASSOC_CONTAINS); + return assocTypeQNames; + } + /** * Helper method to build search types for transfer containers endpoint * @return diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java index 7863035e60..992605e605 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java @@ -114,10 +114,11 @@ public class RecordCategoryChildrenRelation implements RelationshipResourceActio // list record categories and record folders Set searchTypeQNames = searchTypesFactory.buildSearchTypesCategoriesEndpoint(parameters, LIST_RECORD_CATEGORY_CHILDREN_EQUALS_QUERY_PROPERTIES); + Set assocTypeQNames = searchTypesFactory.buildAssocTypesCategoriesEndpoint(); List filterProps = apiUtils.getListChildrenFilterProps(parameters, LIST_RECORD_CATEGORY_CHILDREN_EQUALS_QUERY_PROPERTIES); final PagingResults pagingResults = fileFolderService.list(parentNodeRef, - null, + assocTypeQNames, searchTypeQNames, null, apiUtils.getSortProperties(parameters), From 1f2a3ec2afde5c56f07382d3de70b125240e4722 Mon Sep 17 00:00:00 2001 From: Sara Aspery Date: Wed, 10 May 2017 07:50:33 +0100 Subject: [PATCH 3/7] RM-5115 Changes following review --- .../rm/rest/api/impl/SearchTypesFactory.java | 11 ----------- .../RecordCategoryChildrenRelation.java | 13 ++++--------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/SearchTypesFactory.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/SearchTypesFactory.java index f45b4a85b9..cbaee33f3b 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/SearchTypesFactory.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/SearchTypesFactory.java @@ -29,7 +29,6 @@ package org.alfresco.rm.rest.api.impl; import java.security.InvalidParameterException; import java.util.Collection; -import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -252,16 +251,6 @@ public class SearchTypesFactory return searchTypeQNames; } - /** - * Helper method to build association types for categories endpoint - * @return - */ - public Set buildAssocTypesCategoriesEndpoint() - { - Set assocTypeQNames = Collections.singleton(ContentModel.ASSOC_CONTAINS); - return assocTypeQNames; - } - /** * Helper method to build search types for transfer containers endpoint * @return diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java index 992605e605..084fc1f0ff 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java @@ -30,15 +30,10 @@ package org.alfresco.rm.rest.api.recordcategories; import static org.alfresco.module.org_alfresco_module_rm.util.RMParameterCheck.checkNotBlank; import static org.alfresco.util.ParameterCheck.mandatory; -import java.util.AbstractList; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; +import java.util.Collections; +import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; import org.alfresco.query.PagingResults; import org.alfresco.repo.node.getchildren.FilterProp; @@ -114,7 +109,7 @@ public class RecordCategoryChildrenRelation implements RelationshipResourceActio // list record categories and record folders Set searchTypeQNames = searchTypesFactory.buildSearchTypesCategoriesEndpoint(parameters, LIST_RECORD_CATEGORY_CHILDREN_EQUALS_QUERY_PROPERTIES); - Set assocTypeQNames = searchTypesFactory.buildAssocTypesCategoriesEndpoint(); + Set assocTypeQNames = Collections.singleton(ContentModel.ASSOC_CONTAINS); List filterProps = apiUtils.getListChildrenFilterProps(parameters, LIST_RECORD_CATEGORY_CHILDREN_EQUALS_QUERY_PROPERTIES); final PagingResults pagingResults = fileFolderService.list(parentNodeRef, From 8f9b49b965b6bf768afc982a6948115697ff76a5 Mon Sep 17 00:00:00 2001 From: Sara Aspery Date: Wed, 10 May 2017 09:27:10 +0100 Subject: [PATCH 4/7] RM-5115 Fixed IDE import settings following review --- .../recordcategories/RecordCategoryChildrenRelation.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java index 084fc1f0ff..a9d53888a7 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java @@ -30,8 +30,15 @@ package org.alfresco.rm.rest.api.recordcategories; import static org.alfresco.module.org_alfresco_module_rm.util.RMParameterCheck.checkNotBlank; import static org.alfresco.util.ParameterCheck.mandatory; -import java.util.*; +import java.util.AbstractList; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; From 33f85d5a394bc11fd20b7ffe8a6bc3071af3692b Mon Sep 17 00:00:00 2001 From: Ramona Popa Date: Wed, 10 May 2017 12:05:54 +0100 Subject: [PATCH 5/7] RM-5116 - added support for autoRename parameter --- .../fileplans/FilePlanChildrenRelation.java | 3 +- .../api/impl/FilePlanComponentsApiUtils.java | 91 ++++++++++++++++--- .../alfresco/rm/rest/api/model/RMNode.java | 1 + .../RecordCategoryChildrenRelation.java | 2 +- .../RecordFolderChildrenRelation.java | 4 +- .../UnfiledContainerChildrenRelation.java | 3 +- .../UnfiledRecordFolderChildrenRelation.java | 6 +- 7 files changed, 84 insertions(+), 26 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/fileplans/FilePlanChildrenRelation.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/fileplans/FilePlanChildrenRelation.java index 2ed5d321ac..d691641ff8 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/fileplans/FilePlanChildrenRelation.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/fileplans/FilePlanChildrenRelation.java @@ -184,7 +184,8 @@ public class FilePlanChildrenRelation implements RelationshipResourceAction.Read for (RecordCategory nodeInfo : nodeInfos) { // Create the node - NodeRef newNode = apiUtils.createRMNode(parentNodeRef, nodeInfo.getName(), RECORD_CATEGORY_TYPE, nodeInfo.getProperties(), nodeInfo.getAspectNames()); + nodeInfo.setNodeType(RECORD_CATEGORY_TYPE); + NodeRef newNode = apiUtils.createRMNode(parentNodeRef, nodeInfo, parameters); FileInfo info = fileFolderService.getFileInfo(newNode); result.add(nodesModelFactory.createRecordCategory(info, parameters, mapUserInfo, false)); } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/FilePlanComponentsApiUtils.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/FilePlanComponentsApiUtils.java index 7ba7add131..0b543f10b3 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/FilePlanComponentsApiUtils.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/FilePlanComponentsApiUtils.java @@ -134,6 +134,12 @@ public class FilePlanComponentsApiUtils RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER, RecordsManagementModel.TYPE_HOLD_CONTAINER); + public static final List TYPES_CAN_USE_AUTORENAME = Arrays.asList( + RecordsManagementModel.TYPE_RECORD_CATEGORY, + RecordsManagementModel.TYPE_RECORD_FOLDER, + RecordsManagementModel.TYPE_UNFILED_RECORD_CONTAINER, + RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER); + /** RM Nodes API */ private Nodes nodes; private FileFolderService fileFolderService; @@ -598,27 +604,43 @@ public class FilePlanComponentsApiUtils * Create an RM node * * @param parentNodeRef the parent of the node - * @param name the name of the new node - * @param type the type of the node - * @param properties properties to set on the new node - * @param aspects aspects to set on the new node + * @param nodeInfo the node infos to create + * @param parameters the object to get the parameters passed into the request * @return the new node */ - public NodeRef createRMNode(NodeRef parentNodeRef, String name, String type, Map properties, List aspects) + public NodeRef createRMNode(NodeRef parentNodeRef, RMNode nodeInfo, Parameters parameters) { mandatory("parentNodeRef", parentNodeRef); - checkNotBlank(RMNode.PARAM_NAME, name); - checkNotBlank(RMNode.PARAM_NODE_TYPE, type); + mandatory("nodeInfo", nodeInfo); + mandatory("parameters", parameters); + + String nodeName = nodeInfo.getName(); + String nodeType = nodeInfo.getNodeType(); + checkNotBlank(RMNode.PARAM_NAME, nodeName); + checkNotBlank(RMNode.PARAM_NODE_TYPE, nodeType); // Create the node NodeRef newNodeRef = null; + boolean autoRename = Boolean.valueOf(parameters.getParameter(RMNode.PARAM_AUTO_RENAME)); + try { - QName typeQName = nodes.createQName(type); - newNodeRef = fileFolderService.create(parentNodeRef, name, typeQName).getNodeRef(); + QName typeQName = nodes.createQName(nodeType); + + // Existing file/folder name handling + if (TYPES_CAN_CREATE.contains(typeQName) && autoRename) + { + NodeRef existingNode = nodeService.getChildByName(parentNodeRef, ContentModel.ASSOC_CONTAINS, nodeName); + if (existingNode != null) + { + // File already exists, find a unique name + nodeName = findUniqueName(parentNodeRef, nodeName); + } + } + newNodeRef = fileFolderService.create(parentNodeRef, nodeName, typeQName).getNodeRef(); // Set the provided properties if any - Map qnameProperties = mapToNodeProperties(properties); + Map qnameProperties = mapToNodeProperties(nodeInfo.getProperties()); if (qnameProperties != null) { nodeService.addProperties(newNodeRef, qnameProperties); @@ -628,18 +650,19 @@ public class FilePlanComponentsApiUtils if (!typeQName.equals(RecordsManagementModel.TYPE_NON_ELECTRONIC_DOCUMENT) && dictionaryService.isSubClass(typeQName, ContentModel.TYPE_CONTENT)) { - writeContent(newNodeRef, name, new ByteArrayInputStream("".getBytes()), false); + writeContent(newNodeRef, nodeName, new ByteArrayInputStream("".getBytes()), false); } // Add the provided aspects if any - if (aspects != null) + List aspectNames = nodeInfo.getAspectNames(); + if (aspectNames != null) { - nodes.addCustomAspects(newNodeRef, aspects, ApiNodesModelFactory.EXCLUDED_ASPECTS); + nodes.addCustomAspects(newNodeRef, aspectNames, ApiNodesModelFactory.EXCLUDED_ASPECTS); } } catch (InvalidTypeException ex) { - throw new InvalidArgumentException("The given type:'" + type + "' is invalid '"); + throw new InvalidArgumentException("The given type:'" + nodeType + "' is invalid '"); } return newNodeRef; @@ -955,7 +978,45 @@ public class FilePlanComponentsApiUtils activityPoster.postFileFolderActivity(activityType, null, TenantUtil.getCurrentDomain(), activityInfo.getSiteId(), activityInfo.getParentNodeRef(), activityInfo.getNodeRef(), activityInfo.getFileName(), Activities.APP_TOOL, Activities.RESTAPI_CLIENT, activityInfo.getFileInfo()); - } } + /** + * Creates a unique file name, if the upload component was configured to + * find a new unique name for clashing filenames. + * + * @param parentNodeRef the parent node + * @param fileName the original fileName + * @return a new file name + */ + private String findUniqueName(NodeRef parentNodeRef, String fileName) + { + int counter = 1; + String tmpFilename; + NodeRef existingFile; + do + { + int dotIndex = fileName.lastIndexOf('.'); + if (dotIndex == 0) + { + // File didn't have a proper 'name' instead it + // had just a suffix and started with a ".", create "1.txt" + tmpFilename = counter + fileName; + } + else if (dotIndex > 0) + { + // Filename contained ".", create "fileName-1.txt" + tmpFilename = fileName.substring(0, dotIndex) + "-" + counter + fileName.substring(dotIndex); + } + else + { + // Filename didn't contain a dot at all, create "fileName-1" + tmpFilename = fileName + "-" + counter; + } + existingFile = nodeService.getChildByName(parentNodeRef, ContentModel.ASSOC_CONTAINS, tmpFilename); + counter++; + + } while (existingFile != null); + + return tmpFilename; + } } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/model/RMNode.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/model/RMNode.java index d4d590e3e8..7ddc40ded9 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/model/RMNode.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/model/RMNode.java @@ -57,6 +57,7 @@ public abstract class RMNode public static final String PARAM_PROPERTIES = "properties"; public static final String PARAM_PATH = "path"; public static final String PARAM_ALLOWABLE_OPERATIONS = "allowableOperations"; + public static final String PARAM_AUTO_RENAME = "autoRename"; public static final String PARAM_ISPRIMARY = "isPrimary"; diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java index 7863035e60..fe5bf6e998 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RecordCategoryChildrenRelation.java @@ -174,7 +174,7 @@ public class RecordCategoryChildrenRelation implements RelationshipResourceActio } // Create the node - NodeRef newNode = apiUtils.createRMNode(nodeParent, nodeInfo.getName(), nodeInfo.getNodeType(), nodeInfo.getProperties(), nodeInfo.getAspectNames()); + NodeRef newNode = apiUtils.createRMNode(nodeParent, nodeInfo, parameters); FileInfo info = fileFolderService.getFileInfo(newNode); result.add(nodesModelFactory.createRecordCategoryChild(info, parameters, mapUserInfo, false)); } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordfolders/RecordFolderChildrenRelation.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordfolders/RecordFolderChildrenRelation.java index 9ba8c695ba..30fb7e7909 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordfolders/RecordFolderChildrenRelation.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordfolders/RecordFolderChildrenRelation.java @@ -31,7 +31,6 @@ import static org.alfresco.module.org_alfresco_module_rm.util.RMParameterCheck.c import static org.alfresco.util.ParameterCheck.mandatory; import java.util.AbstractList; -import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; import java.util.List; @@ -57,7 +56,6 @@ import org.alfresco.rm.rest.api.impl.FilePlanComponentsApiUtils; import org.alfresco.rm.rest.api.impl.SearchTypesFactory; import org.alfresco.rm.rest.api.model.Record; import org.alfresco.rm.rest.api.model.RecordFolder; -import org.alfresco.rm.rest.api.model.UnfiledContainerChild; import org.alfresco.rm.rest.api.model.UploadInfo; import org.alfresco.service.cmr.model.FileFolderService; import org.alfresco.service.cmr.model.FileInfo; @@ -169,7 +167,7 @@ public class RecordFolderChildrenRelation implements RelationshipResourceAction. List createdNodes = new LinkedList<>(); for (Record nodeInfo : nodeInfos) { - NodeRef newNodeRef = apiUtils.createRMNode(parentNodeRef, nodeInfo.getName(), nodeInfo.getNodeType(), nodeInfo.getProperties(), nodeInfo.getAspectNames()); + NodeRef newNodeRef = apiUtils.createRMNode(parentNodeRef, nodeInfo, parameters); createdNodes.add(newNodeRef); } return createdNodes; diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/unfiledcontainers/UnfiledContainerChildrenRelation.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/unfiledcontainers/UnfiledContainerChildrenRelation.java index ab419a57ca..36ec2ab187 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/unfiledcontainers/UnfiledContainerChildrenRelation.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/unfiledcontainers/UnfiledContainerChildrenRelation.java @@ -31,7 +31,6 @@ import static org.alfresco.module.org_alfresco_module_rm.util.RMParameterCheck.c import static org.alfresco.util.ParameterCheck.mandatory; import java.util.AbstractList; -import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -187,7 +186,7 @@ public class UnfiledContainerChildrenRelation implements RelationshipResourceAct List createdNodes = new LinkedList<>(); for (UnfiledContainerChild nodeInfo : nodeInfos) { - NodeRef newNodeRef = apiUtils.createRMNode(parentNodeRef, nodeInfo.getName(), nodeInfo.getNodeType(), nodeInfo.getProperties(), nodeInfo.getAspectNames()); + NodeRef newNodeRef = apiUtils.createRMNode(parentNodeRef, nodeInfo, parameters); createdNodes.add(newNodeRef); } return createdNodes; diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/unfiledrecordfolders/UnfiledRecordFolderChildrenRelation.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/unfiledrecordfolders/UnfiledRecordFolderChildrenRelation.java index 0a7faf4771..8e4a9a0063 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/unfiledrecordfolders/UnfiledRecordFolderChildrenRelation.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/unfiledrecordfolders/UnfiledRecordFolderChildrenRelation.java @@ -31,7 +31,6 @@ import static org.alfresco.module.org_alfresco_module_rm.util.RMParameterCheck.c import static org.alfresco.util.ParameterCheck.mandatory; import java.util.AbstractList; -import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -60,7 +59,6 @@ import org.alfresco.rm.rest.api.impl.FilePlanComponentsApiUtils; import org.alfresco.rm.rest.api.impl.SearchTypesFactory; import org.alfresco.rm.rest.api.model.RMNode; import org.alfresco.rm.rest.api.model.UnfiledChild; -import org.alfresco.rm.rest.api.model.UnfiledContainerChild; import org.alfresco.rm.rest.api.model.UnfiledRecordFolder; import org.alfresco.rm.rest.api.model.UnfiledRecordFolderChild; import org.alfresco.rm.rest.api.model.UploadInfo; @@ -175,7 +173,7 @@ public class UnfiledRecordFolderChildrenRelation implements RelationshipResource mandatory("parameters", parameters); NodeRef parentNodeRef = apiUtils.lookupAndValidateNodeType(unfiledRecordFolderId, RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER); - + // Create the children RetryingTransactionCallback> callback = new RetryingTransactionCallback>() { @@ -194,7 +192,7 @@ public class UnfiledRecordFolderChildrenRelation implements RelationshipResource nodeParent = parentNodeRef; } - NodeRef newNodeRef = apiUtils.createRMNode(nodeParent, nodeInfo.getName(), nodeInfo.getNodeType(), nodeInfo.getProperties(), nodeInfo.getAspectNames()); + NodeRef newNodeRef = apiUtils.createRMNode(nodeParent, nodeInfo, parameters); createdNodes.add(newNodeRef); } return createdNodes; From c123ab1e51a17097976a975eb11e73e87e05d467 Mon Sep 17 00:00:00 2001 From: rwetherall Date: Fri, 12 May 2017 11:25:05 +1000 Subject: [PATCH 6/7] Move information into parent README --- README.txt | 12 +++++++++--- .../rm-automation-community-rest-api/README | 7 +------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.txt b/README.txt index f31803686a..2110ac0c64 100644 --- a/README.txt +++ b/README.txt @@ -95,9 +95,6 @@ Follow these instructions install licence and Outlook plugin: - http://docs.alfresco.com/outlook2.1/tasks/Outlook-install_v2.html - - - SNAPSHOT dependencies: ---------------------- @@ -114,6 +111,7 @@ Code Formatting: This project follows the usual Alfresco Coding Standards. If you use Eclipse or IntelliJ, there are settings inside the ide-config directory for you to import. + Surf build errors: ------------------ @@ -121,3 +119,11 @@ If you get: [ERROR] Failed to execute goal on project alfresco-rm-community-share: Could not resolve dependencies for project org.alfresco:alfresco-rm-community-share:amp:2.6-SNAPSHOT: Failed to collect dependencies at org.alfresco.surf:spring-surf-api:jar:6.3 -> org.alfresco.surf:spring-surf:jar:${dependency.surf.version}: Failed to read artifact descriptor for org.alfresco.surf:spring-surf:jar:${dependency.surf.version}: Could not transfer artifact org.alfresco.surf:spring-surf:pom:${dependency.surf.version} from/to alfresco-internal (https://artifacts.alfresco.com/nexus/content/groups/private): Not authorized , ReasonPhrase:Unauthorized. -> [Help 1] then please re-run with -Ddependency.surf.version=6.3 + + +Install lombok plugin for IDEs: +------------------------------- + +To allow UI automation and benchmark projects to be built within an IDE the lombok 'plugin' needs to be installed. + +Execute lombok.jar (doubleclick it, or run java -jar lombok.jar). Follow instructions. diff --git a/rm-automation/rm-automation-community-rest-api/README b/rm-automation/rm-automation-community-rest-api/README index b5f976aa8b..907f41ab0a 100644 --- a/rm-automation/rm-automation-community-rest-api/README +++ b/rm-automation/rm-automation-community-rest-api/README @@ -1,8 +1,3 @@ FIXME: Add more info to the README file -In order to change the value of a property in "config.properties" create a file called "local.properties" under src/test/resources and redefine the property with the new value. - -Install lombok plugin for IDEs: -------------------------------- - -Follow the instructions here http://jnb.ociweb.com/jnb/jnbJan2010.html to install lombok plugin for IDEs. \ No newline at end of file +In order to change the value of a property in "config.properties" create a file called "local.properties" under src/test/resources and redefine the property with the new value. \ No newline at end of file From 92b5f90f17751c73d9de43686801cec6a66e8818 Mon Sep 17 00:00:00 2001 From: rwetherall Date: Fri, 12 May 2017 15:36:28 +1000 Subject: [PATCH 7/7] Adjust text to ensure all automation projects are included. --- README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.txt b/README.txt index 2110ac0c64..b46013c3f5 100644 --- a/README.txt +++ b/README.txt @@ -124,6 +124,6 @@ then please re-run with -Ddependency.surf.version=6.3 Install lombok plugin for IDEs: ------------------------------- -To allow UI automation and benchmark projects to be built within an IDE the lombok 'plugin' needs to be installed. +To allow automation and benchmark projects to be built within an IDE the lombok 'plugin' needs to be installed. Execute lombok.jar (doubleclick it, or run java -jar lombok.jar). Follow instructions.