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

Multirepository not supported when uid is in payload

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 9.10, 10.1
    • Fix Version/s: 9.10-HF06, 10.2
    • Component/s: Rest API
    • Release Notes Summary:
      The REST API supports a multi-repository configuration when the UID is in the request payload.
    • Tags:
    • Backlog priority:
      700
    • Sprint:
      nxfit 10.2.2
    • Story Points:
      5

      Description

      1. install 9.10
      2. setup multi-repository environment

      Following this documentation:
      https://doc.nuxeo.com/nxdoc/document-resources-endpoints/#updating-a-document

      One can update a document through REST.

      Using this url:
      http://localhost:8080/nuxeo/api/v1/repo/[repositoryId]/id/[documentId]

      With the following payload:

      {"entity-type":"document","uid" : "{documentId}", "properties":{"prefix:propertyName":["value"]}}
      

      Fails to update the document with a 404 error.

      It seems the issue is the session is opened in the default repository in this case:
      https://github.com/nuxeo/nuxeo/blob/9.10/nuxeo-core/nuxeo-core-io/src/main/java/org/nuxeo/ecm/core/io/marshallers/json/document/DocumentModelJsonReader.java#L132

      Please note that removing the uid from the payload works fine.
      ------------------------------------------------------------------------------------------
      In this case, the repositoryId passed in the URL is now also set as a request attribute when set in the WebContext by APIRoot#doGetRepository.
      It can then be retrieved by SessionFactory#getRepositoryName and RenderingContextImpl#getSession.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 3 days, 1 hour
                3d 1h

                  PagerDuty

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