02-13-2014 01:02 PM
Hi,
I have the NXQL query below being executed via Resultset.PageProvider REST call
{ "params": { "pageSize" : 100, "query" : "SELECT ecm:uuid, dc:title, ecm:primaryType, ecm:isLatestVersion, ecm:isCheckedInVersion, ecm:versionVersionableId, ecm:currentLifeCycleState, file:content/mime-type FROM Picture " } }
If the document has been edited then an object is returned for each version. Adding
where ecm:isLatestVersion = 1 or ecm:isLatestVersion is null
returns the latest version and the deleted version and the versions can be linked by matching the deleted version's ecm:uuid property with the non-deleted ecm:versionVersionableId but it seems error prone and is not documented.
Can an NXQL query be structured so documents in a deleted state are not returned without client-side post-processing?
Thanks in advance.
03-18-2014 08:51 AM
Try using ecm:isVersion = 0
(or the more verbose ecm:isCheckedInVersion = 0
before Nuxeo 5.8) to only get the "live" document, instead of ecm:isLatestVersion
which deals with versions
02-13-2014 01:34 PM
hello,
you need to add this clause to filter deleted documents:
ecm:currentLifeCycleState != 'deleted'
Thierry
02-13-2014 08:23 PM
Thanks, I tried that but it still returns an entry for the version that was not deleted. The query results without the ecm
03-18-2014 08:51 AM
Try using ecm:isVersion = 0
(or the more verbose ecm:isCheckedInVersion = 0
before Nuxeo 5.8) to only get the "live" document, instead of ecm:isLatestVersion
which deals with versions
03-27-2014 01:57 PM
This tested successfully versioning documents and not versioning them and it getting the expected results. Thanks, Florent!
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.