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

Deprecate Document.FetchByProperty operation

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.10, 2021
    • Fix Version/s: 2023.x
    • Component/s: Rest API
    • Backlog priority:
      800
    • Upgrade notes:
      Hide

      The Document.FetchByProperty operation is deprecated. From now, use Repository.query to fetch documents by a property.

      Show
      The Document.FetchByProperty operation is deprecated. From now, use Repository.query to fetch documents by a property.
    • Sprint:
      nxplatform #71
    • Story Points:
      3

      Description

      When using the operation Document.FetchByProperty, I am unable to fetch on a boolean property, e.g.

      curl -X POST http://localhost:8080/nuxeo/api/v1/automation/Document.FetchByProperty \
      -H 'X-NXProperties: *' \
      -H 'Content-Type: application/json' \
      -u Administrator:Administrator \
      -d '{
          "params": {"property":"ecm:isTrashed", "values": "0"}
      }'
      

      The following error is received

      {"entity-type":"exception","status":400,"message":"Failed to invoke operation: Document.FetchByProperty, Failed to invoke operation Document.FetchByProperty, Failed to execute query: SELECT * FROM Document WHERE ecm:isTrashed = '0', ecm:isTrashed requires literal 0 or 1 as right argument"}
      

      The values parameter doesn't allow to express the type and since its creation values were always treated as String, thus the incompatibility with a boolean property.

      Let deprecates the operation since this is not easily possible to handle all types and that Repository.Query allows to do it.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: