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

Fix JSF UI's document suggestion widgets when configured with a NXQL query

    XMLWordPrintable

    Details

    • Release Notes Summary:
      Suggestion widgets works with a NXQL query.
    • Tags:
    • Backlog priority:
      600
    • Upgrade notes:
      Hide

      Introduces a "searchTerm" alias for the "queryParams" parameter of "Repository.Query" to keep consistency with the "Repository.PageProvider" operation. This eases migration of query based search calls to "Repository.Query" since the "query" parameter in "Repository.PageProvider" was removed in 10.10.

      Show
      Introduces a "searchTerm" alias for the "queryParams" parameter of "Repository.Query" to keep consistency with the "Repository.PageProvider" operation. This eases migration of query based search calls to "Repository.Query" since the "query" parameter in "Repository.PageProvider" was removed in 10.10.
    • Sprint:
      nxNS Sprint 11.1.16, nxNS Sprint 11.1.17
    • Story Points:
      2

      Description

      Since 10.10, document suggestion widgets don't execute the NXQL query if it is configured.

      How to reproduce:
      In Studio:

      • create a new document type named MyDoc and add a field document of type Document in its schema
      • in its creation layout:
        • add a single document suggestion widget on property mydoc:document
        • set NXQL Query property to SELECT * FROM Document WHERE dc:title LIKE ? AND ecm:mixinType != 'HiddenInNavigation' AND ecm:isVersion = 0 AND ecm:isTrashed = 0 AND ecm:primaryType='MyDoc'
      • active automation logging in $NUXEO_HOME/lib/log4j2.xml:
            <Logger name="org.nuxeo.ecm.automation.core" level="info" />
        
      • deploy and start the Nuxeo instance
      • log in the JSF UI
      • create a workspace and in it
        • create a File document with title MyDoc1
        • create a MyDoc document with title MyDoc1
        • create another MyDoc document and in its creation layout type MyDoc1 in suggestion widget Document

      Expected result: the suggestion widget suggests 1 document, the document of type MyDoc and with title MyDoc1.
      Actual result: the suggestion widget suggests the 2 documents with title MyDoc1, including the one of type File, even though the suggestion widget explicitly specifies ecm:primaryType='MyDoc' in its NXQL Query property.

      Operation Repository.PageProvider used to be called by the suggestion widget to execute the widget's NXQL query, but was refactored in 10.10 by NXP-26171 (commit https://github.com/nuxeo/nuxeo/commit/562e48f5f7773b633806660fbcf7bbfe12d3013f) and now operation Repository.Query is supposed to be called if the NXQL query is defined in the suggestion widget. The problem operation Repository.PageProvider is still called, and as it has been refactored, it executes page provider default_document_suggestion instead of the configured NXQL query.

      The problem also exists with the multiple document suggestion widget.

      Also parameters like quote parameters and escape parameters are not supported by operation Repository.Query, which was the case in operation Repository.PageProvider.

      The only workaround seems to be the use of a page provider instead of a NXQL query.

      I attached a Studio jar containing all the Studio customization mentioned above.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 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 - 6 hours
                  6h