Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-24746

Implement a REST api for CommentService

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.3
    • Component/s: Comments

      Description

      Create new comment API, probably expose it as an adapter.

      We need the following endpoints:

      • POST comment
      • GET commentId
      • GET documentId (this endpoint should be paginable)
      • PUT commentId + comment
      • DELETE commentId

      Note: replying to a comment is the same thing than commenting this comment, also getting children of a comment is the same thing than getting comment of a document.

      Technical Specifications

      Comment JSON format

      Here the Comment JSON format used to handle Comment in Nuxeo REST API:

      {
        "id": "00000000-0000-0000-0000-000000000000", // comment id
        "documentId": "00000000-0000-0000-0000-000000000000", // commented document model id
        "author": "Joe",
        "text": "A comment example",
        "creationdDate": "1970-01-01T00:00:00Z",
        "modificationDate": "1970-01-01T00:00:00Z",
        "entityId": "...", // the entity id in external system (present when comment is created from another system)
        "origin": "...", // the entity origin (present when comment is created from another system)
        "entity": "..." // the serialized external entity (present when comment is created from another system)
      }
      
      REST Endpoints

      Several endpoints are added, here the exhaustive list:

      HTTP Method Path Request Body Response
      POST
      /nuxeo/api/v1/id/{docId}/@comment
      Comment created Comment
      GET
      /nuxeo/api/v1/id/{docId}/@comment?pageSize=10&currentPageIndex=0
      x partial list of Comment
      GET
      /nuxeo/api/v1/id/{docId}/@comment/{commentId}
      x Comment
      GET
      /nuxeo/api/v1/id/{docId}/@comment/external/{entityId}
      x external Comment
      PUT
      /nuxeo/api/v1/id/{docId}/@comment/{commentId}
      Comment with updates updated Comment
      PUT
      /nuxeo/api/v1/id/{docId}/@comment/external/{entityId}
      Comment with updates updated external Comment
      DELETE
      /nuxeo/api/v1/id/{docId}/@comment/{commentId}
      x no content
      DELETE
      /nuxeo/api/v1/id/{docId}/@comment/external/{entityId}
      x no content

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 1 hour
                  1d 1h

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.