-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: Community 6.0.4, VB: REST API: V1 Comprehensive
-
Component/s: REST API
-
Labels:
-
Work Funnel:Feature
-
Epic Link:
-
Sprint:Repository Sprint 24, Repo RestAPI Sprint 25, Repo Libraries Sprint 26
-
Story Points:8
-
Work Funnel End:2018-03
-
Template:customfield_14629 189649
Using the existing API [restoreDeletedNode](https://api-explorer.alfresco.com/api-explorer/#!/trashcan/restoreDeletedNode) it is possible that an attempt to restore a node will fail if the original parent location no longer exists.
A client developer should be able to optionally pass a target parent id as a new location (eg. if the user is prompted to choose a new location to which they have write access).
Acceptance Criteria
- update API spec so that the POST operation accepts an optional body with "targetParentId" field/or "assocType" fields. Also add description and any missing error codes etc.
- implement API option to call nodeServiceArchive with the specified targetParentId or otherwise null
- add JUnit test (+ve & -ve) including appropriate error codes such as 403, 404, 409, ... etc
- add TAS-level test
Implementation Notes
- note: nodeArchiveService already provides option to (attempt to) restore new location
- can optionally specify targetParentId (maps to destinationNodeRef arg) or null for original
- can optionally specify assocType (maps to assocTypeQName) or null for original
Open Questions
- investigate: is it possible to optionally override name on restore (TODO check if this can be done via assocName) ?
Example Request
POST /deleted-nodes/{archiveNodeId}/restore { "targetParentId": "....", "assocType": "...." }