cancel
Showing results for 
Search instead for 
Did you mean: 

Try to give parameters to a pageprovider in ecm:fulltext an others where clauses, extracting from widget template.xhtml

milonette_
Star Collaborator
Star Collaborator

Hello,

I try to do a page provider with parameters.

  • Parameter should be get in a WIDGET custom parameters.
  • This widget is using this page provider to display results.

I couldn't find a solution to have results in my request WHEN I had 2 fields "parameter" instead of using <pattern escapeParameters="true" quoteParameters="false">

Here is the extension point :

<extension target="org.nuxeo.ecm.platform.query.api.PageProviderService"  point="providers">

<coreQueryPageProvider name="document_suggestion_amoi">
  <property name="coreSession">#{documentManager}</property>
  <pattern>
    SELECT * FROM Document WHERE (ecm:path STARTSWITH '?')
     AND ecm:primaryType IN ('Folder', 'Workspace') AND ecm:fulltext LIKE '?*' AND ecm:mixinType !=
    'HiddenInNavigation' AND ecm:isCheckedInVersion = 0 AND
    ecm:currentLifeCycleState != 'deleted'
  </pattern>
  <parameter>/My Domain/workspaces/Bidule/</parameter>
  <parameter>#{documentSearchActions.simpleSearchKeywords}</parameter>   
  <sort ascending="true" column="dc:title"/>
  <pageSize>5</pageSize>
</coreQueryPageProvider>
</extension>

moreover, parameter ONE should be #{mycustomparameter_fromwidgetcustom}

thank you

1 ACCEPTED ANSWER

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Hi,

On version 5.6, the document suggestion widget accepts a provider that only takes one parameter: the suggestion input.

Additional parameters set on the page provider definition will be ignored. This limitation has recently been removed, see https://jira.nuxeo.com/browse/NXP-11014. Note that the first '?' character in the query pattern will have to match the suggestion input.

You can define a custom widget template and associated custom suggestion method to replicate the logic on a 5.6.

View answer in original post

9 REPLIES 9

Flav_BARTHE
Champ on-the-rise
Champ on-the-rise

If you don't use quoteParameters="false" you must remove quotes around your parameters no? Whereas, if you do that ecm:fulltext LIKE '?*' will not working anymore... (maybe with a concat?)

Hello,

Try to replace your second parameter by that when you remove quote

Is This pattern using with a Document Suggestion Box?

Thanks Flav. Exactly, it's a document suggestion box.

I got

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Hi,

On version 5.6, the document suggestion widget accepts a provider that only takes one parameter: the suggestion input.

Additional parameters set on the page provider definition will be ignored. This limitation has recently been removed, see https://jira.nuxeo.com/browse/NXP-11014. Note that the first '?' character in the query pattern will have to match the suggestion input.

You can define a custom widget template and associated custom suggestion method to replicate the logic on a 5.6.

Hello,

Hi,