Affects Version/s: 10.10
Component/s: Layouts & Widgets
Release Notes Summary:Suggestion widgets works with a NXQL query.
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.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
Since 10.10, document suggestion widgets don't execute the NXQL query if it is configured.
- 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:
- 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
: the suggestion widget suggests 1 document, the document of type MyDoc and with title MyDoc1.
: 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.