Webadapter based REST api response filtering

I want the immediate children of a path and I also want to filter based on dc:language attribute. I tried the following: http://localhost/nuxeo/site/api/v1/path/default-domain/sections/section1/@children?query=Select * from Document where dc:language = 'English'

This did not work since the @children does not take a query parameter. I also tried @search with the “ecm:path startswith default-domain/sections/section1 and dc:language='English'” but then this gives me the entire folder tree underneath section1

Is there a way to get just the first level of content along with a way to filter based on one or more attributes.

0 votes

1 answers

2118 views

ANSWER



The @search is a good idea but as you saw ecm:path STARTSWITH '/default-domain/sections/section1' will give you too many levels. You would like something like ecm:parentPath = '/default-domain/sections/section1' but this doesn't exist. Please open a ticket with the Report A Bug button at the right if you feel this is a worthwhile addition.

At the moment I think you need two requests, one to get the id of the /default-domain/sections/section1 document, then use a @search with ecm:parentId = 'the-id-for-section1' and the rest of your filter.

0 votes