Uploaded image for project: 'Repository'
  1. Repository
  2. REPO-2339

Trashcan REST API: optionally restore node to new location

    Details

    • Work Funnel:
      Feature
    • Sprint:
      Repository Sprint 24, Repo RestAPI Sprint 25, Repo Libraries Sprint 26
    • Story Points:
      8
    • Work Funnel End:
      2018-03
    • Template:

      Description

      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": "...."
      }
      

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  jvonka Jan Vonka
                • Votes:
                  2 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Structure Helper Panel