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

Unable to use a Page Provider that uses an IN constraint

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Not A Bug
    • Affects Version/s: 9.2
    • Fix Version/s: None

      Description

      Given a Page Provider defined in Studio like so (for example):

      ecm:mixinType != 'HiddenInNavigation' AND ecm:isCheckedInVersion = 0 AND ecm:currentLifeCycleState != 'deleted' AND ecm:uuid IN (?)
      

      And given that I am using the nuxeo-page-provider element in Web UI, and I am using a field of type Document to store the values (aka a JavaScript Array on the client side) it is not possible to pass more than one value to this query. If you pass a single value, it works using ? parameter insertion (while it fails with a predicate). If you pass more than one value it fails in all cases.

      Steps to reproduce:

      There is a Studio project available with a reproducible example:

      https://connect.nuxeo.com/nuxeo/site/studio/ide?project=jfletcher-sandbox-rollin

      Given a Nuxeo Server with the Studio project deployed:

      • Make sure both jsf and webui are installed
      • From JSF...
      • Create a folder in the Domain
      • Add two files to this folder
      • Create a new document of type "DocWithDocField"
      • Link one of the files to this document using the `docField` field
      • Create another "DocWithDocField"
      • Link both of the files to this document using the `docField` field
      • Navigate to the two new documents in WebUI

      The View layout for "DocWithDocField" has two buttons: one to call a Page Provider that uses `?` parameter insertion and one that uses a predicate. When you click the button, the params are bound and the request executes.

      • Open the developer tools and watch the Network panel

      For the document that has only a single File linked, the `?` parameter button works fine. All other requests fail (with different errors depending on the technique used).

      Note that I have tried various permutations of formatting the parameters (e.g. using toString(), json.stringify(), etc.) but nothing helps. I believe the problem is on the server side, not the client side. There doesn't seem to be a way to correctly handle in IN query.

      Also note that nuxeo-page-provider uses the search endpoint, not query.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: