From 01a9bd6450d3657fbf8654d0360acb9923638c11 Mon Sep 17 00:00:00 2001 From: Ramona Popa Date: Wed, 3 May 2017 17:57:57 +0300 Subject: [PATCH 1/9] RM-5087 - Updated yaml file for include parameter --- .../main/webapp/definitions/gs-core-api.yaml | 69 ++++++++----------- 1 file changed, 27 insertions(+), 42 deletions(-) diff --git a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml index a8218af2f3..6b02f2f2ba 100644 --- a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml +++ b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml @@ -208,6 +208,8 @@ paths: Get information for file plan **filePlanId** Besides mandatory fields the file plan's aspects and properties are returned by default. + + You can use the **include** parameter (include=allowableOperations) to return additional information. operationId: getFilePlan parameters: - $ref: '#/parameters/filePlanIdWithAliasParam' @@ -296,10 +298,8 @@ paths: Minimal information for each child is returned by default. - You can use the **include** parameter to return additional information. + You can use the **include** parameter (include=allowableOperations) to return additional information. - You can use the **include** parameter (include=association) to return child association details - for each child, including the **assocType** and the **isPrimary** flag. operationId: getFilePlanCategories produces: - application/json @@ -434,6 +434,8 @@ paths: Get information for unfiled records contianer **unfiledContainerId** Besides mandatory fields the unfiled records container's aspects and properties are returned by default. + + You can use the **include** parameter (include=allowableOperations) to return additional information. operationId: getUnfiledContainer parameters: - $ref: '#/parameters/unfiledContainerIdParam' @@ -527,7 +529,7 @@ paths: Minimal information for each child is returned by default. - You can use the **include** parameter to return additional information. + You can use the **include** parameter (include=allowableOperations) to return additional information. operationId: listUnfiledContainerChildren produces: - application/json @@ -705,6 +707,8 @@ paths: Get information for unfiled record folder id **unfiledRecordFolderId** Besides mandatory fields the unfiled record folder's aspects and properties are returned by default. + + You can use the **include** parameter (include=allowableOperations) to return additional information. operationId: getUnfiledRecordFolder parameters: - $ref: '#/parameters/unfiledRecordFolderIdParam' @@ -829,7 +833,7 @@ paths: Minimal information for each child is returned by default. - You can use the **include** parameter to return additional information. + You can use the **include** parameter (include=allowableOperations) to return additional information. operationId: listUnfiledRecordFolderChildren produces: - application/json @@ -1008,6 +1012,8 @@ paths: Get information for record category **recordCategoryId** Besides mandatory fields the record category's aspects and properties are returned by default. + + You can use the **include** parameter (include=allowableOperations) to return additional information. operationId: getRecordCategory parameters: - $ref: '#/parameters/recordCategoryIdParam' @@ -1132,12 +1138,9 @@ paths: Minimal information for each child is returned by default. - You can use the **include** parameter to return additional information. + You can use the **include** parameter (include=allowableOperations) to return additional information. The list of child nodes includes primary children and secondary children, if there are any. - - You can use the **include** parameter (include=association) to return child association details - for each child, including the **assocType** and the **isPrimary** flag. operationId: listRecordCategoryChildren produces: - application/json @@ -1146,7 +1149,7 @@ paths: - $ref: '#/parameters/skipCountParam' - $ref: '#/parameters/maxItemsParam' - $ref: '#/parameters/recordCategoryWhereParam' - - $ref: '#/parameters/recordCategoryChildIncludeParam' + - $ref: '#/parameters/recordCategoryChildEntryIncludeParam' - $ref: '#/parameters/recordCategoryRelativePathParam' - $ref: '#/parameters/recordCategoryIncludeSourceParam' - $ref: '#/parameters/fieldsParam' @@ -1313,6 +1316,8 @@ paths: Get information for record folder **recordFolderId** Besides mandatory fields the record folder's aspects and properties are returned by default. + + You can use the **include** parameter (include=allowableOperations) to return additional information. operationId: getRecordFolder parameters: - $ref: '#/parameters/recordFolderIdParam' @@ -1436,12 +1441,9 @@ paths: Minimal information for each record is returned by default. - You can use the **include** parameter to return additional information. - The list of records includes primary children and secondary children, if there are any. - You can use the **include** parameter (include=association) to return child association details - for each child, including the **assocType** and the **isPrimary** flag. + You can use the **include** parameter (include=allowableOperations) to return additional information. operationId: listRecordFolderChildren produces: - application/json @@ -1605,6 +1607,8 @@ paths: Get information for record **recordId** Besides mandatory fields the record's aspects and properties are returned by default. + + You can use the **include** parameter (include=allowableOperations) to return additional information. operationId: getRecord parameters: - $ref: '#/parameters/recordIdParam' @@ -1759,6 +1763,8 @@ paths: You can specify the target record folder by providing its id **targetParentId** If the record is already filed, a link to the target record folder is created. + + You can use the **include** parameter (include=allowableOperations) to return additional information. operationId: fileRecord parameters: - $ref: '#/parameters/recordIdParam' @@ -1854,6 +1860,8 @@ paths: Get information for transfer container **transferContainerId** Besides mandatory fields the transfer container's aspects and properties are returned by default. + + You can use the **include** parameter (include=allowableOperations) to return additional information. operationId: getTransferContainer parameters: - $ref: '#/parameters/transferContainerIdWithAliasParam' @@ -1946,10 +1954,7 @@ paths: Minimal information for each child is returned by default. - You can use the **include** parameter to return additional information. - - You can use the **include** parameter (include=association) to return child association details - for each child, including the **assocType** and the **isPrimary** flag. + You can use the **include** parameter (include=allowableOperations) to return additional information. operationId: listTransfers produces: - application/json @@ -1985,6 +1990,8 @@ paths: Get information for transfer **transferId** Besides mandatory fields the transfer's aspects and properties are returned by default. + + You can use the **include** parameter (include=allowableOperations) to return additional information. operationId: getTransfer parameters: - $ref: '#/parameters/transferIdParam' @@ -2020,10 +2027,7 @@ paths: Minimal information for each child is returned by default. - You can use the **include** parameter to return additional information. - - You can use the **include** parameter (include=association) to return child association details - for each child, including the **assocType** and the **isPrimary** flag. + You can use the **include** parameter (include=allowableOperations) to return additional information. operationId: listTransfersChildren produces: - application/json @@ -2162,19 +2166,6 @@ parameters: description: | Returns additional information about the record category. Any optional field from the response model can be requested. For example: * hasRetentionSchedule - * isRecordCategory - * allowableOperations - * path - required: false - type: array - items: - type: string - collectionFormat: csv - recordCategoryChildEntryIncludeParam: - name: include - in: query - description: | - Returns additional information about the record category. Any optional field from the response model can be requested. For example: * allowableOperations * path required: false @@ -2195,7 +2186,7 @@ parameters: description: Also include **source** in addition to **entries** with folder information on the parent node – either the specified parent **recordCategoryId**, or as resolved by **relativePath**. required: false type: boolean - recordCategoryChildIncludeParam: + recordCategoryChildEntryIncludeParam: name: include in: query description: | @@ -2525,12 +2516,6 @@ definitions: FilePlanBodyUpdate: type: object properties: - name: - type: string - pattern: "^(?!(.*[\\\"\\*\\\\\\>\\<\\?\\/\\:\\|]+.*)|(.*[\\.]?.*[\\.]+$)|(.*[ ]+$))" - description: | - The name must not contain spaces or the following special characters: * " < > \ / ? : and |. - The character . must not be used at the end of the name. properties: type: object additionalProperties: From 2785724aa3796057487cefb0b6ff9d693c0c2ff4 Mon Sep 17 00:00:00 2001 From: Ramona Popa Date: Fri, 12 May 2017 15:57:26 +0300 Subject: [PATCH 2/9] RM-5087 - Updated include params; added association for records --- .../rest/api/impl/ApiNodesModelFactory.java | 54 +++++++++++++ .../alfresco/rm/rest/api/model/RMNode.java | 13 +++ .../main/webapp/definitions/gs-core-api.yaml | 79 +++++++++++++------ 3 files changed, 123 insertions(+), 23 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java index 9605a79f32..c4d316b2a7 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java @@ -40,6 +40,7 @@ import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedul import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService; import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; import org.alfresco.rest.api.Nodes; +import org.alfresco.rest.api.model.AssocChild; import org.alfresco.rest.api.model.ContentInfo; import org.alfresco.rest.api.model.Node; import org.alfresco.rest.api.model.UserInfo; @@ -61,7 +62,9 @@ import org.alfresco.rm.rest.api.model.UnfiledRecordFolder; import org.alfresco.rm.rest.api.model.UnfiledRecordFolderChild; import org.alfresco.service.ServiceRegistry; import org.alfresco.service.cmr.model.FileInfo; +import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.ContentData; +import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.service.namespace.NamespaceService; @@ -600,6 +603,48 @@ public class ApiNodesModelFactory return nodes.mapFromNodeProperties(properties, new ArrayList<>(), new HashMap<>(), EXCLUDED_NS, EXCLUDED_PROPS); } + /** + * Utility method that maps associations, applicable only for records + * + * @param rmNode + * @param info + * @param includeParam + */ + private void mapAssociations(RMNode rmNode, FileInfo info, List includeParam) + { + if (includeParam.contains(RMNode.PARAM_INCLUDE_ASSOCIATION)) + { + NodeRef nodeRef = info.getNodeRef(); + ChildAssociationRef parentAssocRef = nodeService.getPrimaryParent(nodeRef); + + if ((parentAssocRef == null) || (parentAssocRef.getParentRef() == null) + || (!parentAssocRef.getParentRef().equals(rmNode.getParentId()))) + { + List parentAssocRefs = nodeService.getParentAssocs(nodeRef); + for (ChildAssociationRef pAssocRef : parentAssocRefs) + { + if (pAssocRef.getParentRef().equals(rmNode.getParentId())) + { + // for now, assume same parent/child cannot appear more than once (due to unique name) + parentAssocRef = pAssocRef; + break; + } + } + } + + if (parentAssocRef != null) + { + QName assocTypeQName = parentAssocRef.getTypeQName(); + if ((assocTypeQName != null) && (!EXCLUDED_NS.contains(assocTypeQName.getNamespaceURI()))) + { + AssocChild childAssoc = new AssocChild(assocTypeQName.toPrefixString(namespaceService), parentAssocRef.isPrimary()); + + rmNode.setAssociation(childAssoc); + } + } + } + } + /** * Creates an object of type FilePlan * @@ -760,6 +805,10 @@ public class ApiNodesModelFactory mapBasicInfo(unfiledContainerChild, info, parameters.getFilter(), mapUserInfo, isMinimalInfo); mapOptionalInfo(unfiledContainerChild, info, parameters.getInclude(), isMinimalInfo); mapUnfiledChildInfo(unfiledContainerChild, info, parameters.getFilter()); + if (unfiledContainerChild.getIsRecord()) + { + mapAssociations(unfiledContainerChild, info, parameters.getInclude()); + } return unfiledContainerChild; } @@ -797,6 +846,10 @@ public class ApiNodesModelFactory mapBasicInfo(unfiledRecordFolderChild, info, parameters.getFilter(), mapUserInfo, isMinimalInfo); mapOptionalInfo(unfiledRecordFolderChild, info, parameters.getInclude(), isMinimalInfo); mapUnfiledChildInfo(unfiledRecordFolderChild, info, parameters.getFilter()); + if (unfiledRecordFolderChild.getIsRecord()) + { + mapAssociations(unfiledRecordFolderChild, info, parameters.getInclude()); + } return unfiledRecordFolderChild; } @@ -834,6 +887,7 @@ public class ApiNodesModelFactory mapBasicInfo(record, info, parameters.getFilter(), mapUserInfo, isMinimalInfo); mapOptionalInfo(record, info, parameters.getInclude(), isMinimalInfo); mapRecordInfo(record, info, parameters.getInclude()); + mapAssociations(record, info, parameters.getInclude()); return record; } } 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 7ddc40ded9..aae2a3c434 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 @@ -31,6 +31,7 @@ import java.util.Date; import java.util.List; import java.util.Map; +import org.alfresco.rest.api.model.Assoc; import org.alfresco.rest.api.model.PathInfo; import org.alfresco.rest.api.model.UserInfo; import org.alfresco.rest.framework.resource.UniqueId; @@ -65,6 +66,7 @@ public abstract class RMNode public static final String PARAM_HAS_RETENTION_SCHEDULE = "hasRetentionSchedule"; public static final String PARAM_IS_CLOSED = "isClosed"; + public static final String PARAM_INCLUDE_ASSOCIATION = "association"; public static final String FILE_PLAN_TYPE = "rma:filePlan"; public static final String RECORD_CATEGORY_TYPE = "rma:recordCategory"; @@ -94,6 +96,7 @@ public abstract class RMNode protected Map properties; protected PathInfo path; protected List allowableOperations; + protected Assoc association; public RMNode() { @@ -221,4 +224,14 @@ public abstract class RMNode this.allowableOperations = allowableOperations; } + public Assoc getAssociation() + { + return association; + } + + public void setAssociation(Assoc association) + { + this.association = association; + } + } diff --git a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml index 6b02f2f2ba..d83e13eb3e 100644 --- a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml +++ b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml @@ -538,7 +538,7 @@ paths: - $ref: '#/parameters/skipCountParam' - $ref: '#/parameters/maxItemsParam' - $ref: '#/parameters/unfiledRecordFolderAndContainerWhereParam' - - $ref: '#/parameters/unfiledContainerEntryIncludeParam' + - $ref: '#/parameters/unfiledContainerChildEntryIncludeParam' - $ref: '#/parameters/unfiledContainerIncludeSourceParam' - $ref: '#/parameters/fieldsParam' responses: @@ -842,7 +842,7 @@ paths: - $ref: '#/parameters/skipCountParam' - $ref: '#/parameters/maxItemsParam' - $ref: '#/parameters/unfiledRecordFolderAndContainerWhereParam' - - $ref: '#/parameters/unfiledRecordFolderEntryIncludeParam' + - $ref: '#/parameters/unfiledRecordFolderChildEntryIncludeParam' - $ref: '#/parameters/unfiledRecordFolderRelativePathParam' - $ref: '#/parameters/unfiledRecordFolderIncludeSourceParam' - $ref: '#/parameters/fieldsParam' @@ -2093,7 +2093,24 @@ parameters: description: | Returns additional information about the unfiled records container children. Any optional field from the response model can be requested. For example: * allowableOperations + * aspectNames * path + * properties + required: false + type: array + items: + type: string + collectionFormat: csv + unfiledContainerChildEntryIncludeParam: + name: include + in: query + description: | + Returns additional information about the unfiled records container children. Any optional field from the response model can be requested. For example: + * allowableOperations + * aspectNames + * association + * path + * properties required: false type: array items: @@ -2119,7 +2136,24 @@ parameters: description: | Returns additional information about the unfiled records container children. Any optional field from the response model can be requested. For example: * allowableOperations + * aspectNames * path + * properties + required: false + type: array + items: + type: string + collectionFormat: csv + unfiledRecordFolderChildEntryIncludeParam: + name: include + in: query + description: | + Returns additional information about the unfiled records container children. Any optional field from the response model can be requested. For example: + * allowableOperations + * aspectNames + * association + * path + * properties required: false type: array items: @@ -2165,9 +2199,11 @@ parameters: in: query description: | Returns additional information about the record category. Any optional field from the response model can be requested. For example: - * hasRetentionSchedule * allowableOperations + * aspectNames + * hasRetentionSchedule * path + * properties required: false type: array items: @@ -2191,14 +2227,14 @@ parameters: in: query description: | Returns additional information about the record category. Any optional field from the response model can be requested. For example: - * properties + * allowableOperations * aspectNames * hasRetentionSchedule * isClosed * isRecordCategory * isRecordFolder - * allowableOperations * path + * properties required: false type: array items: @@ -2231,10 +2267,8 @@ parameters: in: query description: | Returns additional information about the record folders. Any optional field from the response model can be requested. For example: - * properties - * aspectNames - * isClosed * allowableOperations + * isClosed * path required: false type: array @@ -2252,11 +2286,13 @@ parameters: in: query description: | Returns additional information about the records. Any optional field from the response model can be requested. For example: - * properties - * aspectNames - * isCompleted * allowableOperations + * aspectNames + * association + * content + * isCompleted * path + * properties required: false type: array items: @@ -2307,12 +2343,12 @@ parameters: in: query description: | Returns additional information about the transfer folder. Any optional field from the response model can be requested. For example: + * allowableOperations + * aspectNames + * properties * transferPDFIndicator * transferLocation * transferAccessionIndicator - * properties - * aspectNames - * allowableOperations required: false type: array items: @@ -2335,14 +2371,14 @@ parameters: in: query description: | Returns additional information about the transfer's child. Any optional field from the response model can be requested. For example: - * properties + * allowableOperations * aspectNames + * isClosed * isCompleted * isRecord - * isClosed * isRecordFolder - * allowableOperations * path + * properties required: false type: array items: @@ -2360,9 +2396,9 @@ parameters: in: query description: | Returns additional information about the record. Any optional field from the response model can be requested. For example: - * isCompleted - * content * allowableOperations + * content + * isCompleted * path required: false type: array @@ -2961,7 +2997,7 @@ definitions: items: $ref: '#/definitions/RecordCategoryChildAssociationEntry' source: - $ref: '#/definitions/RecordCategory' + $ref: '#/definitions/FilePlan' RecordCategoryChildAssociationEntry: type: object required: @@ -2973,9 +3009,6 @@ definitions: allOf: - $ref: '#/definitions/RecordCategoryChild' - type: object - properties: - association: - $ref: '#/definitions/ChildAssociationInfo' ## Record folder RecordFolder: type: object From 2b3cc425bb96c8c8f05d25d545af6e43dacc9749 Mon Sep 17 00:00:00 2001 From: Ramona Popa Date: Fri, 12 May 2017 16:46:51 +0300 Subject: [PATCH 3/9] RM-5087 - Removed association from file plan children and recordCateg children --- .../main/webapp/definitions/gs-core-api.yaml | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml index d83e13eb3e..61f2bb1c99 100644 --- a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml +++ b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml @@ -314,7 +314,7 @@ paths: '200': description: Successful response schema: - $ref: '#/definitions/RecordCategoryAssociationPaging' + $ref: '#/definitions/RecordCategoryPaging' '401': description: If authentication fails '403': @@ -1157,7 +1157,7 @@ paths: '200': description: Successful response schema: - $ref: '#/definitions/RecordCategoryAssociationPaging' + $ref: '#/definitions/RecordCategoryChildPaging' '401': description: If authentication fails '403': @@ -2984,7 +2984,7 @@ definitions: properties: entry: $ref: '#/definitions/RecordCategoryChild' - RecordCategoryAssociationPaging: + RecordCategoryPaging: type: object properties: list: @@ -2995,20 +2995,23 @@ definitions: entries: type: array items: - $ref: '#/definitions/RecordCategoryChildAssociationEntry' + $ref: '#/definitions/RecordCategoryEntry' source: $ref: '#/definitions/FilePlan' - RecordCategoryChildAssociationEntry: + RecordCategoryChildPaging: type: object - required: - - entry properties: - entry: - $ref: '#/definitions/RecordCategoryChildAssociation' - RecordCategoryChildAssociation: - allOf: - - $ref: '#/definitions/RecordCategoryChild' - - type: object + list: + type: object + properties: + pagination: + $ref: '#/definitions/Pagination' + entries: + type: array + items: + $ref: '#/definitions/RecordCategoryChildEntry' + source: + $ref: '#/definitions/RecordCategory' ## Record folder RecordFolder: type: object From feb0fccaaf8287f2bcab72d63b49af3b46957be3 Mon Sep 17 00:00:00 2001 From: Ramona Popa Date: Mon, 15 May 2017 18:04:29 +0300 Subject: [PATCH 4/9] RM-5087 - updated include params for all endpoints --- .../rest/api/impl/ApiNodesModelFactory.java | 8 --- .../rm/rest/api/model/TransferChild.java | 11 ---- .../main/webapp/definitions/gs-core-api.yaml | 58 ++++++++++++------- 3 files changed, 38 insertions(+), 39 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java index c4d316b2a7..b8cc27497b 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java @@ -469,10 +469,6 @@ public class ApiNodesModelFactory { transferChild.setIsClosed((Boolean) nodeService.getProperty(info.getNodeRef(), RecordsManagementModel.PROP_IS_CLOSED)); } - if(isMinimalInfo && includeParam.contains(TransferChild.PARAM_IS_COMPLETED)) - { - transferChild.setIsCompleted(null); - } } else { @@ -488,10 +484,6 @@ public class ApiNodesModelFactory { transferChild.setIsClosed(null); } - if(isMinimalInfo && includeParam.contains(TransferChild.PARAM_IS_COMPLETED)) - { - transferChild.setIsCompleted(nodeService.hasAspect(info.getNodeRef(), RecordsManagementModel.ASPECT_DECLARED_RECORD)); - } } } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/model/TransferChild.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/model/TransferChild.java index 1defbb7e84..bf0285ca6b 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/model/TransferChild.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/model/TransferChild.java @@ -39,7 +39,6 @@ public class TransferChild extends RMNode public static final String PARAM_IS_RECORD_FOLDER = "isRecordFolder"; public static final String PARAM_IS_RECORD = "isRecord"; - protected Boolean isCompleted; protected Boolean isClosed; protected Boolean isRecordFolder; protected Boolean isRecord; @@ -48,16 +47,6 @@ public class TransferChild extends RMNode { } - public Boolean getIsCompleted() - { - return isCompleted; - } - - public void setIsCompleted(Boolean isCompleted) - { - this.isCompleted = isCompleted; - } - public Boolean getIsClosed() { return isClosed; diff --git a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml index 61f2bb1c99..eef37c4225 100644 --- a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml +++ b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml @@ -307,7 +307,7 @@ paths: - $ref: '#/parameters/filePlanIdWithAliasParam' - $ref: '#/parameters/skipCountParam' - $ref: '#/parameters/maxItemsParam' - - $ref: '#/parameters/recordCategoryEntryIncludeParam' + - $ref: '#/parameters/filePlanCategoriesEntryIncludeParam' - $ref: '#/parameters/filePlanIncludeSourceParam' - $ref: '#/parameters/fieldsParam' responses: @@ -393,7 +393,7 @@ paths: parameters: - $ref: '#/parameters/filePlanIdWithAliasParam' - $ref: '#/parameters/autoRenameParam' - - $ref: '#/parameters/recordCategoryEntryIncludeParam' + - $ref: '#/parameters/filePlanCategoriesEntryIncludeParam' - $ref: '#/parameters/fieldsParam' - in: body name: nodeBodyCreate @@ -666,7 +666,7 @@ paths: parameters: - $ref: '#/parameters/unfiledContainerIdParam' - $ref: '#/parameters/autoRenameParam' - - $ref: '#/parameters/unfiledContainerEntryIncludeParam' + - $ref: '#/parameters/unfiledContainerChildEntryIncludeParam' - $ref: '#/parameters/fieldsParam' - in: body name: nodeBodyCreate @@ -971,7 +971,7 @@ paths: parameters: - $ref: '#/parameters/unfiledRecordFolderIdParam' - $ref: '#/parameters/autoRenameParam' - - $ref: '#/parameters/unfiledRecordFolderEntryIncludeParam' + - $ref: '#/parameters/unfiledRecordFolderChildEntryIncludeParam' - $ref: '#/parameters/fieldsParam' - in: body name: nodeBodyCreate @@ -1565,7 +1565,7 @@ paths: operationId: createRecordFolderChild parameters: - $ref: '#/parameters/recordFolderIdParam' - - $ref: '#/parameters/recordFolderChildEntryIncludeParam' + - $ref: '#/parameters/recordEntryIncludeParam' - $ref: '#/parameters/fieldsParam' - in: body name: recordBodyCreate @@ -1962,7 +1962,7 @@ paths: - $ref: '#/parameters/transferContainerIdWithAliasParam' - $ref: '#/parameters/skipCountParam' - $ref: '#/parameters/maxItemsParam' - - $ref: '#/parameters/transferEntryIncludeParam' + - $ref: '#/parameters/transferContainerChildEntryIncludeParam' - $ref: '#/parameters/transferContainerIncludeSourceParam' - $ref: '#/parameters/fieldsParam' responses: @@ -2067,6 +2067,21 @@ parameters: items: type: string collectionFormat: csv + filePlanCategoriesEntryIncludeParam: + name: include + in: query + description: | + Returns additional information about the record category. Any optional field from the response model can be requested. For example: + * allowableOperations + * aspectNames + * hasRetentionSchedule + * path + * properties + required: false + type: array + items: + type: string + collectionFormat: csv filePlanIdWithAliasParam: name: filePlanId in: path @@ -2093,9 +2108,7 @@ parameters: description: | Returns additional information about the unfiled records container children. Any optional field from the response model can be requested. For example: * allowableOperations - * aspectNames * path - * properties required: false type: array items: @@ -2136,9 +2149,7 @@ parameters: description: | Returns additional information about the unfiled records container children. Any optional field from the response model can be requested. For example: * allowableOperations - * aspectNames * path - * properties required: false type: array items: @@ -2200,10 +2211,8 @@ parameters: description: | Returns additional information about the record category. Any optional field from the response model can be requested. For example: * allowableOperations - * aspectNames * hasRetentionSchedule * path - * properties required: false type: array items: @@ -2226,7 +2235,7 @@ parameters: name: include in: query description: | - Returns additional information about the record category. Any optional field from the response model can be requested. For example: + Returns additional information about the record category child. Any optional field from the response model can be requested. For example: * allowableOperations * aspectNames * hasRetentionSchedule @@ -2331,6 +2340,22 @@ parameters: items: type: string collectionFormat: csv + transferContainerChildEntryIncludeParam: + name: include + in: query + description: | + Returns additional information about the transfer folders. Any optional field from the response model can be requested. For example: + * allowableOperations + * aspectNames + * properties + * transferPDFIndicator + * transferLocation + * transferAccessionIndicator + required: false + type: array + items: + type: string + collectionFormat: csv transferContainerIncludeSourceParam: name: includeSource in: query @@ -2344,8 +2369,6 @@ parameters: description: | Returns additional information about the transfer folder. Any optional field from the response model can be requested. For example: * allowableOperations - * aspectNames - * properties * transferPDFIndicator * transferLocation * transferAccessionIndicator @@ -2374,7 +2397,6 @@ parameters: * allowableOperations * aspectNames * isClosed - * isCompleted * isRecord * isRecordFolder * path @@ -3389,10 +3411,6 @@ definitions: type: boolean default: false description: Indicates if the record folder is closed - isCompleted: - type: boolean - default: false - description: Present only for record nodes. Indicates if the record has a retention schedule defined modifiedAt: type: string format: date-time From 458724af918bac375baadc8c9274b29622af945f Mon Sep 17 00:00:00 2001 From: Ramona Popa Date: Tue, 16 May 2017 10:21:24 +0300 Subject: [PATCH 5/9] RM-5087 - when POST return minimal info --- .../rm/rest/api/fileplans/FilePlanChildrenRelation.java | 2 +- .../api/recordcategories/RecordCategoryChildrenRelation.java | 2 +- .../rest/api/recordfolders/RecordFolderChildrenRelation.java | 4 ++-- .../unfiledcontainers/UnfiledContainerChildrenRelation.java | 4 ++-- .../UnfiledRecordFolderChildrenRelation.java | 4 ++-- .../src/main/webapp/definitions/gs-core-api.yaml | 4 ---- 6 files changed, 8 insertions(+), 12 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 923b70c636..8eecad5b04 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 @@ -213,7 +213,7 @@ public class FilePlanChildrenRelation implements RelationshipResourceAction.Read for (NodeRef newNodeRef : createdNodes) { FileInfo info = fileFolderService.getFileInfo(newNodeRef); - result.add(nodesModelFactory.createRecordCategory(info, parameters, mapUserInfo, false)); + result.add(nodesModelFactory.createRecordCategory(info, parameters, mapUserInfo, true)); } return result; 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 66b2b8b71d..6a3f4d2267 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 @@ -208,7 +208,7 @@ public class RecordCategoryChildrenRelation implements RelationshipResourceActio for (NodeRef nodeInfo : createdNodes) { FileInfo info = fileFolderService.getFileInfo(nodeInfo); - result.add(nodesModelFactory.createRecordCategoryChild(info, parameters, mapUserInfo, false)); + result.add(nodesModelFactory.createRecordCategoryChild(info, parameters, mapUserInfo, true)); } return result; 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 1b4fd75877..fdb2baf0f4 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 @@ -182,7 +182,7 @@ public class RecordFolderChildrenRelation implements RelationshipResourceAction. { FileInfo info = fileFolderService.getFileInfo(newNodeRef); apiUtils.postActivity(info, parentNodeRef, ActivityType.FILE_ADDED); - result.add(nodesModelFactory.createRecord(info, parameters, mapUserInfo, false)); + result.add(nodesModelFactory.createRecord(info, parameters, mapUserInfo, true)); } return result; @@ -216,6 +216,6 @@ public class RecordFolderChildrenRelation implements RelationshipResourceAction. // Get file info for response FileInfo info = fileFolderService.getFileInfo(newNode); apiUtils.postActivity(info, parentNodeRef, ActivityType.FILE_ADDED); - return nodesModelFactory.createRecord(info, parameters, null, false); + return nodesModelFactory.createRecord(info, parameters, null, true); } } 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 0408de262a..f35876139e 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 @@ -201,7 +201,7 @@ public class UnfiledContainerChildrenRelation implements RelationshipResourceAct { FileInfo info = fileFolderService.getFileInfo(newNodeRef); apiUtils.postActivity(info, parentNodeRef, ActivityType.FILE_ADDED); - result.add(nodesModelFactory.createUnfiledContainerChild(info, parameters, mapUserInfo, false)); + result.add(nodesModelFactory.createUnfiledContainerChild(info, parameters, mapUserInfo, true)); } return result; @@ -231,6 +231,6 @@ public class UnfiledContainerChildrenRelation implements RelationshipResourceAct // Get file info for response FileInfo info = fileFolderService.getFileInfo(newNode); apiUtils.postActivity(info, parentNodeRef, ActivityType.FILE_ADDED); - return nodesModelFactory.createUnfiledContainerChild(info, parameters, null, false); + return nodesModelFactory.createUnfiledContainerChild(info, parameters, null, true); } } 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 9fff8274af..6d892e324e 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 @@ -208,7 +208,7 @@ public class UnfiledRecordFolderChildrenRelation implements RelationshipResource { FileInfo info = fileFolderService.getFileInfo(newNodeRef); apiUtils.postActivity(info, parentNodeRef, ActivityType.FILE_ADDED); - result.add(nodesModelFactory.createUnfiledRecordFolderChild(info, parameters, mapUserInfo, false)); + result.add(nodesModelFactory.createUnfiledRecordFolderChild(info, parameters, mapUserInfo, true)); } return result; @@ -244,6 +244,6 @@ public class UnfiledRecordFolderChildrenRelation implements RelationshipResource FileInfo info = fileFolderService.getFileInfo(newNode); apiUtils.postActivity(info, parent, ActivityType.FILE_ADDED); - return nodesModelFactory.createUnfiledRecordFolderChild(info, parameters, null, false); + return nodesModelFactory.createUnfiledRecordFolderChild(info, parameters, null, true); } } diff --git a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml index eef37c4225..953b71c140 100644 --- a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml +++ b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml @@ -336,8 +336,6 @@ paths: the API method tries to create a unique name using an integer suffix. - Any field in the JSON body defined below can also be passed as a form-data field. - This API method also supports record category creation using application/json. You must specify at least a **name**. @@ -1179,8 +1177,6 @@ paths: the API method tries to create a unique name using an integer suffix. - Any field in the JSON body defined below can also be passed as a form-data field. - This API method also supports record category or record folder creation using application/json. You must specify at least a **name** and **nodeType**. From 6eacb540d4af09beef697ba73921f49c264e76ef Mon Sep 17 00:00:00 2001 From: Ramona Popa Date: Tue, 16 May 2017 11:40:33 +0300 Subject: [PATCH 6/9] Revert "RM-5087 - when POST return minimal info" This reverts commit 458724af918bac375baadc8c9274b29622af945f. --- .../rm/rest/api/fileplans/FilePlanChildrenRelation.java | 2 +- .../api/recordcategories/RecordCategoryChildrenRelation.java | 2 +- .../rest/api/recordfolders/RecordFolderChildrenRelation.java | 4 ++-- .../unfiledcontainers/UnfiledContainerChildrenRelation.java | 4 ++-- .../UnfiledRecordFolderChildrenRelation.java | 4 ++-- .../src/main/webapp/definitions/gs-core-api.yaml | 4 ++++ 6 files changed, 12 insertions(+), 8 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 8eecad5b04..923b70c636 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 @@ -213,7 +213,7 @@ public class FilePlanChildrenRelation implements RelationshipResourceAction.Read for (NodeRef newNodeRef : createdNodes) { FileInfo info = fileFolderService.getFileInfo(newNodeRef); - result.add(nodesModelFactory.createRecordCategory(info, parameters, mapUserInfo, true)); + result.add(nodesModelFactory.createRecordCategory(info, parameters, mapUserInfo, false)); } return result; 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 6a3f4d2267..66b2b8b71d 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 @@ -208,7 +208,7 @@ public class RecordCategoryChildrenRelation implements RelationshipResourceActio for (NodeRef nodeInfo : createdNodes) { FileInfo info = fileFolderService.getFileInfo(nodeInfo); - result.add(nodesModelFactory.createRecordCategoryChild(info, parameters, mapUserInfo, true)); + result.add(nodesModelFactory.createRecordCategoryChild(info, parameters, mapUserInfo, false)); } return result; 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 fdb2baf0f4..1b4fd75877 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 @@ -182,7 +182,7 @@ public class RecordFolderChildrenRelation implements RelationshipResourceAction. { FileInfo info = fileFolderService.getFileInfo(newNodeRef); apiUtils.postActivity(info, parentNodeRef, ActivityType.FILE_ADDED); - result.add(nodesModelFactory.createRecord(info, parameters, mapUserInfo, true)); + result.add(nodesModelFactory.createRecord(info, parameters, mapUserInfo, false)); } return result; @@ -216,6 +216,6 @@ public class RecordFolderChildrenRelation implements RelationshipResourceAction. // Get file info for response FileInfo info = fileFolderService.getFileInfo(newNode); apiUtils.postActivity(info, parentNodeRef, ActivityType.FILE_ADDED); - return nodesModelFactory.createRecord(info, parameters, null, true); + return nodesModelFactory.createRecord(info, parameters, null, false); } } 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 f35876139e..0408de262a 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 @@ -201,7 +201,7 @@ public class UnfiledContainerChildrenRelation implements RelationshipResourceAct { FileInfo info = fileFolderService.getFileInfo(newNodeRef); apiUtils.postActivity(info, parentNodeRef, ActivityType.FILE_ADDED); - result.add(nodesModelFactory.createUnfiledContainerChild(info, parameters, mapUserInfo, true)); + result.add(nodesModelFactory.createUnfiledContainerChild(info, parameters, mapUserInfo, false)); } return result; @@ -231,6 +231,6 @@ public class UnfiledContainerChildrenRelation implements RelationshipResourceAct // Get file info for response FileInfo info = fileFolderService.getFileInfo(newNode); apiUtils.postActivity(info, parentNodeRef, ActivityType.FILE_ADDED); - return nodesModelFactory.createUnfiledContainerChild(info, parameters, null, true); + return nodesModelFactory.createUnfiledContainerChild(info, parameters, null, false); } } 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 6d892e324e..9fff8274af 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 @@ -208,7 +208,7 @@ public class UnfiledRecordFolderChildrenRelation implements RelationshipResource { FileInfo info = fileFolderService.getFileInfo(newNodeRef); apiUtils.postActivity(info, parentNodeRef, ActivityType.FILE_ADDED); - result.add(nodesModelFactory.createUnfiledRecordFolderChild(info, parameters, mapUserInfo, true)); + result.add(nodesModelFactory.createUnfiledRecordFolderChild(info, parameters, mapUserInfo, false)); } return result; @@ -244,6 +244,6 @@ public class UnfiledRecordFolderChildrenRelation implements RelationshipResource FileInfo info = fileFolderService.getFileInfo(newNode); apiUtils.postActivity(info, parent, ActivityType.FILE_ADDED); - return nodesModelFactory.createUnfiledRecordFolderChild(info, parameters, null, true); + return nodesModelFactory.createUnfiledRecordFolderChild(info, parameters, null, false); } } diff --git a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml index 953b71c140..eef37c4225 100644 --- a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml +++ b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml @@ -336,6 +336,8 @@ paths: the API method tries to create a unique name using an integer suffix. + Any field in the JSON body defined below can also be passed as a form-data field. + This API method also supports record category creation using application/json. You must specify at least a **name**. @@ -1177,6 +1179,8 @@ paths: the API method tries to create a unique name using an integer suffix. + Any field in the JSON body defined below can also be passed as a form-data field. + This API method also supports record category or record folder creation using application/json. You must specify at least a **name** and **nodeType**. From 3213eb9dd09e7ab6769dd8d02e01a1bbb3ea13a7 Mon Sep 17 00:00:00 2001 From: Ramona Popa Date: Tue, 16 May 2017 12:17:40 +0300 Subject: [PATCH 7/9] RM-5087 - remove aspects and properties from include on POST --- .../src/main/webapp/definitions/gs-core-api.yaml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml index eef37c4225..1178f65305 100644 --- a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml +++ b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml @@ -336,8 +336,6 @@ paths: the API method tries to create a unique name using an integer suffix. - Any field in the JSON body defined below can also be passed as a form-data field. - This API method also supports record category creation using application/json. You must specify at least a **name**. @@ -393,7 +391,7 @@ paths: parameters: - $ref: '#/parameters/filePlanIdWithAliasParam' - $ref: '#/parameters/autoRenameParam' - - $ref: '#/parameters/filePlanCategoriesEntryIncludeParam' + - $ref: '#/parameters/recordCategoryEntryIncludeParam' - $ref: '#/parameters/fieldsParam' - in: body name: nodeBodyCreate @@ -666,7 +664,7 @@ paths: parameters: - $ref: '#/parameters/unfiledContainerIdParam' - $ref: '#/parameters/autoRenameParam' - - $ref: '#/parameters/unfiledContainerChildEntryIncludeParam' + - $ref: '#/parameters/unfiledRecordFolderEntryIncludeParam' - $ref: '#/parameters/fieldsParam' - in: body name: nodeBodyCreate @@ -762,6 +760,7 @@ paths: operationId: updateUnfiledRecordFolder parameters: - $ref: '#/parameters/unfiledRecordFolderIdParam' + - $ref: '#/parameters/unfiledRecordFolderEntryIncludeParam' - $ref: '#/parameters/unfiledRecordFolderIncludeSourceParam' - $ref: '#/parameters/fieldsParam' - in: body @@ -971,7 +970,7 @@ paths: parameters: - $ref: '#/parameters/unfiledRecordFolderIdParam' - $ref: '#/parameters/autoRenameParam' - - $ref: '#/parameters/unfiledRecordFolderChildEntryIncludeParam' + - $ref: '#/parameters/unfiledRecordFolderEntryIncludeParam' - $ref: '#/parameters/fieldsParam' - in: body name: nodeBodyCreate @@ -1181,8 +1180,6 @@ paths: Any field in the JSON body defined below can also be passed as a form-data field. - This API method also supports record category or record folder creation using application/json. - You must specify at least a **name** and **nodeType**. You can create a category like this: @@ -1274,7 +1271,7 @@ paths: parameters: - $ref: '#/parameters/recordCategoryIdParam' - $ref: '#/parameters/autoRenameParam' - - $ref: '#/parameters/recordCategoryChildEntryIncludeParam' + - $ref: '#/parameters/recordCategoryEntryIncludeParam' - $ref: '#/parameters/fieldsParam' - in: body name: nodeBodyCreate From eaf03d0b4685e0e3905528106b69678395491255 Mon Sep 17 00:00:00 2001 From: Ramona Popa Date: Wed, 17 May 2017 18:12:00 +0300 Subject: [PATCH 8/9] RM-5087 - more refactor --- .../rm/rest/api/impl/ApiNodesModelFactory.java | 4 ++-- .../main/webapp/definitions/gs-core-api.yaml | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java index b8cc27497b..0038bcac07 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java @@ -515,7 +515,7 @@ public class ApiNodesModelFactory { recordCategoryChild.setIsClosed((Boolean) nodeService.getProperty(info.getNodeRef(), RecordsManagementModel.PROP_IS_CLOSED)); } - if((!isMinimalInfo && propertyFilter.isAllowed(RMNode.PARAM_HAS_RETENTION_SCHEDULE)) || (isMinimalInfo && includeParam.contains(RMNode.PARAM_HAS_RETENTION_SCHEDULE))) + if (includeParam.contains(RMNode.PARAM_HAS_RETENTION_SCHEDULE)) { recordCategoryChild.setHasRetentionSchedule(null); } @@ -530,7 +530,7 @@ public class ApiNodesModelFactory { recordCategoryChild.setIsRecordCategory(true); } - if((!isMinimalInfo && propertyFilter.isAllowed(RMNode.PARAM_HAS_RETENTION_SCHEDULE)) || (isMinimalInfo && includeParam.contains(RMNode.PARAM_HAS_RETENTION_SCHEDULE))) + if (includeParam.contains(RMNode.PARAM_HAS_RETENTION_SCHEDULE)) { DispositionSchedule ds = dispositionService.getDispositionSchedule(info.getNodeRef()); recordCategoryChild.setHasRetentionSchedule(ds !=null ? true : false); diff --git a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml index 1178f65305..ca60161e1d 100644 --- a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml +++ b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml @@ -1178,7 +1178,7 @@ paths: the API method tries to create a unique name using an integer suffix. - Any field in the JSON body defined below can also be passed as a form-data field. + This API method also supports record category or record folder creation using application/json. You must specify at least a **name** and **nodeType**. @@ -2622,6 +2622,10 @@ definitions: The character . must not be used at the end of the name. nodeType: type: string + isUnfiledRecordFolder: + type: boolean + isRecord: + type: boolean modifiedAt: type: string format: date-time @@ -2675,6 +2679,10 @@ definitions: The character . must not be used at the end of the name. nodeType: type: string + isUnfiledRecordFolder: + type: boolean + isRecord: + type: boolean modifiedAt: type: string format: date-time @@ -2763,6 +2771,10 @@ definitions: The character . must not be used at the end of the name. nodeType: type: string + isUnfiledRecordFolder: + type: boolean + isRecord: + type: boolean modifiedAt: type: string format: date-time @@ -2816,6 +2828,10 @@ definitions: The character . must not be used at the end of the name. nodeType: type: string + isUnfiledRecordFolder: + type: boolean + isRecord: + type: boolean modifiedAt: type: string format: date-time From 7982f6ddd9d828023fb4a461e132daed5aa685e2 Mon Sep 17 00:00:00 2001 From: Ramona Popa Date: Thu, 18 May 2017 15:42:48 +0300 Subject: [PATCH 9/9] RM-5087 - added isUnfiledRecordFolder and isRecord as required --- .../src/main/webapp/definitions/gs-core-api.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml index ca60161e1d..1fc288cfda 100644 --- a/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml +++ b/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml @@ -2622,10 +2622,6 @@ definitions: The character . must not be used at the end of the name. nodeType: type: string - isUnfiledRecordFolder: - type: boolean - isRecord: - type: boolean modifiedAt: type: string format: date-time @@ -2661,6 +2657,8 @@ definitions: - id - name - nodeType + - isUnfiledRecordFolder + - isRecord - createdAt - createdByUser - modifiedAt @@ -2753,6 +2751,8 @@ definitions: - id - name - nodeType + - isUnfiledRecordFolder + - isRecord - createdAt - createdByUser - modifiedAt @@ -2810,6 +2810,8 @@ definitions: - id - name - nodeType + - isUnfiledRecordFolder + - isRecord - createdAt - createdByUser - modifiedAt