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

Support ability to request information on the source entity when requesting a collection on that entity

    Details

      Description

      Given the following URL: /nodes/root/children?relativePath=/folderA/folderB the caller wants the ability to optionally return the node information for folderB as well as it's list of children.

      If folderB has children, each entry will have a parentId property which can be used to make an additional request to get the required information, however, if folderB has no children the entries array will be empty leaving the client no way to find out the id of folderB which is required for performing operations against i.e. copy/move.

      The proposal is to add the ability via an includeSource query parameter to include the default representation of the targeted entity, folderB, in the example above. The presence of the parameter with a value of "true" will effectively cause the framework to include the response of the readById() method for the entity within the list response.

      Example Request

      /sites/mysite/members?includeSource=true
      

      Example Response

      “list”: {
         “pagination”: { ... }
         “entries”: [ ... ]
         “source”: {
         {
            "id": "mysite",
            "guid": "99532d84-d540-410c-b52a-c2131cf33589", 
            "title": "MySite",
            "visibility": "PUBLIC",
            ...
         }
      }
      

      Example Request

      /nodes/99532d84-d540-410c-b52a-c2131cf33589/comments?includeSource=true
      

      Example Response

      “list”: {
         “pagination”: { ... }
         “entries”: [ ... ]
         “source”: {
         {
            "id": "99532d84-d540-410c-b52a-c2131cf33589", 
            "name": "file.txt",
            "nodeType": "cm:content", 
            "parentId": "9afcc003-3911-4f75-a974-a163cc43c986",
            ...
         }
      }
      

      Additional Example Requests

      /nodes/-root-/children?relativePath=/folderA/folderB&includeSource=true
      
      /nodes/99532d84-d540-410c-b52a-c2131cf33589/tags?includeSource=true
      
      /people/gavinc/activities?includeSource=true
      

      NOTE: We will attempt to keep the "source" property within "list", if too difficult it can go outside.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                gcornwell Gavin Cornwell
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: