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

REST API: provide way to get referenced objects

    XMLWordPrintable

    Details

    • Type: User story
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.2
    • Fix Version/s: 7.2
    • Component/s: Rest API
    • Upgrade notes:
      Hide

      Fetching:
      When you defined some document's properties as a reference to an object using an ObjectResolver (contrib to component org.nuxeo.ecm.core.schema.ObjectResolverService, extension point 'resolvers'), you can fetch the corresponding object if the Json reader and Json writer are available (this is the case for DocumentModel, Directory, NuxeoPrincipal and NuxeoGroup properties).
      To enable the fetching:

      • use the parameter fetch.document=properties => this will fetch all properties
      • or with a specific property path : fetch.document=mySchema:users/user[0]/nuxeoPrincipalId => this will fetch the property nuxeoPrincipalId or the first user of the user list property users
      • or with a generic path : fetch.document=mySchema:user:users/user/nuxeoPrincipalId => this will fetch all property nuxeoPrincipalId
      • or with a parent path : fetch.document=mySchema:users => this will fetch all fetchable properties under users

      !!! The property value is accepted in Json by the reader and the corresponding object too (you can use either the reference or the object to update your document)

      Show
      Fetching: When you defined some document's properties as a reference to an object using an ObjectResolver (contrib to component org.nuxeo.ecm.core.schema.ObjectResolverService, extension point 'resolvers'), you can fetch the corresponding object if the Json reader and Json writer are available (this is the case for DocumentModel, Directory, NuxeoPrincipal and NuxeoGroup properties). To enable the fetching: use the parameter fetch.document=properties => this will fetch all properties or with a specific property path : fetch.document=mySchema:users/user [0] /nuxeoPrincipalId => this will fetch the property nuxeoPrincipalId or the first user of the user list property users or with a generic path : fetch.document=mySchema:user:users/user/nuxeoPrincipalId => this will fetch all property nuxeoPrincipalId or with a parent path : fetch.document=mySchema:users => this will fetch all fetchable properties under users !!! The property value is accepted in Json by the reader and the corresponding object too (you can use either the reference or the object to update your document)
    • Sprint:
      Sprint io 7.1-4, Sprint io 7.1-5, Sprint io 7.1-6, Sprint io 7.1-7, Sprint io 7.2-1
    • Story Points:
      2

      Description

      The document resource endpoint currently returns document's properties.

      In document's properties, we currently get:

      schema:documentReference: "/path/to/my/doc"
      

      We should be able to get:

      schema:documentReference: {
       resolver: { name: "documentResolver", parameters: { store: "path" } }
       value: "default:/doc/path/toto",
       object: { entity-type: "document", uid: "bf4fb42c-8e9e-41ce-bb8f-5b5c79646458", ... }
      }
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                PagerDuty

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