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

In PageProvider with parameters allow a parameter with the same name as a field

    XMLWordPrintable

    Details

      Description

      Say I have the ApplicationCommon schema with the country file. The schema prefix is ac.

      Say I have a page provider:

      <extension target="org.nuxeo.ecm.platform.query.api.PageProviderService"
      	point="providers">
      	<coreQueryPageProvider name="QueryWithParams">
      		<pattern quoteParameters="true" escapeParameters="true">
                SELECT * FROM File WHERE dc:format = "DOCX" AND ac:country = :country AND ac:topics = :topic
              </pattern>
      		<pageSize>100</pageSize>
      	</coreQueryPageProvider>
      </extension>
      

      Notice the ac:country = :country part.

      Now, do a REST request:

      http://localhost:8080/nuxeo/api/v1/query/QueryWithParams?country=US&topic=IT
      
      

      The result is an error, where it is obvious that nuxeo also replaced ac:country:

      Invalid token <US > at offset 54 in query: SELECT * FROM File WHERE dc:format = "DOCX" AND ac'US' = 'US' AND ac'IT's = 'IT'
      
      

      (AND ac'US' = 'US')

        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.